-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : GUI_version.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#define GUI_VERSION_STR "@VERSION@"
#define GUI_VERSION @XVERSION@
+#define GUI_DEVELOPMENT @VERSION_DEV@
#endif // __GUI_VERSION_H__
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
-# $Header$
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
IDLDIR =
endif
-SUBDIRS = $(IDLDIR) adm_local resources src doc bin
+SUBDIRS = $(IDLDIR) adm_local resources src doc bin tools
-DIST_SUBDIRS = idl adm_local resources src doc bin
+DIST_SUBDIRS = idl adm_local resources src doc bin tools
-DISTCLEANFILES = a.out aclocal.m4 configure
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool adm_local/unix/config_files/config.guess adm_local/unix/config_files/config.sub adm_local/unix/config_files/depcomp adm_local/unix/config_files/install-sh adm_local/unix/config_files/libtool.m4 adm_local/unix/config_files/ltmain.sh adm_local/unix/config_files/ltoptions.m4 adm_local/unix/config_files/ltsugar.m4 adm_local/unix/config_files/ltversion.m4 adm_local/unix/config_files/lt~obsolete.m4 adm_local/unix/config_files/missing adm_local/unix/config_files/py-compile
salomeinclude_DATA = GUI_version.h
EXTRA_DIST += \
+ build_cmake \
+ build_cmake.bat \
build_configure \
clean_configure \
LICENCE
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-
-SUBDIRS = src
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
SUBDIRS = unix cmake_files
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
SET(CASROOT $ENV{CASROOT})
-SET(OCC_VERSION_MAJOR 6)
-SET(OCC_VERSION_MINOR 3)
-SET(OCC_VERSION_MAINTENANCE 0)
+# SET(OCC_VERSION_MAJOR 6)
+# SET(OCC_VERSION_MINOR 3)
+# SET(OCC_VERSION_MAINTENANCE 10)
+SET(OCC_VERSION_DEVELOPMENT 0)
+
+FIND_FILE(ff Standard_Version.hxx ${CASROOT}/include/opencascade ${CASROOT}/inc)
+IF(ff)
+ FILE(STRINGS ${ff} OCC_VERSION_DEVELOPMENT_STR
+ REGEX "^ *#define OCC_VERSION_DEVELOPMENT.*$")
+ IF(OCC_VERSION_DEVELOPMENT_STR)
+ SET(OCC_VERSION_DEVELOPMENT 1)
+ ENDIF(OCC_VERSION_DEVELOPMENT_STR)
+ENDIF(ff)
SET(CAS_CPPFLAGS)
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAJOR=${OCC_VERSION_MAJOR})
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MINOR=${OCC_VERSION_MINOR})
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAINTENANCE=${OCC_VERSION_MAINTENANCE})
+# SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAJOR=${OCC_VERSION_MAJOR})
+# SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MINOR=${OCC_VERSION_MINOR})
+# SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DOCC_VERSION_MAINTENANCE=${OCC_VERSION_MAINTENANCE})
SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DLIN -DLINTEL -DCSFDB)
+SET(CAS_DEFINITIONS "-DLIN -DLINTEL -DCSFDB")
SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DNo_exception)
+SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DNo_exception")
SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_CONFIG_H)
+SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H")
SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -DHAVE_LIMITS_H)
-SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -I${CASROOT}/inc)
+SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_LIMITS_H")
+SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -I${CASROOT}/inc) # to be removed
+SET(CAS_INCLUDE_DIRS ${CASROOT}/inc)
+
+IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+ SET(CAS_CPPFLAGS ${CAS_CPPFLAGS} -D_OCC64)
+ENDIF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+
+IF(NOT WINDOWS)
+ FIND_LIBRARY(Xmu Xmu)
+ IF(Xmu)
+ SET(CAS_LDPATH ${Xmu})
+ ENDIF(Xmu)
+ENDIF(NOT WINDOWS)
IF(WINDOWS)
- SET(CASROOT_LIBDIR ${CASROOT}/win32/libd)
+ IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(CASROOT_LIBDIR ${CASROOT}/win32/libd)
+ ELSE(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(CASROOT_LIBDIR ${CASROOT}/win32/lib)
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
ELSE(WINDOWS)
SET(CASROOT_LIBDIR ${CASROOT}/lib)
ENDIF(WINDOWS)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
SET(GUI_CXXFLAGS -I${GUI_ROOT_DIR}/include/salome)
FIND_LIBRARY(LogWindow LogWindow ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(ObjBrowser ObjBrowser ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(OCCViewer OCCViewer ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(OpenGLUtils OpenGLUtils ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(Plot2d Plot2d ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(PyConsole PyConsole ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(PyInterp PyInterp ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(qtx qtx ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(QxScene QxScene ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SalomeApp SalomeApp ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeAppTest SalomeAppTest ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SalomeIDLGUI SalomeIDLGUI ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SalomeObject SalomeObject ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SalomePrs SalomePrs ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePyQtGUILight SalomePyQtGUILight ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePyQtGUI SalomePyQtGUI ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePyQt SalomePyQt ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomePy SalomePy ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SalomeSession SalomeSession ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SalomeStyle SalomeStyle ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SOCC SOCC ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SUPERVGraph SUPERVGraph ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(SVTK SVTK ${GUI_ROOT_DIR}/lib/salome)
FIND_LIBRARY(ToolsGUI ToolsGUI ${GUI_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(ViewerTools ViewerTools ${GUI_ROOT_DIR}/lib/salome)
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)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
IF(${WINDOWS})
FIND_LIBRARY(OpenGL_LIB OpenGL32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
FIND_LIBRARY(GlU_LIB GlU32 "C:/Program Files/Microsoft SDKs/Windows/v6.0A/lib")
- SET(OGL_LIBS ${OpenGL_LIB} ${GlU_LIB})
+ELSE(${WINDOWS})
+ FIND_LIBRARY(OpenGL_LIB GL)
+ FIND_LIBRARY(GlU_LIB GLU)
ENDIF(${WINDOWS})
+SET(OGL_LIBS ${OpenGL_LIB} ${GlU_LIB})
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
INCLUDE(FindQt4)
ENDFOREACH(D ${QT_INCLUDES})
SET(QT_INCLUDES ${DIRS})
SET(QT_INCLUDES ${QT_INCLUDES} -DQT_THREAD_SUPPORT)
-SET(QT_MT_LIBS ${QT_LIBRARIES} ${QT_QTXML_LIBRARY} ${QT_QTOPENGL_LIBRARY})
+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})
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE lrelease)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
SET(QWTHOME $ENV{QWTHOME})
-FIND_PATH(QWT_INCLUDE_DIR qwt_plot.h ${QWTHOME}/include)
+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})
IF(WINDOWS)
SET(QWT_INCLUDES ${QWT_INCLUDES} -DQWT_DLL)
ENDIF(WINDOWS)
+
IF(WINDOWS)
+IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+FIND_LIBRARY(QWT_LIBS qwtd5 ${QWTHOME}/lib)
+ELSE(CMAKE_BUILD_TYPE STREQUAL Debug)
FIND_LIBRARY(QWT_LIBS qwt5 ${QWTHOME}/lib)
+ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
ELSE(WINDOWS)
-FIND_LIBRARY(QWT_LIBS qwt ${QWTHOME}/lib)
+FIND_LIBRARY(QWT_LIBS qwt PATHS ${QWTHOME}/lib ${QWTHOME}/lib64)
ENDIF(WINDOWS)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
FIND_PROGRAM(SIP_EXECUTABLE sip)
ENDIF(SIP_ROOT)
SET(SIP_INCLUDES -I${SIP_ROOT}/include/python${PYTHON_VERSION})
+IF(WINDOWS)
+ SET(SIP_INCLUDES ${SIP_INCLUDES} -I${SIP_ROOT}/include)
+ENDIF(WINDOWS)
-FIND_PROGRAM(PYUIC_EXECUTABLE pyuic4)
+IF(WINDOWS)
+ FIND_PROGRAM(PYUIC_EXECUTABLE NAMES pyuic4 pyuic4.bat)
+ELSE(WINDOWS)
+ FIND_PROGRAM(PYUIC_EXECUTABLE NAMES pyuic4)
+ENDIF(WINDOWS)
SET(PYUIC_ROOT ${PYUIC_EXECUTABLE})
IF(PYUIC_ROOT)
GET_FILENAME_COMPONENT(PYUIC_ROOT ${PYUIC_ROOT} PATH)
ENDIF(PYUIC_ROOT)
-IF(WINDOWS)
- SET(PYQT_SIPS ${PYUIC_ROOT}/sip)
-ELSE(WINDOWS)
- SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip)
-ENDIF(WINDOWS)
+SET(PYQT_SIPS $ENV{PYQT_SIPS})
+IF(NOT PYQT_SIPS)
+ IF(WINDOWS)
+ SET(PYQT_SIPS ${PYUIC_ROOT}/sip)
+ ELSE(WINDOWS)
+ IF(PYUIC_ROOT STREQUAL /usr)
+ SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip/PyQt4)
+ ELSE(PYUIC_ROOT STREQUAL /usr)
+ SET(PYQT_SIPS ${PYUIC_ROOT}/share/sip)
+ ENDIF(PYUIC_ROOT STREQUAL /usr)
+ ENDIF(WINDOWS)
+ENDIF(NOT PYQT_SIPS)
SET(PYQT_INCLUDES -I${PYQT_SIPS})
SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtCore -I${PYQT_SIPS}/QtGui)
SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtNetwork -I${PYQT_SIPS}/QtSql)
SET(PYQT_INCLUDES ${PYQT_INCLUDES} -I${PYQT_SIPS}/QtSvg -I${PYQT_SIPS}/QtTest)
-SET(PYQT_SIPFLAGS -x VendorID -x PyQt_NoPrintRangeBug -t WS_X11 -t Qt_4_4_1 -g -s .cc -c .)
-SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${PYQT_INCLUDES})
+EXECUTE_PROCESS(
+ COMMAND ${PYTHON_EXECUTABLE} -c "import re, PyQt4.pyqtconfig ; s = PyQt4.pyqtconfig.Configuration().pyqt_sip_flags ; print s;"
+ OUTPUT_VARIABLE COMPILE_FLAGS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+string(REPLACE " " ";" FLAGS_LIST ${COMPILE_FLAGS})
+FOREACH(FLG ${FLAGS_LIST})
+SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${FLG})
+ENDFOREACH(FLG ${FLAGS_LIST})
+
+SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} -s .cc -c . )
+SET( PYQT_SIPFLAGS ${PYQT_SIPFLAGS} ${PYQT_INCLUDES} )
\ No newline at end of file
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
INCLUDE(FindVTK)
ENDFOREACH(dir ${VTK_INCLUDE_DIRS})
SET(VTK_LIBS)
-FIND_LIBRARY(VTK_COMMON vtkCommon ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_COMMON vtkCommon PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_COMMON})
-FIND_LIBRARY(VTK_GRAPHICS vtkGraphics ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_GRAPHICS vtkGraphics PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_GRAPHICS})
-FIND_LIBRARY(VTK_IMAGING vtkImaging ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_IMAGING vtkImaging PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_IMAGING})
-FIND_LIBRARY(VTK_FILTERING vtkFiltering ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_FILTERING vtkFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_FILTERING})
-FIND_LIBRARY(VTK_IO vtkIO ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_IO vtkIO PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_IO})
-FIND_LIBRARY(VTK_RENDERING vtkRendering ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_RENDERING vtkRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_RENDERING})
-FIND_LIBRARY(VTK_HYBRID vtkHybrid ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_HYBRID vtkHybrid PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_HYBRID})
-FIND_LIBRARY(VTK_PARALLEL vtkParallel ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_PARALLEL vtkParallel PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_PARALLEL})
-FIND_LIBRARY(VTK_WIDGETS vtkWidgets ${VTK_LIBRARY_DIRS})
+FIND_LIBRARY(VTK_WIDGETS vtkWidgets PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
SET(VTK_LIBS ${VTK_LIBS} ${VTK_WIDGETS})
+FIND_LIBRARY(VTK_GENERIC_FILTERING vtkGenericFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_GENERIC_FILTERING})
+FIND_LIBRARY(VTK_INFOVIS vtkInfovis PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_INFOVIS})
+FIND_LIBRARY(VTK_VOLUME_RENDERING vtkVolumeRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+SET(VTK_LIBS ${VTK_LIBS} ${VTK_VOLUME_RENDERING})
+
+FIND_LIBRARY(vtkCommonPythonD vtkCommonPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+FIND_LIBRARY(vtkGraphicsPythonD vtkGraphicsPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+FIND_LIBRARY(vtkImagingPythonD vtkImagingPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+FIND_LIBRARY(vtkPythonCore vtkPythonCore PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
+
+
+#IF(NOT WINDOWS)
+# IF(VTK_MAJOR_VERSION STREQUAL 5)
+# IF(VTK_MINOR_VERSION STREQUAL 0)
+# SET(VTK_INCLUDES ${VTK_INCLUDES} -Wno-deprecated)
+# ENDIF(VTK_MINOR_VERSION STREQUAL 0)
+# ENDIF(VTK_MAJOR_VERSION STREQUAL 5)
+#ENDIF(NOT WINDOWS)
+
+SET(VTK_INCLUDES ${VTK_INCLUDES} -DVTK_EXCLUDE_STRSTREAM_HEADERS)
+SET(VTK_DEFINITIONS -DVTK_EXCLUDE_STRSTREAM_HEADERS)
\ No newline at end of file
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocal_cmake_DATA = \
FindCAS.cmake \
FindOPENGL.cmake \
FindQT4.cmake \
+UseQT4EXT.cmake \
FindQWT.cmake \
FindSIPPYQT.cmake \
FindVTK.cmake \
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = config_files
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocalm4_DATA = \
check_SalomeObject.m4 \
check_sip.m4 \
check_SupervGraphViewer.m4 \
-check_vtk.m4 \
check_VTKViewer.m4 \
-check_corba_in_GUI.m4 \
check_QxGraphViewer.m4 \
-check_TestRecorder.m4
+check_TestRecorder.m4 \
+check_salome_version.m4
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-glViewer=[yes|no|DIR] taking into account that
# DISABLE_GLVIEWER may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
# Check availability of Salome binary distribution
#
# Author : Marc Tajchman (CEA, 2002)
#------------------------------------------------------------
-AC_DEFUN([CHECK_GUI],[
+AC_DEFUN([CHECK_GUI_MODULE],[
AC_REQUIRE([AC_LINKER_OPTIONS])dnl
-AC_CHECKING(for $2 $1 )
-
-SalomeGUI_ok=no
+LightGUI_ok=no
+FullGUI_ok=no
GUI_LDFLAGS=""
GUI_CXXFLAGS=""
-AC_ARG_WITH(gui,
- --with-salome_gui=DIR root directory path of SALOME GUI installation,
- SALOME_GUI_DIR="$withval",SALOME_GUI_DIR="")
+SALOME_GUI_DIR=""
-if test "x${SALOME_GUI_DIR}" = "x" ; then
- # no --with-gui-dir option used
- AC_MSG_RESULT(try \${GUI_ROOT_DIR}: ${GUI_ROOT_DIR})
- if test "x${GUI_ROOT_DIR}" != "x" ; then
- # SALOME_ROOT_DIR environment variable defined
- SALOME_GUI_DIR=${GUI_ROOT_DIR}
+AC_ARG_WITH(gui,
+ [--with-gui=DIR root directory path of SALOME GUI installation],
+ [],
+ [with_gui=auto])
+
+if test "${with_gui}" = "no"; then
+ SalomeGUI_need=no
+else
+ # define SALOME_GUI_DIR
+ if test "${with_gui}" = "yes" -o "${with_gui}" = "auto"; then
+ SalomeGUI_need="$with_gui"
+ AC_MSG_RESULT(try \${GUI_ROOT_DIR}: ${GUI_ROOT_DIR})
+ if test "x${GUI_ROOT_DIR}" != "x" ; then
+ # GUI_ROOT_DIR environment variable defined
+ SALOME_GUI_DIR=${GUI_ROOT_DIR}
+ else
+ # search Salome binaries in PATH variable
+ AC_PATH_PROG(TEMP, SUITApp)
+ if test "x${TEMP}" != "x" ; then
+ AC_MSG_RESULT(SUITApp was found at : ${TEMP})
+ SALOME_BIN_DIR=`dirname ${TEMP}`
+ SALOME_GUI_DIR=`cd ${SALOME_BIN_DIR}/../..; pwd`
+ fi
+ fi
else
- # search Salome binaries in PATH variable
- AC_PATH_PROG(TEMP, $1)
- if test "x${TEMP}" != "x" ; then
- AC_MSG_RESULT($1 was found at : ${TEMP})
- SALOME_BIN_DIR=`dirname ${TEMP}`
- SALOME_GUI_DIR=`cd ${SALOME_BIN_DIR}/../..; pwd`
- fi
+ # GUI directory defined by user
+ SalomeGUI_need=yes
+ SALOME_GUI_DIR="$with_gui"
fi
-fi
-if test -f ${SALOME_GUI_DIR}/bin/salome/$1 ; then
- SalomeGUI_ok=yes
- AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR})
-
- if test "x${GUI_ROOT_DIR}" == "x" ; then
+ # check GUI installation
+ AC_CHECKING(for light GUI)
+ if test -f ${SALOME_GUI_DIR}/bin/salome/SUITApp ; then
+ LightGUI_ok=yes
+ AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR})
+
GUI_ROOT_DIR=${SALOME_GUI_DIR}
- fi
- AC_SUBST(GUI_ROOT_DIR)
+ GUI_LDFLAGS=-L${SALOME_GUI_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+ GUI_CXXFLAGS=-I${SALOME_GUI_DIR}/include/salome
- GUI_LDFLAGS=-L${SALOME_GUI_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
- GUI_CXXFLAGS=-I${SALOME_GUI_DIR}/include/salome
-
- AC_SUBST(GUI_LDFLAGS)
- AC_SUBST(GUI_CXXFLAGS)
-else
- AC_MSG_WARN("Cannot find compiled SALOME GUI distribution")
+ AC_CHECKING(for full GUI)
+ if test -f ${SALOME_GUI_DIR}/bin/salome/SALOME_Session_Server ; then
+ FullGUI_ok=yes
+ fi
+ else
+ AC_MSG_WARN("Cannot find compiled SALOME GUI distribution")
+ fi
+ AC_MSG_RESULT(for light GUI: ${LightGUI_ok})
+ AC_MSG_RESULT(for full GUI: ${FullGUI_ok})
fi
-
-AC_MSG_RESULT(for $2: ${SalomeGUI_ok})
+
+AC_SUBST(GUI_LDFLAGS)
+AC_SUBST(GUI_CXXFLAGS)
+AC_SUBST(GUI_ROOT_DIR)
])dnl
AC_DEFUN([CHECK_SALOME_GUI],[
- CHECK_GUI([SUITApp],
- [SALOME GUI])
+ CHECK_GUI_MODULE()
+ SalomeGUI_ok=${LightGUI_ok}
+])dnl
+
+AC_DEFUN([CHECK_CORBA_IN_GUI],[
+ CHECK_GUI_MODULE()
+ CORBA_IN_GUI=${FullGUI_ok}
+ AC_SUBST(CORBA_IN_GUI)
])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-occViewer=[yes|no|DIR] taking into account that
# DISABLE_OCCVIEWER may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-plot2dViewer=[yes|no|DIR] taking into account that
# DISABLE_PLOT2DVIEWER may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-pyConsole=[yes|no|DIR] taking into account that
# DISABLE_PYCONSOLE may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-qxGraphViewer=[yes|no|DIR] taking into account that
# DISABLE_QXGRAPHVIEWER may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-salomeObject=[yes|no|DIR] taking into account that
# DISABLE_SALOMEOBJECT may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-supervGraphViewer=[yes|no|DIR] taking into account that
# DISABLE_SUPERVGRAPHVIEWER may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check existence of Test recorder sources and libraries.
# Set ENABLE_TESTRECORDER to yes|no
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-vtkViewer=[yes|no|DIR] taking into account that
# DISABLE_VTKVIEWER may be already set during build_configure,
+++ /dev/null
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-dnl
-# Check availability of full Salome binary distribution
-#
-# Author : Marc Tajchman (CEA, 2002)
-#------------------------------------------------------------
-
-AC_DEFUN([CHECK_CORBA_IN_GUI],[
- CHECK_GUI([SALOME_Session_Server],
- [CORBA SALOME GUI])
- CORBA_IN_GUI=${SalomeGUI_ok}
- AC_SUBST(CORBA_IN_GUI)
-])dnl
-
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
#
# Check configure option --disable-corba=[yes|no|DIR] taking into account that
# GUI_DISABLE_CORBA may be already set during build_configure,
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
# Check availability of Qt's msg2qm tool binary distribution
#
# Author : Jerome Roy (CEA, 2003)
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_OPENGL],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_PYQT],[
AC_REQUIRE([CHECK_PYTHON])dnl
AC_REQUIRE([CHECK_QT])dnl
AC_MSG_RESULT([Try $withval as pyuic4 executable])
])
+AC_ARG_WITH(pyrcc4,
+ [ --with-pyrcc4=EXEC pyrcc4 executable ],
+ [PYRCC="$withval"
+ AC_MSG_RESULT([Try $withval as pyrcc4 executable])
+ ])
+
AC_CHECKING(for pyqt)
pyqt_ok=no
+TEST_BIN_DIRS=""
+if test "x${PYQTDIR}" != "x" ; then
+ TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYQTDIR} ${PYQTDIR}/bin"
+fi
+TEST_BIN_DIRS="${TEST_BIN_DIRS} __CHECK__PATH__"
+if test "x${SIPDIR}" != "x" ; then
+ TEST_BIN_DIRS="${TEST_BIN_DIRS} ${SIPDIR} ${SIPDIR}/bin"
+fi
+if test "x${PYTHONHOME}" != "x" ; then
+ TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYTHONHOME}/bin"
+fi
+TEST_BIN_DIRS="${TEST_BIN_DIRS} /usr/bin"
+
dnl check pyuic4
if test "x$PYUIC" != "x" ; then
dnl try $withval value
AC_CHECK_FILE($PYUIC,pyqt_ok=yes,pyqt_ok=no)
else
- TEST_BIN_DIRS=""
- if test "x${PYQTDIR}" != "x" ; then
- TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYQTDIR} ${PYQTDIR}/bin"
- fi
- TEST_BIN_DIRS="${TEST_BIN_DIRS} __CHECK__PATH__"
- if test "x${SIPDIR}" != "x" ; then
- TEST_BIN_DIRS="${TEST_BIN_DIRS} ${SIPDIR} ${SIPDIR}/bin"
- fi
- if test "x${PYTHONHOME}" != "x" ; then
- TEST_BIN_DIRS="${TEST_BIN_DIRS} ${PYTHONHOME}/bin"
- fi
- TEST_BIN_DIRS="${TEST_BIN_DIRS} /usr/bin"
-
dnl search pyuic4
pyqt_ok=no
for d in ${TEST_BIN_DIRS} ; do
AC_MSG_RESULT(Warning! pyuic4 is not found!)
fi
+dnl check pyrcc4
+if test "x$PYRCC" != "x" ; then
+ dnl try $withval value
+ AC_CHECK_FILE($PYRCC,pyqt_ok=yes,pyqt_ok=no)
+else
+ dnl search pyrcc4
+ pyqt_ok=no
+ for d in ${TEST_BIN_DIRS} ; do
+ if test "x${d}" = "x__CHECK__PATH__" ; then
+ AC_PATH_PROG(TEMP, pyrcc4)
+ if test "x${TEMP}" != "x" ; then
+ PYRCC=${TEMP}
+ if test "x$PYQTDIR" = "x" ; then
+ PYQTDIR=`dirname ${PYRCC}`
+ PYQTDIR=`dirname ${PYQTDIR}`
+ fi
+ pyqt_ok=yes
+ break
+ fi
+ else
+ if test -d $d ; then
+ AC_CHECK_FILE(${d}/pyrcc4,pyqt_ok=yes,pyqt_ok=no)
+ if test "x$pyqt_ok" == "xyes" ; then
+ PYRCC=${d}/pyrcc4
+ break
+ fi
+ fi
+ fi
+ done
+fi
+
if test "x$pyqt_ok" == "xyes" ; then
TESTLIBFILE=QtCore.so
TESTSIPFILE=QtCore/QtCoremod.sip
fi
TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/PyQt4"
+ TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/dist-packages/PyQt4"
+ TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/pymodules/python${PYTHON_VERSION}/PyQt4"
+ if test "${build_cpu::6}" = "x86_64" ; then
+ TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib64/python2.6/site-packages/PyQt4"
+ fi
TEST_SIPS_DIRS="${TEST_SIPS_DIRS} /usr/share/sip"
TEST_SIPS_DIRS="${TEST_SIPS_DIRS} /usr/share/sip/PyQt4"
PYQT_INCLUDES="${PYQT_INCLUDES} -I ${d}/QtSvg -I ${d}/QtTest"
# check compatibility with Qt
- SUPPORTED=`grep -e "[[[:space:]]]*Qt_[[[:digit:]_]]\+}" ${PYQT_SIPS}/QtCore/QtCoremod.sip | sed -e "s/\(.*\)[[[:space:]]]*\(Qt_[[[:digit:]_]]\+\)}/\2/g"`
- SUPPORTED=`echo $SUPPORTED | sed -e "s/Qt_//g" -e "s/_/./g"`
- SUPPORTED_ID=`echo $SUPPORTED | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
- if test $SUPPORTED_ID -lt $QT_VERSION_ID ; then
- AC_MSG_RESULT(Warning! Used Qt version ($QT_VERSION) is not supported by PyQt)
- AC_MSG_RESULT(Latest supported Qt version is ${SUPPORTED})
- else
- SUPPORTED=${QT_VERSION}
- fi
- SUPPORTED="Qt_`echo ${SUPPORTED} | sed -e 's/\./_/g'`"
- PYQT_SIPFLAGS="-x VendorID -x PyQt_NoPrintRangeBug -t WS_X11 -t ${SUPPORTED} -g -s ".cc" -c . ${PYQT_INCLUDES}"
+ #SUPPORTED=`grep -e "[[[:space:]]]*Qt_[[[:digit:]_]]\+}" ${PYQT_SIPS}/QtCore/QtCoremod.sip | sed -e "s/\(.*\)[[[:space:]]]*\(Qt_[[[:digit:]_]]\+\)}/\2/g"`
+ #SUPPORTED=`echo $SUPPORTED | sed -e "s/Qt_//g" -e "s/_/./g"`
+ #SUPPORTED_ID=`echo $SUPPORTED | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+ #if test $SUPPORTED_ID -lt $QT_VERSION_ID ; then
+ # AC_MSG_RESULT(Warning! Used Qt version ($QT_VERSION) is not supported by PyQt)
+ # AC_MSG_RESULT(Latest supported Qt version is ${SUPPORTED})
+ #else
+ # SUPPORTED=${QT_VERSION}
+ #fi
+ #SUPPORTED="Qt_`echo ${SUPPORTED} | sed -e 's/\./_/g'`"
+ PYQT_SIPFLAGS=`python -c "from PyQt4 import pyqtconfig; print pyqtconfig.Configuration().pyqt_sip_flags"`
+ PYQT_SIPFLAGS="${PYQT_SIPFLAGS} -s .cc -c . ${PYQT_INCLUDES}"
break
fi
fi
AC_SUBST(PYQT_LIBS)
AC_SUBST(PYQT_SIPS)
AC_SUBST(PYUIC)
+AC_SUBST(PYRCC)
AC_SUBST(PYQT_SIPFLAGS)
dnl AC_LANG_RESTORE
])dnl
dnl
-
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
dnl OPTIONS_QT
dnl ------------------------------------------------------------------------
dnl Adds the --with-qt=path
AC_REQUIRE([AC_PROG_CXXCPP])dnl
AC_REQUIRE([CHECK_OPENGL])dnl
AC_REQUIRE([AC_LINKER_OPTIONS])dnl
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_REQUIRE([OPTIONS_QT])dnl
qt_ok=yes
+QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%')
+
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "x$with_qt" != "x" ; then
dnl Using "--with-qt" prefix path
QTDIR="$with_qt"
-else
- if test -z $QTDIR ; then
- AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
- for d in /usr/local/lib/qt4 /usr/lib/qt4 ; do
- if test -f ${d}/include/Qt/qconfig.h ; then
- AC_MSG_RESULT(trying ${d})
- QTDIR="${d}"
- break
+elif test "$QTDIR" = "/usr/lib/qt3" ; then
+ dnl Using QTDIR environment variable
+ AC_MSG_RESULT(current QTDIR is $QTDIR)
+ dnl
+ if test -d /usr/lib/qt4 ; then
+ AC_MSG_RESULT(it is strange for a qt4 installation !)
+ AC_MSG_RESULT(/usr/lib/qt4 is present)
+ AC_MSG_RESULT(replacing QTDIR by /usr/lib/qt4)
+ QTDIR=/usr/lib/qt4
+ fi
+elif test -z $QTDIR ; then
+ AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed, trying to guess using pkg-config)
+ PKG_PROG_PKG_CONFIG()
+ AS_IF([test "x$PKG_CONFIG" != "x"],
+ [
+ QT_REQUIRED_VERSION=4.0.0
+ if $PKG_CONFIG --exists "QtCore >= $QT_REQUIRED_VERSION"
+ then
+ QT_USING_PKGCONFIG=yes
+ QT_VERSION=`$PKG_CONFIG --modversion QtCore --atleast-version=$QT_REQUIRED_VERSION`
+ QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
+
+ MOC=`$PKG_CONFIG --variable=moc_location "QtCore >= $QT_REQUIRED_VERSION"`
+ UIC=`$PKG_CONFIG --variable=uic_location "QtCore >= $QT_REQUIRED_VERSION"`
+ QRCC=`$PKG_CONFIG --variable=rcc_location "QtCore >= $QT_REQUIRED_VERSION"`
+ LRELEASE=`$PKG_CONFIG --variable=lrelease_location "QtCore >= $QT_REQUIRED_VERSION"`
+
+ QTCORE_CPPFLAGS=`$PKG_CONFIG --cflags "QtCore >= $QT_REQUIRED_VERSION"`
+ QTGUI_CPPFLAGS=`$PKG_CONFIG --cflags "QtGui >= $QT_REQUIRED_VERSION"`
+ QTOPENGL_CPPFLAGS=`$PKG_CONFIG --cflags "QtOpenGL >= $QT_REQUIRED_VERSION"`
+ QTXML_CPPFLAGS=`$PKG_CONFIG --cflags "QtXml >= $QT_REQUIRED_VERSION"`
+ QTASSISTANT_CPPFLAGS=`$PKG_CONFIG --cflags "QtAssistant >= $QT_REQUIRED_VERSION"`
+ QTNETWORK_CPPFLAGS=`$PKG_CONFIG --cflags "QtNetwork >= $QT_REQUIRED_VERSION"`
+ QTWEBKIT_CPPFLAGS=`$PKG_CONFIG --cflags "QtWebKit >= $QT_REQUIRED_VERSION"`
+
+ QTCORE_LDFLAGS=`$PKG_CONFIG --libs "QtCore >= $QT_REQUIRED_VERSION"`
+ QTGUI_LDFLAGS=`$PKG_CONFIG --libs "QtGui >= $QT_REQUIRED_VERSION"`
+ QTOPENGL_LDFLAGS=`$PKG_CONFIG --libs "QtOpenGL >= $QT_REQUIRED_VERSION"`
+ QTXML_LDFLAGS=`$PKG_CONFIG --libs "QtXml >= $QT_REQUIRED_VERSION"`
+ QTASSISTANT_LDFLAGS=`$PKG_CONFIG --libs "QtAssistant >= $QT_REQUIRED_VERSION"`
+ QTNETWORK_LDFLAGS=`$PKG_CONFIG --libs "QtNetwork >= $QT_REQUIRED_VERSION"`
+ QTWEBKIT_LDFLAGS=`$PKG_CONFIG --libs "QtWebKit >= $QT_REQUIRED_VERSION"`
else
- if test -f ${d}/include/qconfig.h ; then
- AC_MSG_RESULT(trying ${d})
- QTDIR="${d}"
- break
- fi
+ AC_MSG_WARN(Qt not found)
fi
- done
- else
- dnl Using QTDIR environment variable
- AC_MSG_RESULT(QTDIR is $QTDIR)
- fi
+ ],
+ [
+ AC_MSG_WARN([pkg-config not found])
+ ]
+ )
+fi
+if test -z $QTDIR ; then
+ AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
+ for d in /usr/local/lib/qt4 /usr/lib/qt4 /usr ; do
+ if test -f ${d}/lib/libQtCore.so ; then
+ AC_MSG_RESULT(trying ${d})
+ QTDIR="${d}"
+ break
+ elif test -f ${d}/lib64/libQtCore.so ; then
+ AC_MSG_RESULT(trying ${d})
+ QTDIR="${d}"
+ break
+ elif test -f ${d}/libQtCore.so ; then
+ AC_MSG_RESULT(trying ${d})
+ QTDIR="${d}"
+ break
+ fi
+ done
fi
-
#
# check QTDIR environment variable
#
-if test "x$QTDIR" = "x"
+if test "x$QTDIR" = "x" -a "x$QT_USING_PKGCONFIG" != "xyes"
then
AC_MSG_RESULT(Please define correct path in "--with-qt" option or use correct $QTDIR variable)
qt_ok=no
#
if test "x$qt_ok" = "xyes"
then
- qt_inc_ok=no
- QTINC=""
- AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
- if test "x$QTINC" = "x"
+ AC_MSG_CHECKING(whether Qt version >= 4.0)
+ if test "x$QT_USING_PKGCONFIG" != "xyes"
then
- AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
- else
- qt_inc_ok=yes
+ qt_inc_ok=no
+ QTINC=""
+ AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
+ if test "x$QTINC" = "x"
+ then
+ AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
+ else
+ qt_inc_ok=yes
+ fi
+
+ if test "x$qt_inc_ok" = "xyes"
+ then
+ QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
+ fi
fi
- if test "x$qt_inc_ok" = "xyes"
- then
- AC_MSG_CHECKING(whether Qt version >= 4.0)
- QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
+
+
+ if test "x$qt_inc_ok" = "xyes" -o "x$QT_USING_PKGCONFIG" = "xyes"
+ then
QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
if test $QT_VERSION_ID -ge 40000
then
#
# check moc presence (meta-object compiler)
#
+qt_add=no
+
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/moc
+ if test "x$QT_USING_PKGCONFIG" != "xyes"
then
- MOC=${QTDIR}/bin/moc
- else
- AC_PATH_PROG(MOC, moc)
+ if test -f ${QTDIR}/bin/moc
+ then
+ MOC=${QTDIR}/bin/moc
+ else
+ AC_PATH_PROG(MOC, moc)
+ fi
fi
+
if test "x$MOC" = "x"
then
qt_ok=no
if test "x$qt_ok" = "xyes"
then
dnl check moc version
- AC_MSG_CHECKING(cheching equality Qt and moc tool version)
+ AC_MSG_CHECKING( equality Qt and moc tool version)
MOC_VERSION=`$MOC -v 2>&1 | awk 'BEGIN{FS="[[ ()]]"};{print $(NF-1)}'`
if test "x$QT_VERSION" = "x$MOC_VERSION"
then
AC_MSG_RESULT(yes)
qt_ok=yes
else
- AC_MSG_RESULT(moc tool and Qt product are inpompatible $MOC_VERSION)
- qt_ok=no
+ AC_MSG_RESULT(moc tool and Qt product are incompatible $MOC_VERSION)
+ QT_VERSION_MAJ=`echo $QT_VERSION | awk -F. '{v=$[1];print v}'`
+ AC_MSG_CHECKING(for moc-qt$QT_VERSION_MAJ compatible version)
+ if test -f ${QTDIR}/bin/moc-qt$QT_VERSION_MAJ
+ then
+ MOC=${QTDIR}/bin/moc-qt$QT_VERSION_MAJ
+ qt_ok=yes
+ qt_add=$QT_VERSION_MAJ
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ qt_ok=no
+ fi
fi
fi
fi
+AC_MSG_CHECKING(moc tool and Qt product done)
+AC_MSG_RESULT(yes)
#
# check uic presence (user interface compiler)
#
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/uic
+ if test "x$QT_USING_PKGCONFIG" != "xyes"
then
- UIC=${QTDIR}/bin/uic
- else
- AC_PATH_PROG(UIC, uic)
+ if test "x$qt_add" = "xno"
+ then
+ AC_MSG_CHECKING(uic)
+ if test -f ${QTDIR}/bin/uic
+ then
+ UIC=${QTDIR}/bin/uic
+ else
+ AC_PATH_PROG(UIC, uic)
+ fi
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_CHECKING(uic-qt$qt_add)
+ if test -f ${QTDIR}/bin/uic-qt$qt_add
+ then
+ UIC=${QTDIR}/bin/uic-qt$qt_add
+ else
+ AC_PATH_PROG(UIC, uic)
+ fi
+ AC_MSG_RESULT(yes)
+ fi
fi
+
if test "x$UIC" = "x"
then
qt_ok=no
qt_ok=yes
AC_MSG_RESULT(uic (Qt user interface compiler) is found)
fi
+
+ if test "x$qt_ok" = "xyes"
+ then
+ dnl check uic version
+ AC_MSG_CHECKING(cheching equality Qt and uic tool version)
+ UIC_VERSION=`$UIC -version 2>&1 | awk '{print $NF}'`
+ if test "x$QT_VERSION" = "x$UIC_VERSION"
+ then
+ AC_MSG_RESULT(yes)
+ qt_ok=yes
+ else
+ AC_MSG_RESULT(uic tool and Qt product are incompatible)
+ qt_ok=no
+ fi
+ fi
fi
#
#
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/rcc
+ if test "x$QT_USING_PKGONFIG" != "xyes"
then
- QRCC=${QTDIR}/bin/rcc
- else
- AC_PATH_PROG(QRCC, rcc)
+ if test "x$qt_add" = "xno"
+ then
+ if test -f ${QTDIR}/bin/rcc
+ then
+ QRCC=${QTDIR}/bin/rcc
+ else
+ AC_PATH_PROG(QRCC, rcc)
+ fi
+ else
+ if test -f ${QTDIR}/bin/rcc-qt$qt_add
+ then
+ QRCC=${QTDIR}/bin/rcc-qt$qt_add
+ else
+ AC_PATH_PROG(QRCC, rcc)
+ fi
+ fi
fi
+
if test "x$QRCC" = "x"
then
qt_ok=no
AC_MSG_RESULT(yes)
qt_ok=yes
else
- AC_MSG_RESULT(rcc tool and Qt product are inpompatible)
+ AC_MSG_RESULT(rcc tool and Qt product are incompatible)
qt_ok=no
fi
fi
#
if test "x$qt_ok" = "xyes"
then
- if test -f ${QTDIR}/bin/lrelease
+ if test "x$QT_USING_PKGCONFIG" != "xyes"
then
- LRELEASE=${QTDIR}/bin/lrelease
- else
- AC_PATH_PROG(LRELEASE, lrelease)
+ if test "x$qt_add" = "xno"
+ then
+ if test -f ${QTDIR}/bin/lrelease
+ then
+ LRELEASE=${QTDIR}/bin/lrelease
+ else
+ AC_PATH_PROG(LRELEASE, lrelease)
+ fi
+ else
+ if test -f ${QTDIR}/bin/lrelease-qt$qt_add
+ then
+ LRELEASE=${QTDIR}/bin/lrelease-qt$qt_add
+ else
+ AC_PATH_PROG(LRELEASE, lrelease)
+ fi
+ fi
fi
+
if test "x$LRELEASE" = "x"
then
qt_ok=no
AC_MSG_RESULT(yes)
qt_ok=yes
else
- AC_MSG_RESULT(lrelease tool and Qt product are inpompatible)
+ AC_MSG_RESULT(lrelease tool and Qt product are incompatible)
qt_ok=no
fi
fi
AC_CHECKING(include Qt header files)
CPPFLAGS_old=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore"
+ if test "x$QT_USING_PKGCONFIG" != "xyes"
+ then
+ CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore"
+ else
+ CPPFLAGS="$CPPFLAGS $QTCORE_CPPFLAGS"
+ fi
AC_CHECK_HEADER(QObject,qt_ok=yes,qt_ok=no)
CPPFLAGS=$CPPFLAGS_old
AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
else
AC_MSG_RESULT(qt header files seem to be OK)
- QT_INCLUDES="-I${QTDIR}/include${QTINC}"
- # user header files
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtCore"
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtGui"
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtOpenGL"
- QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtXml"
- # not used currently header files (uncomment if required)
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtAssistant"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDBus"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDesigner"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtNetwork"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSql"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSvg"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtTest"
- #QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtUiTools"
-
- QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtAssistant"
- QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtNetwork"
+ if test "x$QT_USING_PKGCONFIG" != "xyes"
+ then
+ QT_BASE="-I${QTDIR}/include${QTINC}"
+ # user header files
+ QTCORE_CPPFLAGS="${QT_BASE}/QtCore"
+ QTGUI_CPPFLAGS="${QT_BASE}/QtGui"
+ QTOPENGL_CPPFLAGS="${QT_BASE}/QtOpenGL"
+ QTWEBKIT_CPPFLAGS="${QT_BASE}/QtWebKit"
+ QTXML_CPPFLAGS="${QT_BASE}/QtXml"
+
+ QTASSISTANT_CPPFLAGS="${QT_BASE}/QtAssistant"
+ QTNETWORK_CPPFLAGS="${QT_BASE}/QtNetwork"
+ fi
- # this flag is obsolete with Qt 4
- QT_MT_INCLUDES="$QT_INCLUDES"
+ QT_INCLUDES="$QT_BASE $QTCORE_CPPFLAGS $QTGUI_CPPFLAGS $QTOPENGL_CPPFLAGS $QTXML_CPPFLAGS $QTWEBKIT_CPPFLAGS"
+
+ QT_ASSISTANT_INCLUDES="$QTASSISTANT_CPPFLAGS $QTNETWORK_CPPFLAGS"
+ QT_MT_INCLUDES="${QT_INCLUDES}"
fi
fi
CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
LIBS_old=$LIBS
- if test "x$QTDIR" = "x/usr"
+ if test "x$QT_USING_PKGCONFIG" = "xyes"
then
- QT_LIB_DIR=""
- elif test -d ${QTDIR}/lib; then
- QT_LIB_DIR="-L$QTDIR/lib"
- elif test -d ${QTDIR}/lib64; then
- QT_LIB_DIR="-L$QTDIR/lib64"
+ LIBS="$LIBS $QTCORE_LDFLAGS"
else
- AC_MSG_ERROR(Can't detect of Qt library directory )
- qt_ok=no
+ if test "x$QTDIR" = "x/usr" ; then
+ QT_LIB_DIR=""
+ elif test -d ${QTDIR}/lib; then
+ QT_LIB_DIR="-L$QTDIR/lib"
+ elif test -d ${QTDIR}/lib64; then
+ QT_LIB_DIR="-L$QTDIR/lib64"
+ elif test "x$QTDIR" = "x/usr/lib/qt4" ; then
+ QT_LIB_DIR=""
+ else
+ AC_MSG_ERROR(Can't detect Qt library directory ) #'
+ qt_ok=no
+ fi
+ LIBS="$LIBS $QT_LIB_DIR -lQtCore"
fi
- LIBS="$LIBS $QT_LIB_DIR -lQtCore"
AC_CACHE_VAL(salome_cv_lib_qt,[
AC_TRY_LINK(
else
AC_MSG_RESULT(yes)
# core libs
- QT_CORE_LIBS="$QT_LIB_DIR -lQtCore -lQtXml"
- # gui libs
- QT_GUI_LIBS="$QT_LIB_DIR -lQtGui -lQtOpenGL"
- # other libs (currently not used)
- QT_OTHER_LIBS="$QT_LIB_DIR"
- # other libs (can be used if necessary)
- #QT_OTHER_LIBS="$QT_LIB_DIR -lQt3Support -lQtAssistantClient -lQtDesigner -lQtNetwork -lQtSql -lQtSvg -lQtTest -ltQtUiTools"
- QT_ASSISTANT_LIBS="$QT_LIB_DIR -lQtAssistantClient -lQtNetwork"
+ if test "x$QT_USING_PKGCONFIG" = "xyes"
+ then
+ QT_CORE_LIBS="$QTCORE_LDFLAGS $QTXML_LDFLAGS"
+ QT_GUI_LIBS="$QTGUI_LDFLAGS $QTOPENGL_LDFLAGS $QTWEBKIT_LDFLAGS"
+ QT_ASSISTANT_LIBS="$QTASSISTANT_LDFLAGS $QTNETWORK_LDFLAGS"
+ else
+ QT_CORE_LIBS="$QT_LIB_DIR -lQtCore -lQtXml"
+ # gui libs
+ QT_GUI_LIBS="$QT_LIB_DIR -lQtGui -lQtOpenGL -lQtWebKit"
+ # other libs (currently not used)
+ QT_OTHER_LIBS="$QT_LIB_DIR"
+ # other libs (can be used if necessary)
+ #QT_OTHER_LIBS="$QT_LIB_DIR -lQt3Support -lQtAssistantClient -lQtDesigner -lQtNetwork -lQtSql -lQtSvg -lQtTest -ltQtUiTools"
+ QT_ASSISTANT_LIBS="$QT_LIB_DIR -lQtAssistantClient -lQtNetwork"
+ fi
# all libs
QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_OTHER_LIBS"
# this flag is obsolete with Qt 4
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_QWT],[
AC_REQUIRE([CHECK_QT])dnl
AC_REQUIRE([AC_LINKER_OPTIONS])dnl
AC_MSG_RESULT("select $withval as path to QWT includes")
])
+libqwt_name=qwt
if test -z $QWTHOME; then
AC_MSG_RESULT(QWTHOME not defined)
+ AC_MSG_NOTICE(Trying native Qwt...)
exist_ok=no
if test "x$exist_ok" = "xno"; then
- for d in /usr/local /usr ; do
- AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exist_ok=yes,exist_ok=no)
+ for d in /usr /usr/local ; do
+ for extension in qwt-qt4 qwt; do
+ AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/lib${extension}.so,exist_ok=yes,exist_ok=no)
+ if test "x$exist_ok" = "xyes"; then
+ QWTHOME=$d
+ AC_MSG_RESULT(lib${extension}.so detected in $d/lib)
+ libqwt_name=${extension}
+ dnl break, libqwt-qt4.so is choosen before libqwt.so since it is surely the Qt4 version.
+ break
+ fi
+ done
if test "x$exist_ok" = "xyes"; then
- QWTHOME=$d
- AC_MSG_RESULT(libqwt.so detected in $d/lib)
+ break
fi
done
fi
+ if test "x$exist_ok" = "xno"; then
+ if test "${build_cpu::6}" = "x86_64" ; then
+ for d in /usr /usr/local ; do
+ for extension in qwt-qt4 qwt; do
+ AC_CHECK_FILE(${d}/lib64/lib${extension}.so,exist_ok=yes,exist_ok=no)
+ if test "x$exist_ok" = "xyes"; then
+ QWTHOME=$d
+ AC_MSG_RESULT(lib${extension}.so detected in $d/lib)
+ libqwt_name=${extension}
+ dnl break, libqwt-qt4.so is choosen before libqwt.so since it is surely the Qt4 version.
+ break
+ fi
+ done
+ if test "x$exist_ok" = "xyes"; then
+ break
+ fi
+ done
+ fi
+ fi
if test "x$exist_ok" = "xno"; then
for d in `echo $LD_LIBRARY_PATH | sed -e "s/:/ /g"` ; do
if test -f $d/libqwt.so ; then
fi
if test "x$exist_ok" = "xyes"; then
if test -z $QWT_INCDIR; then
- QWT_INCDIR=$QWTHOME"/include/qwt"
+ QWT_INCDIR=$QWTHOME"/include/qwt-qt4"
+ if test ! -f $QWT_INCDIR/qwt.h ; then
+ QWT_INCDIR=/usr/include/qwt
+ fi
if test ! -f $QWT_INCDIR/qwt.h ; then
QWT_INCDIR=$QWTHOME"/include"
fi
qwt_ok=no
fi
else
+ AC_MSG_NOTICE(Trying Qwt from $QWTHOME ...)
if test -z $QWT_INCDIR; then
QWT_INCDIR="$QWTHOME/include"
fi
LIBS_old=$LIBS
LIBS="$LIBS $QT_LIBS"
if test "x$QWTHOME" = "x/usr" ; then
- LIBS="$LIBS -lqwt"
+ LIBS="$LIBS -l${libqwt_name}"
else
- LIBS="$LIBS -L$QWTHOME/lib -lqwt"
+ LIBS="$LIBS -L$QWTHOME/lib -l${libqwt_name}"
fi
CXXFLAGS_old=$CXXFLAGS
else
AC_MSG_RESULT(yes)
if test "x$QWTHOME" = "x/usr" ; then
- QWT_LIBS=" -lqwt"
+ QWT_LIBS=" -l${libqwt_name}"
else
- QWT_LIBS="-L$QWTHOME/lib -lqwt"
+ QWT_LIBS="-L$QWTHOME/lib -l${libqwt_name}"
fi
fi
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
AC_DEFUN([CHECK_SIP],[
AC_REQUIRE([CHECK_PYTHON])dnl
AC_REQUIRE([CHECK_QT])dnl
fi
TEST_INC_DIRS="${TEST_INC_DIRS} /usr/include /usr/include/python${PYTHON_VERSION}"
TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
-
+ TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/dist-packages/PyQt4"
+ TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/pymodules/python${PYTHON_VERSION}"
+ if test "${build_cpu::6}" = "x86_64" ; then
+ TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib64/python${PYTHON_VERSION}/site-packages"
+ fi
dnl Search sip.h file
sip_ok=no
for d in ${TEST_INC_DIRS} ; do
+++ /dev/null
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-dnl
-dnl OPTIONS_VTK
-dnl ------------------------------------------------------------------------
-dnl Adds the --with-vtk=path and --with-vtk-version configure options
-dnl
-AC_DEFUN([OPTIONS_VTK], [
- AC_ARG_WITH([vtk],
- [AC_HELP_STRING([--with-vtk], [The prefix where VTK is installed (default "" means taking from environment variable)])],
- [with_vtk=$withval], [with_vtk=""])
-
- AC_ARG_WITH([vtk-version],
- [AC_HELP_STRING([--with-vtk-version], [VTK include directory name is vtk-suffix, e.g. vtk-5.0/. What is the suffix? (Default "yes" means taking from environment variable)])],
- [vtk_suffix=$withval], [vtk_suffix="yes"])
-
- AC_ARG_WITH([paraview],
- [AC_HELP_STRING([--with-paraview], [ParaView from the specified location is used instead of VTK (default "" means ParaView should not be used)])])
-])
-
-dnl
-dnl CHECK_VTK
-dnl ------------------------------------------------------------------------
-dnl
-AC_DEFUN([CHECK_VTK], [
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_CXX])dnl
-AC_REQUIRE([AC_PROG_CPP])dnl
-AC_REQUIRE([AC_PROG_CXXCPP])dnl
-AC_REQUIRE([AC_LINKER_OPTIONS])dnl
-
-AC_REQUIRE([OPTIONS_VTK])dnl
-
-AC_CHECKING(for VTK)
-
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-
-AC_SUBST(VTK_INCLUDES)
-AC_SUBST(VTK_LIBS)
-AC_SUBST(VTKPY_MODULES)
-
-VTK_INCLUDES=""
-VTK_LIBS=""
-VTKPY_MODULES=""
-
-vtk_ok=no
-
-if test "x$OpenGL_ok" != "xyes" ; then
- AC_MSG_WARN(VTK needs OpenGL correct configuration, check configure output)
-fi
-
-AC_PATH_X
-if test "x$x_libraries" != "x"
-then
- LXLIB="-L$x_libraries"
-else
- LXLIB=""
-fi
-
-if test "x$x_libraries" = "x/usr/lib"
-then
- LXLIB=""
-fi
-
-if test "x$x_libraries" = "x/usr/lib${LIB_LOCATION_SUFFIX}"
-then
- LXLIB=""
-fi
-
-LOCAL_INCLUDES="$OGL_INCLUDES"
-LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets $LXLIB -lX11 -lXt"
-TRY_LINK_LIBS="-lvtkCommon $LXLIB -lX11 -lXt"
-
-dnl VTK version suffix
-if test -z $vtk_suffix ; then
- vtk_suffix="yes"
-fi
-if test "x$vtk_suffix" == "xno" ; then
- dnl in case user wrote --with-vtk-version=no, use empty suffix
- vtk_suffix=""
-fi
-if test "x$vtk_suffix" != "xyes" ; then
- VTKSUFFIX="$vtk_suffix"
-else
- dnl in case user wrote --with-vtk-version=yes, get the suffix from env
- if test -z $VTKSUFFIX ; then
- VTKSUFFIX="-5.0"
- fi
-fi
-
-dnl VTK install dir
-if test -z $with_vtk ; then
- with_vtk=""
-fi
-if test "x$with_vtk" = "xyes" ; then
- dnl in case user wrote --with-vtk=yes
- with_vtk=""
-fi
-if test "x$with_vtk" = "xno" ; then
- dnl in case user wrote --with-vtk=no
- with_vtk=""
- AC_MSG_WARN(Value "no", specified for option --with-vtk, is not supported)
-fi
-
-if test "x$with_vtk" != "x" ; then
- VTKHOME="$with_vtk"
-else
- if test -z $VTKHOME ; then
- AC_MSG_WARN(undefined VTKHOME variable which specify where vtk was compiled)
- for d in /usr/local /usr ; do
- if test -f ${d}/include/vtk${VTKSUFFIX}/vtkPlane.h ; then
- AC_MSG_RESULT(trying ${d})
- VTKHOME="${d}"
- break
- else
- if test -f ${d}/include/vtk-5.0/vtkPlane.h ; then
- AC_MSG_RESULT(trying ${d})
- VTKHOME="${d}"
- VTKSUFFIX="-5.0"
- break
- else
- if test -f ${d}/include/vtk/vtkPlane.h ; then
- AC_MSG_RESULT(trying ${d})
- VTKHOME="${d}"
- VTKSUFFIX=""
- break
- fi
- fi
- fi
- done
- fi
-fi
-
-# Using regular VTK installation
-if test "x$with_paraview" = "x" ; then
- LOCAL_INCLUDES="-I$VTKHOME/include/vtk${VTKSUFFIX} $LOCAL_INCLUDES"
- LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $LOCAL_LIBS"
- TRY_LINK_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} -L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $TRY_LINK_LIBS"
- if test "x$VTKHOME" != "x/usr" ; then
- LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} $LOCAL_LIBS"
- fi
-else
-# VTK from ParaView overrides other VTK versions
- if test "${with_paraview}" = "yes" ; then
- if test -z $PVHOME ; then
- PVHOME="/usr"
- fi
- else
- PVHOME=${with_paraview}
- fi
-
- if test -z $PVSRCHOME ; then
- PVSRCHOME="$PVHOME/src"
- fi
-
- if test -z $PVINSTALLHOME ; then
- PVINSTALLHOME="$PVHOME/bin"
- fi
-
- LOCAL_INCLUDES="-I$PVSRCHOME/VTK/Common -I$PVSRCHOME/VTK/Filtering -I$PVSRCHOME/VTK/GenericFiltering -I$PVSRCHOME/VTK/Graphics -I$PVSRCHOME/VTK/Hybrid -I$PVSRCHOME/VTK/Imaging -I$PVSRCHOME/VTK/Infovis -I$PVSRCHOME/VTK/IO -I$PVSRCHOME/VTK/Parallel -I$PVSRCHOME/VTK/Rendering -I$PVSRCHOME/VTK/Utilities -I$PVSRCHOME/VTK/Views -I$PVSRCHOME/VTK/VolumeRendering -I$PVSRCHOME/VTK/Widgets -I$PVINSTALLHOME/VTK -I$PVINSTALLHOME/VTK/Common -I$PVINSTALLHOME/VTK/Filtering -I$PVINSTALLHOME/VTK/GenericFiltering -I$PVINSTALLHOME/VTK/Graphics -I$PVINSTALLHOME/VTK/Hybrid -I$PVINSTALLHOME/VTK/Imaging -I$PVINSTALLHOME/VTK/Infovis -I$PVINSTALLHOME/VTK/IO -I$PVINSTALLHOME/VTK/Parallel -I$PVINSTALLHOME/VTK/Rendering -I$PVINSTALLHOME/VTK/Utilities -I$PVINSTALLHOME/VTK/Views -I$PVINSTALLHOME/VTK/VolumeRendering -I$PVINSTALLHOME/VTK/Widgets $LOCAL_INCLUDES"
- LOCAL_LIBS="-L$PVINSTALLHOME/bin -lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc $LOCAL_LIBS"
- TRY_LINK_LIBS="-L$PVINSTALLHOME/bin -lvtksys $TRY_LINK_LIBS"
-fi
-
-dnl vtk headers
-CPPFLAGS_old="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
-
-AC_CHECK_HEADER(vtkPlane.h,vtk_ok="yes",vtk_ok="no")
-
-CPPFLAGS="$CPPFLAGS_old"
-
-if test "x$vtk_ok" = "xyes"
-then
- VTK_INCLUDES="$LOCAL_INCLUDES"
-
- dnl vtk libraries
-
- AC_MSG_CHECKING(linking VTK library)
-
- LIBS_old="$LIBS"
- LIBS="$LIBS $TRY_LINK_LIBS"
- #LIBS="$LIBS $LOCAL_LIBS"
- CPPFLAGS_old="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $VTK_INCLUDES"
-
- dnl VTKPY_MODULES="$VTKHOME/python"
-
- AC_CACHE_VAL(salome_cv_lib_vtk,[
- AC_TRY_LINK([#include "vtkPlane.h"
- ],
- [vtkPlane::New()],
- [salome_cv_lib_vtk=yes],
- [salome_cv_lib_vtk=no])
- ])
- vtk_ok="$salome_cv_lib_vtk"
- LIBS="$LIBS_old"
- CPPFLAGS="$CPPFLAGS_old"
-fi
-
-if test "x$vtk_ok" = "xno"
-then
- AC_MSG_RESULT(no)
- AC_MSG_WARN(unable to link with vtk library)
-else
- AC_MSG_RESULT(yes)
- VTK_LIBS="$LOCAL_LIBS"
- VTK_MT_LIBS="$LOCAL_LIBS"
-fi
-
-AC_MSG_RESULT(for VTK: $vtk_ok)
-
-AC_LANG_RESTORE
-
-# Save cache
-AC_CACHE_SAVE
-
-])dnl
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
+# ============================================================
+# The following is to avoid PACKAGE_... env variable
+# redefinition compilation warnings
+# ============================================================
+#
+AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h -I$(top_builddir)
+AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h -I$(top_builddir)
+
# ============================================================
# This file defines the common definitions used in several
# Makefile. This file must be included, if needed, by the file
#
salomeincludedir = $(includedir)/salome
libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome
+libparaviewdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/paraview
bindir = $(prefix)/bin/salome
salomescriptdir = $(bindir)
salomepythondir = $(pythondir)/salome
# Directory for installing resource files
salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@
+# Directory for installing plugins files
+salomepluginsdir = $(prefix)/share/salome/plugins/@MODULE_NAME@
+
# Directories for installing admin files
admlocaldir = $(prefix)/adm_local
admlocalunixdir = $(admlocaldir)/unix
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-#=======================================================================
-# This section of this makefile comes from the file
-# 'adm/unix/make_conclude' which was generated with config.status
-# from file adm/unix/make_conclude.in
-#=======================================================================
-# -* Makefile *-
-# Authors : Patrick GOLDBRONN (CEA) - Marc Tajchman (CEA)
-# Date : 6/07/2001
-# $Header$
-#
-ifneq ($(GUI_DISABLE_CORBA),yes)
-# ORB Specifics rules
-
-@CORBA@
-
-# transform idl reference in appropriate obj file
-LIB_CLIENT_SRC = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
-LIB_SERVER_SRC = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
-LIB_SWIG_SRC = $(SWIG_DEF:%.i=%_wrap.cxx)
-else
-LIB_CLIENT_SRC =
-LIB_SERVER_SRC =
-LIB_SWIG_SRC =
-endif
-
-LIB_MOC_SRC = $(LIB_MOC:%.h=%_moc.cxx)
-LIB_SRC+=$(LIB_MOC_SRC)
-LIB_DEP= $(LIB_SRC) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(LIB_SWIG_SRC)
-
-ifneq ($(GUI_DISABLE_CORBA),yes)
-LIB_CLIENT_OBJ = $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
-LIB_SERVER_OBJ = $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
-LIB_SWIG_OBJ = $(LIB_SWIG_SRC:%.cxx=%.lo)
-else
-LIB_CLIENT_OBJ =
-LIB_SERVER_OBJ =
-LIB_SWIG_OBJ =
-endif
-
-# transform c file in appropriate libtool obj file (.c, .cc and .cxx)
-LIB_OBJ_C = $(patsubst %.c, %.lo, $(filter %.c, $(LIB_SRC)))
-LIB_OBJ_CC = $(patsubst %.cc, %.lo, $(filter %.cc, $(LIB_SRC)))
-LIB_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(LIB_SRC)))
-LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC)))
-
-# all libtool obj file in library
-LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $(LIB_SERVER_OBJ:%.o=%.lo) $(LIB_SWIG_OBJ) $(LIB_OBJ_F)
-
-# LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la)
-LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la, $(filter %.la, $(LIB)))
-LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a, $(filter %.a, $(LIB)))
-LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so, $(filter %.so, $(LIB)))
-
-ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),)
-ifneq ($(GUI_DISABLE_CORBA),yes)
-LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB)))
-else
-LIB_SWIG =
-endif
-else
-LIB_SWIG =
-endif
-
-lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY)
-# we don't build static library !
-
-$(LIB_BUILD): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.la: %.la
- -$(RM) $@
- -$(RM) $(patsubst %.la, %.so, $@)
- -$(RM) $(patsubst %.la, %.a, $@)
- ln -sf $(CURDIR)/$< $@ || true
- ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \
- $(patsubst %.la, %.so, $@) || true
- ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \
- $(patsubst %.la, %.so, $@).0 || true
-
- if ! test -z $(LIB_SWIG) ; then \
- ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/_$(LIB_SWIG) || true;\
- fi;
-
-$(LIB_BUILD_A): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.a: %.a
- -$(RM) $@
- ln -sf $(CURDIR)/$< $@ || true
-
-$(LIB_BUILD_SO): $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/%.so: %.so
- -$(RM) $@
- ln -sf $(CURDIR)/$< $@ || true
-
-$(LIB): $(LIB_OBJ)
- @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS)
-
-# transform idl reference in appropriate obj file
-ifneq ($(GUI_DISABLE_CORBA),yes)
-BIN_CLIENT_SRC = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_CXX))
-BIN_SERVER_SRC = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_CXX))
-else
-BIN_CLIENT_SRC =
-BIN_SERVER_SRC =
-endif
-BIN_MOC_SRC = $(BIN_MOC:%.h=%_moc.cxx)
-BIN_SRC+=$(BIN_MOC_SRC)
-BIN_DEP=$(BIN:%=%.cxx) $(BIN_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
-
-ifneq ($(GUI_DISABLE_CORBA),yes)
-BIN_CLIENT_OBJ = $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_OBJ))
-BIN_SERVER_OBJ = $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_OBJ))
-else
-BIN_CLIENT_OBJ =
-BIN_SERVER_OBJ =
-endif
-# transform c file in appropriate libtool obj file (.c)
-BIN_OBJ_C = $(patsubst %.c, %.o, $(filter %.c, $(BIN_SRC)))
-# transform c++ file in appropriate libtool obj file (.cc and .cxx)
-BIN_OBJ_CC = $(patsubst %.cc, %.o, $(filter %.cc, $(BIN_SRC)))
-BIN_OBJ_CXX = $(patsubst %.cxx, %.o, $(filter %.cxx, $(BIN_SRC)))
-# all obj file in bin target
-BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ)
-
-bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts
-
-BIN_LIB=$(LIB:lib%.la=-l%)
-
-$(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: %
- -$(RM) $@
- ln -sf $(CURDIR)/$< $@
-
-$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN)
-
-# copy python scripts in $(top_builddir)/bin/salome
-#
-
-UI_FILES = $(notdir $(wildcard $(srcdir)/*.ui))
-UI_PY_FILES_PY = $(patsubst %.ui, %.py, $(UI_FILES))
-UI_PY_FILES = $(filter-out $(EXPORT_PYSCRIPTS) ,$(UI_PY_FILES_PY))
-
-DEST_PYSCRIPTS = $(EXPORT_PYSCRIPTS:%=$(top_builddir)/bin/salome/%)
-DEST_UI_PY_FILES = $(UI_PY_FILES:%=$(top_builddir)/bin/salome/%)
-pyscripts: $(DEST_PYSCRIPTS) $(UI_PY_FILES) $(DEST_UI_PY_FILES)
-$(DEST_PYSCRIPTS): $(top_builddir)/bin/salome/%: %
- cp -f $< $@
-
-# generate generic python scripts from *.ui files
-#
-$(UI_PY_FILES): %.py: %.ui
- $(PYUIC) $< -o $@
-
-# copy ui-generated python scripts in $(top_builddir)/bin
-#
-$(DEST_UI_PY_FILES): $(top_builddir)/bin/salome/%: %
- cp -f $< $@
-
-# copy pyqt files in $(PYTHON_SHARED_SITE)
-#
-PYTHON_SHARED_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
-
-$(PYTHON_SHARED_SITE):
- $(INSTALL) -d $@
-
-DEST_SHAREDPYSCRIPTS = $(EXPORT_SHAREDPYSCRIPTS:%=$(PYTHON_SHARED_SITE)/%)
-sharedpyscripts: $(PYTHON_SHARED_SITE) $(DEST_SHAREDPYSCRIPTS)
-$(DEST_SHAREDPYSCRIPTS): $(PYTHON_SHARED_SITE)/%: %
- cp -f $< $@
-
-check: test
-
-tests: unittest
-
-test: $(LIB) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%)
-
-unittest:
- @if test "x$(UNIT_TEST_PROG)" != "x"; then \
- $(top_builddir)/bin/salome/$(UNIT_TEST_PROG); \
- fi;
-
-# copy header file in $(inc_builddir)
-#
-DEST_HEADERS = $(EXPORT_HEADERS:%=$(inc_builddir)/%)
-inc: $(DEST_HEADERS)
-$(DEST_HEADERS): $(inc_builddir)/%: %
- cp -f $< $@
-
-# build resources file (icons and messages) : .qm file from .po file
-RESOURCES_FILES_ALL := $(notdir $(wildcard $(srcdir)/resources/*))
-RESOURCES_FILES_ALL := $(filter-out CVS, $(RESOURCES_FILES_ALL))
-RESOURCES_FILES_ALL := $(filter-out %.po, $(RESOURCES_FILES_ALL))
-RESOURCES_FILES_ALL := $(filter-out %.in, $(RESOURCES_FILES_ALL))
-RESOURCES_FILES ?= $(RESOURCES_FILES_ALL)
-
-resources: resources-po resources-cp
-
-resources-po: $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
-
-resources-cp: $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%)
-
-$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%): $(top_builddir)/share/salome/resources/$(MODULE_NAME)/% : %
- cp -fr $< $@;
-
-# Make installation directories if they don't exist.
-$(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir):
- $(INSTALL) -d $@ && chmod 755 $@
-
-# Install the library, the public header files, and programs.
-install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res
- @for f in X $(LIB); do \
- if test $$f != X; then \
- ($(LT_INSTALL_LIB) $$f $(libdir)/. || exit 1); \
- fi; \
- done
- @if ! test -z $(LIB_SWIG) ; then \
- (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \
- fi;
- @for f in X $(BIN); do \
- if test $$f != X; then \
- ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
- fi; \
- done
-# Install tests programmes in bindir
- @for f in X $(TEST_PROGS); do \
- if test $$f != X; then \
- ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \
- fi; \
- done
-# Install exported includes in includedir
- @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \
- if test $$f != X; then \
- (cp -p -f $$f $(includedir) || exit 1); \
- fi; \
- done
-
-# Install python script in $(bindir)
-install-python: $(bindir) $(EXPORT_PYSCRIPTS:%=install-%) $(UI_PY_FILES:%=install-%)
-
-$(UI_PY_FILES:%=install-%): install-%: %
- $(INSTALL_PROGRAM) $< $(bindir)/.
-
-$(EXPORT_PYSCRIPTS:%=install-%): install-%: %
- $(INSTALL_PROGRAM) $< $(bindir)/.
-
-#install-python: $(bindir) $(EXPORT_PYSCRIPTS)
-# @for f in X $(EXPORT_PYSCRIPTS); do \
-# if test $$f != X; then \
-# ($(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \
-# fi; \
-# done
-
-# Install pyqt script in $(install-sharedpyqt)
-install-sharedpyqt: $(sharedpydir) $(EXPORT_SHAREDPYSCRIPTS:%=install-%)
-
-$(EXPORT_SHAREDPYSCRIPTS:%=install-%): install-%: %
- $(INSTALL_PROGRAM) $< $(sharedpydir)/.
-
-
-# generic rule to install .qm files :
-install-qm: resources
- $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
- @for f in X $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm); do \
- if test $$f != X; then \
- ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
- fi; \
- done
-
-# generic rule to install resources files (png, ini ...):
-install-res: resources
- $(INSTALL) -d $(datadir)/resources/$(MODULE_NAME)
- @for f in X $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%); do \
- if test $$f != X; then \
- ($(INSTALL_DATA) $$f $(datadir)/resources/$(MODULE_NAME)/. || exit 1); \
- fi; \
- done
-
-# Removes those things that `make install' (would have) installed.
-uninstall:
- @if test "X$(LIB)" != X; then \
- for f in $(LIB); do \
- $(LT_UNINSTALL) $(libdir)/$$f; \
- done; \
- fi
- @if test "X$(BIN)" != X; then \
- for f in $(BIN); do \
- $(LT_UNINSTALL) $(bindir)/$$f; \
- done; \
- fi
- @for f in X $(TEST_PROGS); do \
- if test $$f != X; then \
- $(LT_UNINSTALL) $(bindir)/$$f; \
- fi; \
- done
-# Uninstall exported includes in includedir
- @for f in X $(EXPORT_HEADERS); do \
- if test $$f != X; then \
- $(LT_UNINSTALL) $(includedir)/$$f; \
- fi; \
- done
-# Uninstall python script in $(bindir)
- @for f in X $(EXPORT_PYSCRIPTS); do \
- if test $$f != X; then \
- $(LT_UNINSTALL) $(bindir)/$$f ; \
- fi; \
- done
-
-# Uninstall python script in $(bindir)
- @for f in X $(UI_PY_FILES); do \
- if test $$f != X; then \
- $(LT_UNINSTALL) $(bindir)/$$f ; \
- fi; \
- done
-
-# Uninstall pyqt script in $(sharedpydir)
- @for f in X $(EXPORT_SHAREDPYSCRIPTS); do \
- if test $$f != X; then \
- $(LT_UNINSTALL) $(sharedpydir)/$$f ; \
- fi; \
- done
-
-# Uninstall qm files
- @for f in X $(PO_FILES:%.po=%.qm); do \
- if test $$f != X; then \
- $(LT_UNINSTALL) $(datadir)/resources/$(MODULE_NAME)/$$f ; \
- fi; \
- done
-
-# remove all dependencies files
-#
-cleandep:
- -$(RM) .dep*
-
-# Removes temporary files without removing the final target files. That is,
-# remove things like object files but not libraries or executables.
-#
-mostlyclean: cleandep
- -$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o)
- -$(RM) $(BIN_OBJ) $(BIN:%=%.o)
- -$(RM) $(TEST_OBJ) $(TEST_OBJ:.lo=.o)
- -$(RM) $(PROG_OBJ) $(PROG_OBJ:.lo=.o) $(MOSTLYCLEAN)
-
-# Like `mostlyclean' except it also removes the final targets: things like
-# libraries and executables. This target doesn't remove any file that
-# is part of the SALOME distribution.
-#
-clean: mostlyclean
- -$(RM) $(LIB) $(TEST_PROGS) $(BIN) $(CLEAN)
- -$(RM) TAGS *~ *# core *.core
- -$(RM) -r .libs
- -$(RM) $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB)
- -$(RM) $(patsubst %,$(top_builddir)/bin/salome/%, $(BIN))
- -$(RM) $(patsubst %.la, %.so, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
- -$(RM) $(patsubst %.la, %.a, $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome/$(LIB))
-# remove idl generated files (sources)
- -$(RM) $(LIB_CLIENT_SRC) $(LIB_SERVER_SRC) $(BIN_CLIENT_SRC) $(BIN_SERVER_SRC)
-# remove idl generated files (headers)
- -$(RM) $(LIB_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(LIB_SERVER_IDL:%.idl=%$(IDL_SRV_H))
- -$(RM) $(BIN_CLIENT_IDL:%.idl=%$(IDL_CLN_H)) $(BIN_SERVER_IDL:%.idl=%$(IDL_SRV_H))
- -$(RM) $(LIB_MOC_SRC) $(BIN_MOC_SRC)
- -$(RM) $(LIB_SWIG_SRC)
-
-# Like `clean' except it also removes files that were created by running
-# configure. If you've unpacked the source and built without creating
-# any other files, then `make distclean' will leave only the files that were
-# in the distribution.
-#
-distclean: clean
- #remove qm file !
- -$(RM) $(PO_FILES:%.po=%.qm) $(PO_FILES:%.po=$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm)
- #remove include files
- -$(RM) $(DEST_HEADERS)
- -$(RM) $(DISTCLEAN) *.bak *.old *.new .dep*
- @if test -f $(srcdir)/Makefile.in; then \
- (@SETX@; $(RM) Makefile); \
- fi
-
-
-#implicits rules
-.cc.o:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cc.lo:
- $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cxx.o:
- $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.cxx.lo:
- $(LT) --mode=compile $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
-
-.c.o:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-
-.c.lo:
- $(LT_COMPILE) $(CFLAGS) $(CPPFLAGS) -c $<
-
-.f.o:
- $(FC) $(FFLAGS) -c $< -o $@
-
-.f.lo:
- $(LT) --mode=compile $(FC) $(FFLAGS) -c $<
-
-.ui.h:
- $(UIC) -o $@ $<
-
-.ui.cxx:
- $(UIC) -o $@ -i $*.h $<
-
-#pattern rules
-%_moc.cxx : %.h
- $(MOC) $< -o $@
-
-%_wrap.cxx : %.i
- $(SWIG) $(SWIG_FLAGS) -o $@ $<
-
-$(top_builddir)/share/salome/resources/$(MODULE_NAME)/%.qm: %.po
- $(MSG2QM) $< $@ ; \
-
-#------------------------------------------------------------------------------
-# The following section of this makefile contains dependencies between the
-# source files and the header files. If GNU make and GCC are being used then
-# the dependencies are in the form of rules that cause the information to
-# be kept updated automatically. Otherwise the dependencies are listed
-# explicitly and come from the `.distdep' files in the various directories.
-# These files are part of the distribution and are generated automatically on
-# GNU/GCC systems.
-#------------------------------------------------------------------------------
-
-@DEPEND@
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
dist_salomescript_SCRIPTS = \
runLightSalome.csh \
runLightSalome.sh
+
+# python files
+dist_salomescript_PYTHON = \
+ gui_setenv.py
-THIS IS SALOME - SALOMEGUI VERSION: @VERSION@
+[SALOME GUI] : @VERSION@
+[DEVELOPMENT] : @VERSION_DEV@
+[DESCRIPTION] : SALOME GUI module (SUIT)
#!/bin/csh -f
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : runLightSalome.csh
# Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
#!/bin/bash -f
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : runLightSalome.sh
# Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
+
+
###
-# set default value for the LightAppConfig variable, which
-# is necessary for loading of .ini or .xml resources file
+# function show_usage() : print help an exit
###
-#
-if [ -z "$LightAppConfig" ] ; then
- export LightAppConfig=${GUI_ROOT_DIR}/share/salome/resources/gui
-else
- export LightAppConfig=${LightAppConfig}:${GUI_ROOT_DIR}/share/salome/resources/gui
-fi
-if [ -z "$LightAppResources" ] ; then
- export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources/gui
-else
- export LightAppResources=${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
-fi
+
+show_usage() {
+ local RET=0
+ if [ $# -gt 0 ] ; then RET=$1 ; fi
+ local MOVE1="echo -en \\033[35G"
+ local MOVE2="echo -en \\033[22G"
+ echo
+ echo "Run standalone SALOME desktop".
+ echo
+ echo "Usage: $(basename $0) [options]"
+ echo
+ echo "Options:"
+ echo " * all options have both short and long format;"
+ echo " * some options require additional parameter (below referenced as <param>)"
+ echo " which should be separated by = symbol from the option itself."
+ echo
+ echo -en " --help"
+ ${MOVE2} ; echo -en "(-h)"
+ ${MOVE1} ; echo "Display this information and exit."
+ echo -en " --version"
+ ${MOVE2} ; echo -en "(-v)"
+ ${MOVE1} ; echo "Print SALOME version and exit."
+ echo -en " --modules=<param>"
+ ${MOVE2} ; echo -en "(-m)"
+ ${MOVE1} ; echo "List of modules, separated by comma, to be used within SALOME session."
+ echo
+ echo "Example:"
+ echo " $(basename $0) --modules=LIGHT,PYLIGHT"
+ echo
+ exit ${RET}
+}
###
-# process --modules=... command line option (get list of modules)
+# function show_version() : print SALOME version an exit
###
-modules=""
-
-for arg in X $* ; do
- if [ "$arg" != "X" ] ; then
- case $arg in
- --modules=* ) modules=`echo $arg | awk -F= '{ print $2 }' | sed -e "s%,% %g"` ;;
- *) ;;
- esac
+show_version() {
+ local RET=0
+ local DIR=$(dirname $0)
+ if [ -z "${DIR}" ] ; then DIR=. ; fi
+ if [ -f ${DIR}/VERSION ] ; then
+ cat ${DIR}/VERSION
+ else
+ echo
+ echo "Error: can't find VERSION file" > /dev/stderr
+ echo
+ RET=1
fi
-done
-
-modules="KERNEL GUI $modules"
+ exit ${RET}
+}
###
-# exclude modules duplication
+# function option_modules() : process --modules / -m command line option
###
-mods=""
-
-for mod in $modules ; do
- echo $mods | grep -E "\<$mod\>" >/dev/null 2>&1
- if [ "$?" == "1" ] ; then
- mods="$mods $mod"
+option_modules() {
+ local MODS=`echo $1 | awk -F "=" '{ if(NF>1) print $2 ; else print $1 }'`
+ if [ "X${MODS}" = "X" ] ; then
+ echo
+ echo "Error: Please, specify list of modules" > /dev/stderr
+ echo
+ exit 1
fi
-done
+ MODULES=`echo ${MODS} | sed -e "s%,% %g"`
+ return
+}
+
###
-# set additional environment
+# function run_light_salome(): run SALOME
###
-python_version=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
-
-MY_PATH=""
-MY_LD_LIBRARY_PATH=""
-MY_PYTHONPATH=""
-
-for mod in $mods ; do
- if [ "$arg" != "X" ] ; then
- root_dir=`printenv ${mod}_ROOT_DIR`
- if [ "$root_dir" != "" ] ; then
- mod_lower=`echo $mod | tr "A-Z" "a-z"`
- if [ -d ${root_dir}/bin/salome ] ; then
- if [ "${MY_PATH}" == "" ] ; then
- MY_PATH=${root_dir}/bin/salome
- else
- MY_PATH=${MY_PATH}:${root_dir}/bin/salome
- fi
- fi
- if [ -d ${root_dir}/lib/salome ] ; then
- if [ "${MY_LD_LIBRARY_PATH}" == "" ] ; then
- MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
- else
- MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
- fi
+run_light_salome(){
+
+ local MODULES
+
+ ###
+ # process command line options
+ ###
+
+ local OPTION
+ while getopts ":-:hvm:" OPTION "$@" ; do
+ if [ "${OPTION}" = "-" ] ; then
+ case ${OPTARG} in
+ help ) show_usage ;;
+ version ) show_version ;;
+ modules* ) option_modules "${OPTARG}" ;;
+ * ) echo "!!!Wrong option!!!" ; exit 1 ;;
+ esac
+ else
+ case ${OPTION} in
+ h ) show_usage ;;
+ v ) show_version ;;
+ m* ) option_modules "${OPTARG}" ;;
+ ? ) echo "!!!Wrong option!!!" ; exit 1 ;;
+ esac
+ fi
+ done
+ shift $((OPTIND - 1))
+
+ ###
+ # by default try to detect all available modules
+ ###
+
+ if [ -z "${MODULES}" ] ; then
+ local ENVVAR
+ local ROOTDIR
+ for ENVVAR in `env | awk -F= '{print $1}' | grep _ROOT_DIR` ; do
+ local MOD=`echo $ENVVAR | awk -F_ '{print $1}'`
+ local LMOD=`echo ${MOD} | tr 'A-Z' 'a-z'`
+ ROOTDIR=`printenv ${ENVVAR}`
+ if [ -f ${ROOTDIR}/share/salome/resources/${LMOD}/LightApp.xml ] || [ -f ${ROOTDIR}/share/salome/resources/LightApp.xml ] ; then
+ MODULES="${MODULES} ${MOD}"
fi
- if [ "${python_version}" != "" ] ; then
- if [ -d ${root_dir}/bin/salome ] ; then
- if [ "${MY_PYTHONPATH}" == "" ] ; then
- MY_PYTHONPATH=${root_dir}/bin/salome
- else
- MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
- fi
- fi
- if [ -d ${root_dir}/lib/salome ] ; then
- if [ "${MY_PYTHONPATH}" == "" ] ; then
- MY_PYTHONPATH=${root_dir}/lib/salome
- else
- MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
- fi
- fi
- if [ -d ${root_dir}/lib/python${python_version}/site-packages/salome ] ; then
- if [ "${MY_PYTHONPATH}" == "" ] ; then
- MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
- else
- MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
- fi
- fi
+ done
+ fi
+
+ ###
+ # initial environment
+ ###
+
+ if [ -z "${LightAppResources}" ] ; then
+ export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources/gui
+ else
+ export LightAppResources=${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
+ fi
+
+ MODULES="KERNEL GUI ${MODULES}"
+
+ ###
+ # exclude modules duplication
+ ###
+
+ local MODS=""
+ local MOD
+ for MOD in ${MODULES} ; do
+ echo ${MODS} | grep -E "\<${MOD}\>" >/dev/null 2>&1
+ if [ "$?" == "1" ] ; then
+ MODS="${MODS} ${MOD}"
+ fi
+ done
+ MODULES=${MODS}
+
+ ###
+ # set additional environment
+ ###
+
+ local PVERSION=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
+
+ local MY_PATH=""
+ local MY_LD_LIBRARY_PATH=""
+ local MY_PYTHONPATH=""
+
+ for MOD in ${MODULES} ; do
+ local ROOTDIR=`printenv ${MOD}_ROOT_DIR`
+ if [ -z "${ROOTDIR}" ] ; then continue ; fi
+ local LMOD=`echo ${MOD} | tr 'A-Z' 'a-z'`
+ if [ -d ${ROOTDIR}/bin/salome ] ; then
+ MY_PATH=${MY_PATH}:${ROOTDIR}/bin/salome
+ fi
+ if [ -d ${ROOTDIR}/lib/salome ] ; then
+ MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${ROOTDIR}/lib/salome
+ fi
+ if [ "${PVERSION}" != "" ] ; then
+ if [ -d ${ROOTDIR}/bin/salome ] ; then
+ MY_PYTHONPATH=${MY_PYTHONPATH}:${ROOTDIR}/bin/salome
fi
- if [ "$mod" != "KERNEL" ] && [ "$mod" != "GUI" ] ; then
- export LightAppConfig=${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
+ if [ -d ${ROOTDIR}/lib/salome ] ; then
+ MY_PYTHONPATH=${MY_PYTHONPATH}:${ROOTDIR}/lib/salome
fi
- if [ "${SALOMEPATH}" == "" ] ; then
- export SALOMEPATH=${root_dir}
- else
- export SALOMEPATH=${SALOMEPATH}:${root_dir}
+ if [ -d ${ROOTDIR}/lib/python${PVERSION}/site-packages/salome ] ; then
+ MY_PYTHONPATH=${MY_PYTHONPATH}:${ROOTDIR}/lib/python${PVERSION}/site-packages/salome
fi
fi
- fi
-done
-
-if [ "${MY_PATH}" != "" ] ; then
- export PATH=${MY_PATH}:${PATH}
-fi
-if [ "${MY_LD_LIBRARY_PATH}" != "" ] ; then
- export LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
-fi
-if [ "${PYTHONPATH}" != "" ] ; then
- export PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
-fi
+ if [ -f ${ROOTDIR}/share/salome/resources/${LMOD}/LightApp.xml ] ; then
+ export LightAppConfig=${LightAppConfig}:${ROOTDIR}/share/salome/resources/${LMOD}
+ elif [ -f ${ROOTDIR}/share/salome/resources/LightApp.xml ] ; then
+ export LightAppConfig=${LightAppConfig}:${ROOTDIR}/share/salome/resources
+ fi
+ export SALOMEPATH=${SALOMEPATH}:${ROOTDIR}
+ done
+
+ PATH=${MY_PATH}:${PATH}
+ PATH=`echo ${PATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+ export PATH
+ LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+ LD_LIBRARY_PATH=`echo ${LD_LIBRARY_PATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+ export LD_LIBRARY_PATH
+ PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
+ PYTHONPATH=`echo ${PYTHONPATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+ export PYTHONPATH
+ LightAppConfig=`echo ${LightAppConfig} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+ export LightAppConfig
+ SALOMEPATH=`echo ${SALOMEPATH} | sed -e "s,^:,,;s,:$,,;s,::\+,:,g"`
+ export SALOMEPATH
+
+ ###
+ # start application
+ ###
+
+ MODULES=`echo $MODULES | tr " " ","`
+ SUITApp LightApp --modules=${MODULES} "$*" &
+}
###
-# start application
+# call wrapper function (entry point)
###
-SUITApp LightApp $* &
+run_light_salome "$@"
\ No newline at end of file
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
CURRENT_DIR=`pwd`
-\r
+@REM Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+@REM
+@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+@REM
+
%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --gui\r
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tool for updating list of .in file for the SALOME project
# and regenerating configure script
# Author : Marc Tajchman - CEA
cd ${CONF_DIR}
ABS_CONF_DIR=`pwd`
-mkdir -p salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
-
-# remove KERNEL deprecated configure files
-#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
-# check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig \
-# ac_cxx_typename.m4 check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4
-#do
-# rm salome_adm/unix/config_files/${deprecated}
-#done
-
-# remove KERNEL CVS directories in subdirectory salome_adm
-#for deprecated in CVS unix/CVS unix/config_files/CVS
-#do
-# rm -rf salome_adm/${deprecated}
-#done
-
-cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
-
# ____________________________________________________________________
# aclocal creates the aclocal.m4 file from the standard macro and the
-# custom macro embedded in the directory salome_adm/unix/config_files
-# and KERNEL config_files directory.
+# custom macro embedded in the directory adm_local/unix/config_files
+# and KERNEL salome_adm/unix/config_files directory.
# output:
# aclocal.m4
# autom4te.cache (directory)
-echo "====================================================== aclocal"
+echo "======================================================= aclocal"
aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
# version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
# output:
-# salome_adm/unix/config_files/config.guess
-# salome_adm/unix/config_files/config.sub
-# salome_adm/unix/config_files/ltmain.sh
-#echo "====================================================== libtoolize"
+# adm_local/unix/config_files/config.guess
+# adm_local/unix/config_files/config.sub
+# adm_local/unix/config_files/ltmain.sh
+echo "==================================================== libtoolize"
libtoolize --force --copy --automake || exit 1
-# ____________________________________________________________________
-# make link to KERNEL configuration files to
-#ln -sf ${KERNEL_ROOT_DIR}/salome_adm .
-
# ____________________________________________________________________
# autoconf creates the configure script from the file configure.ac (or
# configure.in if configure.ac doesn't exist)
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
# creates the Makefile.in files from the Makefile.am files.
# output:
-# salome_adm/unix/config_files/compile
-# salome_adm/unix/config_files/depcomp
-# salome_adm/unix/config_files/install-sh
-# salome_adm/unix/config_files/missing
-# salome_adm/unix/config_files/py-compile
+# adm_local/unix/config_files/compile
+# adm_local/unix/config_files/depcomp
+# adm_local/unix/config_files/install-sh
+# adm_local/unix/config_files/missing
+# adm_local/unix/config_files/py-compile
# Makefile.in (from Makefile.am)
echo "====================================================== automake"
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
rm -rf autom4te.cache aclocal.m4 configure make_config
find . -name "*~" -print -exec rm {} \;
find . -name "*.pyc" -print -exec rm {} \;
#exit
# ==================== ON SORT AVANT
-find bin -name Makefile.in | xargs rm -f
-find doc -name Makefile.in | xargs rm -f
-find idl -name Makefile.in | xargs rm -f
-find resources -name Makefile.in | xargs rm -f
-find salome_adm -name Makefile.in | xargs rm -f
-find src -name Makefile.in | xargs rm -f
-rm -f Makefile.in
+find . -name Makefile.in | xargs rm -f
+( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh l*.m4 ltmain.sh missing py-compile )
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Author : Marc Tajchman (CEA)
# Date : 28/06/2001
# Modified by : Patrick GOLDBRONN (CEA)
# Modified by : Marc Tajchman (CEA)
# Modified by : Mikhail PONIKAROV (OCN) - autotools usage
#
-AC_INIT([Salome2 Project GUI module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeGUI])
-AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
+AC_INIT([Salome2 Project GUI module], [6.5.0], [webmaster.salome@opencascade.com], [SalomeGUI])
+AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
AC_SUBST(XVERSION)
+VERSION_DEV=1
+AC_SUBST(VERSION_DEV)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
MODULE_NAME=gui
else
DISABLE_QXGRAPHVIEWER="yes"
fi
-dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
-dnl AFTER PORTING QXGARPH TO QT4 THE STRING BELOW HAVE TO BE REMOVED
-DISABLE_QXGRAPHVIEWER="yes"
dnl
dnl Initialize source and build root directories
AC_PROG_MAKE_SET
AC_PROG_INSTALL
+AC_LOCAL_INSTALL
dnl
dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
dnl full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
- INSTALL='\${ROOT_BUILDDIR}'/salome_adm/unix/config_files/install-sh
+ INSTALL='\${ROOT_BUILDDIR}'/adm_local/unix/config_files/install-sh
;;
esac
AC_CXX_HAVE_SSTREAM
-dnl
-dnl ---------------------------------------------
-dnl testing MPICH
-dnl ---------------------------------------------
-dnl
+echo
+echo ---------------------------------------------
+echo testing MPI
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
-CHECK_MPICH
echo
echo ---------------------------------------------
CHECK_PYTHON
+echo
+echo ---------------------------------------------
+echo testing swig
+echo ---------------------------------------------
+echo
+
+AM_PATH_PYTHON(2.3)
+CHECK_SWIG
+
+
dnl echo
dnl echo ---------------------------------------------
dnl echo testing java
CHECK_DISABLE_CORBA
echo "GUI_DISABLE_CORBA = "$GUI_DISABLE_CORBA
-if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
-
-echo
-echo ---------------------------------------------
-echo testing swig
-echo ---------------------------------------------
-echo
-
-AM_PATH_PYTHON(2.3)
-CHECK_SWIG
-fi
-
echo
echo ---------------------------------------------
echo testing threads
echo "failed : for full configuration of GUI module necessary enable SalomeObject !"
exit
fi
- dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
- dnl AFTER PORTING QXGARPH TO QT4 THE FOLLOWING CHECK HAVE TO BE UNCOMMENTED
- dnl if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
- dnl echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
- dnl exit
- dnl fi
+ if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
+ echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
+ exit
+ fi
fi
echo
omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok libxml_ok Kernel_ok"
else
variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok boost_ok
-occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
+occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok "
fi
for var in $variables
AM_CONDITIONAL(ENABLE_QXGRAPHVIEWER, [test "$DISABLE_QXGRAPHVIEWER" = no])
AM_CONDITIONAL(ENABLE_TESTRECORDER, [test "$ENABLE_TESTRECORDER" = yes])
+if test "$DISABLE_PYCONSOLE" = "no" ; then
+ AC_DEFINE(SUIT_ENABLE_PYTHON)
+fi
+
+dnl Build with GUI observers feature
+AC_DEFINE(WITH_SALOMEDS_OBSERVER)
+
echo
echo ---------------------------------------------
echo generating Makefiles and configure files
# chmod +x ./bin/salome/*; \
#])
+AC_HACK_LIBTOOL
+AC_CONFIG_COMMANDS([hack_libtool],[
+sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
+ $(pwd)/hack_libtool \1 \"\$[@]\" \n\
+}\n\
+CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
+],[])
+
# This list is initiated using autoscan and must be updated manually
# when adding a new file <filename>.in to manage. When you execute
# autoscan, the Makefile list is generated in the output file configure.scan.
# This could be helpfull to update de configuration.
AC_OUTPUT([ \
- ./salome_adm/unix/SALOMEconfig.h \
- ./adm_local/Makefile \
- ./adm_local/cmake_files/Makefile \
- ./adm_local/unix/Makefile \
- ./adm_local/unix/config_files/Makefile \
- ./bin/VERSION \
- ./bin/Makefile \
- ./GUI_version.h \
- ./doc/Makefile \
- ./doc/salome/Makefile \
- ./doc/salome/gui/Makefile \
- ./doc/salome/gui/doxyfile \
- ./doc/salome/tui/Makefile \
- ./doc/salome/tui/doxyfile \
- ./src/Makefile \
- ./src/CASCatch/Makefile \
- ./src/Qtx/Makefile \
- ./src/Style/Makefile \
- ./src/DDS/Makefile \
- ./src/QDS/Makefile \
- ./src/SUIT/Makefile \
- ./src/STD/Makefile \
- ./src/CAF/Makefile \
- ./src/CAM/Makefile \
- ./src/SUITApp/Makefile \
- ./src/LogWindow/Makefile \
- ./src/ObjBrowser/Makefile \
- ./src/Prs/Makefile \
- ./src/OBJECT/Makefile \
- ./src/GLViewer/Makefile \
- ./src/VTKViewer/Makefile \
- ./src/SVTK/Makefile \
- ./src/OCCViewer/Makefile \
- ./src/SOCC/Makefile \
- ./src/PyInterp/Makefile \
- ./src/PyConsole/Makefile \
- ./src/Plot2d/Makefile \
- ./src/SPlot2d/Makefile \
- ./src/SUPERVGraph/Makefile \
- ./src/QxGraph/Makefile \
- ./src/QxScene/Makefile \
- ./src/LightApp/Makefile \
- ./src/ResExporter/Makefile \
- ./src/TOOLSGUI/Makefile \
- ./src/Event/Makefile \
- ./src/Session/Makefile \
- ./src/SalomeApp/Makefile \
- ./src/SalomeApp/Test/Makefile \
- ./src/SALOME_SWIG/Makefile \
- ./src/SALOME_SWIG/supervisionexample.py \
- ./src/SALOME_SWIG/supervisiongeomexample.py \
- ./src/SALOME_PY/Makefile \
- ./src/SALOME_PYQT/Makefile \
- ./src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile \
- ./src/SALOME_PYQT/SalomePyQt/Makefile \
- ./resources/Makefile \
- ./idl/Makefile \
+ adm_local/Makefile \
+ adm_local/cmake_files/Makefile \
+ adm_local/unix/Makefile \
+ adm_local/unix/config_files/Makefile \
+ bin/VERSION \
+ bin/Makefile \
+ GUI_version.h \
+ doc/Makefile \
+ doc/salome/Makefile \
+ doc/salome/gui/Makefile \
+ doc/salome/gui/doxyfile \
+ doc/salome/gui/static/header.html \
+ doc/salome/tui/Makefile \
+ doc/salome/tui/doxyfile \
+ doc/salome/tui/static/header.html \
+ src/Makefile \
+ src/CASCatch/Makefile \
+ src/Qtx/Makefile \
+ src/Style/Makefile \
+ src/DDS/Makefile \
+ src/QDS/Makefile \
+ src/SUIT/Makefile \
+ src/STD/Makefile \
+ src/CAF/Makefile \
+ src/CAM/Makefile \
+ src/SUITApp/Makefile \
+ src/LogWindow/Makefile \
+ src/ObjBrowser/Makefile \
+ src/Prs/Makefile \
+ src/OBJECT/Makefile \
+ src/ViewerTools/Makefile \
+ src/GLViewer/Makefile \
+ src/VTKViewer/Makefile \
+ src/SVTK/Makefile \
+ src/OCCViewer/Makefile \
+ src/SOCC/Makefile \
+ src/PyInterp/Makefile \
+ src/PyConsole/Makefile \
+ src/Plot2d/Makefile \
+ src/SPlot2d/Makefile \
+ src/SUPERVGraph/Makefile \
+ src/QxGraph/Makefile \
+ src/QxScene/Makefile \
+ src/LightApp/Makefile \
+ src/ResExporter/Makefile \
+ src/TOOLSGUI/Makefile \
+ src/Event/Makefile \
+ src/OpenGLUtils/Makefile \
+ src/Session/Makefile \
+ src/SalomeApp/Makefile \
+ src/SalomeApp/Test/Makefile \
+ src/SalomeApp/pluginsdemo/Makefile \
+ src/GuiHelpers/Makefile \
+ src/TreeData/Makefile \
+ src/TreeData/Test/Makefile \
+ src/SALOME_SWIG/Makefile \
+ src/SALOME_SWIG/supervisionexample.py \
+ src/SALOME_SWIG/supervisiongeomexample.py \
+ src/SALOME_PY/Makefile \
+ src/SALOME_PYQT/Makefile \
+ src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile \
+ src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile \
+ src/SALOME_PYQT/SalomePyQt/Makefile \
+ src/GUI_PY/Makefile \
+ resources/Makefile \
+ idl/Makefile \
+ tools/Makefile \
+ tools/dlgfactory/Makefile \
+ tools/vtkEDFOverloads/Makefile \
Makefile
])
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 30/11/2001
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 30/11/2001
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vasily Rusyaev (Open Cascade NN)
# Module : doc
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST += images input static
+EXTRA_DIST += images input static/footer.html static/doxygen.css
+
+guidocdir = $(docdir)/gui/GUI
+guidoc_DATA = images/head.png
usr_docs: doxyfile
echo "Running doxygen in directory: "`pwd`; \
-rm -fr GUI doxygen.bak
install-data-local: usr_docs
- $(INSTALL) -d $(DESTDIR)$(docdir)/gui
- cp -rp GUI $(DESTDIR)$(docdir)/gui
+ if test -d GUI; then \
+ $(INSTALL) -d $(DESTDIR)$(docdir)/gui ; \
+ cp -rp GUI $(DESTDIR)$(docdir)/gui ; \
+ fi
uninstall-local:
rm -rf $(DESTDIR)$(docdir)/gui/GUI
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "GUI Module Reference Manual v.@VERSION@"
+PROJECT_NAME = "SALOME GUI User's Guide"
OUTPUT_DIRECTORY = GUI
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
#---------------------------------------------------------------------------
INPUT = @srcdir@/input
FILE_PATTERNS = *.doc
-IMAGE_PATH = @srcdir@/images
+IMAGE_PATH = @srcdir@/images @top_srcdir@/src/OCCViewer/resources \
+ @top_srcdir@/src/VTKViewer/resources \
+ @top_srcdir@/src/SVTK/resources \
+ @top_srcdir@/src/Plot2d/resources \
+ @top_srcdir@/src/GLViewer/resources \
+ @top_srcdir@/src/QxScene/resources \
#---------------------------------------------------------------------------
#HTML related options
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = .
-HTML_HEADER = @srcdir@/static/header.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
-#HTML_STYLESHEET = @srcdir@/static/doxygen.css
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
TOC_EXPAND = YES
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 300
+#---------------------------------------------------------------------------
+#SORT related options
+#---------------------------------------------------------------------------
+SORT_GROUP_NAMES = NO
+
#---------------------------------------------------------------------------
#LaTeX related option
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
#RTF related options
#---------------------------------------------------------------------------
-GENERATE_RTF = NO
\ No newline at end of file
+GENERATE_RTF = NO
+
+#---------------------------------------------------------------------------
+#Search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
+++ /dev/null
-/*!
-
-\page geometry_preferences_page Geometry preferences
-
-In the \b Geometry module you can set preferences for visualisation of
-geometrical figures which can be used in later sessions with this
-module.
-
-\image html pref15.png
-
-\par
-For all color definitions click on the respective line to access to
-the \ref select_color_and_font_page "Select Color" dialog box.
-
-<ul>
-<li><b>General</b></li>
-<ul>
-<li><b>Default Display Mode</b> - allows to choose between wireframe
-or shading.</li>
-<li><b>Default Shading Color</b> - allows to select default shading
-color.</li>
-<li><b> Default Wireframe Color</b> - allows to select default
-wireframe color (to be applied to any lines not being free boundaries
-or isolated lines).</li>
-<li><b>Color of free boundaries</b> - allows to select default color for free boundaries.</li>
-<li><b>Color of edges, vectors and wires</b> - allows to select
-default color for edges, vectors and wires (isolated lines).</li>
-<li><b>Color of points</b> - allows to select default color for
-vertices.</li>
-<li><b>Color of isolines</b> - allows to select default color for
-isolines.</li>
-<li><b>Step Value for Spin Boxes</b> - allows to define the increment
-of values set in spin boxes.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Marker of Points</b></li>
-<ul>
-<li><b>Type</b> - allows to select the symbol for representation of
-points (cross, asterisk, etc.).</li>
-<li><b>Size</b> - allows to define the size of the marker from 1
-(smallest) to 7 (largest).</li>
-</ul>
-</ul>
-
-*/
\ No newline at end of file
integrated Python console
</ul>
-\image html image65.gif
+\image html image65.png
<b>What can you do in SALOME? (Some of SALOME main functions)</b>
<ul>
</ul>
From the point of view of the \subpage salome_architecture_page "Architecture",
-Salome is composed of several modules, which provides a
-great flexibility in its structure during
-\subpage installing_salome_page "Installation" and
-\subpage running_salome_page "Running".
+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",
+++ /dev/null
-/*!
-
-\page installing_salome_page SALOME Installation Wizard Help
-
-<hr>
-<ul>
-<li>\ref installing_products "Installing products with the Installation Wizard"
-<ul>
-<li>\ref gui_mode_install "GUI mode"
-<li>\ref batch_mode_install "Batch mode"
-<li>\ref environment_files "Environment files"
-</ul>
-<li>\ref pick_up_env "Pick up the environment"
-<li>\ref modifying_xml "Modifying XML configuration file"
-<li>\ref installation_scripts "Implementing installation scripts for the new products"
-<li>\ref finish_buttons "Customizing Readme page buttons"
-</ul>
-<hr>
-\anchor installing_products
-<h1>Installing products with the <em>Installation Wizard</em></h1>
-
-The Installation Wizard can be launched in two modes: \b GUI and \b
-batch.
-<br>The root directory of the Installation Wizard contains Python
-script \b runInstall. To run the Installation Wizard just type \b runInstall.
-in the terminal window:
-<br><br>[ python ] \b runInstall [options]
-
-Without options this script will launch the SALOME Installation
-Wizard in the default mode (GUI). \n The default installation settings
-can be overridden by using command line options. Each option has a
-short and a long notation:
-
-<b>-g / --gui</b>
-\par
-Runs the Installation Wizard in the GUI mode (this is the default
-mode).
-
-<b>-b / --batch</b>
-\par
-Runs the Installation Wizard in the terminal mode.
-
-<b>-f FILE / --file=FILE</b>
-\par
-The XML configuration file to be used by the Installation Wizard. If
-this option is not used then the installation script tries to define
-the \e Linux version and use the corresponding XML file if it exists. For
-examle, for <em>Linux Mandrake 10.1</em> the <b>config_Mandrake_10.1.xml</b> file
-will be used by default. If no appropriate file is found, the file
-<b>config.xml</b> will be used. This file refers to the basic target platform
-which is <em>Linux Mandrake 10.1</em> for SALOME 3.0 and newer. If <b>config.xml</b>
-file is not found either, a warning message box is shown (in GUI mode)
-or printed to the console (in batch mode) and the Installation Wizard
-quits.
-
-<b>-d DIR / --target=DIR</b>
-\par
-The target directory SALOME platform is to be installed to.
-If used, this option overrides the default target directory, given in
-the configuration XML file (usually <b>${HOME}/salome_\<version\></b>,
-see \ref modifying_xml "here" for more details).
-
-<b>-t DIR / --tmp=DIR</b>
-\par
-The directory, which should be used for temporary files. If given,
-this option overrides the default temporary directory, given in the
-configuration xml file (usually \b /tmp, see \ref modifying_xml "here"
-for more information).
-
-<b>-a / --all-from-sources</b>
-\par
-Forces all the products to be installed from sources (including all
-SALOME modules). If this option is used, all default installation
-modes for all products are ignored.
-\n This option is helpful when the user wants to install SALOME on the
-platform which is not officially supported. In this case, the user can
-try to run the SALOME Installation Wizard with the \b -a option in order
-to build all the products from sources.
-\n<b>Note, that this is a time-consuming operation which can take
-more than 24 hours depending on the computer.</b>
-
-<b>-s / --single-directory</b>
-\par
-Install all SALOME binaries packages to one directory. <br><b>
-This option is ignored when --all-from-sources (-a) option is used.</b>
-
-<b>-h / --help</b>
-\par
-Prints help information on the Installation Wizard's use.
-
-<b>-v / --version</b>
-\par
-Prints version information (\b Note: this is the Installation Wizard's
-version number, not the number of SALOME platform version).
-
-The installation procedure supports different \em Linux platforms and
-installs various installation 3d-party prerequisite products which are
-required by SALOME platform. As it was mentioned above, the basic
-target platform for SALOME 3.0 and newer is <em>Linux Mandrake 10.1</em>.
-Use of configuration XML files gives a flexible way to modify the list
-of products to be installed by the Installation Wizard without
-changing the program source code. Just create your own XML
-configuration file and implement installation scripts for the
-prerequisite products you need and then use this XML file with the
-Installation Wizard. This can be done, for example, for some Linux
-platform which is not supported directly by the Installation
-Wizard. See \ref modifying_xml "Modifying XML configuration file" and
-\ref installation_scripts "Implementing installation scripts for the new products"
-sections for more information.
-
-<br>
-<hr>
-\anchor gui_mode_install
-<h2>GUI mode</h2>
-
-The <b>Installation Wizard</b> GUI has been developed using
-Trolltech's <b>Qt 3.0.5</b> toolkit. After launching the Installation
-Wizard in the GUI mode the wizard window is shown to the user. This
-wizard guides the user through several subsequent pages. To navigate
-between the pages use \em "Next" and \em "Back" buttons in the lower
-part of the wizard window. The \em "Cancel" button closes the wizard
-window and quits the installation procedure after the user's
-confirmation. The \em "Help" button opens an additional window to show
-help information.
-
-The first \em "Introduction" page is shown in \ref figure_1 "Figure 1".
-Skip this page by clicking \em "Next":
-
-\anchor figure_1
-\image html intropage.png
-\n <center><b>Figure 1:</b> "Introduction" page</center>
-
-In the second page you are proposed to select the type of the SALOME installation.<br><br>
-At this step three possible types of installation are available:
-
-1. <b><em>"Install binaries"</em></b> type:
-\par
- - all binaries and sources of the chosen modules are installed;
- - all binaries of the chosen prerequisites are installed.
-
-2. <b><em>"Install sources"</em></b> type:
-\par
- - all sources of the chosen modules and prerequisites are installed without compilation.
-
-3. <b><em>"Install sources and make compilation"</em></b> type:
-\par
- - all sources of the chosen modules and prerequisites are installed;<br>
- - all sources are compiled.
-
-In case you select "Install sources and make compilation" installation type, then you can also check "Remove sources and temporary files after compilation" option.
-
-\anchor figure_2
-\image html installtypepage.png
-\n <center><b>Figure 1:</b> "Type Of Installation" page</center>
-
-After the installation type has been selected you click "Next" button and the Installation Wizard tries to determine the Linux platform to load the corresponding configuration file. If the user system is not defined or the current SALOME package does not support this one, the warning will appear (<em>"Install binaries"</em> and <em>"Install sources"</em> installation types only):
-
-\anchor figure_3
-\image html platformpage.png
-\n <center><b>Figure 3:</b> "Installation platform" page</center>
-
-If <em>"Install sources and make compilation"</em> installation type has been selected, the warning message will be slightly different: <em>"Your Linux platform is not supported by this SALOME package and compilation is not tested on this one".</em><br>
-There is a list of all platforms supported by SALOME, but only those supported by the current package are available for selection. in this page you need to to select the reference platform, if you wish to proceed with the present installation procedure.
-
-\b Note: this page is not displayed if the installation platform has been defined automatically.
-
-In the next page you are proposed to enter the target directory
-where the SALOME platform should be installed to. You can also click
-<em>"Browse..."</em> and choose the destination folder using the standard
-browse directory dialog box.
-\n If the necessary directory does not exist you
-are prompted to confirm directory creation. If you type a wrong
-directory path, or if you do not have write permissions
-for the directory you use, the corresponding message box is shown.
-
-\b Note: you are strongly recommended to avoid using directory names containing spaces.</b> Otherwise you can experience some troubles with the installation.
-\n
-\anchor figure_4
-\image html directorypage.png
-\n <center><b>Figure 4:</b> "Installation directory" page</center>
-
-You can select the products to be installed in the "Choice of the products to be installed" page.
-\n In the default mode it gives you the possibility to view and select SALOME modules only. There is a hidden list of 3d-party prerequisite products. To show it, just click <em>"Show prerequisites..."</em> button.
-
-\anchor figure_5
-\image html productpage1.png
-\n <center><b>Figure 5:</b> Choice of the SALOME modules</center>
-
-In the full mode you also have the possibility to select prerequisites.
-\n The checkbox before each product indicates if this one will be installed or not (checked or unchecked). The second column shows the disk space occupied by the corresponding module. This value depends on the selected type of installation.
-\n To hide the prerequisites list - click <em>"Hide prerequisites"</em> button.
-
-\anchor figure_6
-\image html productpage2.png
-\n <center><b>Figure 6:</b> Choice of the prerequisites</center>
-
-Some products may require some other prerequisite products to be installed. So the installation procedure has a special feature to automatically mark these products in the list view. For example, to install PyQt it is necessary to have gcc, Python, Qt and Sip installed, and these products will be also turned on when you check on PyQt. GEOM module requires KERNEL, GUI modules and such prerequisites as: OpenCascade, Python, Swig, Qt, etc.
-\n
-\n The dependencies between SALOME modules are managed in the following way:
-\par
-- If one module is unchecked, all modules which depend on this one are also unchecked automatically;\n
-- If one module is checked, all modules required for this one are also checked automatically.
-
-Dependency between modules and prerequisites is realized in the following way:
-\par
-- The choices made by the user in the list of modules have a direct impact on the list of prerequisites;
-- Whenever a module is checked, all the necessary prerequisites are checked automatically with no possibility for the user to uncheck them (see \ref figure_7 "Fig. 7" below);
-- Whenever a module is unchecked, according to the remaining checked modules, the unnecessary prerequisites are unchecked automatically (see \ref figure_7 "Fig. 7" below).
-
-It is possible to check again the prerequisites, which have been automatically unchecked. In other words, it is possible to add more prerequisites than necessary.
-
-\anchor figure_7
-\image html productpage3.png
-\n <center><b>Figure 7:</b> Dependencies between modules and prerequisites</center>
-
-The <em>"Installation with GUI"</em> checkbox allows managing the installation of the graphical interface. Only modules for that 'woguimode' attribute is set to "true" value in the XML file (see \ref modifying_xml "here" for more information about customizing this installation mode) support without GUI mode and will be checked and installed with their necessary prerequisites in case of installation without GUI. And other modules are unchecked with no possibility to check them in this mode (see \ref figure_8 "Figure below").
-\n By default 'Installation with GUI' checkbox is switched on.
-
-\anchor figure_8
-\image html productpage4.png
-\n <center><b>Figure 8:</b> Installation without GUI mode</center>
-
-The box at the right side of the page displays the information about
-currently selected product: name, version and short description,
-required disk space, disk space required for temporary files and the list of
-prerequisites (this information is provided in the XML file).
-
-The <em>"Disk space required:"</em> field displays how much disk space
-on the hard drive is required for installation of selected products.
-\n\b Note: Please, take into account that the displayed amount of
-required disk space is approximate and may differ when you actually install
-products on your hard drive.
-
-The installation procedure uses a special directory to store temporary
-files. The <em>"Space for temporary files:"</em> field shows the information
-about required disk space on the hard drive for extracting and
-compiling the selected products. You can change the temporary directory (this information is provided in the XML file) to the folder you want.
-\n\b Note: Actually, temporary files are not stored directly in the
-directory entered by the user. The Installation Wizard creates in this directory an additional folder named like INSTALLWORK<b>XXXXX</b> where XXXXX is a unique number. This allows launching several Installation Wizards simultaneously. This temporary directory is removed automatically when the installation finishes.
-
-The installation procedure also checks the available disk space. If there is not enough disk space on your hard drive you will see the corresponding error message box.
-
-Also in the current version of Installation Wizard is possible to install all binaries of the selected SALOME modules into a \b single directory. It is "SALOME" directory. For this purpose there is a checkbox "Install modules to a single directory" checkbox exists (see \ref figure_8 "Fig. 8").
-\n This feature helps to get shorter PYTHONPATH and LD_LIBRARY_PATH environment variables.
-\n\b Note: the installation into a single directory is available with the binaries installation type only.
-
-To proceed further click <em>"Next"</em>. At this moment the program will make some tests to check the installation settings: if there is enough disk space on the hard drive, check for the dependencies for each product you have selected to be installed. If any test fails you will see the corresponding warning message box. Otherwise the wizard will proceed to the next page:
-
-\anchor figure_9
-\image html choicepage.png
-\n <center><b>Figure 9:</b> "Check your choice" page</center>
-
-This page summarizes the installation options you've selected in the previous pages. You can review again your choices and change them if necessary returning to the previous pages.
-\n When you are sure that everything is OK, click <em>"Next"</em> to
-follow to the \ref figure_10 "progress page".
-
-\anchor figure_10
-\image html progresspage1.png
-\n <center><b>Figure 10:</b> "Installation progress" page</center>
-
-To start the installation of the selected products click <em>"Start"</em> button. It launches the shell installation script and you will be able to see the output of the script in the topmost frame of the dialog box. If any errors occur during the installation progress, the corresponding messages will be printed to the log window in the bold red font.
-\n It is possible to break the installation at any time by pressing <em>"Stop"</em> button. Then you can get back to the previous pages if you wish to change the installation settings or restart the installation by pressing <em>"Start"</em> button again.
-
-\b Note: in the current implementation it is not possible to resume the stopped installation process; the installation will restart from the very beginning.
-
-\anchor figure_11
-\image html progresspage2.png
-\n <center><b>Figure 11:</b> "Installation progress" page: installation in progress</center>
-
-The <em>"Installation Status"</em> frame window shows you the progress of
-installation. \c "Waiting" status means that installation of this product
-has not been started yet. The product currently being installed is
-marked as \c "Processing" and is displayed in the status bar under "Installation Status" view. All installed products have \c "Completed"
-status.
-
-You can abort installation and close the installation procedure using
-\em "Cancel" button.
-
-\b Note: This button sends the signal "SIGTERM" to the shell
-script. The script tries to clear all temporary files. The process of
-removing temporary files can take some time, so the installation
-wizard will wait 3 seconds before closing.
-
-At the end of the installation <b>"Installation completed"</b> message will appear in the status bar. You can return to the previous pages to start a new installation or click \em"Next" button to go to the readme page:
-
-\anchor figure_12
-\image html readmepage.png
-\n <center><b>Figure 12:</b> "Finish installation" page</center>
-
-In this page you can read important information about the Instalation
-Wizard itself and some tips: how to run and test SALOME or how to
-build SALOME from the sources. This is the contents of the README file
-which you can find in the root directory of the Installation Wizard.
-
-You can also launch SALOME Desktop from this page or read the Release
-Notes file by clicking on the corresponding buttons in the lower part
-of the page (see \ref modifying_xml "here" and \ref finish_buttons
-"here" for more information about customizing these buttons).
-
-<br>
-<hr>
-\anchor batch_mode_install
-<h2>Batch mode</h2>
-
-To launch the Installation Wizard in the batch mode use -\b b (--\b batch)
-parameter.
-\n In this mode the GUI wizard is not shown but all the installation
-status is displayed directly in the console. In the batch mode the
-user does not have a possibility to change installation settings which
-are given in the configuration file, except target and temporary
-directories which can be overridden by the corresponding command line
-options.
-\n The only exception is --\b all-from-sources (-\b a) option which enables
-special installation mode in which all the products (including SALOME
-modules) are installed from sources, ignoring the default mode defined
-in the XML configuration file (see \ref installing_products "here" for details) and <b>--single-directory (-s)</b> option which defines that all SALOME modules have to be installed into the one directory (SALOME_<version>, by default, where <version> is SALOME version).
-
-\anchor figure_13
-\image html batchmode.png
-\n <center><b>Figure 13:</b> Batch mode</center>
-
-<br>
-<hr>
-\anchor environment_files
-<h2>Environment files</h2>
-
-During the process of installation the script creates some environment
-files to simplify the procedure of launching SALOME. These shell
-scripts set all necessary environment variables for all products you
-have installed. To learn how installation scripts collects the
-environment, see \ref pick_up_env "here". These files are: \b
-salome.csh + \b salome.sh in the <b><em>KERNEL module sources</em></b>
-and <b><em>KERNEL module binaries</em></b> root directories and
-\b env_products.csh + \b env_products.sh and \b env_build.csh +
-\b env_build.sh in the target installation directory.
-
-\b Note: there is some difference between these files: \b env_build.*
-files are optimized to be used for building SALOME modules from
-sources (see \b README file provided with the installation procedure
-on the CD). The \b env_products.* (and \b salome.*) files are
-optimized for SALOME launching. The behavior is defined by the
-environment variable \b ENV_FOR_LAUNCH which is set to \b 0 in
-env_build.* files and to \b 1 in env_products.* (salome.*) files.
-
-<br>
-<hr>
-\anchor pick_up_env
-<h2>Pick up the <em>environment</em></h2>
-
-Please, read carefully the following information. This section
-describes how the installation procedure generates the environment
-scripts for the SALOME platform being installed.
-
-After installing each product shell the script creates a special
-environment file for the product in its installation folder. The name
-of the file is generated from the name of product by the following
-scheme: \b env_<product_name>.sh (for example \b env_Vtk.sh for the
-Vtk). This file includes all necessary environment settings. At the
-final step of the installation the script picks up all the settings
-files and generates two common environment files from them: \b salome.sh
-and \b salome.csh for \b bash and \b csh shells correspondingly.
-Such approach helps to save time when reinstalling products and you may not bother about setting all environment variables manually to build/launch
-SALOME. What you simply need is to source one of these environment
-files.
-
-This also concerns those products which are not being installed. For
-example, you install some SALOME binaries to the directory where you
-have previously installed other products. The Installation procedure
-tries to collect environment files from the target directory if it
-finds necessary products installed there. If some product is not found
-in the target directory the corresponding section of
-\b salome.sh/salome.csh files will be skipped.
-\n For native products (like \b gcc, \b tcl, etc...) the installation
-procedure tries to find them first using \b PATH / \b LD_LIBRARY_PATH
-variables and then in the system default directories (\b /usr/bin,
-\b /usr/lib etc., depending on the product).
-<br><br>
-In any case you may edit \b salome.* files after the installation
-procedure finishes, if you want.
-
-\n\b Note: As it was mentioned \ref environment_files "above" there are
-other environment files which are generated by the installation
-procedure: \b env_products.csh + \b env_products.sh and \b env_build.csh +
-\b env_build.sh. These files can be found in the target installation root
-directory.
-
-<br>
-<hr>
-\anchor modifying_xml
-<h2>Modifying <em>XML</em> configuration <em>file</em></h2>
-
-You can create your own XML configuration file. The Installation
-Wizard can then take it as a command line argument to provide a list
-of products you want to install with it. The list of products and some
-other settings for the Installation Wizard are provided in the XML
-file.
-\n This section describes the structure of the configuration file, optional sections/tags are in brackets.
-
-\code
-<document>
- <config [ version=<application_version> ]
- [ caption=<application_caption> ]
- [ copyright=<application_copyright> ]
- [ license=<application_license_info> ]
- platforms=<target_platform>
- [ targetdir=<target_directory> ]
- [ tempdir=<temp_directory> ]
- />
- [ <buttons>
- [ <button label=<button_label>
- [ tooltip=<button_tooltip> ]
- script=<button_script>
- [ disable=<disable_flag> ]
- />
- ]
- [ <button ...
- />
- ]
- ...
- </buttons>
- ]
- [ <products>
- [ <product name=<product_name>
- type=<product_type>
- [ description=<product_description> ]
- <installation os=<installation_platform>
- version=<product_version>
- [ disable=<disable_flag> ]
- [ woguimode=<without_gui_mode_flag> ]
- installdiskspace=<install_disk_space>
- [ pickupenv=<pickup_env_flag> ]
- script=<installation_script_name>
- />
- ...
- />
- ]
- [ <product ...
- />
- ]
- ...
- </products>
- ]
- [ <dependencies>
- [ <product name=<product_name> >
- [ <dep> <prerequisite_name> </dep> ]
- ...
- </product>
- ]
- ...
- </dependencies>
- ]
-</document>
-\endcode
-
-<b>\<config\> section</b>
-\n\n This is an optional section; it provides general information about the Installation Wizard itself.<br><br>
-Attributes:
-<ul>
-<li><b>version</b>
-\n\n The application version number to be shown in the caption.<br><br>
-</li>
-<li><b>caption</b>
-\n\n The application main window caption - if this string contains '\%1' text the title will contain the version number in this place (see
-above).<br><br>
-</li>
-<li><b>copyright</b>
-\n\n The application copyright information (shown in the first page).<br><br>
-</li>
-<li><b>license</b>
-\n\n The application license information (shown in the first page).<br><br>
-</li>
-<li><b>platforms</b>
-\n\n This parameter defines the directory (relative from ./Products/BINARIES) where the Installation Wizard will search
-precompiled binaries packages. If this tag is not provided, binaries
-packages are looked for in the ./Products/BINARIES directory.<br><br>
-</li>
-<li><b>targetdir</b>
-\n\n The target directory - the path to the directory where products
-should be installed.<br><br>
-</li>
-<li><b>tempdir</b>
-\n\n The temporary directory - the path to the directory for the
-temporary files.<br><br>
-</li>
-</ul>
-
-<b>\<button\> section</b>
-\n\n This is an optional section. It allows customization of the last
-"Finish installation" page of the Installation Wizard by adding one or
-more buttons in the lower part of the wizard's window. The script
-which is attached to each such button, can perform some specific
-action, for example, launch the application or show the Release Notes
-file by using an external program. See \ref finish_buttons "here" for
-more details about writing scripts.<br><br>
-Attributes:
-<ul>
-<li><b>label</b>
-\n\n This is the button text.<br><br>
-</li>
-<li><b>tooltip</b>
-\n\n The button tooltip (optional).<br><br>
-</li>
-<li><b>script</b>
-\n\n The script attached to the button.<br><br>
-</li>
-<li><b>disable</b>
-\n\n If this optional flag has 'true' value, the corresponding button
-will not appear in the "<em>Finish installation</em>" page - the section of XML
-file is silently ignored.<br><br>
-</li>
-</ul>
-
-<b>\<product\> section</b>
-\n\n This section describes product to be installed with the
-Installation Wizard. The XML file should include a \<product\> section
-for each product to be installed. The products appear in the tree view
-and are installed in the order they are described in the configuration
-file. It is recommended (but not obligatory) to define native products
-at the top of the list before all other products.
-<br><br>
-Attributes:
-<ul>
-<li><b>name</b>
-\n\n Product name.<br><br>
-</li>
-<li><b>type</b>
-\n\n The type of the product: 'component' - SALOME module or 'prerequisite' - prerequisite product.<br><br>
-</li>
-<li><b>description</b>
-\n\n Product description (optional).<br><br>
-</li>
-</ul>
-
-<b>\<installation\> section</b>
-
-It is a part of the <product> section, that provides installation information by platforms. The <product> section may contains a several <installation> ones for the different platforms.
-<br><br>
-Attributes:
-<ul>
-<li><b>os</b>
-\n\n A possible installation platform.<br><br>
-</li>
-<li><b>version</b>
-\n\n The version of the product.<br><br>
-</li>
-<li><b>disable</b>
-\n\n If this optional flag has 'true' value, the corresponding product will not appear in the list of products and will not be installed.<br><br>
-</li>
-<li><b>woguimode</b>
-\n\n This optional flag defines that it's possible to install this module without GUI.<br><br>
-</li>
-<li><b>installdiskspace</b>
-\n\n List of three total amount spaces (integer, in Kbytes, derived by comma), which product occupies on the hard drive after the installation in case 'binary', 'sources' and 'sources and compile' installation type.<br><br>
-</li>
-<li><b>pickenv</b>
-\n\n This flag shows that the pickup environment procedure should be performed for this product. If this flag equal to 'true', salome.sh and salome.csh files will be created in the product's installation directory. Usually this option is set to true for SALOME KERNEL module. This is optional key, default value is 'false'.<br><br>
-</li>
-<li><b>script</b>
-\n\n The installation script name. This script is in charge of the installation of the product. It is called automatically by the Installation Wizard when necessary from the main program. See the see
-\ref installation_scripts "next section" for more information.<br><br>
-</li>
-</ul>
-
-\n\b Note: If you add new products to be installed with Installation
-Wizard, you should also provide installation script for this
-product. See the next section for more details.
-
-<br>
-<hr>
-\anchor installation_scripts
-<h2>Implementing <em>installation scripts</em> for the new products</h2>
-
-When you want some product to be installed with the Installation
-Wizard, you should add its description \ref modifying_xml "to the configuration file"
-and create the installation script, following the rules described in this section.
-
-There are some obligatory functions which should be implemented in
-this installation script. These functions are automatically called by
-the master installation script or/and its GUI shell when it is
-necessary. \n File \b common.sh contains some service functions which can
-be used in your installation script, like \b make_env(), \b make_dir(),
-\b try_existing(), \b sort_path(), \b find_in_path(), etc.
-
-<ul>
-<li><b>check_version()</b>
-\n\n This function allows to check the version of the product already
-installed on the computer. It should try to find the product (native
-or preinstalled in the target directory) and check its version. This
-helps to avoid unnecessary reinstallation. This is an internal
-function and is not called from the master installation
-script.<br><br>
-</li>
-<li><b>install_binary()</b>
-\n\n This function is called when <em>'Install binaries'</em> installation mode is selected by the user. The function is responsible for the extracting of the product from the binaries package. It should create environment for the product in the temporary directory (see also the description of \b print_env() function). It is not necessary to implement this function if you do not provide binaries mode installation for the current product.<br><br>
-</li>
-<li><b>install_source()</b>
-This function is called to install SALOME modules sources, if <em>'Install binaries'</em> installation mode is selected by the user, and to install prerequisite products sources, in <em>'Install sources'</em> case (\ref Figure_2 "Fig. 2" above). The function is responsible for the building of the product from the sources package. It should create the environment file for the product in the temporary directory (see also the description of print_env() function). It is not necessary to implement this function if you do not provide a sources mode installation for the current product. <br><br>
-</li>
-<li><b>install_source_and_build()</b>
-This function is called when <em>'Install sources and make a compilation'</em> installation mode is selected. This function should be used to unpack SALOME or prerequisite sources package and then call build/install procedure for it.
-For more details please refer to the \ref installing_products "this"
-and \ref gui_mode_install "this" sections for more details.<br><br>
-</li>
-<li><b>try_preinstalled()</b>
-\n\n This function is called when the 'not install' installation mode
-is selected by the user. In this case the script should inspect the
-target directory to try to find an already preinstalled product, pick
-up and check the environment from there. See \ref pick_up_env "here" for more
-details.<br><br>
-</li>
-<li><b>print_env_bin() & print_env_src()</b>
-\n\n These functions are in charge of the creation of the environment scripts. They should create in the temporary directory two files with \b env_<product_name>.sh and \b env_<product_name>_src.sh names and then copy them into the binary and sources product installation directories correspondingly. The file should contain all necessary environment variable settings for the product. It will be collected during the 'pick-up-environment' procedure.<br><br>
-</li>
-<li><b>pickup_env()</b>
-\n\n This procedure corresponds to the \b pickupenv tag of the
-configuration xml file (see previous section). It should call the
-\b make_env procedure to perform the pick-up environment procedure for
-the product.<br><br>
-</li>
-</ul>
-
-The calling signature of the product installation script is the following:
-<b>\<product_script_name\> \<function_name\> \<temp_folder\>
-\<products_directory\> \<target_directory\> \<dependancies\>
-\<product_name\></b>
-\n\n where \n\n
-<b>\<product_script_name\></b> - installation script name (described in the
-configuration xml file);\n
-<b>\<function_name\></b> - the name of function, corresponding to the selected
-installation mode: \em try_native, \em install_source, \em install_binary or
-\em try_preinstalled;\n
-<b>\<temp_folder\></b> - temporary files directory;\n
-<b>\<products_directory\></b> - directory where the sources/binaries package
-can be found. You should provide the sources package in the
-<em>\<Install_Wizard_root_directory\>/Products/SOURCES</em> directory and
-binaries package in the
-<em>\<InstallWizard_root_directory\>/Products/BINARIES/\<os_version\></em>, where
-\<os_version\> is the target platform description, which appears in the
-corresponding section of the \ref modifying_xml "configuration xml file";
-<em>\<target_directory\></em> - root target directory where the product should be installed to;
-<em>\<dependancies\></em> - single-quoted list of prerequisite products, separated by space;
-<em>\<product_name\></em> - product name itself.
-
-\b Example:
-\n <em>med-2.2.3.sh install_binary /tmp/work
-./Products/BINARIES/Mandrake10.1 /usr/salome 'gcc Hdf' med</em>
-
-Copy the created script into the
-<em>\<Install_Wizard_root_directory\>/config_files</em> sub-directory where all
-installation scripts are stored. Installation Wizard will
-automatically search and call your script during the installation
-procedure.
-
-<br>
-<hr>
-\anchor finish_buttons
-<h2>Customizing <em>Readme page</em> buttons</h2>
-
-The Installation Wizard allows customizing the look-n-feel of the last
-<em>"Finish installation"</em> page. If you want to add one or more buttons to
-this page in order to perform some specific actions at the end of the
-installation (for example, to show the Release Notes file by using
-Open Office) you can put an additional section to the XML
-configuration file. This is the \b \<button\> section (see
-\ref modifying_xml "here" for more details).
-
-To implement the action which will be performed when the user clicks
-the button, you need to create a script and put it to the
-<em>\<Install_Wizard_root_directory\>/config_files</em> directory.
-\n There are some obligatory functions which should be implemented in
-this script. These functions are automatically called by the
-Installation Wizard GUI.
-
-<ul>
-<li><b>check_enabled()</b>
-\n\n This procedure is called by the Installation Wizard when the
-<em>"Finish installation"</em> page is displayed and the status of the buttons
-should be modified according to the installation options. This
-procedure should return \b 0 if the corresponding action can be performed
-and, thus, the button should become enabled. Otherwise, it should
-return \b 1 - in this case the corresponding button will be
-disabled.<br><br>
-</li>
-<li><b>execute()</b>
-\n\n This procedure is invoked when the user clicks the button. This
-procedure should return \b 0 if the corresponding action is done
-successfully and \b 1 if any error occurs.<br><br>
-</li>
-</ul>
-
-The calling signature of the script is the following:
-\n <b>\<product_script_name\> \<function_name\> \<target_directory\>
-\<temp_folder\></b>
-\n\n where \n\n
-\b \<product_script_name\> - the script name itself (retrieved from the XML configuration xml file);
-\n \b \<function_name\> - the name of function;
-\n \b \<target_directory\> - root target directory where the product is installed to;
-\n \b \<temp_folder\> - temporary files directory;
-
-\n\b Note: The standard Installation Wizard buttons "Launch SALOME" and
-"Release Notes" are implemented with this feature. Refer to scripts
-\b start_salome.sh and \b release_notes.sh for sample implementation.
-
-\n\b Note: Any button (even standard) can be ignored by the Installation
-Wizard if the attribute \b \<disable\> in the XML configuration file is set
-to the "true" value.
-
-*/
\ No newline at end of file
</ul>
</li>
-<li>\b Tools menu gives access to: \subpage using_catalog_generator_page "Catalogue Generator", and
-\subpage using_registry_tool_page "Registry tool"</li>
+<li>\b Tools menu gives access to: \subpage using_catalog_generator_page "Catalogue Generator",
+\subpage using_registry_tool_page "Registry tool" and \ref using_pluginsmanager "Python plugins"</li>
<li>\b Help menu gives access to the help on Salome modules. The
appropriate help page can also be called from any operation dialog via
\b Help button.</li>
</ul>
Help for the GUI module provides information about standard
-\subpage viewers_page "Salome Viewers":
-<ul>
-<li>\ref occ_3d_viewer_page "OCC 3D viewer", </li>
-<li>\ref vtk_3d_viewer_page "VTK 3D viewer" and </li>
-<li>\ref plot2d_viewer_page "Plot 2D viewer". </li>
-</ul>
+\subpage viewers_page "Salome Viewers".
+
+General application preferences are described in the \subpage setting_preferences_page "Preferences"
+section of SALOME GUI Help.
+
-\subpage setting_preferences_page "Preferences" for all Salome modules
-are also described in this section of Salome GUI Help.
+\subpage using_input_widgets_page "Using input widgets" sub-section
+covers specific aspects of behavior of certain kinds of SALOME GUI
+input fields.
-*/
\ No newline at end of file
+*/
+++ /dev/null
-/*!
-
-\page mesh_preferences_page Mesh preferences
-
-In the Mesh module you can set mesh preferences, which can be used in
-later sessions with this module.
-
-<h2>General Preferences</h2>
-
-\image html pref21.png
-
-<ul>
-<li><b>Update</b></li>
-<ul>
-<li>If you toggle <b>Automatic Update</b> checkbox, the model in your
-viewer automatically updated whenever you make changes in it.</li>
-</ul>
-<li><b>Quality Controls</b></li>
-<ul>
-<li>If you toggle <b>Display entity</b>, both faces and edges of an
-object will be displayed in the viewer by default.</li>
-<li>If you toggle <b>Use precision</b> checkbox, you can display numbers in
-<b>Quality Control</b> diagrams at the necessary level of precision.</li>
-</ul>
-<li><b>Precision</b> - can be defined by the <b>Number of digits after point</b> in
-the corresponding field. By default, numbers in <b>Quality Control</b>
-diagrams are presented as integers.</li>
-<li><b>Display mode</b> - allows to set Wireframe, Shading, Nodes or Shrink
-presentation mode as default.</li>
-<li><b>Mesh export</b></li>
-<ul>
-<li>If you toggle <b>Automatically create groups for MED export</b> checkbox,
-this operation will be carried out automatically.</li>
-<li>If you toggle <b>Automatic renumbering</b> checkbox, the exported
-mesh will be renumbered automatically</li>
-</ul>
-<li><b>Mesh computation</b></li>
-<ul>
-<li><b>Show a computation result notification</b> combobox allows to
-select the notification mode about a mesh computation result.
-There are 3 possible modes:</li>
-<ul>
-<li><b>Never</b> - do not show the result dialog at all;</li>
-<li><b>Errors only</b> - the result dialog will be shown if there were
-some errors during a mesh computation;</li>
-<li><b>Always</b> - show the result dialog after each mesh
-computation. This is a default mode.</li>
-</ul>
-</ul>
-
-<h2>Mesh Preferences</h2>
-
-\image html pref22.png
-
-<ul>
-<li><b>Nodes</b></li>
-<ul>
-<li><b>Color</b> - allows to select the color of nodes. Click on the
-colored line to access to the \ref select_color_and_font_page "Select Color"
-dialog box.</li>
-<li><b>Size</b> - allows to define the size of nodes.</li>
-</ul>
-<li><b>Elements</b></li>
-<ul>
-<li><b>Fill</b> - allows to select the color of surface of elements
-(seen in Shading mode). Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Outline</b> - allows to select the color of borders of
-elements. Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Back Face</b> - allows to select the color of interior surface
-of elements. Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of lines (edges and borders of elements).</li>
-<li><b>Shrink coef.</b> - allows to define relative space of elements
-compared to gaps between them in shrink mode.</li>
-</ul>
-<li><b>Orientation of Faces</b> - allows to define the behavior of
-<b>Orientation of faces</b> functionality</li>
-<ul>
-<li> \b Color - allows to define the color of orientation vertors;</li>
-<li> \b Scale - allows to define the size of orientation vectors;</li>
-<li> <b> 3D Vector </b> checkbox allows to choose between 2D planar
-and 3D vectors.</li>
-</ul>
-</ul>
-
-<br><h2>Selection Preferences</h2>
-
-\image html pref23.png
-
-<ul>
-<li><b>Selection</b> - performed with mouse-indexing (preselection)
-and left-clicking on an object, whose appearance changes as defined in
-the <b>Preferences</b>.</li>
-<ul>
-<li><b>Object Color</b> - allows to select the color of mesh (edges and
-borders of meshes) of the selected entity. Click on the colored line
-to access to the \ref select_color_and_font_page "Select Color" dialog
-box.</li>
-<li><b>Element color</b> - allows to select the color of surface of selected
-elements (seen in Shading mode). Click on the colored line to access
-to the \ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of selected edges. </li>
-</ul>
-<li><b>Preselection</b> - performed with mouse-indexing on an object,
-whose appearance changes as defined in the <b>Preferences</b>.</li>
-<ul>
-<li><b>Highlight Color</b> - allows to select the color of mesh (edges and
-borders of meshes) of the entity . Click on the colored line to access
-to the \ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Width</b> - allows to define the width of preselected edges.</li>
-</ul>
-<li><b>Precision</b> - in this menu you can set the value of precision
-used for <b>Nodes</b>, <b>Elements</b> and <b>Objects</b>.</li>
-</ul>
-
-<br><h2>Scalar Bar Preferences</h2>
-
-\image html pref24.png
-
-<ul>
-<li><b>Font</b> - in this menu you can set type, face and color for
-the font of <b>Title</b> and <b>Labels</b>.</li>
-<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
-colors</b> and the <b>number of labels</b> in use.</li>
-<li><b>Orientation</b> - here you can choose between vertical and
-horizontal orientation of the <b>Scalar Bar</b></li>.
-<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
-placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
-<b>Height</b>) of Scalar Bars</li>
-<ul>
-<li><b>X</b>: abscissa of the point of origin (from the left
-side)</li>
-<li><b>Y</b>: ordinate of the origin of the bar (from the bottom)</li>
-</ul>
-</ul>
-
-*/
\ No newline at end of file
\page occ_3d_viewer_page OCC 3D Viewer
+<h2>Operations</h2>
+
The functionalities of OCC viewer are available via its Viewer
Toolbar. Buttons marked with small downward triangles have extended
functionality which can be accessed by locking on them with left mouse
button.
-\image html occviewer_toolbar.png "Viewer Toolbar"
+\image html occviewer_toolbar.png
+<hr>
+
+\image html occ_view_camera_dump.png
+<b>Dump View</b> - exports an object from the viewer in bmp, png or
+jpeg image format.
<hr>
-\image html image77.png
-\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
-or jpeg image format.</center>
+
+\image html occ_view_style_switch.png
+
+<b>Interaction style switch</b> - allows to switch between standard
+and "keyboard free" interaction styles. "Keyboard free" style allows
+to process all view transformations without using keyboard (only by
+mouse) and perform selection in view by pressing "S" key. By default,
+rotation in this mode is performed by left mouse button, panning - by
+middle mouse button, zooming - by left and middle mouse buttons
+pressed simultaneously.
<hr>
-\image html image88.gif
-\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
+\image html occ_view_zooming_style_switch.png
+
+<b>Zooming style switch</b> - allows to switch between standard
+(zooming at the center of the view) and advanced (zooming at the
+current cursor position) zooming styles.
<hr>
-\image html image96.png
-\n <center><b>Fit all</b> - allows to select a point to be the center of a
-scene representing all displayed objects in the visible area.</center>
+\image html occ_view_triedre.png
+
+<b>Show/Hide Trihedron</b> - shows or hides coordinate axes.
<hr>
-\image html image97.png
-\n <center><b>Fit area</b> - resizes the view to place in the visible area
-only the contents of a frame drawn with pressed left mouse button.</center>
+\image html occ_view_fitall.png
+
+<b>Fit all</b> - allows to select a point to be the center of a scene
+representing all displayed objects in the visible area.
+<hr>
+
+\image html occ_view_fitarea.png
+
+<b>Fit area</b> - resizes the view to place in the visible area only
+the contents of a frame drawn with pressed left mouse button.
<hr>
-\image html image98.png
-\n <center><b>Zoom</b> - allows to zoom in and out.</center>
+\image html occ_view_zoom.png
+
+<b>Zoom</b> - allows to zoom in and out.
<hr>
-\image html image99.gif
-\n <center><b>Panning</b> - if the represented objects are greater that the
-visible area and you don't wish to use <b>Fit all</b> functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
+\image html occ_view_pan.png
+
+<b>Panning</b> - if the represented objects are greater that the
+visible area and you don't wish to use <b>Fit all</b> functionality,
+click on this button and you'll be able to drag the scene to see its
+remote parts.
<hr>
-\image html image100.png
-\n <center><b>Global panning</b> - represents all displayed objects in
-the visible area.</center>
+\image html occ_view_glpan.png
+
+<b>Global panning</b> - represents all displayed objects in the
+visible area.
<hr>
-\image html view_rotation_point.png
-\n <center><b>Change rotation point</b> - allows to to choose the point around
-which the rotation is performed.</center>
+\image html occ_view_rotation_point.png
+
+<b>Change rotation point</b> - allows to to choose the point around
+which the rotation is performed.
\image html set_rotation_point_dialog1.png
-<center>By default the rotation point is located in the Center of the bounding
-box of an object.</center>
+By default the rotation point is located in the Center of the bounding
+box of an object.
\image html set_rotation_point_dialog2.png
-<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
-define the coordinates of the rotation point manually.</center>
+Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
+define the coordinates of the rotation point manually.
+
+- <b>Set to Origin</b> button restores the default rotation point
+ coordinates.
+
+- <b>Select Point from View</b> button allows to select the rotation
+ point in the 3D Viewer.
+
+<hr>
+
+\image html occ_view_rotate.png
+
+<b>Rotation</b> - allows to rotate the selected object using the
+mouse.
+<hr>
+
+\image html occ_view_front.png
+\image html occ_view_back.png
+\image html occ_view_top.png
+\image html occ_view_bottom.png
+\image html occ_view_left.png
+\image html occ_view_right.png
-<b>Set to Origin</b> button restores the default rotation point
-coordinates.\n
-<b>Select Point from View</b> button allows to select the rotation
-point in the 3D Viewer.
+These buttons orientate the scene strictly about coordinate axes:
+\b Front, \b Back, \b Top, \b Bottom, \b Left or \b Right side.
<hr>
-\image html image89.png
-\n <center><b>Rotation</b> - allows to rotate the selected object using the
-mouse.</center>
+\image html occ_view_anticlockwise.png
+
+<b>Rotate counterclockwise</b> - rotates view 90 @htmlonly ° @endhtmlonly counterclockwise.
+<hr>
-\image html image102.gif
+\image html occ_view_clockwise.png
-<center>These buttons orientate the scene strictly about coordinate axes.</center>
+<b>Rotate clockwise</b> - rotates view 90 @htmlonly ° @endhtmlonly clockwise.
<hr>
-\image html image91.png
-\n <center><b>Reset</b> - restores the default position (isometric) of
-objects in the scene.</center>
+\image html occ_view_reset.png
+
+<b>Reset</b> - restores the default position (isometric) of objects in
+the scene.
<hr>
-\image html image103.png
-\n <center><b>Memorise view</b> - saves the current position of
-objects in the scene.</center>
+\image html occ_view_shoot.png
+
+<b>Memorise view</b> - saves the current position of objects in the
+scene.
<hr>
-\image html image105.gif
-\n <center><b>Restore view</b> - restores the saved position of
-objects in the scene.</center>
+\image html occ_view_presets.png
+
+<b>Restore view</b> - restores the saved position of objects in the
+scene.
<hr>
-\image html image86.png
-\n <center><b>Clone view</b> - opens a new duplicate scene.</center>
+\image html occ_view_clone.png
+
+<b>Clone view</b> - opens a new duplicate scene.
<hr>
-\image html image106.png
-\n <center><b>Clipping</b> - allows to create cross-section views
-(clipping planes) of geometrical objects.</center>
+\image html occ_view_clipping.png
+
+<b>Clipping</b> - allows to create cross-section views (clipping
+planes) of geometrical objects.
\image html clipping.png
-<ul>
-<li><b>Base point</b> - allows to define the coordinates of the base
-point for the clipping plane.</li>
-<ul>
-<li><b>Reset</b> - returns the base point to coordinate origin.</li>
-</ul>
-<li><b>Direction</b> - allows to define the orientation of the
-clipping plane.</li>
-<ul>
-<li><b>Invert</b> - allows to select which part of the object will be removed
-and which will remain after clipping.</li>
-</ul>
-<li><b>Preview</b> - allows to see the results of clipping in the
-viewer.</li>
-</ul>
-<hr>
-\image html occviewer_axialscale.png
-\n <center><b>Scaling</b> - represents objects deformed (stretched or
-stuffed) along the axes of coordinates.</center>
-
-<b>Note!</b> OCC Viewer features a special <b>Polyline Selection</b> mechanism, which allows selecting an arbitraty part of the graphic area using a polygon frame, instead of the usual selection with a rectangular frame.
-
-To produce a Polyline Selection, lock the right mouse button and draw the first side of the polygon, then change the direction by clicking the left mouse button add draw another side, etc. The whole selection frame is drawn with the locked right mouse button.
+
+- <b>Base point</b> - allows to define the coordinates of the base
+ point for the clipping plane.
+
+ - <b>Reset</b> - returns the base point to coordinate origin.
+
+- <b>Direction</b> - allows to define the orientation of the
+ clipping plane.
+
+ - <b>Invert</b> - allows to select which part of the object will be
+ removed and which will remain after clipping.
+
+- <b>Preview</b> - allows to see the results of clipping in the
+ viewer.
+
+<hr>
+
+\image html occ_view_scaling.png
+
+<b>Scaling</b> - represents objects deformed (stretched or stuffed)
+along the axes of coordinates.
+<hr>
+
+\image html occ_view_graduated_axes.png
+
+<b>Graduated axes</b> - allows to define axes parameters and graduate
+them.
+
+\image html graduatedaxes2.png
+
+- <b>Axis name</b> - if checked the axis name is displayed in the viewer.
+
+ - <b>Name</b> - allows to redefine the axis name.
+
+ - <b>Font</b> - allows to define the font color of the axis name.
+
+- <b>Labels</b> - if checked the labels are displayed in the viewer.
+
+ - <b>Number</b> - allows to define the number of labels.
+
+ - <b>Offset</b> - allows to define the distance between labels.
+
+ - <b>Font</b> - allows to define the font color of labels names.
+
+- <b>Tick marks</b> - if checked the tick marks are displayed in the viewer.
+
+ - <b>Length</b> - allows to define the length of tick marks.
+
+- <b>Is visible</b> - if checked the axis is displayed in the viewer.
+
+<hr>
+
+\image html occ_view_ambient.png
+
+<b>Toggle ambient light</b> - toggle "keep only ambient light" flag
+on/off.
+<hr>
+
+\image html occ_view_minimized.png
+\image html occ_view_maximized.png
+
+<b>Minimize/Maximize</b> - these buttons allow switching the current
+view area to the minimized / maximized state.
+<hr>
+
+\image html occ_view_sync.png
+
+<b>Synchronize view</b> - allows to synchronize 3d view
+parameters. This button has two states - checked and
+unchecked. Clicking on this button opens a drop-down menu listing the
+compatible 3d views. As soon as the user selects any view from the
+list, the parameters (view point, position, zoom coefficient, etc.) of
+the current view are synchronized with the selected view (static
+synchronization).
+
+In addition, when this button is in the "checked" state, the dynamic
+synchronization of the views is performed, i.e. any zoom, pan, rotate
+or other view operation done in one view is automatically applied to
+the other view.
+<hr>
+
+\anchor occ_background
+<h2>Background</h2>
+
+OCC Viewer background can be customized using the "Change background"
+popup menu command that opens the following dialog box:
+
+\image html change_background_dlg.png
+
+The following types of the background are supported:
+
+- Single color: the background is colored with the solid color
+ specified by the user in the dialog box.
+
+- Gradient background: the background is gradiently colored according
+ to two colors and the gradient type specified in the dialog box. The
+ following types of background are supported:
+
+ - Horizontal
+
+ - Vertical
+
+ - First diagonal
+
+ - Second diagonal
+
+ - First corner
+
+ - Second corner
+
+ - Third corner
+
+ - Fourth corner
+
+- Image: allows to set image as viewer background and define filling type:
+
+ - Center: the image is located at the center of the viewer backgound
+
+ - Tile: the image fills the entire viewer backgound one by one
+
+ - Stretch: the image is stretched to the entire viewer backgound.
+
+Default background for the viewer is specified via the
+\ref occ_preferences "application preferences".
+
+<h2>Polyline selection</h2>
+
+OCC Viewer features a special <b>Polyline Selection</b> mechanism,
+which allows selecting an arbitraty part of the graphic area using a
+polygon frame (rubber band), instead of the usual selection with a
+rectangular frame.
+
+To produce a Polyline Selection, lock the right mouse button and draw
+the first side of the polygon, then change the direction by clicking
+the left mouse button add draw another side, etc. The whole selection
+frame is drawn with the locked right mouse button.
\image html polyselection1.png
\page plot2d_viewer_page Plot 2D viewer
-\n <b>Plot 2d viewer</b> toolbar gives fast access to the following
-operations:
+The functionalities of Plot2d viewer are available via its Viewer
+Toolbar. Buttons marked with small downward triangles have extended
+functionality which can be accessed by locking on them with left mouse
+button.
-\image html image77.png
-<center><b>Dump View</b> - exports an object from the viewer in bmp,
-png, jpg or jpeg image format.</center>
+\image html plot2dviewer_toolbar.png
+<hr>
-\image html image96.png
-<center><b>Fit all</b> - scales the display to show the entire
-scene. Use this to resize the scene so that it could fit within the
-Viewer boundary.</center>
+\image html plot2d_camera_dump.png
-\image html image97.png
-<center><b>Fit area</b> - resizes the view to place in the visible
-area only the contents of a frame drawn with pressed left mouse
-button.</center>
+<b>Dump View</b> - exports an object from the viewer in
+bmp, png or jpeg image format.
+<hr>
-\image html image98.png
-<center><b>Zoom</b> - allows to zoom in and out.</center>
+\image html plot2d_fitall.png
+<b>Fit all</b> - scales the display to show the entire scene. Use this
+to resize the scene so that it could fit within the Viewer boundary.
+<hr>
-\image html image99.png
-<center>\b Panning - if the represented objects are greater that the
-visible area and you don't wish to use Fit all functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
+\image html plot2d_fitarea.png
-\image html image100.png
-<center><b>Global panning</b> - allows to define the center of the
-scene presenting all displayed objects in the visible area.</center>
+<b>Fit area</b> - resizes the view to place in the visible area only
+the contents of a frame drawn with pressed left mouse button.
+<hr>
+
+\image html plot2d_zoom.png
+
+<b>Zoom</b> - allows to zoom in and out.
+<hr>
+
+\image html plot2d_pan.png
+
+\b Panning - if the represented objects are greater that the visible
+area and you don't wish to use Fit all functionality, click on this
+button and you'll be able to drag the scene to see its remote parts.
+<hr>
+
+\image html plot2d_glpan.png
+
+<b>Global panning</b> - allows to define the center of the scene
+presenting all displayed objects in the visible area.
+<hr>
\image html plot2d_points.png
-<center><b>Draw Points</b> - represents points on the graph.</center>
+
+<b>Draw Points</b> - switches display mode to \em Points. In
+this mode, each curve is displayed as a set of points.
+<hr>
\image html plot2d_lines.png
-<center><b>Draw Lines</b> - represents lines on the graph.</center>
+
+<b>Draw Lines</b> - switches display mode to \em Lines. In this
+mode, each curve is represented as a set of plain line segments.
+<hr>
\image html plot2d_splines.png
-<center><b>Draw Splines</b> - represents splines on the graph.</center>
-\image html plot2d_logarithmic_horizontal.png
-<center><b>Horizontal axis logarithmic</b> - changes the scaling on
-horizontal axis to logarithmic.</center>
+<b>Draw Splines</b> - switches display mode to \em Splines. In
+this mode, each curve is represented as a spline.
+<hr>
+
+\image html plot2d_lmin_normalization.png
+
+<b>Normalization to global minimum by left Y axis</b> - switches
+normalization mode to <b>Left Y Axis: Minimum normalization</b>.
+In this mode, all curves are normalized to the global minimum by the left Y axis.
+
+\image html plot2d_lmax_normalization.png
+
+<b>Normalization to global maximum by left Y axis</b> - switches
+normalization mode to <b>Left Y Axis: Maximum normalization</b>.
+In this mode, all curves are normalized to the global maximum by the left Y axis.
+<hr>
+
+\image html plot2d_rmin_normalization.png
+
+<b>Normalization to global minimum by right Y axis</b> - switches
+normalization mode to <b>Right Y Axis: Minimum normalization</b>.
+In this mode, all curves are normalized to the global minimum by
+the right Y axis.
+
+\image html plot2d_rmax_normalization.png
+
+<b>Normalization to global maximum by right Y axis</b> - switch
+normalization mode to <b>Right Y Axis: Maximum normalization</b>.
+In this mode, all curves are normalized to the global maximum by
+the right Y axis.
+<hr>
-\image html plot2d_logarithmic_vertical.png
-<center><b>Vertical axis logarithmic</b> - changes the scaling on vertical
-axis to logarithmic.</center>
+\image html plot2d_linear.png
+\image html plot2d_log.png
+
+These buttons allow to switch horizontal axis scale to the linear or
+logarithmic mode.
+
+\note The logarithmic mode of the horizontal
+axis scale is allowed only if the minimum value of abscissa component
+of displayed points is greater than zero.
+
+<hr>
+
+\image html plot2d_linear_y.png
+\image html plot2d_log_y.png
+
+These buttons allow to switch vertical axis scale to the linear or
+logarithmic mode.
+
+\note The logarithmic mode of the vertical
+axis scale is allowed only if the minimum value of ordinate component
+of displayed points is greater than zero.
+
+<hr>
\image html plot2d_legend.png
-<center><b>Show Legend</b> - reveals all verbal and numerical
-information on the graphs.</center>
+
+<b>Show Legend</b> - Shows / hides information about the displayed
+objects in a legend.
+<hr>
\image html plot2d_settings.png
-<center>\b Settings - calls a menu, in which you can specify advanced
-settings for your Plot 2d Viewer.</center>
-\image html plot2d_clone.png
-<center><b>Clone view</b> - opens a new duplicate scene.</center>
+\b Settings - provides an access to the settings dialog box, that
+allows to specify advanced parameters for the Plot 2d Viewer.
\anchor settings
-\n \image html plot2d_view_settings.png
+\image html plot2d_view_settings.png
+
+The options are as follows:
+
+- <b>Main title</b> the title of the XY plot. By default, it will
+ consist of the names of the tables, on the basis of which the curve
+ lines have been constructed.
+
+- <b>Curve type</b> you can select from \em Points, \em Lines or
+ \em Spline.
+
+- <b>Show legend</b> here you can define the position of the
+ description table on the XY plot (to the \em Left, to the \em Right,
+ on \em Top or on \em Bottom).
+
+- <b>Legend font</b> here you can set type, face and color for the
+ font of Legend item.
+
+- <b>Marker size</b> - size of the points (markers) forming curve lines.
+
+- <b>Background color</b> of the XY plot.
+
+- <b>Deviation marker</b> allows specifying the properties of the
+ marker, which is used for drawing deviations data.
+
+ - <b>Line width</b> line width of the marker.
+
+ - <b>Tick size</b> size of the upper and lower horizontal lines of
+ the marker.
+
+ - <b>Color</b> color of the marker.
+
+- <b>Normalization</b> allows selecting the type of
+ normalization (\em minimum or/and \em maximum) for the displayed
+ presentations of 2d curves in the view.
+
+- <b>Scale mode</b> allows selecting the type of scaling (\em Linear
+ or \em Logarithmic) for <b>X (Horizontal)</b> or <b>Y (Vertical)</b>
+ axes separately. Note that the \em Logarithmic scale can be used
+ only if the minimum value of corresponding component (abscissa or
+ ordinate) of all points displayed in the viewer is greater than
+ zero.
+
+- <b>Axis ...</b> options group allows specifying additional settings
+ for each axis separately:
+
+ - <b>Axis title</b> - an axis title.
+
+ - <b>Grid / Axes marks</b> allows defining the maximum number
+ of major and minor scale divisions for a given axis. The real
+ number of intervals fits to {1,2,5}*10^N, where N is a natural
+ number, and does not exceed the maximum.
+
+- <b>Save settings as default</b> If this check box is marked, all XY
+ plots will be displayed with these defined properties.
+
+<hr>
+
+\anchor analytical_curve
+\image html plot2d_analytical_curve.png
+
+<b>Analytical curves</b> - provides an access to the analytical curves
+dialog box that allows to add, remove and modify analytical curves
+for the Plot 2d Viewer.
+
+\image html analytical_curves_dlg.png
The options are as follows:
-<ul>
-<li><b>Main title:</b> the title of the XY plot. By default, it will
-consist of the names of the tables, on the basis of which the curve
-lines have been constructed.</li>
-<li><b>Curve type:</b> you can select from \b Points, \b Lines and \b Spline.</li>
-<li><b>Show legend:</b> here you can define the position of the
-description table on the XY plot (to the \b Left, to the \b Right, on
-\b Top or on \b Bottom).</li>
-<li><b>Marker size</b> - size of the points (markers) forming curve lines.</li>
-<li><b>Background color</b> of the XY plot.</li>
-<li><b>Scale mode:</b> here you can select the type of scaling (\b
-Linear or \b Logarithmic) along <b>X (Horizontal)</b> or <b>Y (Vertical)</b> axes.</li>
-</ul>
-
-You can define settings for each axis separately:
-<ul>
-<li>\b Horizontal or \b Vertical axis title.</li>
-<li><b>Grid/Axes marks:</b> here you can define the maximum number of major
-and minor scale divisions for a specified axis. The real number of
-intervals fits to {1,2,5}*10^N, where N is a natural number, and
-doesn't exceed the maximum.</li>
-<li><b>Save settings as default:</b> If this check box is marked, all
-XY plots will be displayed with these defined properties.</li>
-</ul>
+
+- Curve parameters:
+
+ - <b>y(x)=</b> allows specifying a python expression, which is used to
+ calculate the coordinates of the curve points, where <b>x</b>
+ corresponds to the horizontal range, shown in plot 2D viewer.
+
+ - <b>Nb. itervals</b> allows specifying the number of the curve points.
+
+- Curve properties:
+
+ - <b>Auto assign</b> if checked, the properties
+ (<em>Line type</em>, <em>Line width</em>, <em>Marker type</em> and
+ <em>Color</em>) are assigned to curves automatically. To define
+ the curve properties manually, uncheck this control.
+
+ - <b>Line type</b> allows to choose curve line type from \em None,
+ \em Solid, \em Dash, \em Dot, <em>Dash - Dot</em> and
+ <em>Dash - Dot - Dot</em>.
+
+ - <b>Line width</b> allows to specify line width of the curve.
+
+ - <b>Marker type</b> allows to choose curve marker type from
+ \em Circle, \em Rectangle, \em Diamond, <em>Rightward Triangle</em>,
+ <em>Leftward Triangle</em>, <em>Downward Triangle</em>,
+ <em>Upward Triangle</em>, \em Cross and <em>Diagonal Cross</em>).
+
+ - <b>Color</b> allows specifying the curve color.
+
+<hr>
+
+\image html plot2d_clone.png
+
+<b>Clone view</b> - opens a new duplicate scene.
+<hr>
+
+\image html plot2d_print.png
+
+<b>Print view</b> - prints the current view scene.
*/
+++ /dev/null
-/*!
-
-\page postpro_preferences_page Post-Pro Preferences
-
-In the Post-Pro module you can set preferences, default settings,
-which can be used in later sessions with this module.
-
-<h2>MED import Preferences</h2>
-
-\image html ppref1.png
-
-<ul>
-<li><b>MED files import</b></li>
-<ul>
-<li><b>Use Build Progress</b> - when this option is checked you can choose
-all other import MED options at the moment of loading of each file
-using <b>Build Progress</b> menu, otherwise the loading will be done
-according to the <b>Preferences</b> without addressing to the
-user.</li>
-<li><b>Full MED Loading</b> - when this option is checked, the MED file is
-fully loaded in the study, and no additional access to the MED file is
-needed during the session. Reversibly, when unchecked, the MED file is
-loaded on demand. This is the default behaviour in SALOME and
-recommended for big files to optimize memory usage.</li>
-<li><b>Build at once</b> - when this option is checked, you can't
-perform any operations until the MED file is fully loaded and
-processed.</li>
-<li><b>Build fields</b> - when this option is checked, the fields are
-built automatically at loading.</li>
-<li><b>Build min/max</b> - when this option is checked, minimum and
-maximum values of the time stamps are found at loading.</li>
-<li><b>Build groups</b> - when this option is checked, the groups and
-families are built automatically at loading.</li>
-<li><b>Close dialog at finish</b> - when this option is checked, the
-dialog box is closed after loading of the selected MED file. When
-unchecked, it allows loading other MED files.</li>
-</ul>
-</ul>
-
-<br><h2>Scalar Bar Preferences</h2>
-
-\image html pref31.png
-
-<ul>
-<li><b>Scalar Range</b></li>
-<ul>
-<li><b>Scalar Mode</b> - this feature allows refining the value to be
-inspected:</li>
-<ul>
-<li><b>Modulus:</b> value of a scalar or modulus of a vector.</li>
-<li><b>Component N:</b> Nth component of a vector, a tensor or a matrix.</li>
-</ul>
-<li><b>Logarithmic Scaling</b> - this checkbox toggles logarithmic
-scaling.</li>
-<li><b>Ranges to Use</b> - you can use either Field Range or Imposed Range.</li>
-</ul>
-<li><b>Min and Max for Imposed Range</b> - in this menu you can set
-the limits for your Imposed Range, if you have chosen to use it.</li>
-<li><b>Font</b> - in this menu you can set type, face and color for
-the font of <b>Title</b> and <b>Labels</b>.</li>
-<li><b>Colors & Labels</b> - in this menu you can set the <b>number of
-colors</b> and the <b>number of labels</b> in the Scalar bar.</li>
-<li><b>Orientation</b> - here you can choose between vertical and horizontal
-orientation of the Scalar Bar.</li>
-<li><b>Origin & Size Vertical & Horizontal</b> - allows to define
-placement (<b>X</b> and <b>Y</b>) and lookout (<b>Width</b> and
-<b>Height</b>) of Scalar Bars.</li>
-<ul>
-<li><b>X:</b> abscissa of the point of origin (from the left
-side)</li>
-<li><b>Y:</b> ordinate of the origin of the bar (from the bottom)</li>
-</ul>
-<li><b>Scalar bars default position</b></li>
-<ul>
-<li><b>Arrange Scalar Bars</b> - this option prevents superposition of
-scalar bars during visualisation of several fields in the same
-window. If checked, a separate scalar bar is displayed for each
-presentation.</li>
-</ul>
-</ul>
-
-<br><h2>Cut Lines Preferences</h2>
-
-\image html ppref2.png
-
-<ul>
-<li><b>CutLine Preferences</b></li>
-<ul>
-<li><b>Show preview</b> check box allows to edit the parameters of the
-presentation and simultaneously observe the preview of this
-presentation in the viewer.</li>
-<li><b>Invert all curves</b> check box allows to invert the resulting
-curves.</li>
-<li><b>Use absolute length</b> check box allows to use absolute length
-for curves.</li>
-<li><b>Generate Data Table:</b> If this check box is marked, <b>Post
-Pro</b> will automatically generate a data table on the basis of your
-Cut Lines presentation. This table will be created in the structure of
-the study.</li>
-<li><b>Generate Curves:</b> If this check box is marked, <b>Post Pro</b> will
-automatically generate curve lines on the basis of values taken from
-the generated data table. These curves will be created in the
-structure of the study and can be visualized in a XY plot.</li>
-</ul>
-</ul>
-
-<br><h2>Sweep and Animation Preferences</h2>
-
-\image html ppref3.png
-
-
-<ul>
-<li><b>3D Cache</b> - allow to define the mode of usage
-and the size of the 3D Cache, which enables to save in RAM and quickly
-restore the states of field animation (\b Sliding functionality).</li>
-<ul>
-<li><b>Memory Mode</b> - allows to define the mode of usage
-of the 3D Cache: <b>Minimal</b> actually disables the Cache,
-<b>Limited</b> Cache size depends on the current system
-configuration.</li>
-<li><b>Memory Limit</b> - allows to define the maximum size of the 3D
-Cache</li>
-</ul>
-
-<ul>
-<li><b>Animation preferences</b></li>
-<ul>
-<li><b>Speed</b> - allows to define the speed of the animation.</li>
-<li><b>Cycled animation</b> - allows to start a cycled animation of the presentation.</li>
-<li><b>Use proportional timing</b> - allows to render the animation with proportional periods of time between every frame (not depending on the time stamps).</li>
-<li><b>Clean memory at each frame</b> - this option allows to optimize the performance of the operation.</li>
-</ul>
-
-<li><b>Sweeping preferences</b></li>
-<ul>
-<li><b>Mode of the Sweeping</b> - allows to choose between Linear,
-Cosinusoidal and sinusoidal sweeping.</li>
-<li><b>Time step</b> - in this menu you can set the time of
-representation of one step.</li>
-<li><b>Number of cycles</b> - in this menu you can define the number
-of times this animation will be repeated.</li>
-<li><b>Number of steps</b> - in this menu you can define the number of
-steps, which will compose the whole animation.</li>
-<li><b>Parameter varies</b> - allows to choose the range for the
-parameter: from 0 to Pi or from Pi to -Pi.</li>
-</ul>
-</ul>
-
-<br><h2>Representation Preferences</h2>
-
-\image html pref33.png
-
-<ul>
-<li><b>Representation properties</b> - these checkboxes allow to
-choose the default representation type for each field presentation.</li>
-<ul>
-<li><b>Use Shading</b> - when this option is checked, the objects will
-be displayed with shading.</li>
-<li><b>Display only on creation</b> - when this option is checked, all
-previously created presentations will be automatically removed from
-the viewer when a new presentation is created and displayed. You can
-restore the previously created presentations using the Object
-Browser.</li>
-</ul>
-</ul>
-
-<br><h2>Feature Edges</h2>
-
-\image html featureedgesprops.png
-
-These properties define which contours should be highlighted with
-<b>Feature Edges</b> functionality.
-<ul>
-<li><b>Feature edges angle</b> - allows to define at which minimum
-angle between two faces a wire is considered an edge </li>
-<li><b>Show feature edges</b> - allows to display feature edges.</li>
-<li><b>Show boundary edges</b> - allows to display boundary edges.</li>
-<li><b>Show manifold edges</b> - allows to display manifold edges. </li>
-<li><b>Show non-manifold edges</b> - allows to display non-manifold edges.</li>
-</ul>
-
-
-<br><h2>Gauss Points Preferences</h2>
-
-\image html pref34.png
-
-<ul>
-<li><b>Primitive</b> - this menu allows user to choose the graphic
-primitive to use to present the results at Gauss points in the
-viewer.</li>
-<ul>
-<li><b>Primitive type</b> - provides choice between <b>Point
-sprites</b>, <b>Open GL points</b> and <b>Geometrical Spheres</b>.</li>
-<li><b>Maximum Size (Clamp)</b> - defines the maximum size of sprite
-points ranging from 1 to 512. By default the value is set to 256
-pixels.</li>
-<li><b>Main Texture</b> - path to the <b>Main Texture</b> (16x16
-pixels) which defines the shape of the point sprite used for
-rendering.</li>
-<li><b>Alpha Channel Texture (16*16)</b> - path to the <b>Alpha
-Channel Texture</b> which defines the texture of the point
-sprite.</li>
-<li><b>Alpha Channel Threshold</b> - defines the level of transparency
-ranging from 0 to 1.</li>
-<li><b>Geometrical Sphere Resolution</b> - defines the number of faces
-of <b>Geometry Spheres</b>.</li>
-<li><b>Notify when number of faces exceeds</b> - limitation of the
-number of faces; the user will be warned if it exceeds the given
-value.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Size</b> - in this menu you can define:</li>
-<ul>
-<li><b>Range value for min and max size</b> - these two parameters
-will be respectively multiplied by a reference length (average size of
-cells of the mesh) to define the range for minimum and maximum size of
-a point during rendering (at magnification = 100%). Default values
-are:</li>
-<ul>
-<li><b>Rainbow</b> scale: <b>min</b> = <b>10%</b>, <b>max</b> =
-<b>33%</b></li>
-<ul>
-<li>Min size is associated to the smallest real value (including
-negative values).</li>
-<li>Max size is associated to the largest real value.</li>
-</ul>
-<li><b>Bicolor</b> scale: <b>min</b> = <b>0</b> (not editable),
-<b>max</b> = <b>33%</b></li>
-<ul>
-<li>Null size is associated to the 0 scalar value.</li>
-<li>Max size is associated to the largest absolute value.</li>
-</ul>
-</ul>
-Both values are dynamically updated by the system according to the
-selected scalar bar. In the case of a Bicolor scale, the minimum value
-is set to 0 in the dialog and the control is disabled.
-<li><b>Magnification (%)</b> corresponds to the change of size of
-results at Gauss point primitives in 2D space. Acceptable values range
-from 0 to N; 100% means no magnification, 50% means half of its size,
-200% mean twice its size and so forth. By default this value is set to
-100%.</li>
-<li><b>+/- Ratio</b> corresponds to the number by which the
-magnification will be respectively multiplied or divided at edition,
-ranging from 0.01 to 10. By default this value is set to 2.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Geometry</b></li>
-<ul>
-<li><b>Size of points (%)</b> defines a value that will be multiplied
-by a reference length (representative of the average size of cells of
-the mesh) to define the size of points during rendering (at
-magnification = 100%). Default values 10%.</li>
-<li><b>Color</b> - allows to select the color of points used for
-presentations. Click on the colored line to access to the \ref
-select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Gauss Points Scalar Bar</b></li>
-<ul>
-<li><b>Active Bar</b> - this option allows to choose <b>Local</b> or
-<b>Global</b> Bar as active.</li>
-<li><b>Display Global Bar</b> - this option allows to visualize or to
-hide the Global Bar.</li>
-<li><b>Scalar Bar Mode</b> - this option allows to choose between
-<b>Bicolor</b> and <b>Rainbow</b> Scalar Bar Mode.</li>
-<li><b>Spacing</b> - allows to define Spacing from 0.01 to 1.</li>
-</ul>
-</ul>
-
-<ul>
-<b>Spacemouse</b>
-<ul>
-<li><b>Decrease Gauss Points Magnification </b> - divides the current
-magnification by magnification ratio. </li>
-<li><b>Increase Gauss Points Magnification </b> - multiplies the
-current magnification by magnification ratio. </li>
-</ulul>
-</ul>
-
-<br><br><b>Inside<b> and </b>Outside Cursor Preferences</b> allow to set
-<b>Primitives</b>, <b>Size</b> and <b>Magnification</b> for the
-respective zones.
-
-<br><h2>Picking Preferences</h2>
-
-\image html pref37.png
-
-<ul>
-<li><b>Cursor</b> - allows to adjust the Size of the cursor used for
-Picking (ranging from 0.1 to 1), the Height of the pyramids (ranging
-from 0 to 10) and the Selection cursor color.</li>
-<li><b>Tolerance</b> - defines at which distance of the cursor from
-the point it becomes selected (ranges from 0.001 to 10).</li>
-<li><b>Information window</b> - allows to define the
-<b>Transparency</b> (from 0% = opaque to 100% = transparent) and
-<b>Position</b> of the window, which can be:</li>
-<ul>
-<li><b>Centred below the point</b>, or</li>
-<li>located at <b>Top-left corner of the 3D view</b></li>
-</ul>
-<li><b>Movement of the Camera</b> can also be define by the user.</li>
-<ul>
-<li><b>Zoom at first selected point</b> - This value is used to define
-the focal distance at the first selected point (at the end of the
-movement of the camera). This value is a ratio that will be multiplied
-by the current zoom value.</li>
-<li><b>Number of steps between two positions</b> - defines the
-smoothness of camera movement at selection by the number of
-iterations. If set to 1 the camera is zoomed and centered at the point
-momentarily. Greater numbers mean very slow camera movement.</li>
-</ul>
-<li><b>Display parent mesh element</b> - allows to visualize or hide
-the patent mesh element of the selected gauss point.</li>
-</ul>
-</ul>
-
-*/
originality of this approach is that the various components must
cooperate dynamically and be configurable.
-\image html image54.jpg
+\image html image54.png
<br>SALOME platform integrates a number of modules each having its own function:
<ul>
component. All components represent \b CORBA servers and it allows to
run them on different host stations.
-\image html image67.gif
+\image html image67.png
It is equally possible to create engine-independent modules. These
them.</li>
<li>\b Rename - allows to rename the currently selected viewer
window. </li>
+</ul>
+++ /dev/null
-/*!
-
-\page salome_preferences_page SALOME preferences
-
-To begin setting preferences for your study, select \b Preferences in the
-main menu, the following dialog box will appear:
-
-\image html pref11.png
-If you've just started your study and haven't yet loaded other
-modules, you'll be able to change only those settings, which refer to
-the whole GUI SALOME session. These settings will be valid for the
-whole study session.
-
-<h2>General Preferences</h2>
-
-<ul>
-<li><b>Study Properties</b></li>
-<ul>
-<li><b>MultiFile Save</b> - if checked in, your study will be saved in
-several HDF files (one basic HDF file which will store the main
-information about the saved study and several other files for the data created by each component
-used during the study session). Opening of this study
-requires that \b ALL saved files should be stored in the \b SAME directory.
-If you would like to copy your saved study in another directory or
-machine, you should copy all stored files. Otherwise, if you try to
-open this study, some data will be lost and it will lead to invalid
-functioning of the SALOME platform.</li>
-<li><b>ASCII Save</b> - if checked in, your study will be saved in
-ASCII format file (or files).</li>
-<li><b>Store positions of windows</b> - if checked in, positions of windows
-will be saved in a special file at the end of the current session and
-then restored for a new session.</li>
-<li><b>Store/restore last GUI state</b> - if checked in, all GUI settings are
-saved with the rest of the data whenever you save the study. When the
-study is reopened, the GUI state is restored.</li>
-</ul>
-<li><b>External browser</b></li>
-<ul>
-<li>\b Application - this option allows you to set an external browser (IE,
-Netscape) which will be used for viewing SALOME reference manuals. By
-default, Mozilla is used. Press the "<b>...</b>" button(see
-the picture below) to browse for the application you need in the data
-tree of your computer.</li>
-<li>\b Parameters</li>
-</ul>
-<li><b>Python console properties</b> - here you can quickly set the
-parameters (style, size, face) of the font used in your Python
-console.</li>
-<li><b>Show MRU items</b> - allows to define the maximum \b Number of
-items in <b>Most Recently Used</b> list and the <b>Link type</b>:
-<ul>
-<li>\b Long - shows the full path to the file. </li>
-<li>\b Short - shows the file name only. </li>
-<li>\b Auto - shows full paths to the files only if some files from
-different locations have the same name. </li>
-</ul>
-</li>
-</ul>
-\par
-For detailed settings in \ref select_color_and_font_page "Select Font"
-dialog box press the "<b>...</b>" button(see the picture below).
-
-\image html image69.gif ""..." button"
-
-<br><h2>Viewers Preferences</h2>
-
-\image html pref12.png
-
-<ul>
-<li><b>OCC and VTK 3D Viewers</b></li>
-<ul>
-<li><b>Trihedron size</b> - this submenu allows to set the size of
-coordinate axes displayed in the viewer.</li>
-<li><b>Background Color</b> - this submenu allows to select background
-color. Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Number of isolines along U</b> (or <b>V</b>) - this submenu allows to specify
-the number of isolines along the axes of coordinates.</li>
-<li><b>Relative size</b> - if checked in, trihedron axes scale to fit the
-size of the area displayed in 3D Viewer.</li>
-<li><b>Projection mode</b> - allows choosing between \b Orthogonal and
-\b Perspective projection mode. </b>
-<li><b>Navigation mode</b> - this option allows to choose one of the
-modes of work with mouse in VTK viewer.</li>
-<ul>
-<li><b>Salome Standard Controls</b> - allows to manipulate objects in the
-viewer with the mouse and locked Ctrl button: increase or decrease the
-zoom ratio with the left mouse button, translate object in any
-direction with the central mouse button or rotate it with the right
-mouse button.</li>
-<li><b>Keyboard Free</b> - allows to manipulate objects in the viewer
-with the mouse without locking Ctrl button. In this case the
-operations are assigned to the buttons differently: rotation is made
-with the left button, translation with the right and zoom with both
-pressed in the same time.</li>
-</ul>
-<li><b>[+]/[-] Speed Increment</b> - defines the number of units by
-which the speed increases or respectively decreases after pressing [+]
-or [-] keyboard buttons.</li>
-<li><b>Modification Mode</b> - allows choosing between \b Arithmetic
-and \b Geometrical progression used for zooming</li>
-</ul>
-<li><b>Spacemouse</b> - a mouse-like manipulator device specially designed
-for working with 3D presentations, objects, etc. You can reassign the
-actions listed below to any of its buttons.</li>
-<ul>
-<li><b>Decrease Speed Increment</b> - decreases by 1 the speed increment used for the keyboard (same as [-] key).</li>
-<li><b>Increase Speed Increment</b> - increase by 1 the speed increment used for the keyboard (same as [+] key).</li>
-<li><b>Dominant / combined switch</b> - toggles button to switch to dominant or combined movements.</li>
-</ul>
-<li><b>AVI Recording</b></li>
-<ul>
-<li><b>Mode</b> - allows to choose from two recording regimes:</li>
-<ul>
-<li><b>Recording all displayed frames</b> - records exactly at the FPS rate specified by the user.</li>
-<li><b>Recording at a given FPS</b> - records only when the contents
-of the viewer change (some activity is performed). In the AVI file
-non-recorded images are substituted with the copies of the latest
-recorded image, which produces files with lower quality but requires
-less system resources. </li>
-</ul>
-<li><b>FPS</b> - allows to define the FPS (frames per second) rate for
-the clip. Set greater value for better quality.</li>
-<li><b>Quality</b> - allows to set the quality of the clip in the
-interval between 0 and 100.</li>
-<li><b>Progressive</b> - allows to record a progressive API
-file.</li>
-</ul>
-
-<br>
-<li><b>Plot2d Viewer</b></li>
-<ul>
-<li><b>Legend Position</b> - this submenu allows to set the default position
-of the legend, it can be located to the left, to the right, on top or
-on bottom of the graph.</li>
-<li><b>Curve Type</b> - this allows to set the representation of graphs in
-your presentations. You can see only <b>Points</b>, points connected with
-<b>Lines</b> or points connected with smooth <b>Splines</b>.</li>
-<li><b>Marker Size</b> - this submenu allows you to set the size of
-markers in your graphs</li>
-<li><b>Horizontal & Vertical Axis Scale</b> - this submenu allows you to set
-the scale for vertical and horizontal axes. It can be either <b>Linear</b> or
-<b>Logarithmic</b></li>
-<li>Background Color - this submenu allows to select the background
-color. Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-<br>
-<li><b>Graph Supervisor</b></li>
-<ul>
-<li><b>Background Color</b> - this submenu allows to select background
-color. Click on the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-<li><b>Title Color</b> - this submenu allows to select title color. Click on
-the colored line to access to the
-\ref select_color_and_font_page "Select Color" dialog box.</li>
-</ul>
-</ul>
-
-<br><h2>Directories Preferences</h2>
-
-\image html pref13.png
-
-<ul>
-<li>
-<b>Quick Directory List</b> - this section allows to create and manage
-a custom quick directory list. To add a directory in the list, press
-the "Add directory" button:
-\image html image70.gif
-
-then the "<b>...</b>" button and browse the data tree for the
-directory you need.
-The "Up" and "Down" buttons(see the picture below) help you to sort
-the directories in the list:
-\image html image73.gif
-
-\image html image75.gif
-To remove the selected directory from the list, press the "Delete"
-button:
-\image html image72.png
-</li>
-</ul>
-
-<br><h2>Object Browser Preferences</h2>
-
-\image html pref14.png
-
-<ul>
-<li><b>Enable auto-hiding</b> checkbox - hides the
-\ref using_find_tool_page if nor used</li>
-<li><b>Object browser settings</b></li>
-<ul>
-<li><b>Auto size for the first column</b> - this checkbox enables automatic
-resizing for the first column.</li>
-<li><b>Auto size for other columns</b> - this checkbox enables
-automatic resizing for the other columns.</li>
-<li><b>Resize columns after expanding an item</b> - this checkbox enables
-resizing columns on expanding an object browser item.</li>
-</ul>
-</ul>
-
-<ul>
-<li><b>Default columns</b> - these checkboxes allow to display or hide <b>Value</b>,
-<b>Entry</b>, <b>IOR</b> and <b>Reference entry</b> columns in the Object Browser.</li>
-</ul>
-
-*/
\ No newline at end of file
\page select_color_and_font_page Select Color and Font
+\anchor select_color_dlg
<b>Select Color</b> and <b>Select Font</b> menus are used in many
Preferences.
corner of the window, then click <b>Add to Custom Colors</b> button. The
chosen color will be added to <b>Custom Colors</b> table.
+\anchor font_color_dlg
<br><h2>Select font</h2>
\image html selectfont.png
possibility to use not only Latin and Latin Extended but also
Cyrillic, Greek, Arabic, Runic and many other subsets.
-*/
\ No newline at end of file
+*/
\page setting_preferences_page Setting Preferences
-In \b SALOME you can set preferences for each module in the common editor
-of preferences. \subpage salome_preferences_page "SALOME preferences" refer to the whole GUI SALOME
-session, other preferences are module-specific and are accessible only
-after you load a respective module.
-It is possible to set preferences for
-\subpage geometry_preferences_page "Geometry",
-\subpage mesh_preferences_page "Mesh" and
-\subpage postpro_preferences_page "Post-Pro" modules.
+All user preferences of \b SALOME application can be customized using the
+common \b Preferences dialog box. This dialog can be open using the
+<b><i>File > Preferences...</i></b> menu item.
+
+The \b Preferences dialog box consists of two parts:
+- Available preferences sections are listed in the left part of the dialog
+box; usually this list contains "SALOME" item that specifies general
+application preferences and a separate section for each SALOME module
+available in the current session.
+- The tabbed widget at the right side of the dialog box provides
+controls that can be used to customize the preferences.
+
+\note The preferences for modules become accessible only after
+explicit loading of these modules. Until then the dialog box will
+show the corresponding warning message.
+
+More detailed information about preferences for certain modules can be found in the User's guide of the corresponding module.
+
+General application preferences are specified in the \b SALOME section
+of the \b Preferences dialog box. These preferences affect on the
+application look-n-feel and common functionality.
+
+If the study has just been started and other
+modules have not been loaded yet, it will be possible to change only the settings which refer to
+the whole GUI SALOME session.
+
+<h2>General Preferences</h2>
+
+\image html pref_salome_general.png
+
+- <b>Language</b>
+ - <b>Current language</b> - the language used by the application
+ GUI. The language change will come in force only after the application is restarted.
+- <b>Look and feel</b>
+ - <b>Opaque resize</b> - force opaque resize mode for viewers area (tabbed workspace).
+ Clear this checkbox for less perfomant workstations.
+ - <b>Drop-down buttons in toolbars for action groups</b> - when
+ checked, the action groups are represented in the viewer toolbars as
+ a single drop-down button, switchable by the user. Otherwise, all
+ the buttons from the action groups are displayed in the toolbar.
+- <b>Study Properties</b>
+ - <b>Multi file save</b> - if checked in, your study will be saved in
+ several HDF files (one basic HDF file which will store the main
+ information about the saved study and several other files for the
+ data created by each component used during the study
+ session). Opening of this study requires that \b ALL saved files
+ should be stored in the \b SAME directory. If you would like to
+ copy your saved study in another directory or machine, you should
+ copy all stored files. Otherwise, if you try to open this study,
+ some data will be lost and it will lead to invalid functioning of
+ the SALOME platform.
+ - <b>ASCII save</b> - if checked in, your study will be saved in
+ ASCII format file (or files).
+ - <b>Store positions of windows</b> - if checked in, positions of windows
+ will be saved in a special file at the end of the current session and
+ then restored for a new session.
+ - <b>Auto-save interval (min)</b> - allows to specify the time interval (in
+ minutes) for automatic study saving operation. If the time interval is
+ equal to 0 ("Disabled" value is shown) the automatic saving is not performed.
+ - <b>Store/restore last GUI state</b> - if checked in, all GUI settings are
+ saved with the rest of the data whenever you save the study. When the
+ study is reopened, the GUI state is restored.
+ - <b>Multi file python dump</b> - allows to generate multiple files
+ (separately for each component) for dumping of a study to a python script.
+ If the option is disabled, the study is dumped to a single python script.
+ - <b>Publish in study in python dump</b> - if this option is switched on,
+ the Python script resulting from Dump Python operation will
+ include commands related to the publication of the data in the
+ study (if this option is supported by specific module).
+ - <b>Save GUI state in python dump</b> - if this option is switched on,
+ the Python script resulting from Dump Python operation will
+ include commands related to the GUI state.
+- <b>External browser</b> - allow to define what browser will
+ be used to show SALOME reference manuals: internal (built-in
+ SALOME browser) or external (IE, Netscape, Mozilla, ...). In
+ addition, it is possible to specify
+ - \b Application - this option allows you to set an external browser (IE,
+ Netscape) which will be used for viewing SALOME reference manuals. By
+ default, Mozilla is used.
+ - \b Parameters - additional parameters required for launching of
+ the external browser (if applicable).
+- <b>Python console</b> - here you can quickly set the parameters
+ (style, size, face) of the \ref font_color_dlg "font" used in
+ embedded Python console.
+- <b>Show MRU items</b> - allows to define the maximum \b Number of
+items in <b>Most Recently Used</b> list and the <b>Link type</b>:
+ - \b Long - shows the full path to the file.
+ - \b Short - shows the file name only.
+ - \b Auto - shows full paths to the files only if some files from
+different locations have the same name.
+
+\anchor occ_preferences
+<h2>OCC 3D Viewer Preferences</h2>
+
+\image html pref_salome_occviewer.png
+
+- <b>Trihedron</b> - viewer trihedron settings:
+ - <b>Size</b> - size of the coordinate axes (global trihedron)
+ displayed in the viewer.
+ - <b>Relative size</b> - if this option is switched on, trihedron
+ axes scale to fit the size of the scene displayed in 3D viewer.
+ - <b>Show static trihedron</b> - allows to show/hide the static
+ mini-trihedron located in the bottom-left corner of the viewer.
+- <b>Number of isolines</b> - this submenu allows to specify the
+ number of isolines along the axes of coordinates:
+ - <b>Along U</b> and
+ - <b>Along V</b>
+- <b>Background</b> - specifies the default background for the viewers,
+ separately for (for more details, refer to the \ref occ_background
+ "this page"):
+ - <b>3D View</b>
+ - <b>XZ View</b>
+ - <b>YZ View</b>
+ - <b>XY View</b>
+- <b>Navigation style</b> - this option allows to choose one of the
+ modes of work with mouse in OCC and VTK 3D viewers.
+ - <b>Salome Standard Controls</b> - allows to manipulate objects in the
+ viewer with the mouse and locked Ctrl button: increase or decrease the
+ zoom ratio with the left mouse button, translate object in any
+ direction with the central mouse button or rotate it with the right
+ mouse button.
+ - <b>Keyboard Free</b> - allows to manipulate objects in the viewer
+ with the mouse without locking Ctrl button. In this case the
+ operations are assigned to the buttons differently: rotation is made
+ with the left button, translation with the right and zoom with both
+ pressed in the same time.
+- <b>Zooming style</b> - this option allows to choose a zooming mode.
+ - <b>Relative to the view's center</b> - allows to zoom the view
+ relatively to its center.
+ - <b>Relative to the cursor</b> - allows to zoom the view
+ relatively to the current cursor position.
+
+\anchor vtk_preferences
+<h2>VTK 3D Viewer Preferences</h2>
+
+\image html pref_salome_vtkviewer.png
+
+- <b>Projection mode</b> - allows choosing between \b Orthogonal and
+\b Perspective projection mode.
+- <b>Background</b> - specifies the default background for the viewer;
+ for more details, refer to the \ref vtk_background "this page".
+- <b>Navigation style</b> - this option allows to choose one of the
+ modes of work with mouse in OCC and VTK 3D viewers (for more details
+ see \ref occ_preferences "preferences for OCC Viewer 3d").
+- <b>Zooming style</b> - this option allows to choose a zooming mode
+ (for more details see \ref occ_preferences "preferences for OCC Viewer 3d").
+- <b>Speed Increment</b> - defines the number of units by
+ which the speed increases or respectively decreases after pressing [+]
+ or [-] keyboard buttons.
+- <b>Modification Mode</b> - allows choosing between \b Arithmetic
+ and \b Geometrical progression used for zooming.
+- <b>Dynamic pre-selection</b> - switches dynamic pre-selection on/off.
+- <b>Trihedron</b> - viewer trihedron settings:
+ - <b>Size</b> - size of the coordinate axes displayed in the viewer.
+ - <b>Relative size</b> - if this option is switched on, trihedron
+ axes scale to fit the size of the scene displayed in 3D viewer.
+ - <b>Show static trihedron</b> - allows to show/hide the static
+ mini-trihedron located in the bottom-left corner of the viewer.
+- <b>Spacemouse</b> - a mouse-like manipulator device specially designed
+ for working with 3D presentations, objects, etc. You can reassign the
+ actions listed below to any of its buttons.
+ - <b>Decrease Speed Increment</b> - decreases by 1 the speed
+ increment used for the keyboard (same as [-] key).
+ - <b>Increase Speed Increment</b> - increase by 1 the speed
+ increment used for the keyboard (same as [+] key).
+ - <b>Dominant / combined switch</b> - toggles button to switch to
+ dominant or combined movements.
+- <b>AVI Recording</b>
+ - <b>Mode</b> - allows to choose from two recording regimes:
+ - <b>Recording all displayed frames</b> - records exactly at the
+ FPS rate specified by the user.
+ - <b>Recording at a given FPS</b> - records only when the contents
+ of the viewer change (some activity is performed). In the AVI file
+ non-recorded images are substituted with the copies of the latest
+ recorded image, which produces files with lower quality but requires
+ less system resources.
+ - <b>FPS</b> - allows to define the FPS (frames per second) rate for
+ the clip. Set greater value for better quality.
+ - <b>Quality</b> - allows to set the quality of the clip in the
+ interval between 0 and 100.
+ - <b>Progressive</b> - allows to record a progressive API file.
+- <b>Names of groups</b> - allows to specify parameters of the
+titles displayed in the viewer:
+ - <b>Text color</b> - allows selecting the text color;
+ - <b>Transparency</b> - allows selecting the text transparency.
+
+\anchor plot2d_preferences
+<h2>Plot 2D Viewer Preferences</h2>
+
+\image html pref_salome_plot2dviewer.png
+
+- <b>Show legend</b> - this options specifies if it's necessary to
+show legend by default.
+- <b>Legend Position</b> - this submenu allows to set the default position
+of the legend, it can be located to the left, to the right, on top or
+on bottom of the graph.
+- <b>Legend font</b> - this allows to set type and face for the font of Legend item.
+- <b>Curve Type</b> - this allows to set the representation of graphs in
+your presentations. You can see only <b>Points</b>, points connected with
+<b>Lines</b> or points connected with smooth <b>Splines</b>.
+- <b>Marker Size</b> - this submenu allows you to set the size of
+markers in your graphs.
+- <b>Horizontal</b> and <b>Vertical axis scale</b> - this submenus allow you to set
+the scale for vertical and horizontal axes. It can be either <b>Linear</b> or
+<b>Logarithmic</b>. Note that the <b>Logarithmic</b> scale can be used only
+if the minimum value of corresponding component (abscissa or ordinate)
+of all points displayed in the viewer is greater than zero.
+If this condition is not met, the scale is switched to <b>Linear</b>
+automatically, even if it is set to <b>Logarithmic</b>.
+- <b>Background color</b> - this submenu allows to select the background
+color. Click on the colored line to access to the
+\ref select_color_and_font_page "Select Color" dialog box.
+- <b>Legend font color</b> - this allows to select the color of the
+font of the legend item.
+- <b>Highlighted legend font color</b> - this submenu allows to select
+the color of the font of the selected legend item.
+- <b>Selection color</b> - this submenu allows to select the color of
+selected object in the viewer.
+- <b>Deviation marker color</b> - this submenu allows to select the
+color of the deviation marker.
+- <b>Deviation marker line width</b> allows to define line width of
+the deviation marker.
+- <b>Deviation marker tick size</b> allows to define size of the upper
+and lower horizontal lines of the deviation marker.
+
+<br><h2>Directories Preferences</h2>
+
+\image html pref_salome_directories.png
+
+- <b>Quick Directory List</b> - this section allows to create and manage
+a custom quick directory list. To add a directory in the list, press
+the "Add directory" button:
+\image html image70.png
+then the "<b>...</b>" button and browse the data tree for the
+directory you need.
+The "Up" and "Down" buttons(see the picture below) help you to sort
+the directories in the list:
+\image html image73.png
+\image html image75.png
+To remove the selected directory from the list, press the "Delete"
+button:
+\image html image72.png
+
+<br><h2>Object Browser Preferences</h2>
+
+\image html pref_salome_objbrowser.png
+
+- <b>Search Tool</b> - specifies behavior of the
+\ref using_find_tool_page "Search tool".
+ - <b>Enable auto-hiding</b> checkbox - hides the search tool
+ automatically after short perioud of time when it is not used.
+- <b>Look and feel</b>
+ - <b>Auto size for the first column</b> - this checkbox enables automatic
+ resizing for the first column.
+ - <b>Auto size for other columns</b> - this checkbox enables
+ automatic resizing for the other columns.
+ - <b>Resize columns after expanding an item</b> - this checkbox enables
+ resizing columns on expanding an object browser item.
+ - <b>Browse to the published object</b> - this combobox allows to enable
+ automatic browsing to the objects just published to the study (using GUI
+ dialogs only). It means that the object browser will be scrolled to the
+ published objects, make them visible if they are collapsed and select the
+ first of them. Three modes are allowed for activating this feature:
+ - <b>Never</b> - automatic browsing is disabled.
+ - <b>After Apply & Close only</b> - browsing is activated when the
+ dialog is accepted by <b>Apply & Close</b> or <b>Ok</b> buttons (or if
+ the objects are published without using a dialog, for example, by
+ clicking a context menu button) and not activated when the
+ <b>Apply</b> button is pressed and therefore the dialog remains visible.
+ - <b>Always</b> - automatic browsing is always enabled.
+- <b>Default columns</b> - these checkboxes allow to display or hide <b>Value</b>,
+<b>Entry</b>, <b>IOR</b> and <b>Reference entry</b> columns in the Object Browser.
+
+<br><h2>Shortcuts Preferences</h2>
+
+\image html pref_salome_shortcuts.png
+
+- <b>Shortcuts settings</b> widget allows to define custom shortcuts for
+various operations. To change keyboard sequence for a certain action - select the
+action and press the custom keys combination.
+
\subpage select_color_and_font_page "Font and color preferences"
-dialogs are often called from other \b Preferences dialogs.
+are most oftenly used types of user settings.
-\n When you change settings (click \b OK or \b Apply button) each module
+When you change settings (click \b OK or \b Apply button) each module
receives the notification about what preferences are changed. You can
also click \b Defaults button to restore default preferences or \b Close
-button to quit the menu without any changes.
-\n \b Import button allows to load a user file containing preferences
-from your home directory through a standard Import dialog box.
+button to quit the dialog box without any changes.
+
+\b Import button allows loading specific user file containing
+preferences from any location at the computer through a standard
+Import dialog box.
\image html import.png
-This file has no extension and by default starts with
-.SalomeApprc. followed by Salome version number. There exists one file
-for each Salome version in use.
-\n The preferences, set during the current study session, are
-automatically saved in this file at the end of the session. Next time
-you launch SALOME application, these preferences will be restored.
+The preferences files usually have *.xml extension. Also,
+preferences files automatically saved by the application (stored in the
+~/.config/salome directory) have no extension and by default start with
+.SalomeApprc. followed by SALOME version number. Usually there is a
+separate preferences file for each SALOME version in use. Preferences
+are saved to the file in the end of the working session and restored
+at the application start-up.
\note The preferences you set will be default preferences for all \b new
objects, but they are not retroactive and do not automatically apply
to the existing objects.
-*/
\ No newline at end of file
+*/
\b New - creates a new study. The study will be created
with default name \b Study1. It is possible to create
several studies, each accessible from the task bar.
+
\b Open - allows to open an existing study by browsing for it in a
standard Search File dialog box, choosing the required
*.hdf file and clicking \b Open button.
+
+\b Reopen - reloads the current study from the *.hdf file. This menu command
+can be used to reverse the study to the latest saved state.
+
\b Connect - allows to open an unloaded study.
\image html loadstudy2.png
Select one of the studies, which has been previously
</ul>
To confirm your choice click \b Save.
-<b>Notebook</b> - allows to manage study variables using \subpage using_notebook "NoteBook".
+\subpage using_notebook "Notebook" - allows to predefine study variables.
<b>Load Script</b> - allows to load a saved Python Script.
\image html studyproperties.png
<ul>
-<li>\b Author - allows to change the name of the study author</li>
-<li>\b Created - gives the date and time of Study creation</li>
+<li>\b Author - allows to change the name of the study author.</li>
+<li><b> Creation date</b> - gives the date and time of Study creation.</li>
<li>\b Locked - allows to lock the study for modifications.
-Just click on this field and choose \b Yes item. In this case your study will be locked for any modifications
+In case if \b Locked checkbox is checked your study will be locked for any modifications
for all users. Next time you try to edit it, you will see the
following warning message:
\image html lockedstudy.png </li>
-<li>\b Modified - allows to see if any modifications have been
+<li><b>Modified/Not Modified</b> - allows to see if any modifications have been
introduced into study since its last save. </li>
+<li><b>Length units</b> - allows to change the units of the study.</li>
+<li>\b Comment - allows to change the comment of the study.</li>
<li>\b Modifications - allows to view the list of changes made in the study.
-In this dialog box click on the \b Modifications field and scroll it
-down. Each record contains the date and time of the
+Each record contains the date and time of the
modification and the name of the user, who has introduced it.</li>
</ul>
\b Exit - unlike \b Close, closes not only the current, but all opened
Salome studies.
-*/
\ No newline at end of file
+*/
selCount = salome.sg.SelectedCount() # total number of selected items
for i in range(selCount):
print salome.sg.getSelected(i) # print entry ID of i-th selected item
+\endcode
+\code
# get list of all selected objects' IDs
selected = salome.sg.getAllSelected()
\page themes_page Theme
-\b Theme dialog is used for customization of the look and feel of
-Salome. To open it, select in the Main menu <b>View -> Theme </b>.
+The look and feel of the SALOME desktop can be customized by the user
+via SALOME style preferences.
+
+<b>SALOME style prefereces</b> dialog box is used for customization of
+the look and feel of SALOME style. To open it, select in the Main menu
+<b>View -> Theme </b> item.
\image html theme1.png
-It is possible to choose a predefined color scheme in the list to the left
-or to edit your custom color scheme using the controls to the right.
+It is possible to choose a predefined scheme in the list to the left
+or to create a custom scheme using the controls to the right.
+
+The dialog box contains two pages.
-\b Quick button allows to apply color change made in one position to all
-other positions using this color.
+The first page allows specifying the color palette.
+- \b Quick button allows automatic color palette definition basing on
+the main color specified by the user.
\image html theme2.png
-<ul>
-<li>\b Font group allows to edit the default font used in Salome menus.</li>
-<li>\b Lines group allows to apply dashing to Salome elements. </li>
-<li><b> Widgets rounding</b> allows to round corners of Salome dialog
-boxes and define their parameters.</li>
-<li>\b Handle allows to define parameters of the handle.</li>
-<li><b> Widget effect </b> allows to apply special effects to Salome
-dialog boxes.</li>
-</ul>
-*/
\ No newline at end of file
+The second page allows specifying different properties of the theme:
+
+- \b Font group allows to edit the font used in menus, dialog boxes, etc.
+- \b Lines group allows to apply dashing to Salome elements.
+- <b>Widgets rounding</b> allows to round corners of Salome dialog
+boxes and define their parameters.
+- \b Handle allows to define parameters of the handle.
+- <b>Widget effect</b> allows to apply special effects to Salome
+dialog boxes.
+
+If SALOME Theme is not used (<b>Use SALOME Style</b> checkbox is
+switched off), the global system settings are applied (for
+example, KDE settings). So, the look and feel of the application (for
+example, palette and/or font) can be customized by using the Qt utility
+<em>qtconfig</em>.
+
+
+*/
\page using_notebook Using NoteBook
-SALOME <b>NoteBook</b> is destined for managing numerical and boolean
-parameters (variables) which are used to create and modify objects in
-different components.
+SALOME <b>NoteBook</b> allows to predefine numerical and boolean
+parameters (variables).
To open the <b>NoteBook</b> choose <b>File > Notebook</b>, the following
dialog box will appear:
to the study.
\note The dialog will not be validated until at least one of variables in
-the table has invalid name or value (marked by red color). Names of
+the table has an invalid name or value (marked by red color). The names of
variables should be unique and their values should be numerical (integer or
double) or boolean ("True" / "False").
+Here is an example of setting of variables in python scripts:
+\code
+import salome_notebook
+
+notebook = salome_notebook.notebook
+
+notebook.set("Length", 100)
+notebook.set("Radius", 37.5)
+notebook.set("Flag", True)
+\endcode
+
+Later these values can be used as parameters for any operations in
+various components.
+
*/
\ No newline at end of file
The Object Browser may contain supplementary attributes of the objects
displayed in additional columns. By default, these columns are not
displayed - displaying/hiding these columns is possible through
-\ref salome_preferences_page "setting study preferences" or
+\ref setting_preferences_page "setting study preferences" or
right-clicking on the attributes bar and toggling the necessary
attributes.
</ul>
\note <b>Entry, IOR and Reference entry</b> attributes are displayed for debugging purposes only.
-
-*/
\ No newline at end of file
+
+<h2> Enable sorting </h2>
+
+By default the objects in the object browser are sorted in the creation order.
+\n
+However, it is possible to enable sorting
+in the alphabetical order (or the reverse alphabetical order) by right
+clicking in the header of the tree (near the "Name" field) and
+checking "enable sorting" in the popup menu.
+\n
+It is possible to use the arrow near "Name" to reverse the order.
+If "enable sorting" is unchecked, the objects are sorted in the default order again.
+
+*/
\page viewers_page Viewers
-Salome provides a selection of viewers for data representation. Some
-of them are used in several modules, others are used only in one
-module or in some particular cases.
-
-
-<ul>
-<li>\subpage occ_3d_viewer_page "OCC (Open CasCade) 3D viewer" has been developed on the basis of Open
-CASCADE Technology. This is the default viewer for Geometry Module,
-providing good representation of construction and transformation of
-geometrical objects. Only this viewer allows to work with groups and
-sub-shapes. This viewer can also work in Mesh module, however, it
-doesn't allow to visualize meshes. </li>
-<li>\subpage vtk_3d_viewer_page "VTK 3D viewer" has been developed
-basing on Visualization ToolKit library by Kitware, Inc. This is the default viewer for Mesh Module, allowing to
-visualize meshes. It is also used in Post-Pro module for all 3D presentations.</li>
-<li>\subpage plot2d_viewer_page "Plot 2D viewer" has been developed
-basing on open-source Qwt library. It is destined for the representation of 2d
-plots and graphs in Post-Pro module.</li>
-<li>GL 2D viewer - general purpose OpenGL-based viewer, which can be
-used for visualization of 2D scenes.</li>
-<li>QxScene 2D viewer - has been developed on the basis of
-QGraphicsView scene by Trolltech. This viewer is used in YACS module
-for visualization of computation schemes.</li>
-</ul>
+SALOME provides a set of viewers for data representation. SALOME GUI
+module includes several 2D and 3D viewers, that are used for
+different purposes within the platform:
+
+- \subpage occ_3d_viewer_page has been developed on
+the basis of Open CASCADE Technology (http://www.opencascade.org).
+This is the default viewer for SALOME Geometry module, it provids good
+representation of construction and transformation of geometrical objects.
+
+- \subpage vtk_3d_viewer_page has been developed
+basing on Kitware Visualization ToolKit library (http://www.vtk.org).
+This is the default viewer for SALOME Mesh module, where it is used
+for visualization of meshes. It is also used in SALOME Post-Pro module
+for all 3D presentations.
+
+- \subpage plot2d_viewer_page has been developed
+basing on the open-source Qwt library (http://qwt.sourceforge.net).
+It is used, for example, for the representation of 2D plots and graphs
+in the SALOME Post-Pro module.
+
+- \subpage gl_2d_viewer_page is a general purpose
+OpenGL-based viewer, which can be used for visualization of 2D
+scenes. This type of viewer is not currently used in SALOME platform
+directly, but can be used in custom modules for 2D visualization purposes.
+
+- \subpage qxscene_2d_viewer_page has been
+developed on the basis of Qt QGraphicsView scene. This viewer is used
+in SALOME YACS module for visualization of computation schemes.
*/
\page vtk_3d_viewer_page VTK 3D Viewer
+<h2>Operations</h2>
+
The functionalities of VTK viewer are available via its Viewer
Toolbar. Buttons marked with small downward triangles have extended
functionality which can be accessed by locking on them with left mouse
button.
-\image html image157.gif "Viewer Toolbar"
+\image html vtkviewer_toolbar.png
+<hr>
+
+\image html vtk_view_camera_dump.png
+<b>Dump View</b> - exports an object from the viewer in bmp, png or
+jpeg image format.
<hr>
-\image html image77.png
-\n <center><b>Dump View</b> - exports an object from the viewer in bmp, png, jpg
-or jpeg image format.</center>
+
+\image html vtk_view_style_switch.png
+
+<b>Interaction style switch</b> - allows to switch between standard
+and "keyboard free" interaction styles. "Keyboard free" style allows
+to process all view transformations without using keyboard (only by
+mouse) and perform selection in view by pressing "S" key. By default,
+rotation in this mode is performed by left mouse button, panning - by
+middle mouse button, zooming - by left and middle mouse buttons
+pressed simultaneously.
+<hr>
+
+\image html vtk_view_zooming_style_switch.png
+
+<b>Zooming style switch</b> - allows to switch between standard
+(zooming at the center of the view) and advanced (zooming at the
+current cursor position) zooming styles. The second mode is available
+only for parallel (non-perspective) view's mode.
<hr>
-\image html image88.gif
-\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
+\image html vtk_view_highlight.png
+
+<b>Dynamic pre-selection switch</b> - allows to switch on/off dynamic
+pre-selection of objects. When the dynamic pre-selection is switched
+on, an objects can be selected by clicking the point/cell belonging to
+this object, with some performance loss. Switch dynamic pre-selection
+off to have a good performance on big objects (for example, huge
+meshes).
<hr>
-\image html image96.png
-\n <center><b>Fit all</b> - scales the presentation so that it could
-fit within the Viewer boundaries. </center>
+\image html vtk_view_triedre.png
+
+<b>Show/Hide Trihedron</b> - shows or hides coordinate axes.
<hr>
-\image html image97.png
-\n <center><b>Fit area</b> - resizes the view to place in the visible area
-only the contents of a frame drawn with pressed left mouse button.</center>
+\image html vtk_view_fitall.png
+
+<b>Fit all</b> - scales the presentation so that it could fit within
+the Viewer boundaries.
<hr>
-\image html image98.png
-\n <center><b>Zoom</b> - allows to zoom in and out.</center>
+\image html vtk_view_fitarea.png
+
+<b>Fit area</b> - resizes the view to place in the visible area only
+the contents of a frame drawn with pressed left mouse button.
<hr>
-\image html image99.png
-\n <center><b>Panning</b> - if the represented objects are greater that the
-visible area and you don't wish to use <b>Fit all</b> functionality, click on
-this button and you'll be able to drag the scene to see its remote
-parts.</center>
+\image html vtk_view_zoom.png
+
+<b>Zoom</b> - allows to zoom in and out.
<hr>
-\image html image100.png
-\n <center><b>Global panning</b> - allows to select a point to be the
-center of the presentation showing all displayeed objects in the
-visible ares <center>
+\image html vtk_view_pan.png
+
+<b>Panning</b> - if the represented objects are greater that the
+visible area and you don't wish to use <b>Fit all</b> functionality,
+click on this button and you'll be able to drag the scene to see its
+remote parts.
<hr>
-\image html view_rotation_point.png
-\n <center><b>Change rotation point</b> - allows to to choose the point around
-which the rotation is performed.</center>
+\image html vtk_view_glpan.png
+
+<b>Global panning</b> - allows to select a point to be the center of
+the presentation showing all displayed objects in the visible ares.
+<hr>
+
+\image html vtk_view_rotation_point.png
+
+<b>Change rotation point</b> - allows to to choose the point around
+which the rotation is performed.
\image html set_rotation_point_dialog1.png
-<center>By default the rotation point is located in the Center of the bounding
-box of an object.</center>
+By default the rotation point is located in the Center of the bounding
+box of an object.
\image html set_rotation_point_dialog2.png
-<center>Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
-define the coordinates of the rotation point manually.</center>
+Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
+define the coordinates of the rotation point manually.
+
+- <b>Set to Origin</b> button restores the default rotation point
+ coordinates.
+
+- <b>Select Point from View</b> button allows to select the rotation
+ point in the 3D Viewer.
-<b>Set to Origin</b> button restores the default rotation point
-coordinates.\n
-<b>Select Point from View</b> button allows to select the rotation
-point in the 3D Viewer.
<hr>
-\image html image89.png
-\n <center><b>Rotation</b> - allows to rotate the selected object using the
-mouse.</center>
+\image html vtk_view_rotate.png
-\image html image102.gif
+<b>Rotation</b> - allows to rotate the selected object using the
+mouse.
+<hr>
-<center>These buttons orientate the scene strictly about coordinate axes.</center>
+\image html vtk_view_front.png
+\image html vtk_view_back.png
+\image html vtk_view_top.png
+\image html vtk_view_bottom.png
+\image html vtk_view_left.png
+\image html vtk_view_right.png
+
+These buttons orientate the scene strictly about coordinate axes:
+\b Front, \b Back, \b Top, \b Bottom, \b Left or \b Right side.
+<hr>
+
+\image html vtk_view_anticlockwise.png
+
+<b>Rotate counterclockwise</b> - rotates view 90° counterclockwise.
<hr>
-\image html image91.png
-\n <center><b>Reset</b> - restores the default position (isometric) of
-objects in the scene.</center>
+\image html vtk_view_clockwise.png
+
+<b>Rotate clockwise</b> - rotates view 90° clockwise.
<hr>
-\image html urbutton.png
-\n <center><b>Update Rate</b> - allows to define the Update Rate for
-the presentations displayed in the viewer</center>
+\image html vtk_view_reset.png
+
+<b>Reset</b> - restores the default position (isometric) of objects in
+the scene.
+<hr>
+
+\image html vtk_view_update_rate.png
+
+<b>Update Rate</b> - allows to define the Update Rate for the
+presentations displayed in the viewer.
\image html updaterate.png
-<ul>
-<li><b>Desired Update Rate, FPS</b> - allows to set the target Update
-Rate</li>
-<li><b>Still Update Rate, FPS</b> - allows to set the Update Rate for
-the periods when both the user and the application do not perform any
-actions in the viewer</li>
-<li><b>Current Update Rate, FPS</b> - shows the Update Rate currently
-available on your configuration</li>
-<li><b>Number of Cells</b> - shows the number of cells currently in
-display</li>
-</ul>
+- <b>Desired Update Rate, FPS</b> - allows to set the target Update
+ Rate
+
+- <b>Still Update Rate, FPS</b> - allows to set the Update Rate for
+ the periods when both the user and the application do not perform
+ any actions in the viewer
+
+- <b>Current Update Rate, FPS</b> - shows the Update Rate currently
+ available on your configuration
+
+- <b>Number of Cells</b> - shows the number of cells currently in
+ display
-\image html image108.png
-\n <center><b>Scaling</b> - represents objects deformed (stretched or
-stuffed) along the axes of coordinates.</center>
<hr>
-\image html image109.gif
-\n <center><b>Graduated axes</b> - allows to define parameters of axes
-and graduate them.</center>
+\image html vtk_view_scaling.png
+
+<b>Scaling</b> - represents objects deformed (stretched or stuffed)
+along the axes of coordinates.
+<hr>
+
+\image html vtk_view_graduated_axes.png
+
+<b>Graduated axes</b> - allows to define parameters of axes and
+graduate them.
\image html graduatedaxes1.png
-<ul>
-<li><b>Axis name</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the axis name is displayed in the
-viewer.</li>
-<li><b>Name</b> - allows to redefine the name of the axis.</li>
-<li><b>Font</b> - allows to define color and properties of the font of
-axis name.</li>
-</ul>
-<li><b>Labels</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the labels are displayed in the
-viewer.</li>
-<li><b>Number</b> - allows to define the number of labels.</li>
-<li><b>Offset</b> - allows to define the distance between labels.</li>
-<li><b>Font</b> - allows to define color and properties of the font of
-labels names.</li>
-</ul>
-<li><b>Tick marks</b></li>
-<ul>
-<li><b>Is visible</b> - if checked the tick marks are displayed in the
-viewer.</li>
-<li><b>Length</b> - allows to define the length of tick marks.</li>
-</ul>
-<li><b>Is visible</b> - if checked the axis is displayed in the
-viewer. </li>
-</ul>
-
-*/
\ No newline at end of file
+- <b>Axis name</b> - if checked the axis name is displayed in the viewer.
+
+ - <b>Name</b> - allows to redefine the name of the axis.
+
+ - <b>Font</b> - allows to define color and properties of the font of axis name.
+
+- <b>Labels</b> - if checked the labels are displayed in the viewer.<
+
+ - <b>Number</b> - allows to define the number of labels.
+
+ - <b>Offset</b> - allows to define the distance between labels.
+
+ - <b>Font</b> - allows to define color and properties of the font of labels names.
+
+- <b>Tick marks</b> - if checked the tick marks are displayed in the viewer.
+
+ - <b>Length</b> - allows to define the length of tick marks.
+
+- <b>Is visible</b> - if checked the axis is displayed in the viewer.
+
+<hr>
+
+\image html vtk_view_parameters.png
+
+<b>Change View Parameters</b> - this button provides access to the
+dialog box allowing customization different parameters of the view.
+
+\image html vtk_view_parameters_dlg.png
+
+- <b>Projection Mode</b> - switchs to the Orthogonal / Perspective
+ projection mode
+
+- <b>Focal Point</b> - allows to specify the focal point of the view
+
+ - <b>Set to Bounding Box Center</b> - chooses the center of the
+ bounding box of the current scene as the focal point.
+
+ - <b>Set to Origin</b> - chooses the global coordinates system origin as
+ the focal point
+
+ - <b>Select Point from View</b> - allows to specify the focal point by the
+ direct selection of a point in the view window
+
+ - <b>X</b>, <b>Y</b>, <b>Z</b> - allows to input the coordinates of the focal
+ point directly
+
+- <b>Camera Position</b> - allows to specify the position of the view camera:
+
+ - <b>Absolute Coordinates</b> - either in absolute coordinates,
+
+ - <b>Relative to Focal Point</b> - or as a offset to the focal point;
+
+ - <b>Projection Direction</b> - allows specify the direction of the
+ projection vector;
+
+ - <b>Focal Distance</b> - the focal distance value;
+
+ - <b>View Up Direction</b> - direction of the "view up" vector.
+
+- <b>Zooming</b> - the current zoom factor (available in the <b>Orthogonal
+ mode</b> only)
+
+- <b>View Angle</b> - the current view angle (available in the <b>Perspective
+ mode</b> only)
+
+<hr>
+
+\image html vtk_view_sync.png
+
+<b>Synchronize view</b> - allows to synchronize 3d view
+parameters. This button has two states - checked and
+unchecked. Clicking on this button opens a drop-down menu listing the
+compatible 3d views. As soon as the user selects any view from the
+list, the parameters (view point, position, zoom coefficient, etc.) of
+the current view are synchronized with the selected view (static
+synchronization).
+
+In addition, when this button is in the "checked" state, the dynamic
+synchronization of the views is performed, i.e. any zoom, pan, rotate
+or other view operation done in one view is automatically applied to
+the other view.
+<hr>
+
+\image html vtk_view_parallel.png
+
+<b>Orthogonal mode</b> - Switches the view to the orthogonal mode.
+<hr>
+
+\image html vtk_view_perspective.png
+
+<b>Perspective mode</b> - Switches the view to the perspective mode.
+<hr>
+
+\image html vtk_view_recording_start.png
+\image html vtk_view_recording_play.png
+\image html vtk_view_recording_pause.png
+\image html vtk_view_recording_stop.png
+
+These buttons allow recording viewing operations as a video file in
+the AVI format using external software (jpeg2yuv):
+
+- <b>Start recording</b> - specify parameters and start recording;
+
+- <b>Pause recording</b> - suspend recording;
+
+- <b>Continue recording</b> - resume recording;
+
+- <b>Stop recording</b> - stop recording.
+
+<hr>
+
+\anchor vtk_background
+<h2>Background</h2>
+
+VTK Viewer background can be customized using the "Change background"
+popup menu command that opens the following dialog box:
+
+\image html change_background_dlg.png
+
+The following types of the background are supported:
+
+- Single color: the background is colored with the solid color
+ specified by the user in the dialog box.
+
+- Gradient background: the background is gradiently colored according
+ to two colors and the gradient type specified in the dialog
+ box. The following types of background are supported:
+
+ - Horizontal
+
+ - Vertical
+
+ - First diagonal
+
+ - Second diagonal
+
+ - First corner
+
+ - Second corner
+
+ - Third corner
+
+ - Fourth corner
+
+- Image: allows to set image as viewer background and define filling type:
+
+ - Center: the image is located at the center of the viewer backgound
+
+ - Tile: the image fills the entire viewer backgound one by one
+
+ - Stretch: the image is stretched to the entire viewer backgound.
+
+
+Default background for the viewer is specified via the
+\ref vtk_preferences "application preferences".
+
+*/
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-</head>
-<body>
-<hr style="width: 100%; height: 2px;">
-<div style="text-align: center;">Copyright © 2003-2009 CEA, EDF<br>
-</div>
+ <li class="footer"></li>
+ </ul>
+ </div>
+ <div class="footer1">
+ <div style="text-align: center;">
+ Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
+ </div>
+ </div>
</body>
</html>
+
\ No newline at end of file
+++ /dev/null
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>$title</title>
- <link href="doxygen.css" rel="stylesheet" type="text/css">
-</head>
-<hr>
-<center>
-SALOME documentation central
-</center>
-<hr>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vasily Rusyaev (Open Cascade NN)
# Module : doc
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST += images static
+EXTRA_DIST += images input static/footer.html static/doxygen.css
+
+tuidocdir = $(docdir)/tui/GUI
+tuidoc_DATA = images/head.png
dev_docs: doxyfile
echo "Running doxygen in directory: "`pwd`; \
fi;
uninstall-local:
- rm -rf $(DESTDIR)$(docdir)/tui/GUI
+ @test -d $(DESTDIR)$(tuidocdir) && chmod -R +w $(DESTDIR)$(tuidocdir) ; \
+ for filen in `find $(DESTDIR)$(tuidocdir) -mindepth 1 -maxdepth 1` dummy ; do \
+ case $${filen} in \
+ dummy ) ;; \
+ $(DESTDIR)$(tuidocdir)/head.png ) ;; \
+ * ) echo "removing $${filen}" && rm -rf $${filen} ;; \
+ esac ; \
+ done
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# Doxyfile 1.4.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "GUI Module Programming Guide v.@VERSION@"
+PROJECT_NAME = "SALOME GUI Developer"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = GUI
CREATE_SUBDIRS = NO
INPUT = @top_srcdir@/src \
@top_srcdir@/bin \
@top_srcdir@/idl \
- @top_builddir@/bin
-FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@
+ @top_builddir@/bin \
+ @srcdir@/input
+FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@ *.doc
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_FILE_EXTENSION = .html
-HTML_HEADER = @srcdir@/static/myheader.html
+HTML_HEADER = @builddir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
HTML_STYLESHEET = @srcdir@/static/doxygen.css
HTML_ALIGN_MEMBERS = YES
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = jpg
+DOT_IMAGE_FORMAT = png
+DOT_FONTNAME = Arial
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
-H1 {
- text-align: center;
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+ font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+ font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+ font-size: 150%;
+}
+
+h2 {
+ font-size: 120%;
+}
+
+h3 {
+ font-size: 100%;
+}
+
+dt {
+ font-weight: bold;
+}
+
+div.multicol {
+ -moz-column-gap: 1em;
+ -webkit-column-gap: 1em;
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+ margin-top: 2px;
+}
+
+p.endli {
+ margin-bottom: 0px;
+}
+
+p.enddd {
+ margin-bottom: 4px;
+}
+
+p.endtd {
+ margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+ font-weight: bold;
+}
+
+span.legend {
+ font-size: 70%;
+ text-align: center;
+}
+
+h3.version {
+ font-size: 90%;
+ text-align: center;
+}
+
+div.qindex, div.navtab{
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+}
+
+div.qindex, div.navpath {
+ width: 100%;
+ line-height: 140%;
+}
+
+div.navtab {
+ margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+ color: #3D578C;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.contents a:visited {
+ color: #4665A2;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.qindex {
+ font-weight: bold;
+}
+
+a.qindexHL {
+ font-weight: bold;
+ background-color: #9CAFD4;
+ color: #ffffff;
+ border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+ color: #ffffff;
+}
+
+a.el {
+ font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+ color: #4665A2;
}
-CAPTION {
- font-weight: bold
+a.codeRef {
+ color: #4665A2;
}
-/* Link in the top navbar */
-A.qindex {}
+/* @end */
-A.qindexRef {}
+dl.el {
+ margin-left: -1cm;
+}
-/* Link to any cross-referenced Doxygen element */
-A.el {
- text-decoration: none;
- font-weight: bold
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 105%;
}
-A.elRef {
- font-weight: bold
+pre.fragment {
+ border: 1px solid #C4CFE5;
+ background-color: #FBFCFD;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
+ overflow: auto;
+ word-wrap: break-word;
+ font-size: 9pt;
+ line-height: 125%;
+}
+
+div.ah {
+ background-color: black;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px;
+ padding: 0.2em;
+ border: solid thin #333;
+ border-radius: 0.5em;
+ -webkit-border-radius: .5em;
+ -moz-border-radius: .5em;
+ box-shadow: 2px 2px 3px #999;
+ -webkit-box-shadow: 2px 2px 3px #999;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+ background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ font-weight: bold;
+}
+
+div.version {
+ border:1px solid #0000FF;
+ color: #CCCCCC;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+ margin: 5px;
+}
+
+div.footer1 {
+ background-color: #DFE5F1;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ margin-top: 15px;
}
+
-/* Link to any cross-referenced Doxygen element inside a code section
- (ex: header)
+div.groupText {
+ margin-left: 16px;
+ font-style: italic;
+}
+
+body {
+ background: white;
+ color: black;
+ margin: 0;
+}
+
+div.contents {
+ margin-top: 10px;
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+td.indexkey {
+ background-color: #EBEFF6;
+ font-weight: bold;
+ border: 1px solid #C4CFE5;
+ margin: 2px 0px 2px 0;
+ padding: 2px 10px;
+}
+
+td.indexvalue {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ padding: 2px 10px;
+ margin: 2px 0px;
+}
+
+tr.memlist {
+ background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+ text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+ vertical-align: middle;
+}
+
+div.center {
+ text-align: center;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+}
+
+div.center img {
+ border: 0px;
+}
+
+address.footer {
+ text-align: right;
+ padding-right: 12px;
+}
+
+img.footer {
+ border: 0px;
+ vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+ color: #008000
+}
+
+span.keywordtype {
+ color: #604020
+}
+
+span.keywordflow {
+ color: #e08000
+}
+
+span.comment {
+ color: #800000
+}
+
+span.preprocessor {
+ color: #806020
+}
+
+span.stringliteral {
+ color: #002080
+}
+
+span.charliteral {
+ color: #008080
+}
+
+span.vhdldigit {
+ color: #ff00ff
+}
+
+span.vhdlchar {
+ color: #000000
+}
+
+span.vhdlkeyword {
+ color: #700070
+}
+
+span.vhdllogic {
+ color: #ff0000
+}
+
+/* @end */
+
+/*
+.search {
+ color: #003399;
+ font-weight: bold;
+}
+
+form.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+
+input.search {
+ font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #e8eef2;
+}
*/
-A.code {
- text-decoration: none;
- font-weight: normal;
- color: #4444ee
+
+td.tiny {
+ font-size: 75%;
}
-A.codeRef {
- font-weight: normal;
- color: #4444ee
+.dirtab {
+ padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #A3B4D7;
}
-A:hover {
- text-decoration: none;
- background-color: lightblue
+th.dirtab {
+ background: #EBEFF6;
+ font-weight: bold;
}
-DL.el {
- margin-left: -1cm
+hr {
+ height: 0px;
+ border: none;
+ border-top: 1px solid #4A6AAA;
}
-/* A code fragment (ex: header) */
-DIV.fragment {
- width: 100%;
- border: none;
- background-color: #CCCCCC
+hr.footer {
+ height: 1px;
}
-/* In the alpha list (coumpound index), style of an alphabetical index letter */
-DIV.ah {
- background-color: #CCCCCC;
- font-weight: bold;
- color: #ffffff;
- margin-bottom: 3px;
- margin-top: 3px
+/* @group Member Descriptions */
+
+table.memberdecls {
+ border-spacing: 0px;
+ padding: 0px;
}
-/* Method name (+ type) */
-TD.md {
- background-color: lightblue;
- font-weight: bold;
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #F9FAFC;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
}
-/* Method parameter (some of them) */
-TD.mdname1 {
- background-color: lightblue;
- font-weight: bold; color: #602020;
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
}
-/* Method parameter (some of them) */
-TD.mdname {
- background-color: lightblue;
- font-weight: bold;
- color: #602020;
- width: 600px;
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #C4CFE5;
}
-/* Separator between methods group (usually empty, seems not supported by IE) */
-DIV.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- margin-bottom: 6px;
- font-weight: bold
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
}
-DIV.groupText {
- margin-left: 16px;
- font-style: italic;
- font-size: smaller
+.memTemplParams {
+ color: #4665A2;
+ white-space: nowrap;
}
-BODY { background: #FFFFFF
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #4665A2;
+ font-weight: normal;
+ margin-left: 9px;
+}
+
+.memnav {
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+ margin-left: 6px;
+}
+
+.memproto {
+ border-top: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 6px 0px 6px 0px;
+ color: #253555;
+ font-weight: bold;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ /* opera specific markup */
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ border-top-right-radius: 8px;
+ border-top-left-radius: 8px;
+ /* firefox specific markup */
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ -moz-border-radius-topright: 8px;
+ -moz-border-radius-topleft: 8px;
+ /* webkit specific markup */
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
+ background-image:url('nav_f.png');
+ background-repeat:repeat-x;
+ background-color: #E2E8F2;
+
+}
+
+.memdoc {
+ border-bottom: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 2px 5px;
+ background-color: #FBFCFD;
+ border-top-width: 0;
+ /* opera specific markup */
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ /* firefox specific markup */
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+ /* webkit specific markup */
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+ border-spacing: 6px 2px;
+}
+
+.params .paramname, .retval .paramname {
+ font-weight: bold;
+ vertical-align: top;
+}
+
+.params .paramtype {
+ font-style: italic;
+ vertical-align: top;
+}
+
+.params .paramdir {
+ font-family: "courier new",courier,monospace;
+ vertical-align: top;
+}
+
+
+
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+ font-family: sans-serif;
+ margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+ font-size: 9pt;
+ font-weight: bold;
+ margin: 5px;
+}
+
+.directory h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice. Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+ height: 61px;
+ background-repeat: no-repeat;
+ background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+ display: none;
+}
+*/
+
+.directory > h3 {
+ margin-top: 0;
+}
+
+.directory p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory div {
+ display: none;
+ margin: 0px;
+}
+
+.directory img {
+ vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+ font-size: 100%;
+ font-weight: bold;
+}
+
+.directory-alt h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+.directory-alt > h3 {
+ margin-top: 0;
+}
+
+.directory-alt p {
+ margin: 0px;
+ white-space: nowrap;
}
-/* BODY {
- background: url(sources/bg_salome.gif)
-} */
+.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+.directory-alt img {
+ vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+ margin-top: 8px;
+}
+
+address {
+ font-style: normal;
+ color: #2A3D61;
+}
+
+table.doxtable {
+ border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+ border: 1px solid #2D4068;
+ padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+ background-color: #374F7F;
+ color: #FFFFFF;
+ font-size: 110%;
+ padding-bottom: 4px;
+ padding-top: 5px;
+ text-align:left;
+}
+
+.tabsearch {
+ top: 0px;
+ left: 10px;
+ height: 36px;
+ background-image: url('tab_b.png');
+ z-index: 101;
+ overflow: hidden;
+ font-size: 13px;
+}
+
+.navpath ul
+{
+ font-size: 11px;
+ background-image:url('tab_b.png');
+ background-repeat:repeat-x;
+ height:30px;
+ line-height:30px;
+ color:#8AA0CC;
+ border:solid 1px #C2CDE4;
+ overflow:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.navpath li
+{
+ list-style-type:none;
+ float:left;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:url('bc_s.png');
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+ height:32px;
+ display:block;
+ text-decoration: none;
+ outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+ color:#6884BD;
+}
+
+.navpath li.footer
+{
+ list-style-type:none;
+ float:right;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:none;
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+ font-size: 8pt;
+}
+
+
+div.summary
+{
+ float: right;
+ font-size: 8pt;
+ padding-right: 5px;
+ width: 50%;
+ text-align: right;
+}
+
+div.summary a
+{
+ white-space: nowrap;
+}
-div.tabs {
- text-align: justify;
- font-weight: bold;
- color: #FFFFFF;
+div.ingroups
+{
+ font-size: 8pt;
+ padding-left: 5px;
+ width: 50%;
+ text-align: left;
}
-DIV.div-footer {
- margin-left: 1em;
- margin-right: 1em;
- margin-bottom: 0.2em;
- text-align: right;
- font-size: 9pt;
+div.ingroups a
+{
+ white-space: nowrap;
+}
+
+div.header
+{
+ background-image:url('nav_h.png');
+ background-repeat:repeat-x;
+ background-color: #F9FAFC;
+ margin: 0px;
+ border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+ padding: 5px 5px 5px 10px;
+}
+
+.title {
+ font-size: 150%;
+ font-weight: bold;
+ margin: 10px 2px;
+}
+
+dl
+{
+ padding: 0 0 0 10px;
+}
+
+dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
+{
+ border-left:4px solid;
+ padding: 0 0 0 6px;
+}
+
+dl.note
+{
+ border-color: #D0D000;
+}
+
+dl.warning, dl.attention
+{
+ border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+ border-color: #00D000;
+}
+
+dl.deprecated
+{
+ border-color: #505050;
+}
+
+dl.todo
+{
+ border-color: #00C0E0;
+}
+
+dl.test
+{
+ border-color: #3030E0;
+}
+
+dl.bug
+{
+ border-color: #C08050;
+}
+
+#projectlogo
+{
+ text-align: center;
+ vertical-align: bottom;
+ border-collapse: separate;
+}
+
+#projectlogo img
+{
+ border: 0px none;
+}
+
+#projectname
+{
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+/* font: 300% arial,sans-serif;*/
+ margin: 0px;
+ padding: 0px;
+}
+
+#projectbrief
+{
+ font: 120% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-/* In File List, Coumpound List, etc, 1st column of the index */
-TD.indexkey {
- background-color: #CCCCCC;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
+#projectnumber
+{
+ font: 50% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
}
-/* In File List, Coumpound List, etc, 2nd column of the index */
-TD.indexvalue {
- background-color: #CCCCCC;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
+#titlearea
+{
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ padding: 0px;
+ margin: 0px;
+ width: 100%;
+ border-bottom: 1px solid #5373B4;
}
-span.keyword { color: #008000 }
-span.keywordtype { color: #604020 }
-span.keywordflow { color: #e08000 }
-span.comment { color: #800000 }
-span.preprocessor { color: #806020 }
-span.stringliteral { color: #002080 }
-span.charliteral { color: #008080 }
-</DIV>
-<DIV class="div-footer">
-Generated on $datetime for $projectname by <A href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></A> $doxygenversion</DIV>
-</BODY>
-</HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+</head>
+<body>
+<div class="footer1">
+<!--hr style="width: 100%; height: 2px;"-->
+<div style="text-align: center;">
+Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
+</div>
+</div>
+</body>
+</html>
+++ /dev/null
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
- <title>Main Page</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="tabs.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-
-</body>
-</html>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# This Makefile is responsible of generating the client and server
# implementation of IDL interfaces for both C++ and python usage.
# The building process of the C++ files is in charge of each source
BASEIDL_FILES = SalomeApp_Engine.idl
+BASEIDL_FILES_PY=$(BASEIDL_FILES:%.idl=%_idl.py)
+
# This variable defines the files to be installed
dist_salomeidl_DATA = $(BASEIDL_FILES)
nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
libSalomeIDLGUI_la_CPPFLAGS = \
- -I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @KERNEL_CXXFLAGS@
libSalomeIDLGUI_la_LDFLAGS = -no-undefined -version-info=0:0:0
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
IDLPYFLAGS = @IDLPYFLAGS@ -I$(KERNEL_ROOT_DIR)/idl/salome
# potential problem on parallel make on the following - multiple outputs
$(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
done
-# uninstall-local removes too much, but it works in distcheck
+# we want to remove only staff generated for IDL files and nothing more
uninstall-local:
- rm -rf $(DESTDIR)$(salomepythondir)/*
+ @for modulen in SalomeApp ; do \
+ test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
+ test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
+ done ; \
+ for filen in $(BASEIDL_FILES_PY) ; do \
+ echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
+ done
mostlyclean-local:
-rm -f *.hh *.cc .depidl
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SalomeApp_Engine.idl
// Author : Alexander SLADKOV
-//
+
#ifndef __SalomeApp_Engine__
#define __SalomeApp_Engine__
* SalomeApp::Engine: special CORBA pseudo-engine for persistance needs of components
* with no CORBA-based Engine.
*/
- interface Engine : Engines::Component,
+ interface Engine : Engines::EngineComponent,
SALOMEDS::Driver
{
};
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAF_H
#define CAF_H
#if defined WIN32
-# if defined CAF_EXPORTS
+# if defined CAF_EXPORTS || defined caf_EXPORTS
# define CAF_EXPORT __declspec( dllexport )
# else
# define CAF_EXPORT __declspec( dllimport )
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = caf
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT ../STD
-LIBS += -L../../lib -lqtx -lsuit -lstd
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += CAF_EXPORTS
-
-HEADERS = CAF.h
-HEADERS += CAF_Application.h
-HEADERS += CAF_Operation.h
-HEADERS += CAF_Study.h
-HEADERS += CAF_Tools.h
-
-SOURCES = CAF_Application.cxx
-SOURCES += CAF_Operation.cxx
-SOURCES += CAF_Study.cxx
-SOURCES += CAF_Tools.cxx
-
-TRANSLATIONS = resources/CAF_images.ts \
- resources/CAF_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAF_Application.h"
#include "CAF_Tools.h"
QtxListAction* editUndo =
new QtxListAction( tr( "TOT_APP_EDIT_UNDO" ),
- resMgr->loadPixmap( "STD", tr( "ICON_EDIT_UNDO" ) ),
- tr( "MEN_APP_EDIT_UNDO" ), Qt::CTRL+Qt::Key_Z, desk );
+ resMgr->loadPixmap( "STD", tr( "ICON_EDIT_UNDO" ) ),
+ tr( "MEN_APP_EDIT_UNDO" ), Qt::CTRL+Qt::Key_Z, desk );
editUndo->setStatusTip( tr( "PRP_APP_EDIT_UNDO" ) );
registerAction( EditUndoId, editUndo );
QtxListAction* editRedo =
new QtxListAction( tr( "TOT_APP_EDIT_REDO" ),
- resMgr->loadPixmap( "STD", tr( "ICON_EDIT_REDO" ) ),
- tr( "MEN_APP_EDIT_REDO" ), Qt::CTRL+Qt::Key_Y, desk );
+ resMgr->loadPixmap( "STD", tr( "ICON_EDIT_REDO" ) ),
+ tr( "MEN_APP_EDIT_REDO" ), Qt::CTRL+Qt::Key_Y, desk );
editRedo->setStatusTip( tr( "PRP_APP_EDIT_REDO" ) );
registerAction( EditRedoId, editRedo );
bool success = false;
if ( doc )
{
- if ( success = doc->undo() )
+ success = doc->undo();
+ if ( success )
doc->update();
}
return success;
bool success = false;
if ( doc )
{
- if ( success = doc->redo() )
+ success = doc->redo();
+ if ( success )
doc->update();
}
return success;
{
if ( !undo( cafStudy ) )
{
- ok = false;
- break;
+ ok = false;
+ break;
}
numActions--;
}
{
if ( !redo( cafStudy ) )
{
- ok = false;
- break;
+ ok = false;
+ break;
}
numActions--;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAF_APPLICATION_H
#define CAF_APPLICATION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAF_Operation.h"
#include "CAF_Study.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAF_OPERATION_H
#define CAF_OPERATION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAF_Study.h"
#include "CAF_Tools.h"
#include "CAF_Application.h"
+#include <Basics_OCCTVersion.hxx>
+
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Application.h>
if ( res && app && !app->stdApp().IsNull() )
{
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
TColStd_SequenceOfExtendedString formats;
bool status = false;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
+
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+ status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == PCDM_RS_OK;
+#else
status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == CDF_RS_OK;
+#endif
}
catch ( Standard_Failure ) {
status = false;
bool status = false;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
if ( save )
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+ status = app->Save( stdDoc() ) == PCDM_SS_OK;
+#else
status = app->Save( stdDoc() ) == CDF_SS_OK;
+#endif
else
{
TCollection_ExtendedString format, path( CAF_Tools::toExtString( fname ) );
if ( format.Length() )
stdDoc()->ChangeStorageFormat( format );
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+ status = app->SaveAs( stdDoc(), path ) == PCDM_SS_OK;
+#else
status = app->SaveAs( stdDoc(), path ) == CDF_SS_OK;
+#endif
}
}
catch ( Standard_Failure ) {
bool res = true;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
if ( myStdDoc->HasOpenCommand() )
bool res = true;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
myStdDoc->AbortCommand();
bool res = true;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
myStdDoc->CommitCommand();
return false;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
myStdDoc->Undo();
}
catch ( Standard_Failure ) {
SUIT_MessageBox::critical(application()->desktop(), tr( "ERR_ERROR" ),
- tr( "ERR_DOC_UNDO" ));
+ tr( "ERR_DOC_UNDO" ));
return false;
}
return true;
return false;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
myStdDoc->Redo();
}
catch ( Standard_Failure ) {
SUIT_MessageBox::critical( application()->desktop(), tr( "ERR_ERROR" ),
- tr( "ERR_DOC_REDO" ) );
+ tr( "ERR_DOC_REDO" ) );
return false;
}
return true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAF_STUDY_H
#define CAF_STUDY_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CAF_Tools.cxx
// Author : UI team
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CAF_Tools.h
// Author : UI team
//
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : caf
# $Header$
-#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libcaf.la
CAF_Application_moc.cxx \
CAF_Operation_moc.cxx \
CAF_Study_moc.cxx
+
nodist_libcaf_la_SOURCES = $(MOC_FILES)
nodist_salomeres_DATA = \
- CAF_msg_en.qm
+ CAF_msg_en.qm \
+ CAF_msg_fr.qm
-libcaf_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libcaf_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@ \
+ -I$(srcdir)/../STD -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
libcaf_la_LDFLAGS = $(QT_MT_LIBS) $(CAS_OCAF) $(CAS_OCAFVIS)
libcaf_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../STD/libstd.la
-
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_APP_EDIT_UNDO"
-msgstr "undo.png"
-
-msgid "ICON_APP_EDIT_REDO"
-msgstr "redo.png"
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "CAF_Application::ABOUT_INFO"
-msgstr "SUIT Caf application"
-
-msgid "CAF_Application::MEN_APP_EDIT"
-msgstr "&Edit"
-
-msgid "CAF_Application::MEN_DESK_EDIT"
-msgstr "&Edit"
-
-msgid "CAF_Application::MEN_APP_EDIT_REDO"
-msgstr "&Redo"
-
-msgid "CAF_Application::MEN_APP_EDIT_UNDO"
-msgstr "&Undo"
-
-msgid "CAF_Application::PRP_APP_EDIT_REDO"
-msgstr "Redoes the last operation"
-
-msgid "CAF_Application::PRP_APP_EDIT_UNDO"
-msgstr "Undoes the last operation"
-
-msgid "CAF_Application::TOT_APP_EDIT_REDO"
-msgstr "Redo"
-
-msgid "CAF_Application::TOT_APP_EDIT_UNDO"
-msgstr "Undo"
-
-msgid "CAF_Application::INF_APP_UNDOACTIONS"
-msgstr " Undoes %1 action(s) "
-
-msgid "CAF_Application::INF_APP_REDOACTIONS"
-msgstr " Redoes %1 action(s) "
-
-msgid "CAF_Application::INF_ALL_DOCUMENTS_FILTER"
-msgstr "All Readable Documents"
-
-msgid "CAF_Application::INF_ALL_FILTER"
-msgstr "All Files (*.*)"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>CAF_Application</name>
<message>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAM_H
#define CAM_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = CAM
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT ../STD
-LIBS += -L../../lib -lqtx -lsuit -lstd
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += CAM_EXPORTS
-
-HEADERS = CAM.h
-HEADERS += CAM_Application.h
-HEADERS += CAM_DataModel.h
-HEADERS += CAM_DataObject.h
-HEADERS += CAM_Module.h
-HEADERS += CAM_Study.h
-
-SOURCES = CAM_Application.cxx
-SOURCES += CAM_DataModel.cxx
-SOURCES += CAM_DataObject.cxx
-SOURCES += CAM_Module.cxx
-SOURCES += CAM_Study.cxx
-
-TRANSLATIONS = resources/CAM_images.ts \
- resources/CAM_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAM_Application.h"
#include "CAM_Study.h"
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
+#include <KERNEL_version.h>
+#include <GUI_version.h>
+
#include <QApplication>
#include <QRegExp>
#include <dlfcn.h>
#endif
+#include <cstdio>
+
+namespace
+{
+class BusyLocker
+{
+public:
+ BusyLocker( bool& busy ) : myPrev( busy ), myBusy( busy ) { myBusy = true; }
+ ~BusyLocker() { myBusy = myPrev; }
+private:
+ bool myPrev;
+ bool& myBusy;
+};
+}
+
/*!
\brief Create new instance of CAM_Application.
\return new instance of CAM_Application class
CAM_Application::CAM_Application( const bool autoLoad )
: STD_Application(),
myModule( 0 ),
- myAutoLoad( autoLoad )
+ myAutoLoad( autoLoad ),
+ myBlocked( false )
{
readModuleList();
}
*/
CAM_Application::~CAM_Application()
{
+ for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); it != myModules.end(); ++it )
+ delete *it;
+ myModules.clear();
}
/*!
{
CAM_Module* mod = 0;
for ( QList<CAM_Module*>::const_iterator it = myModules.begin();
- it != myModules.end() && !mod; ++it )
+ it != myModules.end() && !mod; ++it )
if ( (*it)->moduleName() == modName )
mod = *it;
return mod;
out.clear();
for ( QList<CAM_Module*>::const_iterator it = myModules.begin();
- it != myModules.end(); ++it )
+ it != myModules.end(); ++it )
out.append( *it );
}
if ( loaded )
{
for ( QList<CAM_Module*>::const_iterator it = myModules.begin();
- it != myModules.end(); ++it )
+ it != myModules.end(); ++it )
lst.append( (*it)->moduleName() );
}
else
{
for ( ModuleInfoList::const_iterator it = myInfoList.begin();
- it != myInfoList.end(); ++it )
+ it != myInfoList.end(); ++it )
lst.append( (*it).title );
}
}
ModuleList newList;
for ( ModuleInfoList::const_iterator it = myInfoList.begin();
- it != myInfoList.end(); ++it )
+ it != myInfoList.end(); ++it )
{
if ( (*it).title == mod->moduleName() )
newList.append( mod );
}
for ( QList<CAM_Module*>::const_iterator it = myModules.begin();
- it != myModules.end(); ++it )
+ it != myModules.end(); ++it )
{
if ( !newList.contains( *it ) )
newList.append( *it );
{
for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end(); ++it )
{
+ if ( !isModuleAccessible( (*it).title ) ) {
+ continue;
+ }
CAM_Module* mod = loadModule( (*it).title );
if ( mod )
addModule( mod );
else {
+ QString wrn = tr( "Can not load module %1" ).arg( (*it).title );
if ( desktop() && desktop()->isVisible() )
- SUIT_MessageBox::critical( desktop(), tr( "Loading modules" ),
- tr( "Can not load module %1" ).arg( (*it).title ) );
+ SUIT_MessageBox::critical( desktop(), tr( "Loading modules" ), wrn );
else
- qWarning( tr( "Can not load module %1" ).arg( (*it).title ).toLatin1().data() );
+ qWarning( qPrintable( wrn ) );
}
}
}
{
if ( myInfoList.isEmpty() )
{
- qWarning( tr( "Modules configuration is not defined." ).toLatin1().data() );
+ qWarning( qPrintable( tr( "Modules configuration is not defined." ) ) );
+ return 0;
+ }
+
+ if ( !isModuleAccessible( modName ) ) {
+ qWarning( qPrintable( tr( "Module \"%1\" cannot be loaded in this application." ).arg( modName ) ) );
return 0;
}
QString libName = moduleLibrary( modName );
if ( libName.isEmpty() )
{
- qWarning( tr( "Information about module \"%1\" doesn't exist." ).arg( modName ).toLatin1().data() );
+ qWarning( qPrintable( tr( "Information about module \"%1\" doesn't exist." ).arg( modName ) ) );
return 0;
}
QString err;
GET_MODULE_FUNC crtInst = 0;
+ GET_VERSION_FUNC getVersion = 0;
#ifdef WIN32
HINSTANCE modLib = ::LoadLibrary( libName.toLatin1() );
err = QString( "Failed to find %1 function. %2" ).arg( GET_MODULE_NAME ).arg( (LPTSTR)lpMsgBuf );
::LocalFree( lpMsgBuf );
}
+
+ getVersion = (GET_VERSION_FUNC)::GetProcAddress( modLib, GET_VERSION_NAME );
}
#else
void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY );
crtInst = (GET_MODULE_FUNC)dlsym( modLib, GET_MODULE_NAME );
if ( !crtInst )
err = QString( "Failed to find function %1. %2" ).arg( GET_MODULE_NAME ).arg( dlerror() );
+
+ getVersion = (GET_VERSION_FUNC)dlsym( modLib, GET_VERSION_NAME );
}
#endif
if ( desktop() && desktop()->isVisible() )
SUIT_MessageBox::warning( desktop(), tr( "Error" ), err );
else
- qWarning( err.toLatin1().data() );
+ qWarning( qPrintable( err ) );
}
+ char* version = getVersion ? getVersion() : 0;
+
+ if(version) {
+ for ( ModuleInfoList::iterator it = myInfoList.begin(); it != myInfoList.end(); ++it ) {
+ if ( (*it).title == modName ) {
+ if( (*it).version.isEmpty() ) {
+ (*it).version = QString(version);
+ }
+ break;
+ }
+ }
+ }
+
return module;
}
*/
bool CAM_Application::activateModule( const QString& modName )
{
- if ( !modName.isEmpty() && !activeStudy() )
+ if ( !modName.isEmpty() && !activeStudy() || myBlocked )
return false;
+ // VSR 25/10/2011: prevent nested activation/deactivation
+ // See issues 0021307, 0021373
+ BusyLocker lock( myBlocked );
+
bool res = false;
if ( !modName.isEmpty() )
{
{
// ....
}
- }
+ }
myModule = mod;
if ( myModule ){
{
myModule->setMenuShown( false );
myModule->setToolShown( false );
+ QString wrn = tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() );
if ( desktop() && desktop()->isVisible() )
- SUIT_MessageBox::critical( desktop(), tr( "ERROR_TLT" ), tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ) );
+ SUIT_MessageBox::critical( desktop(), tr( "ERROR_TLT" ), wrn );
else
- qWarning( tr( "ERROR_ACTIVATE_MODULE_MSG" ).arg( myModule->moduleName() ).toLatin1().data() );
+ qWarning( qPrintable( wrn ) );
myModule = 0;
return false;
}
(*it)->studyClosed( theDoc );
}
+void CAM_Application::afterCloseDoc()
+{
+}
+
/*!
\brief Set active study.
\param study study to be made active
return res;
}
+/*!
+ \brief Returns \c true if module is accessible for the current application.
+ Singleton module can be loaded only in one application object. In other application
+ objects this module will be unavailable.
+ \param title module title (user name)
+ \return \c true if module is accessible (can be loaded) or \c false otherwise
+ */
+bool CAM_Application::isModuleAccessible( const QString& title ) const
+{
+ bool found = false;
+ bool blocked = false;
+
+ QStringList somewhereLoaded;
+ QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+ foreach( SUIT_Application* app, apps ) {
+ CAM_Application* camApp = dynamic_cast<CAM_Application*>( app );
+ if ( !camApp ) continue;
+ QStringList loaded;
+ camApp->modules( loaded, true );
+ foreach( QString lm, loaded ) {
+ if ( !somewhereLoaded.contains( lm ) ) somewhereLoaded << lm;
+ }
+ }
+
+ for ( ModuleInfoList::const_iterator it = myInfoList.begin(); it != myInfoList.end() && !found; ++it )
+ {
+ found = (*it).title == title;
+ blocked = (*it).isSingleton && somewhereLoaded.contains((*it).title);
+ }
+ return found && !blocked;
+}
+
/*!
\brief Get module library name by its title (user name).
\param title module title (user name)
QStringList mods = modules.split( QRegExp( "[:|,\\s]" ), QString::SkipEmptyParts );
for ( int i = 0; i < mods.count(); i++ ) {
if ( !mods[i].trimmed().isEmpty() )
- modList.append( mods[i].trimmed() );
+ modList.append( mods[i].trimmed() );
}
}
if ( modTitle.isEmpty() )
{
printf( "****************************************************************\n" );
- printf( "* Warning: %s not found in resources.\n", (*it).toLatin1().data() );
- printf( "* Module will not be available\n" );
+ printf( "* Warning: %s GUI resources are not found.\n", qPrintable(*it) );
+ printf( "* %s GUI will not be available.\n", qPrintable(*it) );
printf( "****************************************************************\n" );
continue;
}
else
modLibrary = modName;
+ bool aIsSingleton = resMgr->booleanValue(*it, "singleton", false);
+
+ QString ver = resMgr->stringValue(*it, "version", QString());
+
ModuleInfo inf;
inf.name = modName;
inf.title = modTitle;
inf.internal = modLibrary;
inf.icon = modIcon;
+ inf.isSingleton = aIsSingleton;
+ inf.version = ver;
myInfoList.append( inf );
}
SUIT_MessageBox::warning( desktop(), tr( "Warning" ), tr( "Modules list is empty" ) );
else
{
- printf( "****************************************************************\n" );
- printf( "* Warning: modules list is empty.\n" );
- printf( "****************************************************************\n" );
+ printf( "****************************************************************\n" );
+ printf( "* Warning: modules list is empty.\n" );
+ printf( "****************************************************************\n" );
}
}
}
/*SUIT_Study* study = */activeStudy();
STD_Application::createEmptyStudy();
}
+
+/*!
+ \brief Return information about version of the each module.
+*/
+CAM_Application::ModuleShortInfoList CAM_Application::getVersionInfo() const {
+
+ ModuleShortInfoList info;
+
+ ModuleShortInfo kernel;
+ kernel.name = "KERNEL";
+ kernel.version = KERNEL_VERSION_STR;
+ info.append(kernel);
+
+ ModuleShortInfo gui;
+ gui.name = "GUI";
+ gui.version = GUI_VERSION_STR;
+ info.append(gui);
+
+ for(int i = 0; i < myInfoList.size(); i++) {
+ ModuleShortInfo infoItem;
+ infoItem.name = myInfoList.at(i).title;
+ infoItem.version = myInfoList.at(i).version;
+ info.append(infoItem);
+ }
+ return info;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAM_APPLICATION_H
#define CAM_APPLICATION_H
public:
typedef QList<CAM_Module*> ModuleList;
+ typedef struct { QString name; QString version; } ModuleShortInfo;
+ typedef QList<ModuleShortInfo> ModuleShortInfoList;
public:
CAM_Application( const bool = true );
QString moduleName( const QString& ) const;
QString moduleTitle( const QString& ) const;
QString moduleIcon( const QString& ) const;
+ bool isModuleAccessible( const QString& ) const;
virtual void createEmptyStudy();
+ ModuleShortInfoList getVersionInfo() const;
+
protected:
virtual SUIT_Study* createNewStudy();
virtual void updateCommandsStatus();
virtual void moduleAdded( CAM_Module* );
virtual void beforeCloseDoc( SUIT_Study* );
+ virtual void afterCloseDoc();
virtual bool activateModule( CAM_Module* = 0 );
virtual void setActiveStudy( SUIT_Study* );
void readModuleList();
private:
- typedef struct { QString name, title, internal, icon; } ModuleInfo;
+ typedef struct { QString name, title, internal, icon; bool isSingleton; QString version; } ModuleInfo;
typedef QList<ModuleInfo> ModuleInfoList;
private:
ModuleList myModules; //!< loaded modules list
ModuleInfoList myInfoList; //!< modules info list
bool myAutoLoad; //!< auto loading flag
+ bool myBlocked; //!< "blocked" flag, internal usage
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAM_DataModel.h"
#include "CAM_Module.h"
if ( myRoot )
myRoot->disconnect( SIGNAL( destroyed( SUIT_DataObject* ) ),
- this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+ this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
myRoot = (CAM_DataObject*)newRoot;
if ( myRoot )
myRoot->connect( SIGNAL( destroyed( SUIT_DataObject* ) ),
- this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+ this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
emit rootChanged( this );
}
\return \c true if data model is loaded successfully
*/
bool CAM_DataModel::open( const QString& /*name*/,
- CAM_Study* /*study*/,
- QStringList /*files*/ )
+ CAM_Study* /*study*/,
+ QStringList /*files*/ )
{
return true;
}
\return \c true if data model is saved successfully
*/
bool CAM_DataModel::saveAs( const QString& /*name*/,
- CAM_Study* /*study*/,
- QStringList& /*files*/ )
+ CAM_Study* /*study*/,
+ QStringList& /*files*/ )
{
return true;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAM_DATAMODEL_H
#define CAM_DATAMODEL_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAM_DataObject.h"
#include "CAM_Module.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAM_DATAOBJECT_H
#define CAM_DATAOBJECT_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAM_Module.h"
#include "CAM_DataModel.h"
Provides support of menu/toolbars management.
*/
+class ActionMgrLocker
+{
+public:
+ ActionMgrLocker( QtxActionMgr* m, bool use ) : myMgr( m ), myUseLock( use )
+ {
+ if ( myUseLock ) {
+ myUpdEnabled = myMgr->isUpdatesEnabled();
+ myMgr->setUpdatesEnabled( false );
+ }
+ }
+ ~ActionMgrLocker()
+ {
+ if ( myUseLock ) {
+ myMgr->setUpdatesEnabled( myUpdEnabled );
+ //myMgr->update();
+ }
+ }
+
+ QtxActionMgr* myMgr;
+ bool myUseLock;
+ bool myUpdEnabled;
+};
+
/*!
\brief Default constructor.
: QObject(),
myApp( 0 ),
myName( name ),
- myDataModel( 0 )
+ myDataModel( 0 ),
+ myMenuShown( false ),
+ myToolShown( false )
{
}
if ( !toolMgr() )
return -1;
- return toolMgr()->createToolBar( name );
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
+
+ return toolMgr()->createToolBar( name, myToolShown );
}
/*!
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
+
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
+
+ if ( !myToolShown )
+ setToolShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
+
int regId = registerAction( id, a );
int intId = toolMgr()->insert( a, tBar, idx );
+
+ if ( !myToolShown )
+ setToolShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
+
int intId = toolMgr()->insert( action( id ), tBar, idx );
+
+ if ( !myToolShown )
+ setToolShown( action( id ), false );
+
return intId != -1 ? id : -1;
}
if ( !toolMgr() )
return -1;
+ ActionMgrLocker lock( toolMgr(), !myToolShown );
+
int intId = toolMgr()->insert( action( id ), tBar, idx );
+
+ if ( !myToolShown )
+ setToolShown( action( id ), false );
+
return intId != -1 ? id : -1;
}
{
if ( !menuMgr() )
return -1;
-
+
return menuMgr()->insert( subMenu, menu, group, id, idx );
}
{
if ( !a || !menuMgr() )
return -1;
+
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
+
+ if ( !myMenuShown )
+ setMenuShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !a || !menuMgr() )
return -1;
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
+
int regId = registerAction( id, a );
int intId = menuMgr()->insert( a, menu, group, idx );
+
+ if ( !myMenuShown )
+ setMenuShown( a, false );
+
return intId != -1 ? regId : -1;
}
if ( !menuMgr() )
return -1;
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
+
int intId = menuMgr()->insert( action( id ), menu, group, idx );
+
+ if ( !myMenuShown )
+ setMenuShown( action( id ), false );
+
return intId != -1 ? id : -1;
}
if ( !menuMgr() )
return -1;
+ ActionMgrLocker lock( menuMgr(), !myMenuShown );
+
int intId = menuMgr()->insert( action( id ), menu, group, idx );
+
+ if ( !myMenuShown )
+ setMenuShown( action( id ), false );
+
return intId != -1 ? id : -1;
}
*/
void CAM_Module::setMenuShown( const bool on )
{
+ myMenuShown = on;
+
QtxActionMenuMgr* mMgr = menuMgr();
if ( !mMgr )
return;
*/
void CAM_Module::setToolShown( const bool on )
{
+ myToolShown = on;
+
QtxActionToolMgr* tMgr = toolMgr();
if ( !tMgr )
return;
*/
QAction* CAM_Module::createAction( const int id, const QString& text, const QIcon& icon,
const QString& menu, const QString& tip, const int key,
- QObject* parent, const bool toggle, QObject* reciever, const char* member )
+ QObject* parent, const bool toggle, QObject* reciever,
+ const char* member, const QString& shortcutAction )
{
- QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle );
+ QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
a->setStatusTip( tip );
if ( reciever && member )
return QtxActionMgr::separator();
}
+/*!
+ \brief Update visibility state of the module objects.
+*/
+void CAM_Module::updateModuleVisibilityState() {
+
+}
+
+
/*!
\brief Connect data model of the module to the active study
\param camStudy CAM study object
if( (*it) == this && !camStudy->containsDataModel( dm ) )
{
if ( prev )
- camStudy->insertDataModel( (*it)->dataModel(), prev );
+ camStudy->insertDataModel( (*it)->dataModel(), prev );
else
- camStudy->insertDataModel( (*it)->dataModel(), 0 );
+ camStudy->insertDataModel( (*it)->dataModel(), 0 );
}
prev = dm;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAM_MODULE_H
#define CAM_MODULE_H
void setToolShown( QAction*, const bool );
void setToolShown( const int, const bool );
+ virtual void updateModuleVisibilityState();
+
public slots:
virtual bool activateModule( SUIT_Study* );
virtual bool deactivateModule( SUIT_Study* );
bool unregisterAction( QAction* );
QAction* createAction( const int, const QString&, const QIcon&, const QString&,
const QString&, const int, QObject* = 0,
- const bool = false, QObject* = 0, const char* = 0 );
+ const bool = false, QObject* = 0, const char* = 0, const QString& = QString() );
private:
CAM_Application* myApp; //!< parent application object
QString myInfo; //!< latest info message
CAM_DataModel* myDataModel; //!< data model
QMap<int, QAction*> myActionMap; //!< menu actions
+ bool myMenuShown; //!< menu shown flag
+ bool myToolShown; //!< tool shown flag
friend class CAM_Application;
};
extern "C"
{
typedef CAM_Module* (*GET_MODULE_FUNC)();
+ typedef char* (*GET_VERSION_FUNC)();
}
#define GET_MODULE_NAME "createModule"
-
+#define GET_VERSION_NAME "getModuleVersion"
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "CAM_Study.h"
#include "CAM_DataModel.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef CAM_STUDY_H
#define CAM_STUDY_H
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : CAM
CAM_DataModel_moc.cxx
nodist_libCAM_la_SOURCES = $(MOC_FILES)
-nodist_salomeres_DATA = CAM_msg_en.qm
+nodist_salomeres_DATA = CAM_msg_en.qm CAM_msg_fr.qm
libCAM_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../STD -I$(srcdir)/../Qtx
libCAM_la_LDFLAGS = $(QT_MT_LIBS)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ERROR_TLT"
-msgstr "Error"
-
-msgid "ERROR_ACTIVATE_MODULE_MSG"
-msgstr "Failed to activate module %1"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CASCatch.hxx
// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CASCatch_CatchSignals.cxx
// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
//
#endif
act.sa_handler = (SIG_PFV) &SegvHandler ;
-#ifdef SA_SIGINFO // OSF,SOLARIS,IRIX
+#ifdef SA_SIGINFO // OSF,SOLARIS,IRIX
act.sa_flags = act.sa_flags | SA_SIGINFO ;
# ifdef SOLARIS
act.sa_sigaction = (void(*)(int, siginfo_t *, void*)) &SegvHandler ;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CASCatch_CatchSignals.hxx
// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CASCatch_ErrorHandler.cxx
// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CASCatch_ErrorHandler.hxx
// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CASCatch_Failure.cxx
// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
//
* \brief creates a CASCatch_Failure
*/
//================================================================================
-CASCatch_Failure::CASCatch_Failure () { myMessage = "Signal detected";}
+CASCatch_Failure::CASCatch_Failure () { myMessage = (Standard_Character*)"Signal detected";}
//================================================================================
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : CASCatch_Failure.hxx
// Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
//
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.am
# Author : Sergey RUIN, Open CASCADE S.A.S (sergey.ruin@opencascade.com)
-#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DDS_H
#define DDS_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = DDS
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-CAS_OCAF = -L$${CASROOT}/Linux/lib -lPTKernel -lTKernel -lTKCDF -lTKLCAF -lTKPCAF -lTKStdSchema
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS}
-LIBS += $${CAS_KERNEL} $${CAS_OCAF}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=2 OCC_VERSION_MAINTENANCE=0 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = DDS.h
-HEADERS += DDS_DicGroup.h
-HEADERS += DDS_DicItem.h
-HEADERS += DDS_Dictionary.h
-HEADERS += DDS_KeyWords.h
-
-SOURCES = DDS_DicGroup.cxx
-SOURCES += DDS_DicItem.cxx
-SOURCES += DDS_Dictionary.cxx
-SOURCES += DDS_KeyWords.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DDS_DicGroup.h"
#include "DDS_Dictionary.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DDS_DICGROUP_H
#define DDS_DICGROUP_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DDS_DicItem.h"
#include "DDS_Dictionary.h"
/*!
\brief Get the minimum value of the parameter for the specified
units system \a theSystem.
-
+
Returned value is converted to SI.
\param theUnitsSystem units system
{
// Read the text in the element "value"
//LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild();
- LDOM_Node aNode = aListItemValue.getFirstChild();
- const LDOM_Text& aText = (const LDOM_Text&) aNode;
- LDOM_Text aListItemTxt(aText);
+ LDOM_Node aNode = aListItemValue.getFirstChild();
+ const LDOM_Text& aText = (const LDOM_Text&) aNode;
+ LDOM_Text aListItemTxt(aText);
if ( !aListItemTxt.isNull() )
{
// adding ID and text value to sequence
LDOMString v = attr.getValue();
if( v.Type()==LDOMBasicString::LDOM_Integer )
{
- Standard_Integer ival;
- v.GetInteger( ival );
- value = TCollection_ExtendedString( ival );
+ Standard_Integer ival;
+ v.GetInteger( ival );
+ value = TCollection_ExtendedString( ival );
}
else
- value = ( Standard_CString )v.GetString();
+ value = ( Standard_CString )v.GetString();
}
else
continue;
else if ( anUnitData.myUnits.ToCString()[0] ) // treat '%' as unit with scale 100
anUnitData.myScale = 0.01;
}
- catch( Standard_Failure ) {
+ catch( Standard_Failure ) {
anUnitData.myUnits.Clear();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DDS_DICITEM_H
#define DDS_DICITEM_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DDS_Dictionary.h"
#include "DDS_KeyWords.h"
+#include <Basics_OCCTVersion.hxx>
+
#include <LDOMString.hxx>
#include <LDOMParser.hxx>
if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
{
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
aRetValue = UnitsAPI::AnyToSI( theValue, theUnits );
if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
{
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
#endif
aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DDS_DICTIONARY_H
#define DDS_DICTIONARY_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "DDS_KeyWords.h"
IMPLEMENT_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef DDS_KEYWORDS_H
#define DDS_KEYWORDS_H
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Alexander SOLOVYOV (OCN)
# Module : DDS
-# $Header: /home/server/cvs/GUI/GUI_SRC/src/DDS/Makefile.in
-#
+# $Header$
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libDDS.la
DDS_Dictionary.cxx \
DDS_KeyWords.cxx
-libDDS_la_CPPFLAGS = $(CAS_CPPFLAGS)
+libDDS_la_CPPFLAGS = $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@
libDDS_la_LDFLAGS = $(CAS_KERNEL) $(CAS_OCAF)
-
-
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#if !defined ( EVENT_H )
#define EVENT_H
#ifdef WIN32
-# ifdef EVENT_EXPORTS
+# if defined EVENT_EXPORTS || defined Event_EXPORTS
# define EVENT_EXPORT __declspec(dllexport)
# else
# define EVENT_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = Event
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include
-LIBS +=
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += EVENT_EXPORTS
-
-HEADERS = Event.h
-HEADERS += SALOME_Event.h
-HEADERS += SALOME_EventFilter.h
-
-SOURCES = SALOME_Event.cxx
-SOURCES += SALOME_EventFilter.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Utils : general SALOME's definitions and tools
# File : Makefile.in
# Author : Marc Tajchman (CEA)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// KERNEL SALOME_Event : Define event posting mechanism
// File : SALOME_Event.cxx
// Author : Sergey ANIKIN
\class SALOME_Event
\brief The class which encapsulates data and functionality required for
posting component-specific events to perform arbitrary operations
- in the main GUI thread.
+ in the main GUI thread.
SALOME_Event objects can be posted by any thread belonging to the GUI process.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// KERNEL SALOME_Event : Define event posting mechanism
// File : SALOME_Event.h
// Author : Sergey ANIKIN
TResult myResult;
typedef TResult (TObject::* TAction)();
TMemFunEvent(TObject* theObject, TAction theAction,
- TResult theResult = TResult()):
+ TResult theResult = TResult()):
myObject(theObject),
myAction(theAction),
myResult(theResult)
TResult myResult;
typedef TResult (TObject::* TAction)(TArg);
TMemFun1ArgEvent(TObject* theObject, TAction theAction, TArg theArg,
- TResult theResult = TResult()):
+ TResult theResult = TResult()):
myObject(theObject),
myAction(theAction),
myResult(theResult),
TResult myResult;
typedef TResult (TObject::* TAction)(TArg,TArg1);
TMemFun2ArgEvent(TObject* theObject, TAction theAction,
- TArg theArg, TArg1 theArg1,
- TResult theResult = TResult()):
+ TArg theArg, TArg1 theArg1,
+ TResult theResult = TResult()):
myObject(theObject),
myAction(theAction),
myResult(theResult),
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SALOME_EventFilter.h"
#include "SALOME_Event.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOME_EVENTFILTER_H
#define SALOME_EVENTFILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer.h
// Created: November, 2004
//
#ifdef WIN32
-#ifdef GLVIEWER_EXPORTS
+#if defined GLVIEWER_EXPORTS || defined GLViewer_EXPORTS
#define GLVIEWER_API __declspec(dllexport)
#else
#define GLVIEWER_API __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = GLViewer
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-GL_LIBS = -L/usr/X11R6/lib$$(LIB_LOCATION_SUFFIX) -lGLU
-
-INCLUDEPATH += $$(QTDIR)/include/QtOpenGL ../../include $${CAS_CPPFLAGS} ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit $${GL_LIBS} $${CAS_KERNEL}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += GLVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = GLViewer.h
-HEADERS += GLViewer_AspectLine.h
-HEADERS += GLViewer_BaseDrawers.h
-HEADERS += GLViewer_BaseObjects.h
-HEADERS += GLViewer_Compass.h
-HEADERS += GLViewer_Context.h
-HEADERS += GLViewer_CoordSystem.h
-HEADERS += GLViewer_Defs.h
-HEADERS += GLViewer_Drawer.h
-HEADERS += GLViewer_Geom.h
-HEADERS += GLViewer_Grid.h
-HEADERS += GLViewer_Group.h
-HEADERS += GLViewer_MimeData.h
-HEADERS += GLViewer_Object.h
-HEADERS += GLViewer_Selector.h
-HEADERS += GLViewer_Selector2d.h
-HEADERS += GLViewer_Text.h
-HEADERS += GLViewer_Tools.h
-HEADERS += GLViewer_ToolTip.h
-HEADERS += GLViewer_ViewFrame.h
-HEADERS += GLViewer_ViewManager.h
-HEADERS += GLViewer_ViewPort.h
-HEADERS += GLViewer_ViewPort2d.h
-HEADERS += GLViewer_Viewer.h
-HEADERS += GLViewer_Viewer2d.h
-HEADERS += GLViewer_Widget.h
-
-SOURCES = GLViewer_AspectLine.cxx
-SOURCES += GLViewer_BaseDrawers.cxx
-SOURCES += GLViewer_BaseObjects.cxx
-SOURCES += GLViewer_Compass.cxx
-SOURCES += GLViewer_Context.cxx
-SOURCES += GLViewer_CoordSystem.cxx
-SOURCES += GLViewer_Drawer.cxx
-SOURCES += GLViewer_Geom.cxx
-SOURCES += GLViewer_Grid.cxx
-SOURCES += GLViewer_Group.cxx
-SOURCES += GLViewer_MimeData.cxx
-SOURCES += GLViewer_Object.cxx
-SOURCES += GLViewer_Selector.cxx
-SOURCES += GLViewer_Selector2d.cxx
-SOURCES += GLViewer_Text.cxx
-SOURCES += GLViewer_Tools.cxx
-SOURCES += GLViewer_ToolTip.cxx
-SOURCES += GLViewer_ViewFrame.cxx
-SOURCES += GLViewer_ViewManager.cxx
-SOURCES += GLViewer_ViewPort.cxx
-SOURCES += GLViewer_ViewPort2d.cxx
-SOURCES += GLViewer_Viewer.cxx
-SOURCES += GLViewer_Viewer2d.cxx
-SOURCES += GLViewer_Widget.cxx
-
-TRANSLATIONS = resources/GLViewer_images.ts \
- resources/GLViewer_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_AspectLine.cxx
// Created: 26/05/2005 3:17:00 PM
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_AspectLine.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_BaseDrawers.cxx
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_BaseDrawers.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// Author : OPEN CASCADE
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "GLViewer_BaseObjects.h"
#include "GLViewer_BaseDrawers.h"
#include "GLViewer_AspectLine.h"
#include "GLViewer_CoordSystem.h"
#include "GLViewer_Text.h"
#include "GLViewer_Group.h"
-
#include "GLViewer_Drawer.h"
#include <QFile>
-//#include <cmath>
-//using namespace std;
-
/*!
Constructor
*/
ydist = ( myYCoord[i] - y ) * myYScale;
// if ( isCircle && ( xdist * xdist + ydist * ydist <= radius * radius ) ||
- if ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ||
- !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) )
+ if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
+ ( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
{
isFound = FALSE;
count++;
ydist = ( myYCoord[i] - y ) * myYScale;
//if ( isCircle && ( xdist * xdist + ydist * ydist <= radius * radius ) ||
- if ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ||
- !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) )
+ if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
+ ( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
{
count++;
if ( isShift )
return false;
GLfloat xa, xb, ya, yb, l;
GLfloat rsin, rcos, r, ra, rb;
- GLboolean update;
+ // GLboolean update;
GLboolean selected = myIsSel;
myIsSel = GL_FALSE;
else
myHighFlag = GL_TRUE;
- update = ( GLboolean )( myIsSel != selected );
+ // update = ( GLboolean )( myIsSel != selected );
// cout << "GLViewer_Polyline::select complete with " << (int)myIsSel << endl;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_BaseObjects.h
// Created: November, 2004
//! Export numbers of highlighted/selected lines
void exportNumbers( QList<int>& high, QList<int>& unhigh,
- QList<int>& sel, QList<int>& unsel );
+ QList<int>& sel, QList<int>& unsel );
//! Returns numbers of selected lines
QList<int> getSelectedElements() { return mySelNumbers; }
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Compass.cxx
// Created: November, 2004
void GLViewer_Compass::setArrowWidthBottom( const int WidthBot )
{
if( WidthBot > myArrowWidthTop || WidthBot < 1 )
- return;
+ return;
myArrowWidthBottom=WidthBot;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Compass.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Context.cxx
// Created: November, 2004
if ( !Append )
{
for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it )
- if( myLastPicked != *it )
+ if( myLastPicked != *it )
{
- updateAll = (*it)->unselect() || updateAll;
- aList.append( *it );
+ updateAll = (*it)->unselect() || updateAll;
+ aList.append( *it );
}
if( updateAll || myUpdateAll )
if ( !Append )
{
for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it )
- if ( myLastPicked != *it )
+ if ( myLastPicked != *it )
{
- updateAll = (*it)->unselect() || updateAll;
- aList.append( *it );
+ updateAll = (*it)->unselect() || updateAll;
+ aList.append( *it );
}
if( updateAll || myUpdateAll )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Context.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Context.cxx
// Created: November, 2004
double eps = 1E-8, pi = 3.14159265;
if( r>eps )
+ {
if( fabs(x)>eps )
{
double arg = y/x;
phi = pi/2.0;
else
phi = 3*pi/2.0;
+ }
x = r;
y = phi-myRotation;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_CoordSystem.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Defs.h
// Created: March, 2005
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Drawer.cxx
// Created: November, 2004
*/
void GLViewer_Drawer::setAntialiasing(const bool on)
{
- if (on)
- {
+ if (on)
+ {
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
- glEnable(GL_POINT_SMOOTH);
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_POLYGON_SMOOTH);
- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable (GL_BLEND);
- }
- else
- {
- glDisable(GL_POINT_SMOOTH);
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_POLYGON_SMOOTH);
- glBlendFunc (GL_ONE, GL_ZERO);
- glDisable (GL_BLEND);
- }
+ glEnable(GL_POINT_SMOOTH);
+ glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_POLYGON_SMOOTH);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable (GL_BLEND);
+ }
+ else
+ {
+ glDisable(GL_POINT_SMOOTH);
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_POLYGON_SMOOTH);
+ glBlendFunc (GL_ONE, GL_ZERO);
+ glDisable (GL_BLEND);
+ }
}
/*! Loads texture from file
\param fillingColor - color of filling
*/
void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, GLfloat lineWidth, GLfloat gap,
- QColor color, bool filled, QColor fillingColor )
+ QColor color, bool filled, QColor fillingColor )
{
if( !rect )
return;
\param isStripe - enables line stipple
*/
void GLViewer_Drawer::drawContour( GLViewer_Rect* rect, QColor color, GLfloat lineWidth,
- GLushort pattern, bool isStripe )
+ GLushort pattern, bool isStripe )
{
float x1 = rect->left();
float x2 = rect->right();
\param filled - drawn as filled
*/
void GLViewer_Drawer::drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue,
- GLfloat lineWidth,
- GLfloat staff, GLfloat length, GLfloat width,
- GLfloat x, GLfloat y, GLfloat angle, GLboolean filled )
+ GLfloat lineWidth,
+ GLfloat staff, GLfloat length, GLfloat width,
+ GLfloat x, GLfloat y, GLfloat angle, GLboolean filled )
{
GLfloat vx1 = x;
GLfloat vy1 = y + staff + length;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Drawer.h
// Created: November, 2004
//! Returns object priority
int getPriority() const { return myPriority; }
- //! The function enables and disables antialiasing in Open GL (for points, lines and polygons).
- void setAntialiasing(const bool on);
+ //! The function enables and disables antialiasing in Open GL (for points, lines and polygons).
+ void setAntialiasing(const bool on);
//! Clears all generated textures
static void destroyAllTextures();
*/
void drawText( const QString& text,
GLfloat xPos,
- GLfloat yPos,
+ GLfloat yPos,
const QColor& color,
QFont* aFont,
int theSeparator,
*\param smallFont - font format
*/
void drawGLText( QString text,
- float x,
- float y,
+ float x,
+ float y,
int hPosition = GLText_Center,
int vPosition = GLText_Center,
QColor color = Qt::black,
//! Draw basic primitives: rectangle, contour, polygon, vertex, cross, arrow
//* with predefined color
static void drawRectangle( GLViewer_Rect*, GLfloat, GLfloat = 0, QColor = Qt::black,
- bool = false, QColor = Qt::white );
+ bool = false, QColor = Qt::white );
static void drawContour( GLViewer_Rect*, QColor, GLfloat, GLushort, bool );
static void drawContour( const GLViewer_PntList&, QColor, GLfloat );
static void drawPolygon( GLViewer_Rect*, QColor, GLushort, bool );
static void drawVertex( GLfloat, GLfloat, QColor );
static void drawCross( GLfloat, GLfloat, QColor );
static void drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue,
- GLfloat, GLfloat, GLfloat, GLfloat,
- GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE );
+ GLfloat, GLfloat, GLfloat, GLfloat,
+ GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE );
//! Draw object text
virtual void drawText( GLViewer_Object* theObject );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
//#include <GLViewerAfx.h>
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Geom.h
// Created: November, 2004
#include <QtOpenGL>
#include <math.h>
-//using namespace QGL;
-
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Grid.cxx
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Grid.h
// Created: November, 2004
* \param xScale and \param yScal - scale factors along x and y direction
*/
GLViewer_Grid( GLfloat width, GLfloat height,
- GLfloat winW, GLfloat winH,
- GLfloat xSize, GLfloat ySize,
- GLfloat xPan, GLfloat yPan,
- GLfloat xScale, GLfloat yScale );
+ GLfloat winW, GLfloat winH,
+ GLfloat xSize, GLfloat ySize,
+ GLfloat xPan, GLfloat yPan,
+ GLfloat xScale, GLfloat yScale );
~GLViewer_Grid();
//! Draws grid
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Group.xx
// Created: March, 2005
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Group.h
// Created: March, 2005
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
-//
-// Author : OPEN CASCADE
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "GLViewer_MimeData.h"
#include "GLViewer_BaseObjects.h"
-//#include <cmath>
-//using namespace std;
-
/*!
Destructor
*/
for( j = 0; j < aObjNum; j++ )
{
QByteArray aTempArray;
- aTempArray.resize(aObjSizeList[j]);
+ aTempArray.resize(aObjSizeList[j]);
for( ; anIndex < aCurIndex + aObjSizeList[j]; anIndex++ )
aTempArray[anIndex-aCurIndex] = theArray[anIndex];
aObjects.append( aTempArray );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_MimeData.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// Author : OPEN CASCADE
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "GLViewer_Object.h"
#include "GLViewer_Drawer.h"
#include "GLViewer_AspectLine.h"
#include <SUIT_DataOwner.h>
-//#include <cmath>
-//using namespace std;
-
/*!
Default constructor
*/
QByteArray aResult;
aResult.resize( 2*anISize + sizeOf8Float +
- aTypeLength + aToolTipLength +
- aGLText.size() + aAspect.size() );
+ aTypeLength + aToolTipLength +
+ aGLText.size() + aAspect.size() );
// puts 8 float values into the byte array
char* aPointer = (char*)&aRectData;
for( i = 0; i < sizeOf8Float; i++, aPointer++ )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Object.h
// Created: November, 2004
*\param isCircle - = true if sensitive area of detection is round
*/
virtual GLboolean highlight( GLfloat x,
- GLfloat y,
+ GLfloat y,
GLfloat tol,
GLboolean isCircle = GL_FALSE ) = 0;
//! Clears all highlight information
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Selector.cxx
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Selector.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Selector2d.cxx
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Selector2d.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
//#include <GLViewerAfx.h>
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Text.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ToolTip.xx
// Created: March, 2005
mypViewPort = theParent;
//mypLabel = NULL;
mypLabel = new QLabel( "Test", NULL,
- Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint );
+ Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint );
mypLabel->setObjectName("ObjectTipText");
mypLabel->setMargin( 1 );
//mypLabel->setAutoMask( FALSE );
case QEvent::MouseButtonDblClick:
case QEvent::KeyPress:
case QEvent::KeyRelease:
- // input - turn off tool tip mode
- hideTipAndSleep();
- break;*/
+ // input - turn off tool tip mode
+ hideTipAndSleep();
+ break;*/
case QEvent::MouseMove:
{
//hideTipAndSleep();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ToolTip.h
// Created: March, 2005
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Tools.cxx
// Created: April, 2005
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Tools.h
// Created: April, 2005
class GLVIEWER_API GLViewer_Tools
{
public:
- //GLViewer_Tools();
- //virtual ~GLViewer_Tools();
+ //GLViewer_Tools();
+ //virtual ~GLViewer_Tools();
//static
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// Author : OPEN CASCADE
-// File: GLViewer_ViewFrame.cxx
-// Created: November, 2004
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "GLViewer_ViewFrame.h"
#include "GLViewer_Viewer.h"
#include "GLViewer_ViewPort2d.h"
#ifdef WIN32
#include <Standard_Integer.hxx>
#include <iostream>
-using namespace std;
#endif
/*!
// Dump view
aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_DUMP" ) ),
- tr( "MNU_DUMP_VIEW" ), 0, this);
+ tr( "MNU_DUMP_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_DUMP_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView()));
toolMgr()->registerAction( aAction, DumpId );
// FitAll
aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITALL" ) ),
- tr( "MNU_FITALL" ), 0, this);
+ tr( "MNU_FITALL" ), 0, this);
aAction->setStatusTip(tr("DSC_FITALL"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll()));
toolMgr()->registerAction( aAction, FitAllId );
// FitRect
aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITAREA" ) ),
- tr( "MNU_FITRECT" ), 0, this);
+ tr( "MNU_FITRECT" ), 0, this);
aAction->setStatusTip(tr("DSC_FITRECT"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea()));
toolMgr()->registerAction( aAction, FitRectId );
// FitSelect
aAction = new QtxAction(tr("MNU_FITSELECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITSELECT" ) ),
- tr( "MNU_FITSELECT" ), 0, this);
+ tr( "MNU_FITSELECT" ), 0, this);
aAction->setStatusTip(tr("DSC_FITSELECT"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitSelect()));
toolMgr()->registerAction( aAction, FitSelectId );
// Zoom
aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_ZOOM" ) ),
- tr( "MNU_ZOOM_VIEW" ), 0, this);
+ tr( "MNU_ZOOM_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom()));
toolMgr()->registerAction( aAction, ZoomId );
// Panning
aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_PAN" ) ),
- tr( "MNU_PAN_VIEW" ), 0, this);
+ tr( "MNU_PAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_PAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
toolMgr()->registerAction( aAction, PanId );
// Global Panning
aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_GLOBALPAN" ) ),
- tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+ tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan()));
toolMgr()->registerAction( aAction, GlobalPanId );
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_RESET" ) ),
- tr( "MNU_RESET_VIEW" ), 0, this);
+ tr( "MNU_RESET_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
toolMgr()->registerAction( aAction, ResetId );
*/
void GLViewer_ViewFrame::createToolBar()
{
- int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") );
+ int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false );
toolMgr()->append( DumpId, tid );
QtxMultiAction* aScaleAction = new QtxMultiAction( this );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ViewFrame.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ViewManager.cxx
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ViewManager.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ViewPort.cxx
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ViewPort.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ViewPort2d.cxx
// Created: November, 2004
{
myRectBand->hide(); /* erase */
- mypLastPoint->setX( x );
+ mypLastPoint->setX( x );
mypLastPoint->setY( y );
- QRect aRect = selectionRect();
- myRectBand->setGeometry( aRect ); /* draw */
- myRectBand->setVisible( aRect.isValid() );
+ QRect aRect = selectionRect();
+ myRectBand->setGeometry( aRect ); /* draw */
+ myRectBand->setVisible( aRect.isValid() );
}
}
mypFirstPoint = NULL;
mypLastPoint = NULL;
- delete myRectBand;
- myRectBand = 0;
+ delete myRectBand;
+ myRectBand = 0;
}
}
if( !aList.isEmpty() )
{
- int index = 0;
int str_size = aList.first().length();
for( int i = 1, size = aList.count(); i < size; i++ )
{
if ( str_size < (int)aList[i].length() )
{
- index = i;
str_size = aList[i].length();
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_ViewPort2d.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Viewer.cxx
// Created: November, 2004
qAbs( myStart.x() - myCurr.x() ), qAbs( myStart.y() - myCurr.y() ) );
if ( !rect.isEmpty() )
{
- if ( !sketchRect->isEmpty() && myRectBand )
+ if ( !sketchRect->isEmpty() && myRectBand )
myRectBand->hide(); /* erase */
*sketchRect = rect;
if ( state != Fin )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Viewer.h
// Created: November, 2004
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Viewer2d.cxx
// Created: November, 2004
return;
GLViewer_ViewPort2d* vp = ( ( GLViewer_ViewPort2d* )getActiveView()->getViewPort() );
- QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp );
+ QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp );
if ( selColor.isValid() ) {
vp->setBackgroundColor( selColor );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Viewer2d.h
// Created: November, 2004
* output paper size \param aPType, with margins in mm
*/
virtual bool translateTo( VectorFileType aType, QString FileName, PaperType aPType,
- double mmLeft, double mmRight, double mmTop, double mmBottom );
+ double mmLeft, double mmRight, double mmTop, double mmBottom );
//bool isSketchingActive();
//int getSketchingType();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// Author : OPEN CASCADE
-// File: GLViewer_Widget.cxx
-// Created: November, 2004
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "GLViewer_Widget.h"
#include "GLViewer_ViewPort2d.h"
#include "GLViewer_Viewer2d.h"
-//#include "GLViewer_Compass.h"
#include "GLViewer_Grid.h"
-//#include "GLViewer_Object.h"
#include "GLViewer_CoordSystem.h"
#include "GLViewer_ViewFrame.h"
#include <cmath>
-using namespace std;
#include <QEvent>
#include <QPaintEvent>
#include <QRect>
-
#include <QFile>
-//#include <qpixmap.h>
#include <QImage>
#include <QApplication>
-//#include <qintdict.h>
-//#include <qpaintdevicemetrics.h>
-//#include <qsize.h>
#include <QToolTip>
/*!
\return start point of curren rotation of Window in OpenGL global scene
*/
void GLViewer_Widget::getRotationStart( GLfloat& rotationStartX,
- GLfloat& rotationStartY,
+ GLfloat& rotationStartY,
GLfloat& rotationStartZ )
{
rotationStartX = myRotationStartX;
A function for installing the rotation angle of Window in OpenGL global scene in degree (Only in 2D)
*/
void GLViewer_Widget::setRotationStart( GLfloat rotationStartX,
- GLfloat rotationStartY,
+ GLfloat rotationStartY,
GLfloat rotationStartZ )
{
myRotationStartX = rotationStartX;
\param rotationCenterZ - center z
*/
void GLViewer_Widget::getRotation( GLfloat& rotationAngle,
- GLfloat& rotationCenterX,
- GLfloat& rotationCenterY,
- GLfloat& rotationCenterZ )
+ GLfloat& rotationCenterX,
+ GLfloat& rotationCenterY,
+ GLfloat& rotationCenterZ )
{
rotationAngle = myRotationAngle;
rotationCenterX = myRotationCenterX;
\param rotationCenterZ - center z
*/
void GLViewer_Widget::setRotation( GLfloat rotationAngle,
- GLfloat rotationCenterX,
- GLfloat rotationCenterY,
- GLfloat rotationCenterZ )
+ GLfloat rotationCenterX,
+ GLfloat rotationCenterY,
+ GLfloat rotationCenterZ )
{
myRotationAngle = rotationAngle;
myRotationCenterX = rotationCenterX;
{
uchar* theCurLine = image.scanLine( i ), cur;
for( int j=w1; j<=w2; j++ )
- for( int k=0; k<3; k++ )
- {
- cur = *(theCurLine+4*j+2-k);
- *(line+cur_index) = hex( cur/16 ); //HI
- *(line+cur_index+1) = hex( cur%16 ); //LO
- full++;
- cur_index+=2;
- if( cur_index>=80 )
- {
- aBuffer += line;
- aBuffer += "\n";
- cur_index = 0;
- }
- }
+ for( int k=0; k<3; k++ )
+ {
+ cur = *(theCurLine+4*j+2-k);
+ *(line+cur_index) = hex( cur/16 ); //HI
+ *(line+cur_index+1) = hex( cur%16 ); //LO
+ full++;
+ cur_index+=2;
+ if( cur_index>=80 )
+ {
+ aBuffer += line;
+ aBuffer += "\n";
+ cur_index = 0;
+ }
+ }
}
aBuffer += "> false 3 colorimage\n\n";
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Author : OPEN CASCADE
// File: GLViewer_Widget.h
// Created: November, 2004
//! Returns scales on OpenGL scene along 3 directions
/*! in 2d scene zScale = 1.0 */
void getScale( GLfloat& xScale,
- GLfloat& yScale,
- GLfloat& zScale );
+ GLfloat& yScale,
+ GLfloat& zScale );
//! A function for installing the scales of OpenGL scene
void setScale( GLfloat xScale,
- GLfloat yScale,
+ GLfloat yScale,
GLfloat zScaleGLfloat );
//! Returns offset parameters of Window in OpenGL global scene
//! Returns start point of curren rotation of Window in OpenGL global scene
void getRotationStart( GLfloat& rotationStartX,
- GLfloat& rotationStartY,
- GLfloat& rotationStartZ );
+ GLfloat& rotationStartY,
+ GLfloat& rotationStartZ );
//! A function for installing the start point of curren rotation of Window in OpenGL global scene
void setRotationStart( GLfloat rotationStartX,
- GLfloat rotationStartY,
- GLfloat rotationStartZ );
+ GLfloat rotationStartY,
+ GLfloat rotationStartZ );
//! Returns parameters of current rotation
void getRotation( GLfloat& rotationAngle,
- GLfloat& rotationCenterX,
- GLfloat& rotationCenterY,
- GLfloat& rotationCenterZ );
+ GLfloat& rotationCenterX,
+ GLfloat& rotationCenterY,
+ GLfloat& rotationCenterZ );
//! A function for installing the parameters of current rotation
void setRotation( GLfloat, GLfloat, GLfloat, GLfloat );
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : caf
nodist_salomeres_DATA = \
GLViewer_images.qm \
- GLViewer_msg_en.qm
+ GLViewer_msg_en.qm \
+ GLViewer_msg_fr.qm
libGLViewer_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
libGLViewer_la_LDFLAGS = $(QT_MT_LIBS) $(CAS_KERNEL) $(OGL_LIBS)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: GLViewer_images.po
-# Created: 10/25/2004 12:46:36 PM
-# Author: Sergey Anikin
-
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 2005-05-05 10:17+0400\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_GL_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_GL_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_GL_FITSELECT"
-msgstr "view_fitselect.png"
-
-msgid "ICON_GL_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_GL_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_GL_RESET"
-msgstr "view_reset.png"
-
-msgid "ICON_GL_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_GL_DUMP"
-msgstr "view_dump.png"
-
-msgid "ICON_GL_CURSOR_ZOOM"
-msgstr "cursor_zoom.png"
-
-msgid "ICON_GL_CURSOR_ROTATE"
-msgstr "cursor_rotate.png"
-
-msgid "ICON_GL_CURSOR_SKETCH"
-msgstr "cursor_sketch.png"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: GLViewer_msg_en.po
-# Created: 10/25/2004 12:46:36 PM
-# Author: Sergey Anikin
-
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_FITSELECT"
-msgstr "Fit area of selection within the view frame"
-
-msgid "MNU_FITSELECT"
-msgstr "Fit Selection"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump"
-
-msgid "GL_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "CHANGE_BGCOLOR"
-msgstr "Change background..."
-
-msgid "GLViewer_ViewFrame::DUMP_VIEW_SAVE_FILE_DLG_CAPTION"
-msgstr "Save Dump View in file"
-
-msgid "GLViewer_ViewFrame::DUMP_VIEW_ERROR_DLG_CAPTION"
-msgstr "Error"
-
-msgid "GLViewer_ViewFrame::DUMP_VIEW_ERROR_DLG_TEXT"
-msgstr "Can't save Dump View in file"
-
-msgid "GLViewer_ViewManager::GL_VIEW_TITLE"
-msgstr "GL Scene:%M - viewer:%V"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp.h
// Author : OCC team
//
#define LIGHTAPP_H
#ifdef WIN32
-# ifdef LIGHTAPP_EXPORTS
+# if defined LIGHTAPP_EXPORTS || defined LightApp_EXPORTS
# define LIGHTAPP_EXPORT __declspec(dllexport)
# else
# define LIGHTAPP_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = LightApp
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-HDF5_INCLUDES = $$(HDF5HOME)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-VTK_INCLUDES = $$(VTKHOME)/include/vtk
-
-QWT_INCLUDES = $$(QWTHOME)/include
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-INCLUDEPATH += $${PYTHON_INCLUDES} $${QT_INCLUDES} $${CAS_CPPFLAGS} $${HDF5_INCLUDES} $${KERNEL_CXXFLAGS} ../SUIT ../STD ../CAM ../LogWindow ../Prs ../Qtx ../Event #../ObjBrowser
-
-#if ENABLE_VTKVIEWER
- INCLUDEPATH += $${VTK_INCLUDES} ../VTKViewer
-#else
-# DEFINES += DISABLE_VTKVIEWER
-#endif
-
-#if ENABLE_PLOT2DVIEWER
- INCLUDEPATH += $${QWT_INCLUDES} ../Plot2d
-#else
-# DEFINES += DISABLE_PLOT2DVIEWER
-#endif
-
-#if ENABLE_OCCVIEWER
- INCLUDEPATH += ../OCCViewer
-#else !ENABLE_OCCVIEWER
-# DEFINES += DISABLE_OCCVIEWER
-#endif
-
-#if ENABLE_PYCONSOLE
- INCLUDEPATH += $${PYTHON_INCLUDES} ../PyConsole ../PyInterp
-#else !ENABLE_PYCONSOLE
-# DEFINES += DISABLE_PYCONSOLE
-#endif
-
-#if ENABLE_GLVIEWER
- INCLUDEPATH += ../GLViewer
-#else !ENABLE_GLVIEWER
-# DEFINES += DISABLE_GLVIEWER
-#endif
-
-#if ENABLE_SUPERVGRAPHVIEWER
- INCLUDEPATH += ../SUPERVGraph
-#else !ENABLE_SUPERVGRAPHVIEWER
-# DEFINES += DISABLE_SUPERVGRAPHVIEWER
-#endif
-
-#if ENABLE_SALOMEOBJECT
-
- INCLUDEPATH += ../OBJECT
-#if ENABLE_PLOT2DVIEWER
- INCLUDEPATH += ../SPlot2d
-#endif
-
-#if ENABLE_OCCVIEWER
- INCLUDEPATH += ../SOCC
-#endif
-
-#if ENABLE_VTKVIEWER
- INCLUDEPATH += ../SVTK
-#endif
-
-#else !ENABLE_SALOMEOBJECT
-# DEFINES += DISABLE_SALOMEOBJECT
-
-#endif
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-HDF5_LIBS = -L$$(HDF5HOME)/lib -lhdf5
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-PYTHON_LIBS = -L$$(PYTHONHOME)/lib/python2.4/config -lpython2.4 -ldl -lutil
-
-LIBS += $${QT_MT_LIBS} -L../../lib -lsuit -lstd -lCAM -lLogWindow $${CAS_KERNEL} -lSalomePrs $${HDF5_LIBS} $${KERNEL_LDFLAGS} -lSalomeHDFPersist #-lObjBrowser
-
-#if ENABLE_PYCONSOLE
- LIBS += $${PYTHON_LIBS}
-#endif
-
-#if ENABLE_SALOMEOBJECT
- LIBS += -lSalomeObject
-#endif
-
-#if ENABLE_VTKVIEWER
- LIBS += -lVTKViewer
-#if ENABLE_SALOMEOBJECT
- LIBS += -lSVTK
-#endif
-#endif
-
-#if ENABLE_OCCVIEWER
- LIBS += -lOCCViewer
-#if ENABLE_SALOMEOBJECT
- LIBS += -lSOCC
-#endif
-#endif
-
-#if ENABLE_GLVIEWER
- LIBS += -lGLViewer
-#endif
-
-#if ENABLE_PLOT2DVIEWER
- LIBS += -lPlot2d
-#if ENABLE_SALOMEOBJECT
- LIBS += -lSPlot2d
-#endif
-#endif
-
-#if ENABLE_PYCONSOLE
- LIBS += -lPyInterp -lPyConsole
-#endif
-
-#if ENABLE_SUPERVGRAPHVIEWER
- LIBS += -lSUPERVGraph
-#endif
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += LIGHTAPP_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = LightApp.h
-HEADERS += LightApp_AboutDlg.h
-HEADERS += LightApp_Application.h
-HEADERS += LightApp_DataModel.h
-HEADERS += LightApp_DataObject.h
-HEADERS += LightApp_DataOwner.h
-HEADERS += LightApp_DataSubOwner.h
-HEADERS += LightApp_Dialog.h
-HEADERS += LightApp_Displayer.h
-HEADERS += LightApp_Driver.h
-HEADERS += LightApp_EventFilter.h
-HEADERS += LightApp_HDFDriver.h
-HEADERS += LightApp_Module.h
-HEADERS += LightApp_ModuleAction.h
-HEADERS += LightApp_ModuleDlg.h
-HEADERS += LightApp_NameDlg.h
-#HEADERS += LightApp_OBFilter.h
-HEADERS += LightApp_OBSelector.h
-HEADERS += LightApp_Operation.h
-HEADERS += LightApp_Selection.h
-HEADERS += LightApp_SelectionMgr.h
-HEADERS += LightApp_ShowHideOp.h
-HEADERS += LightApp_Study.h
-HEADERS += LightApp_SwitchOp.h
-HEADERS += LightApp_Preferences.h
-HEADERS += LightApp_PreferencesDlg.h
-HEADERS += LightApp_RootObject.h
-HEADERS += LightApp_UpdateFlags.h
-HEADERS += LightApp_WidgetContainer.h
-
-#if ENABLE_VTKVIEWER
-#if ENABLE_SALOMEOBJECT
- HEADERS += LightApp_VTKSelector.h
-#endif
-#endif
-#if ENABLE_OCCVIEWER
- HEADERS += LightApp_OCCSelector.h
-#endif
-#if ENABLE_GLVIEWER
- HEADERS += LightApp_GLSelector.h
-#endif
-
-SOURCES = LightApp_AboutDlg.cxx
-SOURCES += LightApp_Application.cxx
-SOURCES += LightApp_DataModel.cxx
-SOURCES += LightApp_DataObject.cxx
-SOURCES += LightApp_DataOwner.cxx
-SOURCES += LightApp_DataSubOwner.cxx
-SOURCES += LightApp_Dialog.cxx
-SOURCES += LightApp_Displayer.cxx
-SOURCES += LightApp_Driver.cxx
-SOURCES += LightApp_EventFilter.cxx
-SOURCES += LightApp_HDFDriver.cxx
-SOURCES += LightApp_Module.cxx
-SOURCES += LightApp_ModuleAction.cxx
-SOURCES += LightApp_ModuleDlg.cxx
-SOURCES += LightApp_NameDlg.cxx
-#SOURCES += LightApp_OBFilter.cxx
-SOURCES += LightApp_OBSelector.cxx
-SOURCES += LightApp_Operation.cxx
-SOURCES += LightApp_Selection.cxx
-SOURCES += LightApp_SelectionMgr.cxx
-SOURCES += LightApp_ShowHideOp.cxx
-SOURCES += LightApp_Study.cxx
-SOURCES += LightApp_SwitchOp.cxx
-SOURCES += LightApp_Preferences.cxx
-SOURCES += LightApp_PreferencesDlg.cxx
-SOURCES += LightApp_WidgetContainer.cxx
-
-#if ENABLE_VTKVIEWER
-#if ENABLE_SALOMEOBJECT
- SOURCES += LightApp_VTKSelector.cxx
-#endif
-#endif
-#if ENABLE_OCCVIEWER
- SOURCES += LightApp_OCCSelector.cxx
-#endif
-#if ENABLE_GLVIEWER
- SOURCES += LightApp_GLSelector.cxx
-#endif
-
-TRANSLATIONS = resources/LightApp_images.ts \
- resources/LightApp_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_AboutDlg.cxx
// Created: 03.06.2005 13:52:45
// Author: Sergey TELKOV
//
#include "LightApp_AboutDlg.h"
+#include "LightApp_Application.h"
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <QPixmap>
#include <QIcon>
#include <QGroupBox>
+#include <QTabWidget>
+#include <QPushButton>
/*!Constructor.*/
LightApp_AboutDlg::LightApp_AboutDlg( const QString& defName, const QString& defVer, QWidget* parent )
pal.setBrush( QPalette::Inactive, QPalette::WindowText, QBrush( Qt::darkBlue ) );
pal.setBrush( QPalette::Inactive, QPalette::Window, QBrush( Qt::white ) );
+
pal.setBrush( QPalette::Disabled, QPalette::WindowText, QBrush( Qt::darkBlue ) );
pal.setBrush( QPalette::Disabled, QPalette::Window, QBrush( Qt::white ) );
+
+
setPalette(pal);
- QVBoxLayout* main = new QVBoxLayout( mainFrame() );
- QtxGridBox* base = new QtxGridBox( 1, Qt::Horizontal, mainFrame(), 0, 0 );
+ QTabWidget* tw = new QTabWidget( mainFrame() );
+
+ QGridLayout* main = new QGridLayout( mainFrame() );
+ main->addWidget( tw, 0, 0, 1, 3 );
+
+ QtxGridBox* base = new QtxGridBox( 1, Qt::Horizontal, tw, 0, 0 );
base->setInsideMargin( 0 );
- main->addWidget( base );
+
+ tw->addTab(base, tr("ABOUT_BASE") );
+
+ tw->addTab(getModulesInfoWidget(tw), tr("ABOUT_MODULE_INFOS") );
+
+ QPushButton * btn = new QPushButton( tr("ABOUT_CLOSE"), mainFrame() );
+
+ main->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 1, 0, 1, 1);
+
+ main->addWidget( btn, 1, 1, 1, 1);
+
+ main->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 1, 2, 1, 1);
+
+ connect(btn, SIGNAL( clicked() ), this, SLOT( accept()) );
+
QLabel* screen = new QLabel( base );
screen->setScaledContents( true );
//! Do nothing.
}
-/*!On mouse press event.*/
-void LightApp_AboutDlg::mousePressEvent( QMouseEvent* )
-{
- accept();
-}
-
/*!Change font of widget \a wid.
*\param wid - QWidget
*\param bold - boolean value
( lab->pixmap() && !lab->pixmap()->isNull() );
vis ? lab->show() : lab->hide();
}
+
+/*! Return widget with info about versions of modules */
+QWidget* LightApp_AboutDlg::getModulesInfoWidget(QWidget* parent) const {
+
+ QWidget* modulesInfo = new QWidget(parent);
+ QGridLayout* gridLayout = new QGridLayout(modulesInfo);
+
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>(SUIT_Session::session()->activeApplication());
+ if(app) {
+
+ CAM_Application::ModuleShortInfoList info = app->getVersionInfo();
+
+ CAM_Application::ModuleShortInfoList::const_iterator it = info.constBegin();
+ int i = 0;
+
+ QString unknownVersion = tr("ABOUT_UNKNOWN_VERSION");
+
+ while (it != info.constEnd()) {
+ QLabel * name = new QLabel( "<h4>" + (*it).name + ":</h4>", modulesInfo);
+ QString v = (*it).version.isEmpty() ? unknownVersion : (*it).version;
+ QLabel * version = new QLabel("<h4>" + v + "</h4>",modulesInfo);
+ gridLayout->addWidget(name , i, 0);
+ gridLayout->addWidget(version , i, 1);
+ gridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), i, 2);
+ it++;
+ i++;
+ }
+ gridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), i, 0);
+ gridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), i, 1);
+ }
+ return modulesInfo;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_AboutDlg.h
// Created: 03.06.2005 13:49:25
// Author: Sergey TELKOV
LightApp_AboutDlg( const QString&, const QString&, QWidget* = 0 );
virtual ~LightApp_AboutDlg();
-protected:
- virtual void mousePressEvent( QMouseEvent* );
-
private:
void checkLabel( QLabel* ) const;
void changeFont( QWidget*, const bool = false, const bool = false,
const bool = false, const int = 0 ) const;
+
+ QWidget* getModulesInfoWidget(QWidget* parent) const;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Application.cxx
// Created: 6/20/2005 18:39:45 PM
// Author: Natalia Donis
-//
+
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+ #include <Standard_math.hxx>
+ #ifndef DISABLE_PYCONSOLE
+ #include <pymath.h>
+ #endif
+#endif
+
#ifndef DISABLE_PYCONSOLE
- #include <PyConsole_Interp.h> // WARNING! This include must be the first!
+ #include "LightApp_PyInterp.h" // WARNING! This include must be the first!
#include <PyConsole_Console.h>
#endif
#include "LightApp_OBSelector.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_DataObject.h"
+#include "LightApp_WgViewModel.h"
+#include "LightApp_FullScreenHelper.h"
+
+
+#include <GUI_version.h>
+#include <Basics_OCCTVersion.hxx>
#include <SALOME_Event.h>
#include <SUIT_Study.h>
#include <SUIT_FileDlg.h>
#include <SUIT_ResourceMgr.h>
+#include <SUIT_ShortcutMgr.h>
#include <SUIT_Tools.h>
#include <SUIT_Accel.h>
#include <SUIT_MessageBox.h>
#include <QtxActionToolMgr.h>
#include <QtxSearchTool.h>
#include <QtxWorkstack.h>
+#include <QtxMap.h>
+#include <QtxWebBrowser.h>
#include <LogWindow.h>
#ifndef DISABLE_PLOT2DVIEWER
#include <Plot2d_ViewManager.h>
#include <Plot2d_ViewModel.h>
+ #include <Plot2d_ViewWindow.h>
+ #include <Plot2d_ViewFrame.h>
#include "LightApp_Plot2dSelector.h"
#ifndef DISABLE_SALOMEOBJECT
#include <SPlot2d_ViewModel.h>
#endif
#endif
-#include <QxScene_ViewManager.h>
-#include <QxScene_ViewModel.h>
-#include <QxScene_ViewWindow.h>
-
#ifndef DISABLE_OCCVIEWER
#include <OCCViewer_ViewManager.h>
+ #include <OCCViewer_ViewFrame.h>
#ifndef DISABLE_SALOMEOBJECT
#include <SOCC_ViewModel.h>
#else
//#endif
#ifndef DISABLE_QXGRAPHVIEWER
- #include <QxGraph_ViewModel.h>
- #include <QxGraph_ViewWindow.h>
- #include <QxGraph_ViewManager.h>
+//VSR: QxGraph has been replaced by QxScene
+// #include <QxGraph_ViewModel.h>
+// #include <QxGraph_ViewWindow.h>
+// #include <QxGraph_ViewManager.h>
+ #include <QxScene_ViewManager.h>
+ #include <QxScene_ViewModel.h>
+ #include <QxScene_ViewWindow.h>
#endif
+
+#define VISIBILITY_COLUMN_WIDTH 25
+
#include <QDir>
#include <QImage>
#include <QString>
#include <QByteArray>
#include <QMenu>
#include <QProcess>
+#include <QTimer>
+#include <QHeaderView>
+#include <QTreeView>
+#include <QMimeData>
+#include <QShortcut>
#include <utilities.h>
#include <SALOME_ListIO.hxx>
#endif
+#include <Standard_Version.hxx>
+
#define ToolBarMarker 0
#define DockWidgetMarker 1
static const char* imageEmptyIcon[] = {
"20 20 1 1",
-". c None",
+". c None",
"....................",
"....................",
"....................",
/*! \var global preferences of LightApp */
LightApp_Preferences* LightApp_Application::_prefs_ = 0;
+
/*!
\class LightApp_Application
Application containing LightApp module
/*!Constructor.*/
LightApp_Application::LightApp_Application()
: CAM_Application( false ),
- myPrefs( 0 )
+ myPrefs( 0 ),
+ myScreenHelper(new LightApp_FullScreenHelper())
{
+ Q_INIT_RESOURCE( LightApp );
+
STD_TabDesktop* desk = new STD_TabDesktop();
+ desk->setFullScreenAllowed(false);
setDesktop( desk );
+ // initialize auto save timer
+ myAutoSaveTimer = new QTimer( this );
+ myAutoSaveTimer->setSingleShot( true );
+ connect( myAutoSaveTimer, SIGNAL( timeout() ), this, SLOT( onSaveDoc() ) );
+
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
QPixmap aLogo = aResMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false );
+ QtxWebBrowser::setData("browser:icon", aResMgr->loadPixmap( "LightApp", tr( "BROWSER_ICON" ) ) );
+ QtxWebBrowser::setData("browser:title", tr( "BROWSER_TITLE" ) );
+ QtxWebBrowser::setData("toolbar:title", tr( "BROWSER_TOOLBAR_TITLE" ) );
+ QtxWebBrowser::setData("menu:file:title", tr( "BROWSER_FILEMENU" ) );
+ QtxWebBrowser::setData("action:close:title", tr( "BROWSER_CLOSE" ) );
+ QtxWebBrowser::setData("action:close:icon", aResMgr->loadPixmap( "LightApp", tr( "BROWSER_CLOSE_ICON" ) ) );
+ QtxWebBrowser::setData("action:back:title", tr( "BROWSER_BACK" ) );
+ QtxWebBrowser::setData("action:forward:title", tr( "BROWSER_FORWARD" ) );
+ QtxWebBrowser::setData("action:find:title", tr( "BROWSER_FIND" ) );
+ QtxWebBrowser::setData("action:findnext:title", tr( "BROWSER_FINDNEXT" ) );
+ QtxWebBrowser::setData("action:findprev:title", tr( "BROWSER_FINDPREV" ) );
+
desktop()->setWindowIcon( aLogo );
desktop()->setDockableMenuBar( false );
desktop()->setDockableStatusBar( false );
QStringList anAddFamilies = aResMgr->stringValue( "PyConsole", "additional_families" ).split( ";", QString::SkipEmptyParts );
QString aFamily;
for ( QStringList::Iterator it = anAddFamilies.begin(); it != anAddFamilies.end(); ++it )
+ {
+ aFamily = *it;
+ if ( famdb.contains(aFamily) )
{
- aFamily = *it;
- if ( famdb.contains(aFamily) )
- {
- f.setFamily( aFamily );
- aResMgr->setValue( "PyConsole", "font", f );
- break;
- }
+ f.setFamily( aFamily );
+ aResMgr->setValue( "PyConsole", "font", f );
+ break;
}
+ }
}
/*!Destructor.
LightApp_Application::~LightApp_Application()
{
delete mySelMgr;
+ delete myScreenHelper;
}
/*!Start application.*/
/*!Gets application name.*/
QString LightApp_Application::applicationName() const
{
- return tr( "APP_NAME" );
+ static QString _app_name;
+ if ( _app_name.isEmpty() )
+ _app_name = tr( "APP_NAME" );
+ return _app_name;
}
/*!Gets application version.*/
}
else
{
- QString path( ::getenv( "GUI_ROOT_DIR" ) );
- if ( !path.isEmpty() )
- path += QDir::separator();
- path += QString( "bin/salome/VERSION" );
-
- QFile vf( path );
- if ( vf.open( QIODevice::ReadOnly ) )
- {
- QString line( vf.readLine( 1024 ) );
- vf.close();
-
- if ( !line.isEmpty() )
- {
- while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
- line.remove( line.length() - 1, 1 );
-
- int idx = line.lastIndexOf( ":" );
- if ( idx != -1 )
- _app_version = line.mid( idx + 1 ).trimmed();
- }
- }
+ _app_version = GUI_VERSION_STR;
}
}
return _app_version;
const QString& suffix,
const int accel )
{
- QAction* a = createAction( id, tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ), QIcon(),
- tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
- tr( QString( "NEW_WINDOW_%1" ).arg( suffix ).toLatin1().constData() ),
- accel, desktop(), false, this, SLOT( onNewWindow() ) );
+ 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, // tooltip
+ accel, // shortcut
+ desktop(), // parent
+ false, // toggle flag
+ this, // receiver
+ SLOT( onNewWindow() ) ); // slot
createMenu( a, parentId, -1 );
}
/*!Create actions:*/
+
void LightApp_Application::createActions()
{
STD_Application::createActions();
//! Preferences
createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIcon(),
- tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
- Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) );
+ tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
+ Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) );
//! Help for modules
int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
- int helpModuleMenu = createMenu( tr( "MEN_DESK_MODULE_HELP" ), helpMenu, -1, 0 );
createMenu( separator(), helpMenu, -1, 1 );
-
QStringList aModuleList;
modules( aModuleList, false );
+ aModuleList.prepend( "GUI" );
+ aModuleList.prepend( "KERNEL" );
int id = LightApp_Application::UserID + FIRST_HELP_ID;
- // help for KERNEL and GUI
- QString dir;//QByteArray dir;
- QString aFileName = "index.html";
- QString root;
- QAction* a;
- dir = getenv("GUI_ROOT_DIR");
- if ( !dir.isEmpty() ) {
- root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
- Qtx::addSlash("salome") + Qtx::addSlash("gui") + Qtx::addSlash("GUI") );
- if ( QFileInfo( root + aFileName ).exists() ) {
- a = createAction( id, tr( QString("GUI Help").toLatin1().constData() ),
- resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
- tr( QString("GUI Help").toLatin1().constData() ),
- tr( QString("GUI Help").toLatin1().constData() ),
- 0, desk, false, this, SLOT( onHelpContentsModule() ) );
- a->setObjectName( QString("GUI") );
- createMenu( a, helpModuleMenu, -1 );
- id++;
- }
- }
- dir = getenv("KERNEL_ROOT_DIR");
- if ( !dir.isEmpty() ) {
- root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
- Qtx::addSlash("salome") );
- if ( QFileInfo( root + aFileName ).exists() ) {
- a = createAction( id, tr( QString("KERNEL Help").toLatin1().constData() ),
- resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
- tr( QString("KERNEL Help").toLatin1().constData() ),
- tr( QString("KERNEL Help").toLatin1().constData() ),
- 0, desk, false, this, SLOT( onHelpContentsModule() ) );
- a->setObjectName( QString("KERNEL") );
- createMenu( a, helpModuleMenu, -1 );
- id++;
- }
- }
+
// help for other existing modules
- QStringList::Iterator it;
- for ( it = aModuleList.begin(); it != aModuleList.end(); ++it )
- {
- if ( (*it).isEmpty() )
+
+ QString aModule;
+ foreach( aModule, aModuleList ) {
+ if ( aModule.isEmpty() ) // module title (user name)
continue;
+ IMap <QString, QString> helpData; // list of help files for the module
+ QString helpSubMenu; // help submenu name (empty if not needed)
+ QString modName = moduleName( aModule ); // module name
+ if ( modName.isEmpty() ) modName = aModule; // for KERNEL and GUI
+ QString rootDir = QString( "%1_ROOT_DIR" ).arg( modName ); // module root dir variable
+ QString modDir = getenv( rootDir.toLatin1().constData() ); // module root dir
+ QString docSection;
+ if (resMgr->hasValue( modName, "documentation" ) )
+ docSection = resMgr->stringValue(modName, "documentation");
+ else if ( resMgr->hasSection( modName + "_documentation" ) )
+ docSection = modName + "_documentation";
+ if ( !docSection.isEmpty() ) {
+ helpSubMenu = resMgr->stringValue( docSection, "sub_menu", "" ).arg( aModule );
+ QStringList listOfParam = resMgr->parameters( docSection );
+ foreach( QString paramName, listOfParam ) {
+ QString valueStr = resMgr->stringValue( docSection, paramName );
+ if ( !valueStr.isEmpty() ) {
+ QFileInfo fi( valueStr );
+ if ( fi.isRelative() && !modDir.isEmpty() )
+ valueStr = Qtx::addSlash( modDir ) + valueStr;
+ if ( QFile::exists( valueStr ) )
+ helpData.insert( paramName.arg( aModule ), valueStr );
+ }
+ }
+ }
+
+ if ( helpData.isEmpty() && !modDir.isEmpty() ) {
+ QStringList idxLst = QStringList() << modDir << "share" << "doc" << "salome" << "gui" << modName << "index.html";
+ QString indexFile = idxLst.join( QDir::separator() ); // index file
+ if ( QFile::exists( indexFile ) )
+ helpData.insert( tr( "%1 module Users's Guide" ).arg( aModule ), indexFile );
+ }
- QString modName = moduleName( *it );
-
- dir = getenv( (modName + "_ROOT_DIR").toLatin1().constData() );
- if ( !dir.isEmpty() ) {
- root = Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") +
- Qtx::addSlash("salome") + Qtx::addSlash("gui") + Qtx::addSlash(modName) );
- if ( QFileInfo( root + aFileName ).exists() ) {
-
- QAction* a = createAction( id, tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
- resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
- tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
- tr( (moduleTitle(modName) + QString(" Help")).toLatin1().constData() ),
- 0, desk, false, this, SLOT( onHelpContentsModule() ) );
- a->setObjectName( modName );
- createMenu( a, helpModuleMenu, -1 );
- id++;
+ IMapConstIterator<QString, QString > fileIt;
+ for ( fileIt = helpData.begin(); fileIt != helpData.end(); fileIt++ ) {
+ QString helpFileName = fileIt.key();
+ // remove all '//' occurances
+ while ( helpFileName.contains( "//" ) )
+ helpFileName.replace( "//", "" );
+ // obtain submenus hierarchy if given
+ QStringList smenus = helpFileName.split( "/" );
+ helpFileName = smenus.last();
+ smenus.removeLast();
+ QAction* a = createAction( id, helpFileName,
+ resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
+ helpFileName, helpFileName,
+ 0, desk, false, this, SLOT( onHelpContentsModule() ) );
+ a->setData( fileIt.value() );
+ if ( !helpSubMenu.isEmpty() ) {
+ smenus.prepend( helpSubMenu );
+ }
+ // create sub-menus hierarchy
+ int menuId = helpMenu;
+ foreach ( QString subMenu, smenus ) {
+ menuId = createMenu( subMenu, menuId, -1, 0 );
}
+ createMenu( a, menuId, -1, 0 );
+ id++;
}
}
const int iconSize = 20;
+ QStringList::Iterator it;
for ( it = modList.begin(); it != modList.end(); ++it )
{
if ( !isLibExists( *it ) )
continue;
+ QString modName = moduleName( *it );
+
+ if ( !isModuleAccessible( *it ) )
+ continue;
+
QString iconName;
if ( iconMap.contains( *it ) )
iconName = iconMap[*it];
- QString modName = moduleName( *it );
-
QPixmap icon = resMgr->loadPixmap( modName, iconName, false );
if ( icon.isNull() )
{
- icon = modIcon;
- INFOS ( "****************************************************************" << std::endl
- << "* Icon for " << (*it).toLatin1().constData() << " not found. Using the default one." << std::endl
- << "****************************************************************" << std::endl );
+ icon = modIcon;
+ INFOS ( "****************************************************************" << std::endl
+ << "* Icon for " << (*it).toLatin1().constData()
+ << " not found. Using the default one." << std::endl
+ << "****************************************************************" << std::endl );
}
icon = Qtx::scaleIcon( icon, iconSize );
moduleAction->insertModule( *it, icon );
}
-
- connect( moduleAction, SIGNAL( moduleActivated( const QString& ) ), this, SLOT( onModuleActivation( const QString& ) ) );
+ connect( moduleAction, SIGNAL( moduleActivated( const QString& ) ),
+ this, SLOT( onModuleActivation( const QString& ) ) );
registerAction( ModulesListId, moduleAction );
}
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
createAction( CloseId, tr( "TOT_CLOSE" ), QIcon(), tr( "MEN_DESK_CLOSE" ), tr( "PRP_CLOSE" ),
- Qt::SHIFT+Qt::Key_C, desk, false, this, SLOT( onCloseWindow() ) );
+ Qt::CTRL+Qt::Key_F4, desk, false, this, SLOT( onCloseWindow() ) );
createAction( CloseAllId, tr( "TOT_CLOSE_ALL" ), QIcon(), tr( "MEN_DESK_CLOSE_ALL" ), tr( "PRP_CLOSE_ALL" ),
0, desk, false, this, SLOT( onCloseAllWindow() ) );
createAction( GroupAllId, tr( "TOT_GROUP_ALL" ), QIcon(), tr( "MEN_DESK_GROUP_ALL" ), tr( "PRP_GROUP_ALL" ),
createActionForViewer( NewVTKViewId, newWinMenu, QString::number( 3 ), Qt::ALT+Qt::Key_K );
#endif
#ifndef DISABLE_QXGRAPHVIEWER
- createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_C );
+//VSR: QxGraph has been replaced by QxScene
+// createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_C );
+ createActionForViewer( NewQxSceneViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_S );
#endif
- createActionForViewer( NewQxSceneViewId, newWinMenu, QString::number( 5 ), Qt::ALT+Qt::Key_S );
-
createAction( RenameId, tr( "TOT_RENAME" ), QIcon(), tr( "MEN_DESK_RENAME" ), tr( "PRP_RENAME" ),
- Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) );
+ Qt::ALT+Qt::SHIFT+Qt::Key_R, desk, false, this, SLOT( onRenameWindow() ) );
createMenu( RenameId, windowMenu, -1 );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createAction( StyleId, tr( "TOT_THEME" ), QIcon(), tr( "MEN_DESK_THEME" ), tr( "PRP_THEME" ),
0, desk, false, this, SLOT( onStylePreferences() ) );
+ createAction( FullScreenId, tr( "TOT_FULLSCREEN" ), QIcon(), tr( "MEN_DESK_FULLSCREEN" ), tr( "PRP_FULLSCREEN" ),
+ Qt::Key_F11, desk, false, this, SLOT( onFullScreen() ) );
+
+
int viewMenu = createMenu( tr( "MEN_DESK_VIEW" ), -1 );
createMenu( separator(), viewMenu, -1, 20, -1 );
createMenu( StyleId, viewMenu, 20, -1 );
+ createMenu( FullScreenId, viewMenu, 20, -1 );
int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ) );
createTool( ModulesListId, modTBar );
putInfo( tr("INF_CANCELLED") );
LightApp_ModuleAction* moduleAction =
- qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
+ qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
if ( moduleAction )
- moduleAction->setActiveModule( QString() );
+ moduleAction->setActiveModule( QString() );
cancelled = true;
}
}
break;
#endif
#ifndef DISABLE_QXGRAPHVIEWER
- case NewQxGraphViewId:
- type = QxGraph_Viewer::Type();
- break;
-#endif
+//VSR: QxGraph has been replaced by QxScene
+// case NewQxGraphViewId:
+// type = QxGraph_Viewer::Type();
+// break;
case NewQxSceneViewId:
type = QxScene_Viewer::Type();
break;
+#endif
}
if ( !type.isEmpty() )
*/
void LightApp_Application::onNewDoc()
{
- saveDockWindowsState();
+ //asl: fix for 0020515
+ if ( activeStudy() )
+ saveDockWindowsState();
CAM_Application::onNewDoc();
}
#endif
#ifndef DISABLE_QXGRAPHVIEWER
- a = action( NewQxGraphViewId );
- if( a )
- a->setEnabled( activeStudy() );
-#endif
+//VSR: QxGraph has been replaced by QxScene
+// a = action( NewQxGraphViewId );
a = action( NewQxSceneViewId );
if( a )
a->setEnabled( activeStudy() );
+#endif
}
/*!
{
public:
RunBrowser( LightApp_Application* app,
- const QString& theApp,
- const QString& theParams,
- const QString& theHelpFile,
- const QString& theContext = QString() )
+ const QString& theApp,
+ const QString& theParams,
+ const QString& theHelpFile,
+ const QString& theContext = QString() )
: myApp( theApp ),
myParams( theParams ),
-#ifdef WIN32
- myHelpFile( "file://" + theHelpFile ),
-#else
- myHelpFile( "file:" + theHelpFile ),
-#endif
myContext( theContext ),
myStatus(0),
myLApp( app )
{
+ //For the external browser always specify 'file://' protocol,
+ //because some WEB browsers (for example Mozilla Firefox) can't open local file without protocol.
+ myHelpFile = QString("file://%1").arg( QFileInfo( theHelpFile ).canonicalFilePath() );
}
virtual void run()
{
- if ( !myApp.isEmpty()) {
- QString aCommand = QString( "%1 %2 %3" ).arg( myApp, myParams, myHelpFile );
- if ( !myContext.isEmpty() )
- aCommand += "#" + myContext;
+ if ( !myApp.isEmpty() && !myHelpFile.isEmpty()) {
+ QString aCommand = QString( "%1 %2 \"%3%4\"" ).arg( myApp, myParams, myHelpFile, myContext.isEmpty() ? QString("") : QString( "#%1" ).arg( myContext ) );
QProcess* proc = new QProcess();
proc->start( aCommand );
if ( !proc->waitForStarted() ) {
- SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
- QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) );
- ce2000->setData( msg );
- QApplication::postEvent( myLApp, ce2000 );
+ SALOME_CustomEvent* ce2000 = new SALOME_CustomEvent( 2000 );
+ QString* msg = new QString( QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).arg( myApp, myHelpFile ) );
+ ce2000->setData( msg );
+ QApplication::postEvent( myLApp, ce2000 );
}
}
}
*/
void LightApp_Application::onHelpContentsModule()
{
- const QAction* obj = (QAction*) sender();
-
- QString aComponentName = obj->objectName();
- QString aFileName = "index.html";
+ const QAction* a = (QAction*) sender();
+ QString helpFile = a->data().toString();
+ if ( helpFile.isEmpty() ) return;
- QString dir = getenv( (aComponentName + "_ROOT_DIR").toLatin1().constData() );
- QString homeDir = !aComponentName.compare(QString("KERNEL")) ?
- Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") ) :
- Qtx::addSlash( Qtx::addSlash(dir) + Qtx::addSlash("share") + Qtx::addSlash("doc") + Qtx::addSlash("salome") + Qtx::addSlash("gui") + Qtx::addSlash(aComponentName) );
-
- QString helpFile = QFileInfo( homeDir + aFileName ).absoluteFilePath();
SUIT_ResourceMgr* resMgr = resourceMgr();
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- QString anApp = resMgr->stringValue("ExternalBrowser", platform);
+ QString anApp = resMgr->stringValue("ExternalBrowser", platform);
#ifdef WIN32
- QString quote("\"");
- anApp.prepend( quote );
- anApp.append( quote );
+ QString quote("\"");
+ anApp.prepend( quote );
+ anApp.append( quote );
#endif
QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
+ bool useExtBrowser = resMgr->booleanValue("ExternalBrowser", "use_external_browser", false );
- if ( !anApp.isEmpty() )
- {
- RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
- rs->start();
- }
- else
- {
- if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+ if( useExtBrowser ) {
+ if ( !anApp.isEmpty() ) {
+ RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile );
+ rs->start();
+ }
+ else {
+ if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
- showPreferences( tr( "PREF_APP" ) );
+ showPreferences( tr( "PREF_APP" ) );
+ }
+ }
+ else {
+#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);
+#else
+ QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile));
+#endif
}
}
SLOT: Displays help contents for choosen dialog
*/
void LightApp_Application::onHelpContextModule( const QString& theComponentName,
- const QString& theFileName,
- const QString& theContext )
-{
+ const QString& theFileName,
+ const QString& theContext )
+{
+ QString fileName = theFileName;
+ QString context = theContext;
+ if ( !QFile::exists( fileName ) && theContext.isEmpty() ) {
+ // context might be passed within theFileName argument
+ QStringList comps = fileName.split("#");
+ if ( comps.count() > 1 ) {
+ context = comps.last();
+ comps.removeLast();
+ fileName = comps.join("#");
+ }
+ }
+
QString homeDir = "";
if ( !theComponentName.isEmpty() ) {
QString dir = getenv( ( theComponentName + "_ROOT_DIR" ).toLatin1().constData() );
if ( !dir.isEmpty() )
homeDir = Qtx::addSlash( Qtx::addSlash( dir ) +
- Qtx::addSlash( "share" ) +
- Qtx::addSlash( "doc" ) +
- Qtx::addSlash( "salome" ) +
- Qtx::addSlash( "gui" ) +
- Qtx::addSlash( theComponentName ) );
+ Qtx::addSlash( "share" ) +
+ Qtx::addSlash( "doc" ) +
+ Qtx::addSlash( "salome" ) +
+ Qtx::addSlash( "gui" ) +
+ Qtx::addSlash( theComponentName ) );
}
- QString helpFile = QFileInfo( homeDir + theFileName ).absoluteFilePath();
+ QString helpFile = QFileInfo( homeDir + fileName ).absoluteFilePath();
SUIT_ResourceMgr* resMgr = resourceMgr();
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- QString anApp = resMgr->stringValue("ExternalBrowser", platform);
+ QString anApp = resMgr->stringValue("ExternalBrowser", platform);
#ifdef WIN32
- QString quote("\"");
- anApp.prepend( quote );
- anApp.append( quote );
+ QString quote("\"");
+ anApp.prepend( quote );
+ anApp.append( quote );
#endif
- QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
- if ( !anApp.isEmpty() )
- {
- RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile, theContext );
- rs->start();
+ bool useExtBrowser = resMgr->booleanValue("ExternalBrowser", "use_external_browser", false );
+
+ if(useExtBrowser) {
+ QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");
+
+ if ( !anApp.isEmpty() ) {
+ RunBrowser* rs = new RunBrowser( this, anApp, aParams, helpFile, context );
+ rs->start();
+ }
+ else {
+ if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+ showPreferences( tr( "PREF_APP" ) );
+ }
}
- else
- {
- if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "DEFINE_EXTERNAL_BROWSER" ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
- showPreferences( tr( "PREF_APP" ) );
+ else {
+#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);
+#else
+ QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile),context);
+#endif
+
}
}
*/
void LightApp_Application::onSelectionChanged()
{
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+ bool canCopy = m ? m->canCopy() : false;
+ bool canPaste = m ? m->canPaste() : false;
+
+ action( EditCopyId )->setEnabled(canCopy);
+ action( EditPasteId )->setEnabled(canPaste);
}
/*!
f = resourceMgr()->fontValue( "PyConsole", "font" );
else
{
- f = ( ( PyConsole_Console* )wid )->font();
- resourceMgr()->setValue( "PyConsole", "font", f );
+ f = ( ( PyConsole_Console* )wid )->font();
+ resourceMgr()->setValue( "PyConsole", "font", f );
}
}
else
dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
dock->setObjectName( QString( "window_%1" ).arg( id ) );
dock->setWidget( wid );
+
+ QKeySequence accel = wid->property( "shortcut" ).value<QKeySequence>();
+ if ( !accel.isEmpty() )
+ dock->toggleViewAction()->setShortcut( accel );
+
dock->show();
}
void LightApp_Application::placeDockWindow( const int id, Qt::DockWidgetArea place )
{
QDockWidget* dock = windowDock( dockWindow( id ) );
- if ( dock && desktop() )
+ if ( dock && desktop() ) {
desktop()->addDockWidget( place, dock );
+ QtxDockAction* a = qobject_cast<QtxDockAction*>( action( ViewWindowsId ) );
+ if ( a ) a->update();
+ }
}
/*!
study->dataModels( dm_list );
QListIterator<CAM_DataModel*> it( dm_list );
while ( it.hasNext() ) {
- CAM_DataModel* camDM = it.next();
+ CAM_DataModel* camDM = it.next();
if ( camDM && camDM->inherits( "LightApp_DataModel" ) )
((LightApp_DataModel*)camDM)->update();
}
}
}
#endif
- if( vmType == QxScene_Viewer::Type() )
- {
- viewMgr = new QxScene_ViewManager( activeStudy(), desktop() );
- QxScene_Viewer* vm = new QxScene_Viewer();
- viewMgr->setViewModel( vm );
- //QxScene_ViewWindow* wnd = dynamic_cast<QxScene_ViewWindow*>( viewMgr->getActiveView() );
- }
//#ifndef DISABLE_SUPERVGRAPHVIEWER
// if( vmType == SUPERVGraph_Viewer::Type() )
// {
// }
//#endif
#ifndef DISABLE_QXGRAPHVIEWER
- if( vmType == QxGraph_Viewer::Type() )
- {
- viewMgr = new QxGraph_ViewManager( activeStudy(), desktop(), new QxGraph_Viewer() );
- }
+//VSR: QxGraph has been replaced by QxScene
+// if( vmType == QxGraph_Viewer::Type() )
+// {
+// viewMgr = new QxGraph_ViewManager( activeStudy(), desktop(), new QxGraph_Viewer() );
+// }
+ if( vmType == QxScene_Viewer::Type() )
+ {
+ viewMgr = new QxScene_ViewManager( activeStudy(), desktop() );
+ QxScene_Viewer* vm = new QxScene_Viewer();
+ viewMgr->setViewModel( vm );
+ //QxScene_ViewWindow* wnd = dynamic_cast<QxScene_ViewWindow*>( viewMgr->getActiveView() );
+ }
#endif
#ifndef DISABLE_OCCVIEWER
if( vmType == OCCViewer_Viewer::Type() )
#ifndef DISABLE_SALOMEOBJECT
vm = new SOCC_Viewer();
#else
- vm = new OCCViewer_Viewer( true, resMgr->booleanValue( "OCCViewer", "static_trihedron", true ) );
+ vm = new OCCViewer_Viewer( true );
#endif
- vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) );
- vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) );
+ vm->setBackground( 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) ) );
+ vm->setBackground( 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) ) );
+
+ vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ),
+ resMgr->booleanValue( "OCCViewer", "relative_size", vm->trihedronRelative() ));
int u( 1 ), v( 1 );
vm->isos( u, v );
u = resMgr->integerValue( "OCCViewer", "iso_number_u", u );
v = resMgr->integerValue( "OCCViewer", "iso_number_v", v );
vm->setIsos( u, v );
+ vm->setInteractionStyle( resMgr->integerValue( "OCCViewer", "navigation_mode", vm->interactionStyle() ) );
+ vm->setZoomingStyle( resMgr->integerValue( "OCCViewer", "zooming_mode", vm->zoomingStyle() ) );
viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface
new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr );
}
if( vm )
{
vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) );
- vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
+ vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
vm->setTrihedronSize( resMgr->doubleValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ),
- resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
+ resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
+ vm->setStaticTrihedronVisible( resMgr->booleanValue( "VTKViewer", "show_static_trihedron", vm->isStaticTrihedronVisible() ) );
vm->setInteractionStyle( resMgr->integerValue( "VTKViewer", "navigation_mode", vm->interactionStyle() ) );
+ vm->setZoomingStyle( resMgr->integerValue( "VTKViewer", "zooming_mode", vm->zoomingStyle() ) );
+ vm->setDynamicPreSelection( resMgr->booleanValue( "VTKViewer", "dynamic_preselection", vm->dynamicPreSelection() ) );
vm->setIncrementalSpeed( resMgr->integerValue( "VTKViewer", "speed_value", vm->incrementalSpeed() ),
- resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
+ resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ),
- resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ),
- resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) );
+ resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ),
+ resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) );
new LightApp_VTKSelector( vm, mySelMgr );
}
#else
viewMgr = new VTKViewer_ViewManager( activeStudy(), desktop() );
VTKViewer_Viewer* vm = dynamic_cast<VTKViewer_Viewer*>( viewMgr->getViewModel() );
if ( vm )
- vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) );
+ vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
#endif
}
#endif
addViewManager( viewMgr );
SUIT_ViewWindow* viewWin = viewMgr->createViewWindow();
- if ( viewWin && desktop() )
+ if ( viewWin && desktop() ) {
viewWin->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) );
+ viewWin->setDropDownButtons( resMgr->booleanValue( "viewers", "drop_down_buttons", true ) );
+ }
return viewMgr;
}
+SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType, QWidget* w )
+{
+ SUIT_ResourceMgr* resMgr = resourceMgr();
+
+ SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(),
+ desktop(),
+ new LightApp_WgViewModel( vmType, w ) );
+ vm->setTitle( QString( "%1: %M - viewer %V" ).arg( vmType ) );
+
+ addViewManager( vm );
+ SUIT_ViewWindow* vw = vm->createViewWindow();
+ if ( vw && desktop() ) {
+ vw->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) );
+ vw->setDropDownButtons( resMgr->booleanValue( "viewers", "drop_down_buttons", true ) );
+ }
+
+ if ( !vmType.isEmpty() && !myUserWmTypes.contains( vmType ) )
+ myUserWmTypes << vmType;
+
+ return vm;
+}
+
/*!
SLOT: Removes view manager from application
*/
/*!Protected SLOT. On study closed.*/
void LightApp_Application::onStudyClosed( SUIT_Study* s )
{
+ // stop auto-save timer
+ myAutoSaveTimer->stop();
+
// Bug 10396: clear selection
mySelMgr->clearSelected();
updateViewManagers();
}
+void LightApp_Application::studySaved( SUIT_Study* s )
+{
+ CAM_Application::studyOpened( s );
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ if ( aResMgr && activeStudy() ) {
+ int autoSaveInterval = aResMgr->integerValue( "Study", "auto_save_interval", 0 );
+ if ( autoSaveInterval > 0 ) myAutoSaveTimer->start( autoSaveInterval*60000 );
+ }
+}
+
void LightApp_Application::studyCreated( SUIT_Study* s )
{
CAM_Application::studyCreated( s );
updateObjectBrowser( true );
}
+/*!Private SLOT. Support drag-and-drop operation.*/
+void LightApp_Application::onDropped( const QList<SUIT_DataObject*>& objects, SUIT_DataObject* parent, int row, Qt::DropAction action )
+{
+ LightApp_DataObject* parentObj = dynamic_cast<LightApp_DataObject*>( parent );
+ if ( !parentObj )
+ return;
+
+ LightApp_Module* aModule = dynamic_cast<LightApp_Module*>( parentObj->module() );
+ if ( aModule )
+ aModule->dropObjects( objects, parentObj, row, action );
+}
+
/*!Private SLOT. On preferences.*/
void LightApp_Application::onPreferences()
{
if ( desktop() )
resourceMgr()->setValue( "desktop", "geometry", desktop()->storeGeometry() );
resourceMgr()->save();
+
+ // Update shortcuts
+ shortcutMgr()->updateShortcuts();
}
delete prefDlg;
ob->setWindowTitle( tr( "OBJECT_BROWSER" ) );
connect( ob, SIGNAL( requestUpdate() ), this, SLOT( onRefresh() ) );
+ QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( ob->model() );
+ treeModel->setSearcher( this );
+ treeModel->registerColumn( 0, EntryCol, LightApp_DataObject::EntryId );
+ treeModel->setAppropriate( EntryCol, Qtx::Toggled );
+
+ // Mantis issue 0020136: Drag&Drop in OB
+ 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 ) ) );
+ }
+
// temporary commented
/*
OB_ListView* ob_list = dynamic_cast<OB_ListView*>( const_cast<QListView*>( ob->listView() ) );
// Create OBSelector
new LightApp_OBSelector( ob, mySelMgr );
+ ob->treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed);
+ ob->treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId);
+ ob->treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH);
+ ob->setProperty( "shortcut", QKeySequence( "Alt+Shift+O" ) );
wid = ob;
-
ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
#ifndef DISABLE_PYCONSOLE
else if ( flag == WT_PyConsole )
{
- PyConsole_Console* pyCons = new PyConsole_Console( desktop() );
+ PyConsole_Console* pyCons = new PyConsole_Console( desktop(),new LightApp_PyInterp());
pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
+ pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
+ pyCons->setIsShowBanner(resourceMgr()->booleanValue( "PyConsole", "show_banner", true ));
+ pyCons->setProperty( "shortcut", QKeySequence( "Alt+Shift+P" ) );
+
wid = pyCons;
pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
{
LogWindow* logWin = new LogWindow( desktop() );
logWin->setWindowTitle( tr( "LOG_WINDOW" ) );
+ logWin->setProperty( "shortcut", QKeySequence( "Alt+Shift+L" ) );
wid = logWin;
logWin->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
that->myPrefs = _prefs_;
- if ( !toCreate )
+ connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ),
+ this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ) );
+
+ if ( !crt )
return myPrefs;
SUIT_ResourceMgr* resMgr = resourceMgr();
for ( QStringList::const_iterator it = modNameList.begin(); it != modNameList.end(); ++it )
{
- if ( !app->isLibExists( *it ) )
- continue;
+ if ( !app->isLibExists( *it ) || _prefs_->hasModule( *it ) )
+ continue;
int modId = _prefs_->addPreference( *it );
if ( iconMap.contains( *it ) )
- _prefs_->setItemIcon( modId, Qtx::scaleIcon( resMgr->loadPixmap( moduleName( *it ), iconMap[*it], false ), 20 ) );
+ _prefs_->setItemIcon( modId, Qtx::scaleIcon( resMgr->loadPixmap( moduleName( *it ), iconMap[*it], false ), 20 ) );
}
ModuleList modList;
CAM_Module* anItem = itr.next();
if ( anItem->inherits( "LightApp_Module" ) )
- mod = (LightApp_Module*)anItem;
+ mod = (LightApp_Module*)anItem;
if ( mod && !_prefs_->hasModule( mod->moduleName() ) )
{
- _prefs_->addPreference( mod->moduleName() );
- mod->createPreferences();
- that->emptyPreferences( mod->moduleName() );
+ _prefs_->addPreference( mod->moduleName() );
+ mod->createPreferences();
+ that->emptyPreferences( mod->moduleName() );
}
}
}
_prefs_->setItemProperty( "info", tr( "PREFERENCES_NOT_LOADED" ) );
- connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ),
- this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ) );
-
return myPrefs;
}
if ( !item || !item->isEmpty() )
return;
- printf( "---------------------> Modify for empty module.\n" );
+ // printf( "---------------------> Modify for empty module.\n" );
QtxPagePrefFrameItem* frm = new QtxPagePrefFrameItem( item->title(), item->parentItem() );
frm->setIcon( item->icon() );
QStringList aValuesList;
QList<QVariant> anIndicesList;
+ QIntList idList;
+ QIntList txtList;
+ // . Top-level "SALOME" preferences group <<start>>
int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
pref->setItemIcon( salomeCat, Qtx::scaleIcon( resourceMgr()->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false ), 20 ) );
+ // .. "General" preferences tab <<start>>
int genTab = pref->addPreference( tr( "PREF_TAB_GENERAL" ), salomeCat );
- int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab );
+ // ... "Language" group <<start>>
+ int langGroup = pref->addPreference( tr( "PREF_GROUP_LANGUAGE" ), genTab );
+ pref->setItemProperty( "columns", 2, langGroup );
+ // .... -> application language
+ int curLang = pref->addPreference( tr( "PREF_CURRENT_LANGUAGE" ), langGroup,
+ LightApp_Preferences::Selector, "language", "language" );
+ QStringList aLangs = SUIT_Session::session()->resourceMgr()->stringValue( "language", "languages", "en" ).split( "," );
+ QList<QVariant> aIcons;
+ foreach ( QString aLang, aLangs ) {
+ aIcons << QPixmap( QString( ":/images/%1" ).arg( aLang ) );
+ }
+ pref->setItemProperty( "strings", aLangs, curLang );
+ pref->setItemProperty( "icons", aIcons, curLang );
+ // ... "Language" group <<end>>
+
+ // ... "Look and feel" group <<start>>
+ int lookGroup = pref->addPreference( tr( "PREF_GROUP_LOOK_AND_FEEL" ), genTab );
+ // .... -> opaque resize
+ pref->addPreference( tr( "PREF_OPAQUE_RESIZE" ), lookGroup, LightApp_Preferences::Bool, "desktop", "opaque_resize" );
+ // .... -> drop-down buttons
+ pref->addPreference( tr( "PREF_DROP_DOWN_BUTTONS" ), lookGroup, LightApp_Preferences::Bool, "viewers", "drop_down_buttons" );
+ // ... "Look and feel" group <<end>>
+
+ // ... "Study properties" group <<start>>
+ int studyGroup = pref->addPreference( tr( "PREF_GROUP_STUDY" ), genTab );
pref->setItemProperty( "columns", 2, studyGroup );
-
+ // .... -> multi-file save
pref->addPreference( tr( "PREF_MULTI_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "multi_file" );
+ // .... -> ascii save mode
pref->addPreference( tr( "PREF_ASCII_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "ascii_file" );
+ // .... -> store windows geometry
pref->addPreference( tr( "PREF_STORE_POS" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" );
-
- int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab );
- QString platform;
+ // .... -> auto-save
+ int autoSaveInterval = pref->addPreference( tr( "PREF_AUTO_SAVE" ), studyGroup,
+ LightApp_Preferences::IntSpin, "Study", "auto_save_interval" );
+ pref->setItemProperty( "min", 0, autoSaveInterval );
+ pref->setItemProperty( "max", 1440, autoSaveInterval );
+ pref->setItemProperty( "special", tr( "PREF_AUTO_SAVE_DISABLED" ), autoSaveInterval );
+ // ... "Study properties" group <<end>>
+
+ // ... "Help browser" group <<start>>
+ int extgroup = pref->addPreference( tr( "PREF_GROUP_EXT_BROWSER" ), genTab, LightApp_Preferences::Auto, "ExternalBrowser", "use_external_browser");
#ifdef WIN32
- platform = "winapplication";
+ QString platform = "winapplication";
#else
- platform = "application";
+ QString platform = "application";
#endif
+ // .... -> browser application
int apppref = pref->addPreference( tr( "PREF_APP" ), extgroup, LightApp_Preferences::File, "ExternalBrowser", platform );
pref->setItemProperty( "mode", Qtx::PT_OpenFile, apppref );
-
+ // .... -> browser parameters
pref->addPreference( tr( "PREF_PARAM" ), extgroup, LightApp_Preferences::String, "ExternalBrowser", "parameters" );
+ // ... "Help browser" group <<end>>
+ // ... "Python console properties" group <<start>>
int pythonConsoleGroup = pref->addPreference( tr( "PREF_GROUP_PY_CONSOLE" ), genTab );
+ // .... -> font
pref->addPreference( tr( "PREF_FONT" ), pythonConsoleGroup, LightApp_Preferences::Font, "PyConsole", "font" );
+ // .... -> show banner
+ pref->addPreference( tr( "PREF_SHOW_BANNER" ), pythonConsoleGroup, LightApp_Preferences::Bool, "PyConsole", "show_banner" );
+ // ... "Python console properties" group <<end>>
- int viewTab = pref->addPreference( tr( "PREF_TAB_VIEWERS" ), salomeCat );
-
- int occGroup = pref->addPreference( tr( "PREF_GROUP_OCCVIEWER" ), viewTab );
-
- int vtkGroup = pref->addPreference( tr( "PREF_GROUP_VTKVIEWER" ), viewTab );
-
- int plot2dGroup = pref->addPreference( tr( "PREF_GROUP_PLOT2DVIEWER" ), viewTab );
-
- int supervGroup = pref->addPreference( tr( "PREF_GROUP_SUPERV" ), viewTab );
-
- pref->setItemProperty( "columns", 2, occGroup );
- pref->setItemProperty( "columns", 1, vtkGroup );
- pref->setItemProperty( "columns", 2, plot2dGroup );
-
- // OCC Viewer
- int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup,
- LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" );
+ // ... "MRU" preferences group <<start>>
+ int mruGroup = pref->addPreference( tr( "PREF_GROUP_MRU" ), genTab, LightApp_Preferences::Auto, "MRU", "show_mru" );
+ pref->setItemProperty( "columns", 4, mruGroup );
+ // number of MRU items
+ int mruVisCount = pref->addPreference( tr( "PREF_MRU_VISIBLE_COUNT" ), mruGroup, LightApp_Preferences::IntSpin,
+ "MRU", "visible_count" );
+ pref->setItemProperty( "min", 0, mruVisCount );
+ pref->setItemProperty( "max", 100, mruVisCount );
+ // MRU links type
+ int mruLinkType = pref->addPreference( tr( "PREF_MRU_LINK_TYPE" ), mruGroup, LightApp_Preferences::Selector,
+ "MRU", "link_type" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_MRU_LINK_AUTO") << tr("PREF_MRU_LINK_SHORT") << tr("PREF_MRU_LINK_FULL");
+ anIndicesList << 0 << 1 << 2 ;
+ pref->setItemProperty( "strings", aValuesList, mruLinkType );
+ pref->setItemProperty( "indexes", anIndicesList, mruLinkType );
+ // ... "MRU" preferences group <<end>>
+ // .. "General" preferences tab <<end>>
+
+ // .. "OCC viewer" group <<start>>
+ int occGroup = pref->addPreference( tr( "PREF_GROUP_OCCVIEWER" ), salomeCat );
+
+ // ... "Trihedron" group <<start>>
+ int occTriGroup = pref->addPreference( tr( "PREF_TRIHEDRON" ), occGroup );
+ pref->setItemProperty( "columns", 2, occTriGroup );
+ // .... -> trihedron size
+ int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occTriGroup,
+ LightApp_Preferences::DblSpin, "OCCViewer", "trihedron_size" );
pref->setItemProperty( "min", 1.0E-06, occTS );
pref->setItemProperty( "max", 1000, occTS );
-
-
- int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup,
- LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" );
+ // .... -> relative size of trihedron
+ pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), occTriGroup, LightApp_Preferences::Bool, "OCCViewer", "relative_size" );
+ // .... -> show static trihedron
+ pref->addPreference( tr( "PREF_SHOW_STATIC_TRIHEDRON" ), occTriGroup, LightApp_Preferences::Bool, "OCCViewer", "show_static_trihedron" );
+ // ... "Trihedron" group <<end>>
+
+ // ... "Iso-lines" group <<start>>
+ int isoGroup = pref->addPreference( tr( "PREF_ISOS" ), occGroup );
+ pref->setItemProperty( "columns", 2, isoGroup );
+ // .... -> nb isos U
+ int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), isoGroup,
+ LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" );
pref->setItemProperty( "min", 0, isoU );
pref->setItemProperty( "max", 100000, isoU );
-
- pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
- LightApp_Preferences::Color, "OCCViewer", "background" );
-
- int isoV = pref->addPreference( tr( "PREF_ISOS_V" ), occGroup,
- LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" );
+ // .... -> nb isos V
+ int isoV = pref->addPreference( tr( "PREF_ISOS_V" ), isoGroup,
+ LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" );
pref->setItemProperty( "min", 0, isoV );
pref->setItemProperty( "max", 100000, isoV );
+ // ... "Iso-lines" group <<end>>
- // VTK Viewer
- int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
- pref->setItemProperty( "columns", 2, vtkGen );
-
- int vtkProjMode = pref->addPreference( tr( "PREF_PROJECTION_MODE" ), vtkGen,
- LightApp_Preferences::Selector, "VTKViewer", "projection_mode" );
- QStringList aProjModeList;
- aProjModeList.append( tr("PREF_ORTHOGRAPHIC") );
- aProjModeList.append( tr("PREF_PERSPECTIVE") );
-
- QList<QVariant> aModeIndexesList;
- aModeIndexesList.append(0);
- aModeIndexesList.append(1);
-
- pref->setItemProperty( "strings", aProjModeList, vtkProjMode );
- pref->setItemProperty( "indexes", aModeIndexesList, vtkProjMode );
-
- pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), vtkGen,
- LightApp_Preferences::Color, "VTKViewer", "background" );
-
- int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkGen,
- LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
-
- pref->setItemProperty( "min", 1.0E-06, vtkTS );
- pref->setItemProperty( "max", 150, vtkTS );
+ // ... "Background" group <<start>>
+ int bgGroup = pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup );
+ // pref->setItemProperty( "columns", 2, bgGroup );
+ aValuesList.clear();
+ anIndicesList.clear();
+ txtList.clear();
+ QString formats = OCCViewer_Viewer::backgroundData( aValuesList, idList, txtList );
+ foreach( int gid, idList ) anIndicesList << gid;
+ // .... -> 3D viewer background
+ int bgId = pref->addPreference( tr( "PREF_3DVIEWER_BACKGROUND" ), bgGroup,
+ 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( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+ pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+ pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+ pref->setItemProperty( "custom_enabled", false, bgId );
+ pref->setItemProperty( "image_formats", formats, bgId );
+ // .... -> XZ viewer background
+ bgId = pref->addPreference( tr( "PREF_XZVIEWER_BACKGROUND" ), bgGroup,
+ 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( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+ pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+ pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+ pref->setItemProperty( "custom_enabled", false, bgId );
+ pref->setItemProperty( "image_formats", formats, bgId );
+ // .... -> YZ viewer background
+ bgId = pref->addPreference( tr( "PREF_YZVIEWER_BACKGROUND" ), bgGroup,
+ 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( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+ pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+ pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+ pref->setItemProperty( "custom_enabled", false, bgId );
+ pref->setItemProperty( "image_formats", formats, bgId );
+ // .... -> XY viewer background
+ bgId = pref->addPreference( tr( "PREF_XYVIEWER_BACKGROUND" ), bgGroup,
+ 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 );
+ pref->setItemProperty( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+ pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+ pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+ pref->setItemProperty( "custom_enabled", false, bgId );
+ pref->setItemProperty( "image_formats", formats, bgId );
+ // ... "Background" group <<end>>
+
+ // ... -> empty frame (for layout) <<start>>
+ int occGen = pref->addPreference( "", occGroup, LightApp_Preferences::Frame );
+ pref->setItemProperty( "margin", 0, occGen );
+ pref->setItemProperty( "columns", 2, occGen );
+ // .... -> navigation mode
+ int occStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), occGen,
+ LightApp_Preferences::Selector, "OCCViewer", "navigation_mode" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_STANDARD_STYLE") << tr("PREF_KEYFREE_STYLE");
+ anIndicesList << 0 << 1;
+ pref->setItemProperty( "strings", aValuesList, occStyleMode );
+ pref->setItemProperty( "indexes", anIndicesList, occStyleMode );
+ // .... -> zooming mode
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+ int occZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), occGen,
+ LightApp_Preferences::Selector, "OCCViewer", "zooming_mode" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_ZOOMING_AT_CENTER") << tr("PREF_ZOOMING_AT_CURSOR");
+ anIndicesList << 0 << 1;
+ pref->setItemProperty( "strings", aValuesList, occZoomingStyleMode );
+ pref->setItemProperty( "indexes", anIndicesList, occZoomingStyleMode );
+#endif
+ // ... -> empty frame (for layout) <<end>>
+ // .. "OCC viewer" group <<end>>
- pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkGen, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
+ // .. "VTK viewer" group <<start>>
+ int vtkGroup = pref->addPreference( tr( "PREF_GROUP_VTKVIEWER" ), salomeCat ); //viewTab
+ // ... -> empty frame (for layout) <<start>>
+ int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
+ //pref->setItemProperty( "columns", 2, vtkGen );
+ // .... -> projection mode
+ int vtkProjMode = pref->addPreference( tr( "PREF_PROJECTION_MODE" ), vtkGen,
+ LightApp_Preferences::Selector, "VTKViewer", "projection_mode" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_ORTHOGRAPHIC") << tr("PREF_PERSPECTIVE");
+ anIndicesList << 0 << 1;
+ pref->setItemProperty( "strings", aValuesList, vtkProjMode );
+ pref->setItemProperty( "indexes", anIndicesList, vtkProjMode );
+ // .... -> background
+ aValuesList.clear();
+ anIndicesList.clear();
+ txtList.clear();
+ 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" );
+ pref->setItemProperty( "gradient_names", aValuesList, bgId );
+ pref->setItemProperty( "gradient_ids", anIndicesList, bgId );
+ pref->setItemProperty( "texture_enabled", !txtList.isEmpty(), bgId );
+ pref->setItemProperty( "texture_center_enabled", (bool)txtList.contains( Qtx::CenterTexture ), bgId );
+ pref->setItemProperty( "texture_tile_enabled", (bool)txtList.contains( Qtx::TileTexture ), bgId );
+ pref->setItemProperty( "texture_stretch_enabled", (bool)txtList.contains( Qtx::StretchTexture ), bgId );
+ pref->setItemProperty( "custom_enabled", false, bgId );
+ pref->setItemProperty( "image_formats", formats, bgId );
+ // .... -> navigation mode
int vtkStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), vtkGen,
- LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" );
- QStringList aStyleModeList;
- aStyleModeList.append( tr("PREF_STANDARD_STYLE") );
- aStyleModeList.append( tr("PREF_KEYFREE_STYLE") );
-
- pref->setItemProperty( "strings", aStyleModeList, vtkStyleMode );
- pref->setItemProperty( "indexes", aModeIndexesList, vtkStyleMode );
-
- pref->addPreference( "", vtkGroup, LightApp_Preferences::Space );
-
+ LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_STANDARD_STYLE") << tr("PREF_KEYFREE_STYLE");
+ anIndicesList << 0 << 1;
+ pref->setItemProperty( "strings", aValuesList, vtkStyleMode );
+ pref->setItemProperty( "indexes", anIndicesList, vtkStyleMode );
+ // .... -> zooming mode
+ int vtkZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), vtkGen,
+ LightApp_Preferences::Selector, "VTKViewer", "zooming_mode" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_ZOOMING_AT_CENTER") << tr("PREF_ZOOMING_AT_CURSOR");
+ anIndicesList << 0 << 1;
+ pref->setItemProperty( "strings", aValuesList, vtkZoomingStyleMode );
+ pref->setItemProperty( "indexes", anIndicesList, vtkZoomingStyleMode );
+ // .... -> speed increment
int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
- LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
-
+ LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
pref->setItemProperty( "min", 1, vtkSpeed );
pref->setItemProperty( "max", 1000, vtkSpeed );
-
+ // .... -> speed mode
int vtkSpeedMode = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED_MODE" ), vtkGen,
- LightApp_Preferences::Selector, "VTKViewer", "speed_mode" );
- QStringList aSpeedModeList;
- aSpeedModeList.append( tr("PREF_ARITHMETIC") );
- aSpeedModeList.append( tr("PREF_GEOMETRICAL") );
-
- pref->setItemProperty( "strings", aSpeedModeList, vtkSpeedMode );
- pref->setItemProperty( "indexes", aModeIndexesList, vtkSpeedMode );
+ LightApp_Preferences::Selector, "VTKViewer", "speed_mode" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr("PREF_ARITHMETIC") << tr("PREF_GEOMETRICAL");
+ anIndicesList << 0 << 1;
+ pref->setItemProperty( "strings", aValuesList, vtkSpeedMode );
+ pref->setItemProperty( "indexes", anIndicesList, vtkSpeedMode );
+ // .... -> dynamic pre-selection
+ pref->addPreference( tr( "PREF_DYNAMIC_PRESELECTION" ), vtkGen, LightApp_Preferences::Bool, "VTKViewer", "dynamic_preselection" );
+ // ... -> empty frame (for layout) <<end>>
+
+ // ... "Trihedron" group <<start>>
+ int vtkTriGroup = pref->addPreference( tr( "PREF_TRIHEDRON" ), vtkGroup );
+ pref->setItemProperty( "columns", 2, vtkTriGroup );
+ // .... -> trihedron size
+ int vtkTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), vtkTriGroup,
+ LightApp_Preferences::DblSpin, "VTKViewer", "trihedron_size" );
+ pref->setItemProperty( "min", 1.0E-06, vtkTS );
+ pref->setItemProperty( "max", 150, vtkTS );
+ // .... -> relative size of trihedron
+ pref->addPreference( tr( "PREF_RELATIVE_SIZE" ), vtkTriGroup, LightApp_Preferences::Bool, "VTKViewer", "relative_size" );
+ // .... -> static trihedron
+ pref->addPreference( tr( "PREF_SHOW_STATIC_TRIHEDRON" ), vtkTriGroup, LightApp_Preferences::Bool, "VTKViewer", "show_static_trihedron" );
+ // ... "Trihedron" group <<end>>
+ // ... space mouse sub-group <<start>>
int vtkSM = pref->addPreference( tr( "PREF_FRAME_SPACEMOUSE" ), vtkGroup, LightApp_Preferences::GroupBox );
- pref->setItemProperty( "columns", 2, vtkSM );
+ //pref->setItemProperty( "columns", 2, vtkSM );
+ // .... -> decrease speed increment
int spacemousePref1 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_1" ), vtkSM,
- LightApp_Preferences::Selector, "VTKViewer",
- "spacemouse_func1_btn" ); //decrease_speed_increment
+ LightApp_Preferences::Selector, "VTKViewer",
+ "spacemouse_func1_btn" );
+ // .... -> increase speed increment
int spacemousePref2 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_2" ), vtkSM,
- LightApp_Preferences::Selector, "VTKViewer",
- "spacemouse_func2_btn" ); //increase_speed_increment
+ LightApp_Preferences::Selector, "VTKViewer",
+ "spacemouse_func2_btn" );
+ // .... -> dominant / combined switch
int spacemousePref3 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_3" ), vtkSM,
- LightApp_Preferences::Selector, "VTKViewer",
- "spacemouse_func5_btn" ); //dominant_combined_switch
-
- QStringList values;
- values.append( tr( "PREF_SPACEMOUSE_BTN_1" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_2" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_3" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_4" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_5" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_6" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_7" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_8" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_*" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_10" ) );
- values.append( tr( "PREF_SPACEMOUSE_BTN_11" ) );
- QList<QVariant> indices;
- indices.append( 1 );
- indices.append( 2 );
- indices.append( 3 );
- indices.append( 4 );
- indices.append( 5 );
- indices.append( 6 );
- indices.append( 7 );
- indices.append( 8 );
- indices.append( 9 ); // == button_*
- indices.append( 10 );
- indices.append( 11 );
- pref->setItemProperty( "strings", values, spacemousePref1 );
- pref->setItemProperty( "indexes", indices, spacemousePref1 );
- pref->setItemProperty( "strings", values, spacemousePref2 );
- pref->setItemProperty( "indexes", indices, spacemousePref2 );
- pref->setItemProperty( "strings", values, spacemousePref3 );
- pref->setItemProperty( "indexes", indices, spacemousePref3 );
-
+ LightApp_Preferences::Selector, "VTKViewer",
+ "spacemouse_func5_btn" ); //
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr( "PREF_SPACEMOUSE_BTN_1" ) << tr( "PREF_SPACEMOUSE_BTN_2" ) << tr( "PREF_SPACEMOUSE_BTN_3" );
+ aValuesList << tr( "PREF_SPACEMOUSE_BTN_4" ) << tr( "PREF_SPACEMOUSE_BTN_5" ) << tr( "PREF_SPACEMOUSE_BTN_6" );
+ aValuesList << tr( "PREF_SPACEMOUSE_BTN_7" ) << tr( "PREF_SPACEMOUSE_BTN_8" ) << tr( "PREF_SPACEMOUSE_BTN_*" );
+ aValuesList << tr( "PREF_SPACEMOUSE_BTN_10" ) << tr( "PREF_SPACEMOUSE_BTN_11" );
+ anIndicesList << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11;
+ pref->setItemProperty( "strings", aValuesList, spacemousePref1 );
+ pref->setItemProperty( "indexes", anIndicesList, spacemousePref1 );
+ pref->setItemProperty( "strings", aValuesList, spacemousePref2 );
+ pref->setItemProperty( "indexes", anIndicesList, spacemousePref2 );
+ pref->setItemProperty( "strings", aValuesList, spacemousePref3 );
+ pref->setItemProperty( "indexes", anIndicesList, spacemousePref3 );
+ // ... space mouse sub-group <<end>>
+
+ // ... avi recording sub-group <<start>>
int vtkRec = pref->addPreference( tr( "PREF_FRAME_RECORDING" ), vtkGroup, LightApp_Preferences::GroupBox );
pref->setItemProperty( "columns", 2, vtkRec );
-
+ // .... -> recording mode
int modePref = pref->addPreference( tr( "PREF_RECORDING_MODE" ), vtkRec,
- LightApp_Preferences::Selector, "VTKViewer", "recorder_mode" );
- values.clear();
- values.append( tr( "PREF_SKIPPED_FRAMES" ) );
- values.append( tr( "PREF_ALL_DISLPAYED_FRAMES" ) );
- indices.clear();
- indices.append( 0 );
- indices.append( 1 );
- pref->setItemProperty( "strings", values, modePref );
- pref->setItemProperty( "indexes", indices, modePref );
-
+ LightApp_Preferences::Selector, "VTKViewer", "recorder_mode" );
+ aValuesList.clear();
+ anIndicesList.clear();
+ aValuesList << tr( "PREF_SKIPPED_FRAMES" ) << tr( "PREF_ALL_DISLPAYED_FRAMES" );
+ anIndicesList << 0 << 1;
+ pref->setItemProperty( "strings", aValuesList, modePref );
+ pref->setItemProperty( "indexes", anIndicesList, modePref );
+ // .... -> fps
int fpsPref = pref->addPreference( tr( "PREF_FPS" ), vtkRec,
- LightApp_Preferences::DblSpin, "VTKViewer", "recorder_fps" );
+ LightApp_Preferences::DblSpin, "VTKViewer", "recorder_fps" );
pref->setItemProperty( "min", 0.1, fpsPref );
pref->setItemProperty( "max", 100, fpsPref );
-
+ // .... -> quality
int qualityPref = pref->addPreference( tr( "PREF_QUALITY" ), vtkRec,
- LightApp_Preferences::IntSpin, "VTKViewer", "recorder_quality" );
+ LightApp_Preferences::IntSpin, "VTKViewer", "recorder_quality" );
pref->setItemProperty( "min", 1, qualityPref );
pref->setItemProperty( "max", 100, qualityPref );
-
+ // .... -> progressive mode
pref->addPreference( tr( "PREF_PROGRESSIVE" ), vtkRec,
- LightApp_Preferences::Bool, "VTKViewer", "recorder_progressive" );
-
- // Plot2d
+ LightApp_Preferences::Bool, "VTKViewer", "recorder_progressive" );
+ // ... avi recording sub-group <<end>>
+
+ // ... group names sub-group <<start>>
+ int vtkGN = pref->addPreference( tr( "PREF_FRAME_GROUP_NAMES" ), vtkGroup,
+ LightApp_Preferences::GroupBox, "VTKViewer", "show_group_names" );
+ pref->setItemProperty( "columns", 2, vtkGN );
+ // .... -> text color
+ pref->addPreference( tr( "PREF_GROUP_NAMES_TEXT_COLOR" ), vtkGN,
+ LightApp_Preferences::Color, "VTKViewer", "group_names_text_color" );
+ // .... -> transparency
+ int transPref = pref->addPreference( tr( "PREF_GROUP_NAMES_TRANSPARENCY" ), vtkGN,
+ LightApp_Preferences::DblSpin, "VTKViewer", "group_names_transparency" );
+ pref->setItemProperty( "min", 0.0, transPref );
+ pref->setItemProperty( "max", 1.0, transPref );
+ pref->setItemProperty( "step", 0.1, transPref );
+ // ... -> group names sub-group <<end>>
+ // .. "VTK viewer" group <<end>>
+
+ // .. "Plot2d viewer" group <<start>>
+ int plot2dGroup = pref->addPreference( tr( "PREF_GROUP_PLOT2DVIEWER" ), salomeCat ); //viewTab
+ //pref->setItemProperty( "columns", 2, plot2dGroup );
+
+ // ... -> show legend
pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup,
- LightApp_Preferences::Bool, "Plot2d", "ShowLegend" );
-
+ LightApp_Preferences::Bool, "Plot2d", "ShowLegend" );
+ // ... -> legend position
int legendPosition = pref->addPreference( tr( "PREF_LEGEND_POSITION" ), plot2dGroup,
- LightApp_Preferences::Selector, "Plot2d", "LegendPos" );
+ LightApp_Preferences::Selector, "Plot2d", "LegendPos" );
aValuesList.clear();
anIndicesList.clear();
aValuesList << tr("PREF_LEFT") << tr("PREF_RIGHT") << tr("PREF_TOP") << tr("PREF_BOTTOM");
anIndicesList << 0 << 1 << 2 << 3 ;
-
pref->setItemProperty( "strings", aValuesList, legendPosition );
pref->setItemProperty( "indexes", anIndicesList, legendPosition );
-
+ // ... -> legend font
+ pref->addPreference( tr( "PREF_LEGEND_FONT" ), plot2dGroup, LightApp_Preferences::Font, "Plot2d", "LegendFont" );
+ // ... -> curve type
int curveType = pref->addPreference( tr( "PREF_CURVE_TYPE" ), plot2dGroup,
- LightApp_Preferences::Selector, "Plot2d", "CurveType" );
+ LightApp_Preferences::Selector, "Plot2d", "CurveType" );
aValuesList.clear();
anIndicesList.clear();
aValuesList << tr("PREF_POINTS") << tr("PREF_LINES") << tr("PREF_SPLINE");
anIndicesList << 0 << 1 << 2 ;
-
pref->setItemProperty( "strings", aValuesList, curveType );
pref->setItemProperty( "indexes", anIndicesList, curveType );
-
+ // ... -> marker size
int markerSize = pref->addPreference( tr( "PREF_MARKER_SIZE" ), plot2dGroup,
- LightApp_Preferences::IntSpin, "Plot2d", "MarkerSize" );
-
+ LightApp_Preferences::IntSpin, "Plot2d", "MarkerSize" );
pref->setItemProperty( "min", 0, markerSize );
pref->setItemProperty( "max", 100, markerSize );
-
+ // ... -> horizontal scaling mode
+ int horScale = pref->addPreference( tr( "PREF_HOR_AXIS_SCALE" ), plot2dGroup,
+ LightApp_Preferences::Selector, "Plot2d", "HorScaleMode" );
aValuesList.clear();
anIndicesList.clear();
aValuesList << tr("PREF_LINEAR") << tr("PREF_LOGARITHMIC");
anIndicesList << 0 << 1 ;
-
- int horScale = pref->addPreference( tr( "PREF_HOR_AXIS_SCALE" ), plot2dGroup,
- LightApp_Preferences::Selector, "Plot2d", "HorScaleMode" );
-
pref->setItemProperty( "strings", aValuesList, horScale );
pref->setItemProperty( "indexes", anIndicesList, horScale );
-
+ // ... -> vertical scaling mode
int verScale = pref->addPreference( tr( "PREF_VERT_AXIS_SCALE" ), plot2dGroup,
- LightApp_Preferences::Selector, "Plot2d", "VerScaleMode" );
-
+ LightApp_Preferences::Selector, "Plot2d", "VerScaleMode" );
pref->setItemProperty( "strings", aValuesList, verScale );
pref->setItemProperty( "indexes", anIndicesList, verScale );
-
- pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), plot2dGroup,
- LightApp_Preferences::Color, "Plot2d", "Background" );
-
+ // ... -> background
+ pref->addPreference( tr( "PREF_VIEWER_BACKGROUND_COLOR" ), plot2dGroup,
+ LightApp_Preferences::Color, "Plot2d", "Background" );
+ // ... -> font color
+ pref->addPreference( tr( "PREF_FONT_COLOR" ), plot2dGroup, LightApp_Preferences::Color, "Plot2d", "LegendFontColor" );
+ // ... -> selection font color
+ pref->addPreference( tr( "PREF_SELECTED_FONT_COLOR" ), plot2dGroup, LightApp_Preferences::Color, "Plot2d", "SelectedLegendFontColor" );
+ // ... -> selection color
+ pref->addPreference( tr( "PREF_VIEWER_SELECTION" ), plot2dGroup,
+ LightApp_Preferences::Color, "Plot2d", "SelectionColor" );
+ // ... -> errors/deviation colot
+ pref->addPreference( tr( "PREF_DEVIATION_COLOR" ), plot2dGroup,
+ LightApp_Preferences::Color, "Plot2d", "DeviationMarkerColor" );
+ // ... -> deviation markers line size
+ int deviationMarkerLw = pref->addPreference( tr( "PREF_DEVIATION_MARKER_LW" ), plot2dGroup,
+ LightApp_Preferences::IntSpin, "Plot2d", "DeviationMarkerLineWidth" );
+ pref->setItemProperty( "min", 1, deviationMarkerLw );
+ pref->setItemProperty( "max", 5, deviationMarkerLw );
+ // ... -> deviation markers tick mark size
+ int deviationMarkerTs = pref->addPreference( tr( "PREF_DEVIATION_MARKER_TS" ), plot2dGroup,
+ LightApp_Preferences::IntSpin, "Plot2d", "DeviationMarkerTickSize" );
+ pref->setItemProperty( "min", 1, deviationMarkerTs );
+ pref->setItemProperty( "max", 5, deviationMarkerTs );
+ // .. "Plot2d viewer" group <<end>>
+
+ // .. "Directories" preferences tab <<start>>
int dirTab = pref->addPreference( tr( "PREF_TAB_DIRECTORIES" ), salomeCat );
+ // ... --> quick directories list
int dirGroup = pref->addPreference( tr( "PREF_GROUP_DIRECTORIES" ), dirTab );
pref->addPreference( tr( "" ), dirGroup,
- LightApp_Preferences::DirList, "FileDlg", "QuickDirList" );
-
- pref->setItemProperty( "columns", 4, supervGroup );
- pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), supervGroup,
- LightApp_Preferences::Color, "SUPERVGraph", "Background" );
- pref->addPreference( tr( "PREF_SUPERV_TITLE_COLOR" ), supervGroup,
- LightApp_Preferences::Color, "SUPERVGraph", "Title" );
-// pref->addPreference( tr( "PREF_SUPERV_CTRL_COLOR" ), supervGroup,
-// LightApp_Preferences::Color, "SUPERVGraph", "Ctrl" );
+ LightApp_Preferences::DirList, "FileDlg", "QuickDirList" );
+ // .. "Directories" preferences tab <<end>>
+ // .. "Object browser" preferences tab <<start>>
int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
+
+ // ... "Search tool" group <<start>>
int stGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SEARCH_TOOL" ), obTab );
+ // .... --> auto-hide
pref->addPreference( tr( "PREF_AUTO_HIDE_SEARCH_TOOL" ), stGroup, LightApp_Preferences::Bool,
- "ObjectBrowser", "auto_hide_search_tool" );
+ "ObjectBrowser", "auto_hide_search_tool" );
+ // ... "Search tool" group <<end>>
- int objSetGroup = pref->addPreference( tr( "PREF_OBJ_BROWSER_SETTINGS" ), obTab );
+ // ... "Object browser settings" group <<start>>
+ int objSetGroup = pref->addPreference( tr( "PREF_GROUP_LOOK_AND_FEEL" ), obTab );
pref->setItemProperty( "columns", 2, objSetGroup );
+ // .... -> auto size first column
pref->addPreference( tr( "PREF_AUTO_SIZE_FIRST" ), objSetGroup, LightApp_Preferences::Bool,
- "ObjectBrowser", "auto_size_first" );
+ "ObjectBrowser", "auto_size_first" );
+ // .... -> auto size other columns
pref->addPreference( tr( "PREF_AUTO_SIZE" ), objSetGroup, LightApp_Preferences::Bool,
- "ObjectBrowser", "auto_size" );
+ "ObjectBrowser", "auto_size" );
+ // .... -> resize columns on expand item
pref->addPreference( tr( "PREF_RESIZE_ON_EXPAND_ITEM" ), objSetGroup, LightApp_Preferences::Bool,
- "ObjectBrowser", "resize_on_expand_item" );
-
- // MRU preferences
- int mruGroup = pref->addPreference( tr( "PREF_GROUP_MRU" ), genTab, LightApp_Preferences::Auto, "MRU", "show_mru" );
- pref->setItemProperty( "columns", 4, mruGroup );
- int mruVisCount = pref->addPreference( tr( "PREF_MRU_VISIBLE_COUNT" ), mruGroup, LightApp_Preferences::IntSpin,
- "MRU", "visible_count" );
- pref->setItemProperty( "min", 0, mruVisCount );
- pref->setItemProperty( "max", 100, mruVisCount );
- int mruLinkType = pref->addPreference( tr( "PREF_MRU_LINK_TYPE" ), mruGroup, LightApp_Preferences::Selector,
- "MRU", "link_type" );
+ "ObjectBrowser", "resize_on_expand_item" );
+ // .... -> browse to published object
+ int browsePublished = pref->addPreference( tr( "PREF_BROWSE_TO_THE_PUBLISHED_OBJECT" ), objSetGroup, LightApp_Preferences::Selector,
+ "ObjectBrowser", "browse_published_object" );
aValuesList.clear();
anIndicesList.clear();
- aValuesList << tr("PREF_MRU_LINK_AUTO") << tr("PREF_MRU_LINK_SHORT") << tr("PREF_MRU_LINK_FULL");
- anIndicesList << 0 << 1 << 2 ;
- pref->setItemProperty( "strings", aValuesList, mruLinkType );
- pref->setItemProperty( "indexes", anIndicesList, mruLinkType );
+ aValuesList << tr( "PREF_BROWSE_NEVER" ) << tr( "PREF_BROWSE_AFTER_APPLY_AND_CLOSE_ONLY" ) << tr( "PREF_BROWSE_ALWAYS" );
+ anIndicesList << BP_Never << BP_ApplyAndClose << BP_Always;
+ pref->setItemProperty( "strings", aValuesList, browsePublished );
+ pref->setItemProperty( "indexes", anIndicesList, browsePublished );
+ // ... "Object browser settings" group <<end>>
+ // .. "Object browser" preferences tab <<end>>
+
+ // .. "Shortcuts" preferences tab <<start>>
+ int shortcutTab = pref->addPreference( tr( "PREF_TAB_SHORTCUTS" ), salomeCat );
+ // ... "Shortcuts settings" group <<start>>
+ int shortcutGroup = pref->addPreference( tr( "PREF_GROUP_SHORTCUTS" ), shortcutTab );
+ pref->addPreference( tr( "" ), shortcutGroup,
+ LightApp_Preferences::ShortcutTree, "shortcuts" );
+ // ... "Shortcuts settings" group <<end>>
+ // .. "Shortcuts" preferences tab <<end>>
+ // . Top-level "SALOME" preferences group <<end>>
pref->retrieve();
}
if ( !resMgr )
return;
+ if ( sec == "viewers" && param == "drop_down_buttons" )
+ {
+ ViewManagerList vmlist = viewManagers();
+ foreach( SUIT_ViewManager* vm, vmlist )
+ {
+ QVector<SUIT_ViewWindow*> vwlist = vm->getViews();
+ foreach( SUIT_ViewWindow* vw, vwlist )
+ if ( vw ) vw->setDropDownButtons( resMgr->booleanValue( "viewers", "drop_down_buttons", true ) );
+ }
+ }
+
#ifndef DISABLE_OCCVIEWER
- if ( sec == QString( "OCCViewer" ) && param == QString( "trihedron_size" ) )
+ if ( sec == QString( "OCCViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )))
{
- double sz = resMgr->doubleValue( sec, param, -1 );
+ double sz = resMgr->doubleValue( sec, "trihedron_size", -1 );
+ bool relative = resMgr->booleanValue( sec, "relative_size", true );
QList<SUIT_ViewManager*> lst;
viewManagers( OCCViewer_Viewer::Type(), lst );
QListIterator<SUIT_ViewManager*> it( lst );
{
SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
- continue;
+ continue;
OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
- occVM->setTrihedronSize( sz );
+ occVM->setTrihedronSize( sz, relative );
occVM->getAISContext()->UpdateCurrentViewer();
}
}
#endif
+#ifndef DISABLE_OCCVIEWER
+ if ( sec == QString( "OCCViewer" ) && param == QString( "show_static_trihedron" ) )
+ {
+ bool isVisible = resMgr->booleanValue( "OCCViewer", "show_static_trihedron", true );
+ QList<SUIT_ViewManager*> lst;
+ viewManagers( OCCViewer_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
+ continue;
+
+ OCCViewer_Viewer* occVM = dynamic_cast<OCCViewer_Viewer*>( vm );
+ if( occVM )
+ {
+ occVM->setStaticTrihedronDisplayed( isVisible );
+ }
+ }
+ }
+#endif
+
+#ifndef DISABLE_OCCVIEWER
+ if ( sec == QString( "OCCViewer" ) && param == QString( "navigation_mode" ) )
+ {
+ int mode = resMgr->integerValue( "OCCViewer", "navigation_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+ viewManagers( OCCViewer_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
+ continue;
+
+ OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
+ occVM->setInteractionStyle( mode );
+ }
+ }
+#endif
+
+#ifndef DISABLE_OCCVIEWER
+ if ( sec == QString( "OCCViewer" ) && param == QString( "zooming_mode" ) )
+ {
+ int mode = resMgr->integerValue( "OCCViewer", "zooming_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+ viewManagers( OCCViewer_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
+ continue;
+
+ OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
+ occVM->setZoomingStyle( mode );
+ }
+ }
+#endif
+
#ifndef DISABLE_VTKVIEWER
if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) )
{
{
SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
- continue;
+ continue;
SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
if( vtkVM )
{
- vtkVM->setTrihedronSize( sz, isRelative );
- vtkVM->Repaint();
+ vtkVM->setTrihedronSize( sz, isRelative );
+ vtkVM->Repaint();
}
}
#endif
{
SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
- continue;
+ continue;
SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
if( vtkVM ) vtkVM->setIncrementalSpeed( speed, mode );
{
SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
- continue;
+ continue;
SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
if( vtkVM ) vtkVM->setProjectionMode( mode );
{
SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
- continue;
+ continue;
SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
if( vtkVM ) vtkVM->setInteractionStyle( mode );
}
#endif
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "zooming_mode" ) )
+ {
+ int mode = resMgr->integerValue( "VTKViewer", "zooming_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setZoomingStyle( mode );
+ }
+#endif
+ }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "dynamic_preselection" ) )
+ {
+ bool mode = resMgr->booleanValue( "VTKViewer", "dynamic_preselection", true );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setDynamicPreSelection( mode );
+ }
+#endif
+ }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "show_static_trihedron" ) )
+ {
+ bool isVisible = resMgr->booleanValue( "VTKViewer", "show_static_trihedron", true );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM )
+ {
+ vtkVM->setStaticTrihedronVisible( isVisible );
+ vtkVM->Repaint();
+ }
+ }
+#endif
+ }
+#endif
+
#ifndef DISABLE_VTKVIEWER
if ( sec == QString( "VTKViewer" ) && (param == QString( "spacemouse_func1_btn" ) ||
- param == QString( "spacemouse_func2_btn" ) ||
- param == QString( "spacemouse_func5_btn" ) ) )
+ param == QString( "spacemouse_func2_btn" ) ||
+ param == QString( "spacemouse_func5_btn" ) ) )
{
int btn1 = resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", 1 );
int btn2 = resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", 2 );
{
SUIT_ViewModel* vm = it.next()->getViewModel();
if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
- continue;
+ continue;
SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
if( vtkVM ) vtkVM->setSpacemouseButtons( btn1, btn2, btn3 );
{
OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>( it.next() );
if( mgr && mgr->getOCCViewer() )
- mgr->getOCCViewer()->setIsos( u, v );
+ mgr->getOCCViewer()->setIsos( u, v );
}
}
#endif
bool autoSizeFirst = resMgr->booleanValue( "ObjectBrowser", "auto_size_first", true );
ob->setAutoSizeFirstColumn( autoSizeFirst );
if ( autoSizeFirst )
- ob->adjustFirstColumnWidth();
+ ob->adjustFirstColumnWidth();
}
else if ( param=="auto_size" ) {
bool autoSize = resMgr->booleanValue( "ObjectBrowser", "auto_size", false );
ob->setAutoSizeColumns(autoSize);
if ( autoSize )
- ob->adjustColumnsWidth();
+ ob->adjustColumnsWidth();
}
else if ( param=="resize_on_expand_item" ) {
bool resizeOnExpandItem = resMgr->booleanValue( "ObjectBrowser", "resize_on_expand_item", false );
{
if( param=="store_positions" )
updateWindows();
+ if( param=="auto_save_interval" ) {
+ myAutoSaveTimer->stop();
+ int autoSaveInterval = resMgr->integerValue( "Study", "auto_save_interval", 0 );
+ if ( activeStudy() && autoSaveInterval > 0 ) myAutoSaveTimer->start( autoSaveInterval*60000 );
+ }
}
#ifndef DISABLE_PYCONSOLE
- if( sec=="PyConsole" )
+ if( sec=="PyConsole" && pythonConsole() )
{
- if( param=="font" )
- if( pythonConsole() )
- pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
+ if ( param=="font" ) {
+ pythonConsole()->setFont( resMgr->fontValue( "PyConsole", "font" ) );
+ }
+ else if ( param=="show_banner" ) {
+ pythonConsole()->setIsShowBanner( resMgr->booleanValue( "PyConsole", "show_banner", true ) );
+ }
}
#endif
QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
if ( mru ) {
if ( param == "visible_count" )
- mru->setVisibleCount( resMgr->integerValue( "MRU", "visible_count", 5 ) ); // 5 MRU items by default
+ mru->setVisibleCount( resMgr->integerValue( "MRU", "visible_count", 5 ) ); // 5 MRU items by default
else if ( param == "max_count" )
- mru->setHistoryCount( resMgr->integerValue( "MRU", "max_count", -1 ) ); // unlimited history by default
+ mru->setHistoryCount( resMgr->integerValue( "MRU", "max_count", -1 ) ); // unlimited history by default
else if ( param == "insert_mode" )
- mru->setInsertMode( resMgr->integerValue( "MRU", "insert_mode", 0 ) ); // QtxMRUAction::MoveFirst by default
+ mru->setInsertMode( resMgr->integerValue( "MRU", "insert_mode", 0 ) ); // QtxMRUAction::MoveFirst by default
else if ( param == "link_type" )
- mru->setLinkType( resMgr->integerValue( "MRU", "link_type", 0 ) ); // QtxMRUAction::LinkAuto by default
+ mru->setLinkType( resMgr->integerValue( "MRU", "link_type", 0 ) ); // QtxMRUAction::LinkAuto by default
else if ( param == "show_clear" )
- mru->setClearPossible( resMgr->booleanValue( "MRU", "show_clear", false ) ); // do not show "Clear" item by default
+ mru->setClearPossible( resMgr->booleanValue( "MRU", "show_clear", false ) ); // do not show "Clear" item by default
else if ( param == "show_mru" )
- mru->setVisible( resMgr->booleanValue( "MRU", "show_mru", false ) ); // do not show MRU menu item by default
+ mru->setVisible( resMgr->booleanValue( "MRU", "show_mru", false ) ); // do not show MRU menu item by default
+ }
+ }
+ if ( sec == "language" && param == "language" )
+ {
+ SUIT_MessageBox::information( desktop(), tr( "WRN_WARNING" ), tr( "LANG_CHANGED" ) );
+ }
+ if ( sec == "desktop" && param == "opaque_resize" ) {
+ bool opaqueResize = resMgr->booleanValue( "desktop", "opaque_resize", false );
+ QMainWindow::DockOptions dopts = desktop()->dockOptions();
+ if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
+ else dopts &= ~QMainWindow::AnimatedDocks;
+ desktop()->setDockOptions( dopts );
+ desktop()->setOpaqueResize( opaqueResize );
+ if ( dynamic_cast<STD_TabDesktop*>( desktop() ) )
+ dynamic_cast<STD_TabDesktop*>( desktop() )->workstack()->setOpaqueResize( opaqueResize );
+ }
+
+ if ( sec == "ExternalBrowser" && param == "use_external_browser" ) {
+ if ( resMgr->booleanValue("ExternalBrowser", "use_external_browser", false ) )
+ {
+ if(QtxWebBrowser::webBrowser())
+ QtxWebBrowser::webBrowser()->close();
+ }
+ }
+
+#ifndef DISABLE_PLOT2DVIEWER
+ if ( sec == "Plot2d" ) {
+ if( param == "SelectionColor" ) {
+ QColor c = resMgr->colorValue( sec, param );
+ Plot2d_Object::setSelectionColor(c);
+ }
+ else if (param == "SelectedLegendFontColor") {
+ QColor c = resMgr->colorValue( sec, param );
+ Plot2d_Object::setHighlightedLegendTextColor(c);
}
}
+#endif
}
/*!
myWinVis.insert( *itr, arr );
}
- if ( desktop() )
+ if ( desktop() ) {
desktop()->retrieveGeometry( aResMgr->stringValue( "desktop", "geometry" ) );
+ bool opaqueResize = aResMgr->booleanValue( "desktop", "opaque_resize", false );
+ QMainWindow::DockOptions dopts = desktop()->dockOptions();
+ if ( opaqueResize ) dopts |= QMainWindow::AnimatedDocks;
+ else dopts &= ~QMainWindow::AnimatedDocks;
+ desktop()->setDockOptions( dopts );
+ desktop()->setOpaqueResize( opaqueResize );
+ if ( dynamic_cast<STD_TabDesktop*>( desktop() ) )
+ dynamic_cast<STD_TabDesktop*>( desktop() )->workstack()->setOpaqueResize( opaqueResize );
+ }
}
/*!
void LightApp_Application::updateModuleActions()
{
QString modName;
- if ( activeModule() )
+ if ( activeModule() ) {
modName = activeModule()->moduleName();
+ if ( !isModuleAccessible( modName ) ) {
+ QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+ foreach( SUIT_Application* app, apps ) {
+ LightApp_Application* lapp = dynamic_cast<LightApp_Application*>( app );
+ if ( lapp && lapp != this )
+ lapp->removeModuleAction( modName );
+ }
+ }
+ }
LightApp_ModuleAction* moduleAction =
qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
moduleAction->setActiveModule( modName );
}
+void LightApp_Application::removeModuleAction( const QString& modName )
+{
+ LightApp_ModuleAction* moduleAction =
+ qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
+ if ( moduleAction )
+ moduleAction->removeModule( modName );
+}
+
/*!
Gets current windows.
\param winMap - output current windows map.
for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it )
{
if ( !dockWindow( it.key() ) )
- getWindow( it.key() );
+ getWindow( it.key() );
}
}
*/
void LightApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title )
{
- CAM_Application::contextMenuPopup( type, thePopup, title );
+ //Add "Rename" item
+ LightApp_SelectionMgr* selMgr = LightApp_Application::selectionMgr();
+ bool cacheIsOn = selMgr->isSelectionCacheEnabled();
+ selMgr->setSelectionCacheEnabled( true );
SUIT_DataBrowser* ob = objectBrowser();
+
+ CAM_Application::contextMenuPopup( type, thePopup, title );
+
if ( ob && type == ob->popupClientType() ) {
thePopup->addSeparator();
QAction* a = thePopup->addAction( tr( "MEN_REFRESH" ), this, SLOT( onRefresh() ) );
- if ( ob->updateKey() )
- a->setShortcut( ob->updateKey() );
+ if ( ob->shortcutKey(SUIT_DataBrowser::UpdateShortcut) )
+ a->setShortcut( ob->shortcutKey(SUIT_DataBrowser::UpdateShortcut) );
+ }
+
+ if ( selMgr && ob ) {
+ SALOME_ListIO selected;
+ selMgr->selectedObjects( selected );
+ if(selected.Extent() == 1){
+ Handle(SALOME_InteractiveObject) anIObject = selected.First();
+ SUIT_DataObject* obj = findObject(anIObject->getEntry());
+ if(obj && obj->renameAllowed()) {
+ QAction* a = new QAction(tr("MEN_RENAME_OBJ"), thePopup);
+ connect( a, SIGNAL( triggered(bool) ), ob, SLOT( onStartEditing() ) );
+ if ( ob->shortcutKey(SUIT_DataBrowser::RenameShortcut) )
+ a->setShortcut( ob->shortcutKey(SUIT_DataBrowser::RenameShortcut) );
+
+ QList<QAction*> acts = thePopup->actions();
+ QAction* firstAction = acts.count() > 0 ? acts.first() : 0;
+ thePopup->insertAction(firstAction,a);
+ }
+ }
}
+
+ selMgr->setSelectionCacheEnabled( cacheIsOn );
}
/*!
if ( objectBrowser() )
objectBrowser()->updateTree();
+
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ if ( aResMgr && activeStudy() ) {
+ int autoSaveInterval = aResMgr->integerValue( "Study", "auto_save_interval", 0 );
+ if ( autoSaveInterval > 0 ) myAutoSaveTimer->start( autoSaveInterval*60000 );
+ }
+}
+
+/*!Set desktop:*/
+void LightApp_Application::setDesktop( SUIT_Desktop* desk )
+{
+ CAM_Application::setDesktop( desk );
+
+ if ( desk ) {
+ connect( desk, SIGNAL( message( const QString& ) ),
+ this, SLOT( onDesktopMessage( const QString& ) ), Qt::UniqueConnection );
+ }
}
/*!
resourceMgr()->setValue( "Style", "use_salome_style", Style_Salome::isActive() );
}
+void LightApp_Application::onFullScreen(){
+ if(myScreenHelper) {
+ if(desktop()->isFullScreen())
+ myScreenHelper->switchToNormalScreen();
+ else
+ myScreenHelper->switchToFullScreen();
+ }
+}
+
/*!
Connects just added view manager
*/
{
disconnect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
this, SLOT( onCloseView( SUIT_ViewManager* ) ) );
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+ if (aStudy )
+ aStudy->removeViewMgr(vm->getGlobalId());
+
STD_Application::removeViewManager( vm );
- delete vm;
+
+ // IPAL22894: Crash on closing OCC view
+ //delete vm;
+ vm->deleteLater();
}
/*!
//abd: changed libSalomePyQtGUI to SalomePyQtGUI for WIN32
bool isPythonModule = lib.contains("SalomePyQtGUI");
+ bool isPythonLightModule = lib.contains("libSalomePyQtGUILight");
QStringList paths;
#ifdef WIN32
if( inf.exists() )
{
- isLibFound = true;
- break;
+ isLibFound = true;
+ break;
}
}
<< "* Module " << moduleTitle.toLatin1().constData() << " will not be available in GUI mode" << std::endl
<< "****************************************************************" << std::endl );
}
- else if ( !isPythonModule )
+ else if ( !isPythonModule && !isPythonLightModule)
return true;
- if ( isPythonModule )
+ if ( isPythonModule || isPythonLightModule)
{
QString pylib = moduleName( moduleTitle ) + QString(".py");
QString pylibgui = moduleName( moduleTitle ) + QString("GUI.py");
bool isPyLib = false, isPyGuiLib = false;
QStringList::const_iterator anIt = paths.begin(), aLast = paths.end();
for( ; anIt!=aLast; anIt++ )
- {
- QFileInfo inf( Qtx::addSlash( *anIt ) + pylib );
- QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui );
+ {
+ QFileInfo inf( Qtx::addSlash( *anIt ) + pylib );
+ QFileInfo infgui( Qtx::addSlash( *anIt ) + pylibgui );
- if( !isPyLib && inf.exists() )
- isPyLib = true;
+ if(!isPythonLightModule)
+ if( !isPyLib && inf.exists() )
+ isPyLib = true;
- if( !isPyGuiLib && infgui.exists() )
- isPyGuiLib = true;
+ if( !isPyGuiLib && infgui.exists() )
+ isPyGuiLib = true;
- if ( isPyLib && isPyGuiLib && isLibFound)
- return true;
- }
+ if ((isPyLib || isPythonLightModule ) && isPyGuiLib && isLibFound)
+ return true;
+ }
printf( "****************************************************************\n" );
printf( "* Warning: python library for %s cannot be found:\n", moduleTitle.toLatin1().constData() );
if (!isPyLib)
- printf( "* No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() );
+ printf( "* No module named %s\n", moduleName( moduleTitle ).toLatin1().constData() );
if (!isPyGuiLib)
- printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() );
+ printf( "* No module named %s\n", (moduleName( moduleTitle ) + QString("GUI")).toLatin1().constData() );
printf( "****************************************************************\n" );
return true;
}
SALOME_CustomEvent* ce = ( SALOME_CustomEvent* )e;
QString* d = ( QString* )ce->data();
if( SUIT_MessageBox::question(0, tr("WRN_WARNING"),
- d ? *d : "",
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
+ d ? *d : "",
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes )
showPreferences( tr( "PREF_APP" ) );
if( d )
delete d;
{
if (theObj)
{
- bool isSuitable = !theObj->entry().isEmpty() &&
- !theObj->componentDataType().isEmpty() &&
- !theObj->name().isEmpty();
+ bool isSuitable = !theObj->entry().isEmpty() &&
+ !theObj->componentDataType().isEmpty() &&
+ !theObj->name().isEmpty();
return isSuitable;
}
{
// Do you want to reload it?
if ( SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYOPEN" ).arg( aName ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ) == SUIT_MessageBox::Yes )
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No ) == SUIT_MessageBox::Yes )
choice = OpenReload;
}
QList<SUIT_Application*> appList = session->applications();
for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !app; ++it )
{
- if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
- app = ::qobject_cast<STD_Application*>( *it );
+ if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
+ app = ::qobject_cast<STD_Application*>( *it );
}
if ( app )
{
- app->onCloseDoc( false );
- appList = session->applications();
- STD_Application* other = 0;
- for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !other; ++it )
- other = ::qobject_cast<STD_Application*>( *it );
-
- if ( other )
- res = other->onOpenDoc( aName );
+ app->onCloseDoc( false );
+ appList = session->applications();
+ STD_Application* other = 0;
+ for ( QList<SUIT_Application*>::iterator it = appList.begin(); it != appList.end() && !other; ++it )
+ other = ::qobject_cast<STD_Application*>( *it );
+
+ if ( other )
+ res = other->onOpenDoc( aName );
}
}
break;
return res;
}
+
+QStringList LightApp_Application::viewManagersTypes() const
+{
+ QStringList aTypesList;
+ aTypesList += myUserWmTypes;
+#ifndef DISABLE_GLVIEWER
+ aTypesList<<GLViewer_Viewer::Type();
+#endif
+#ifndef DISABLE_PLOT2DVIEWER
+ aTypesList<<Plot2d_Viewer::Type();
+#endif
+#ifndef DISABLE_QXGRAPHVIEWER
+ aTypesList<<QxScene_Viewer::Type();
+#endif
+#ifndef DISABLE_OCCVIEWER
+ aTypesList<<OCCViewer_Viewer::Type();
+#endif
+#ifndef DISABLE_VTKVIEWER
+ #ifndef DISABLE_SALOMEOBJECT
+ aTypesList<<SVTK_Viewer::Type();
+ #else
+ aTypesList<<VTKViewer_Viewer::Type();
+ #endif
+#endif
+ return aTypesList;
+}
+/*!
+ * Removes all view managers of known types
+ * Other view managers are ignored
+ */
+void LightApp_Application::clearKnownViewManagers()
+{
+ QStringList aTypesList = viewManagersTypes();
+ QList<SUIT_ViewManager*> aMgrList;
+ viewManagers( aMgrList );
+ foreach (SUIT_ViewManager* aMgr, aMgrList) {
+ if (aTypesList.contains(aMgr->getType()))
+ removeViewManager(aMgr);
+ }
+}
+
+/*!
+ Copy of current selection
+ */
+void LightApp_Application::onCopy()
+{
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+ if( m )
+ m->copy();
+}
+
+/*!
+ Paste of current data in clipboard
+ */
+void LightApp_Application::onPaste()
+{
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+ if( m )
+ m->paste();
+}
+
+/*!
+ Browse (i.e. set focus on) the published objects
+ \param theIsApplyAndClose - flag indicating that the dialog for creating objects
+ has been accepted by Ok (or Apply & Close) button
+ \param theIsOptimizedBrowsing - flag switching to optimized browsing mode
+ (to select the first published object only)
+ \return entry of the selected object
+ */
+QString LightApp_Application::browseObjects( const QStringList& theEntryList,
+ const bool theIsApplyAndClose,
+ const bool theIsOptimizedBrowsing )
+{
+ QString aResult;
+ if( SUIT_ResourceMgr* aResourceMgr = resourceMgr() )
+ {
+ int aBrowsePolicy = aResourceMgr->integerValue( "ObjectBrowser", "browse_published_object", (int)BP_Never );
+ switch( aBrowsePolicy )
+ {
+ case BP_Never:
+ return aResult;
+ case BP_ApplyAndClose:
+ if( !theIsApplyAndClose )
+ return aResult;
+ case BP_Always:
+ default:
+ break;
+ }
+ }
+
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( activeStudy() );
+ if( !aStudy )
+ return aResult;
+
+ SUIT_DataBrowser* anOB = objectBrowser();
+ if( !anOB )
+ return aResult;
+
+ SUIT_AbstractModel* aModel = dynamic_cast<SUIT_AbstractModel*>( anOB->model() );
+ if( !aModel )
+ return aResult;
+
+ QStringListIterator anIter( theEntryList );
+ if( theIsOptimizedBrowsing )
+ {
+ // go to the last entry
+ anIter.toBack();
+ if( anIter.hasPrevious() )
+ anIter.previous();
+ }
+
+ // scroll to each entry in the list
+ // (in optimized mode - to the last entry only)
+ QString anEntry;
+ LightApp_DataObject* anObject;
+ while( anIter.hasNext() )
+ {
+ anEntry = anIter.next();
+ if( !anEntry.isEmpty() )
+ {
+ anObject = aStudy->findObjectByEntry( anEntry );
+ if( anObject )
+ {
+ QModelIndex anIndex = aModel->index( anObject );
+ anOB->treeView()->scrollTo( anIndex );
+ }
+ }
+ }
+
+ // always select the last object
+ if( anObject && !anEntry.isEmpty() )
+ {
+ QList<SUIT_Selector*> aSelectorList;
+ selectionMgr()->selectors( "ObjectBrowser", aSelectorList );
+ if( !aSelectorList.isEmpty() )
+ {
+ if( LightApp_OBSelector* aSelector = dynamic_cast<LightApp_OBSelector*>( aSelectorList.first() ) )
+ {
+ bool anIsAutoBlock = aSelector->autoBlock();
+
+ // temporarily disable auto block, to emit LightApp_SelectionMgr::currentSelectionChanged() signal
+ aSelector->setAutoBlock( false );
+
+ SUIT_DataOwnerPtrList aList;
+#ifndef DISABLE_SALOMEOBJECT
+ Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
+ ( anObject->entry().toLatin1().constData(),
+ anObject->componentDataType().toLatin1().constData(),
+ anObject->name().toLatin1().constData() );
+ LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj );
+#else
+ LightApp_DataOwner* owner = new LightApp_DataOwner( anEntry );
+#endif
+
+ aList.append( owner );
+ selectionMgr()->setSelected( aList );
+ aResult = anEntry;
+
+ // restore auto block flag
+ aSelector->setAutoBlock( anIsAutoBlock );
+ }
+ }
+ }
+
+ return aResult;
+}
+
+SUIT_DataObject* LightApp_Application::findObject( const QString& id ) const
+{
+ LightApp_Study* study = dynamic_cast<LightApp_Study*>( activeStudy() );
+ return study ? study->findObjectByEntry( id ) : 0;
+}
+
+/*!
+ Checks that an object can be renamed.
+ \param entry entry of the object
+ \brief Return \c true if object can be renamed
+*/
+bool LightApp_Application::renameAllowed( const QString& /*entry*/) const {
+ return false;
+}
+
+/*!
+ Rename object by entry.
+ \param entry entry of the object
+ \param name new name of the object
+ \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool LightApp_Application::renameObject( const QString& entry, const QString& ) {
+ return false;
+}
+
+/*! Process standard messages from desktop */
+void LightApp_Application::onDesktopMessage( const QString& message )
+{
+ const QString sectionSeparator = "/";
+
+ if ( message.toLower() == "updateobjectbrowser" ||
+ message.toLower() == "updateobjbrowser" ) {
+ // update object browser
+ updateObjectBrowser();
+ }
+ else {
+ QStringList data = message.split( sectionSeparator );
+ if ( data.count() > 1 ) {
+ QString msgType = data[0].trimmed();
+ LightApp_Module* sMod = 0;
+ CAM_Module* mod = module( msgType );
+ if ( !mod )
+ mod = module( moduleTitle( msgType ) );
+ if ( mod && mod->inherits( "LightApp_Module" ) )
+ 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 );
+ }
+ }
+ else if ( sMod ) {
+ // received message for the module
+ QString msg = QStringList( data.mid(1) ).join( sectionSeparator );
+ sMod->message( msg );
+ }
+ }
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Application.h
// Created: 6/20/2005 18:39:25 PM
// Author: OCC team
-//
+
#ifndef LIGHTAPP_APPLICATION_H
#define LIGHTAPP_APPLICATION_H
#endif // _MSC_VER > 1000
#include "LightApp.h"
+#include <SUIT_TreeModel.h>
#include <CAM_Application.h>
#include <QPointer>
+#include <QStringList>
class LogWindow;
#ifndef DISABLE_PYCONSOLE
class LightApp_WidgetContainer;
class LightApp_Preferences;
class LightApp_SelectionMgr;
+class LightApp_FullScreenHelper;
class LightApp_DataObject;
class SUIT_DataBrowser;
class SUIT_Study;
class QWidget;
class QStringList;
class QDockWidget;
+class QTimer;
#ifdef WIN32
#pragma warning( disable:4251 )
Description : Application containing only LightApp module
*/
-class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application
+class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application, public SUIT_DataSearcher
{
Q_OBJECT
enum { MenuWindowId = 6 };
enum { RenameId = CAM_Application::UserID,
- CloseId, CloseAllId, GroupAllId,
- PreferencesId, MRUId, ModulesListId,
+ CloseId, CloseAllId, GroupAllId,
+ PreferencesId, MRUId, ModulesListId,
NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, NewQxGraphViewId,
- NewQxSceneViewId, StyleId,
- UserID };
+ NewQxSceneViewId = NewQxGraphViewId, StyleId, FullScreenId,
+ UserID };
protected:
enum { NewStudyId = 1, OpenStudyId };
+ enum BrowsePolicy { BP_Never = 0, BP_ApplyAndClose, BP_Always };
+
public:
LightApp_Application();
virtual ~LightApp_Application();
virtual QString getFileFilter() const;
virtual QString getFileName( bool open, const QString& initial, const QString& filters,
- const QString& caption, QWidget* parent );
+ const QString& caption, QWidget* parent );
virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent );
virtual QStringList getOpenFileNames( const QString& initial, const QString& filters,
- const QString& caption, QWidget* parent );
+ const QString& caption, QWidget* parent );
void updateActions();
virtual void addViewManager( SUIT_ViewManager* );
virtual void removeViewManager( SUIT_ViewManager* );
virtual SUIT_ViewManager* createViewManager( const QString& vmType );
+ virtual SUIT_ViewManager* createViewManager( const QString& vmType, QWidget* w );
QWidget* getWindow( const int, const int = -1 );
QWidget* dockWindow( const int ) const;
virtual void createEmptyStudy();
+ virtual void setDesktop( SUIT_Desktop* );
+
SUIT_Accel* accel() const;
void setDefaultStudyName( const QString& theName );
virtual void updateDesktopTitle();
+ //! Returns list of view manager types which are supported by this application
+ QStringList viewManagersTypes() const;
+
+ //! Removes ViewManagers only of known type
+ virtual void clearKnownViewManagers();
+
+ virtual QString browseObjects( const QStringList& theEntryList,
+ const bool theIsApplyAndClose = true,
+ const bool theIsOptimizedBrowsing = false );
+
+ virtual SUIT_DataObject* findObject( const QString& ) const;
+
+ virtual bool renameAllowed( const QString& ) const;
+ virtual bool renameObject( const QString&, const QString& );
+
signals:
void studyOpened();
void studySaved();
virtual void onOpenDoc();
virtual void onHelpAbout();
virtual bool onOpenDoc( const QString& );
+ virtual void onCopy();
+ virtual void onPaste();
+ virtual void onSelectionChanged();
protected:
virtual void createActions();
virtual void setActiveStudy( SUIT_Study* );
virtual void updateCommandsStatus();
- virtual void onSelectionChanged();
virtual void beforeCloseDoc( SUIT_Study* );
virtual void afterCloseDoc();
void onMRUActivated( const QString& );
void onStylePreferences();
+ void onFullScreen();
+
+ virtual void onDesktopMessage( const QString& );
private slots:
void onSelection();
void onRefresh();
+ void onDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction );
void onPreferences();
void onPreferenceChanged( QString&, QString&, QString& );
void onRenameWindow();
void updateWindows();
void updateViewManagers();
void updateModuleActions();
+ void removeModuleAction( const QString& );
void loadDockWindowsState();
void saveDockWindowsState();
virtual void studyOpened( SUIT_Study* );
virtual void studyCreated( SUIT_Study* );
+ virtual void studySaved( SUIT_Study* );
void updatePreference( const QString&, const QString&, const QString& );
LightApp_Preferences* myPrefs;
LightApp_SelectionMgr* mySelMgr;
+ LightApp_FullScreenHelper* myScreenHelper;
+
WinMap myWin;
WinVis myWinVis;
WinGeom myWinGeom;
SUIT_Accel* myAccel;
+ QTimer* myAutoSaveTimer;
static LightApp_Preferences* _prefs_;
static int lastStudyId;
+ QStringList myUserWmTypes;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_DataModel.cxx
// Created: 10/25/2004 10:36:06 AM
// Author: Sergey LITONIN
{
myGroupId = 0;
if( module() )
- myGroupId = qHash( module()->name() );
+ myGroupId = qHash( module()->name() );
}
/*!
return true;
}
+/*!
+ Does nothing by default. Should be redefined in light modules
+ that want to participate in "Dump study" operation.
+*/
+bool LightApp_DataModel::dumpPython( const QString&, CAM_Study*, bool, QStringList& )
+{
+ return true;
+}
+
/*!
Emit closed()
*/
*/
void LightApp_DataModel::update( LightApp_DataObject*, LightApp_Study* )
{
- LightApp_ModuleObject* modelRoot = dynamic_cast<LightApp_ModuleObject*>( root() );
+ // san: Previously modelRoot was casted to LightApp_ModuleObject*,
+ // BUT this is incorrect: in full SALOME the model root has different type.
+ // Hopefully LightApp_DataObject* is sufficient here.
+ LightApp_DataObject* modelRoot = dynamic_cast<LightApp_DataObject*>( root() );
DataObjectList ch;
QMap<SUIT_DataObject*,int> aMap;
if( modelRoot )
build();
- modelRoot = dynamic_cast<LightApp_ModuleObject*>( root() );
+ modelRoot = dynamic_cast<LightApp_DataObject*>( root() );
if( modelRoot )
{
DataObjectList new_ch = modelRoot->children();
{
SUIT_AbstractModel* m = dynamic_cast<SUIT_AbstractModel*>( browser ? browser->model() : 0 );
if( m )
- m->unregisterColumn( groupId(), name );
+ m->unregisterColumn( groupId(), name );
+}
+
+/*!
+ Creates the data model's root (module object) using the study services.
+ This is important because different study classes use different moduel object classes.
+ Therefore creation of the module object cannot be done at the data model level
+ where the type of the current study instance should not be known.
+ The module object returned by this method should be then passed to the model's setRoot().
+ \return the module object instance corresponding to the study type
+ \sa CAM_DataModel class
+*/
+CAM_ModuleObject* LightApp_DataModel::createModuleObject( SUIT_DataObject* theRoot ) const
+{
+ LightApp_RootObject* aStudyRoot = dynamic_cast<LightApp_RootObject*>( theRoot );
+ if ( !aStudyRoot )
+ return 0;
+
+ LightApp_Study* aStudy = aStudyRoot->study();
+ if ( aStudy )
+ return aStudy->createModuleObject( const_cast<LightApp_DataModel*>( this ),
+ theRoot );
+ return 0;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_DataModel.h
// Created: 10/25/2004 10:32:33 AM
// Author: Sergey LITONIN
class LightApp_Study;
class LightApp_DataObject;
class SUIT_DataBrowser;
+class CAM_ModuleObject;
/*!
Description : Base class of data model
virtual bool save( QStringList& );
virtual bool saveAs( const QString&, CAM_Study*, QStringList& );
virtual bool close();
+ virtual bool dumpPython( const QString&,
+ CAM_Study*,
+ bool,
+ QStringList& );
virtual void update( LightApp_DataObject* = 0, LightApp_Study* = 0 );
LightApp_Study* getStudy() const;
virtual void build();
virtual void updateWidgets();
+ virtual CAM_ModuleObject* createModuleObject( SUIT_DataObject* theRoot ) const;
private:
int myGroupId;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_DataObject.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#include "LightApp_DataObject.h"
#include "LightApp_Study.h"
#include "LightApp_DataModel.h"
+#include "LightApp_Module.h"
+#include "LightApp_Application.h"
#include <CAM_Module.h>
#include <SUIT_DataObjectKey.h>
#include <QVariant>
+#include <iostream>
+
/*!
\class LightApp_DataObject::Key
\brief Represents unique data object key for the LightApp_DataObject
*/
/*!
- \brief Constructor.
+ \brief Constructor.
\param parent parent data object
*/
LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent )
-: CAM_DataObject( parent ),
- myCompObject( 0 ),
+: CAM_DataObject( parent ),
+ myCompObject( 0 ),
myCompDataType( "" )
{
}
return m ? m->groupId() : CAM_DataObject::groupId();
}
+/*!
+ \brief return custom data for data object
+*/
+QVariant LightApp_DataObject::customData(Qtx::CustomDataType type) {
+ switch(type) {
+ case Qtx::IdType:
+ return EntryId;
+ break;
+ default:
+ return QVariant();
+ break;
+ }
+}
+
+/*!
+ \brief Check if the object is visible.
+ \return \c true if this object is displayable or \c false otherwise
+*/
+bool LightApp_DataObject::isVisible() const
+{
+ LightApp_RootObject* r = dynamic_cast<LightApp_RootObject*>( root() );
+ return r && r->study() && componentDataType() != r->study()->getVisualComponentName();
+}
+
+/*!
+ \brief Check if the object is draggable.
+
+ This method can be re-implemented in the subclasses.
+
+ \return \c true if it is possible to drag this object
+*/
+bool LightApp_DataObject::isDraggable() const
+{
+ LightApp_Module* aModule = dynamic_cast<LightApp_Module*>(module());
+ if (aModule) {
+ return aModule->isDraggable(this);
+ }
+ return false;
+}
+
+/*!
+ \brief Check if the drop operation fo this object is possible.
+
+ This method can be re-implemented in the subclasses.
+
+ \param obj object being dropped
+ \return \c true if it is possible to drop an object \c obj
+ to this object
+*/
+bool LightApp_DataObject::isDropAccepted() const
+{
+ LightApp_Module* aModule = dynamic_cast<LightApp_Module*>(module());
+ if (aModule) {
+ return aModule->isDropAccepted(this);
+ }
+ return false;
+}
+
+/*!
+ \brief Check if this object is can't be renamed in place
+
+ This method can be re-implemented in the subclasses.
+ Default implementation returns \c false (all objects can not be renamed).
+
+ \param id column id
+ \return \c true if the item can be renamed by the user in place (e.g. in the Object browser)
+*/
+bool LightApp_DataObject::renameAllowed( const int id ) const
+{
+ if ( id == NameId ) {
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( module() );
+ LightApp_Application* app = 0;
+ LightApp_RootObject* r = dynamic_cast<LightApp_RootObject*>( root() );
+ if(r && r->study())
+ app = dynamic_cast<LightApp_Application*>(r->study()->application());
+
+ return ( m && m->renameAllowed( entry() ) ) ||
+ ( app && app->renameAllowed( entry() ) );
+ }
+ return CAM_DataObject::renameAllowed( id );
+}
+
+
+/*!
+ \brief Set name of the this object.
+
+ This method can be re-implemented in the subclasses.
+ Default implementation returns \c false.
+
+ \return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool LightApp_DataObject::setName(const QString& name)
+{
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( module() );
+ LightApp_RootObject* r = dynamic_cast<LightApp_RootObject*>( root() );
+ LightApp_Application* app =
+ (r && r->study()) ? dynamic_cast<LightApp_Application*>(r->study()->application()) : 0;
+
+ return ( m && m->renameObject( entry(), name ) ) ||
+ ( app && app->renameObject( entry(), name ) );
+ return CAM_DataObject::setName(name);
+}
+
+
/*!
\brief Get object string identifier.
return QString();
}
+/*!
+ \brief Returns the string identifier of the data objects referenced by this one.
+
+ This method should be reimplemented in the subclasses.
+ Default implementation returns null string.
+
+ \return ID string of the referenced data object
+*/
+QString LightApp_DataObject::refEntry() const
+{
+ return QString();
+}
+
+/*!
+ \brief Tells if this data objects is a reference to some other or not.
+
+ The base implementation retuns true, if refEntry() returns non-empty string.
+
+ \return true if refEntry() is a non-empty string.
+*/
+bool LightApp_DataObject::isReference() const
+{
+ return !refEntry().isEmpty();
+}
+
/*!
\brief Get the data object unique key.
\return data object key
/*!
\brief Get object text data for the specified column.
- Column with \a id = 0 (NameId) is supposed to be used
+ Column with \a id == NameId is supposed to be used
to get the object name.
- Column with \a id = 1 (EntryId) is supposed to be used
+ Column with \a id == EntryId is supposed to be used
to get the object entry.
+ Column with \a id == RefEntryId is supposed to be used
+ to show the entry of the object referenced by this one.
\param id column id
\return object text data
*/
QString LightApp_DataObject::text( const int id ) const
{
- return id == EntryId ? entry() : CAM_DataObject::text( id );
+ QString txt;
+
+ switch ( id )
+ {
+ case EntryId:
+ txt = entry();
+ break;
+ case RefEntryId:
+ // Issue 21379: reference support at LightApp level
+ if ( isReference() )
+ txt = refEntry();
+ break;
+ default:
+ // Issue 21379: Note that we cannot return some specially decorated
+ // name string (like "* ref_obj_name") when isReference() returns true,
+ // since there is no generic way at LightApp level
+ // to query the object name using refEntry() up to now.
+ // TODO: Think how to make reference name generation
+ // more generic at move it here from SalomeApp level...
+ txt = CAM_DataObject::text( id );
+ break;
+ }
+
+ return txt;
+}
+
+/*!
+ \brief Get data object color for the specified column.
+ \param role color role
+ \param id column id (not used)
+ \return object color for the specified column
+*/
+QColor LightApp_DataObject::color( const ColorRole role, const int id) const
+{
+ QColor c;
+
+ // Issue 21379: reference support at LightApp level
+ // Centralized way for choosing text/background color for references.
+ // Colors for "normal" objects should be chosen by sub-classes.
+ switch ( role )
+ {
+ case Text:
+ case Foreground:
+ // text color (not selected item)
+ // TODO: think how to detect invalid references...
+ if ( isReference() )
+ c = QColor( 255, 0, 0 ); // valid reference (red)
+ break;
+
+ case Highlight:
+ // background color for the highlighted item
+ // TODO: think how to detect invalid references...
+ if ( isReference() )
+ c = QColor( 255, 0, 0 ); // valid reference (red)
+ break;
+
+ case HighlightedText:
+ // text color for the highlighted item
+ if ( isReference() )
+ c = QColor( 255, 255, 255 ); // white
+ break;
+
+ default:
+ break;
+ }
+
+ if ( !c.isValid() )
+ c = CAM_DataObject::color( role, id );
+
+ return c;
}
/*!
bool result = true;
bool calculated = false;
for ( int i = 0; i < idsLeft.count() || i < idsRight.count(); i++ ) {
- bool okLeft = true, okRight = true;
- int lid = 0, rid = 0;
- if ( i < idsLeft.count() )
- lid = idsLeft[i].toInt( &okLeft );
- if ( i < idsRight.count() )
- rid = idsRight[i].toInt( &okRight );
- if ( okLeft && okRight ) {
- // both seem to be correct integer ID
- return lid < rid;
- }
- else if ( okLeft || okRight ) {
- // objects with correct (int) ID have higher priority
- return okLeft;
- }
- else {
- // both not integer ID
- int r = QString::localeAwareCompare( idsLeft[i], idsRight[i] );
- if ( !calculated && r != 0 ) {
- result = r < 0;
- calculated = true;
- }
- }
+ bool okLeft = true, okRight = true;
+ int lid = 0, rid = 0;
+ if ( i < idsLeft.count() )
+ lid = idsLeft[i].toInt( &okLeft );
+ if ( i < idsRight.count() )
+ rid = idsRight[i].toInt( &okRight );
+ if ( okLeft && okRight ) {
+ // both seem to be correct integer ID
+ return lid < rid;
+ }
+ else if ( okLeft || okRight ) {
+ // objects with correct (int) ID have higher priority
+ return okLeft;
+ }
+ else {
+ // both not integer ID
+ int r = QString::localeAwareCompare( idsLeft[i], idsRight[i] );
+ if ( !calculated && r != 0 ) {
+ result = r < 0;
+ calculated = true;
+ }
+ }
}
// we should reach this if the entries are exactly equal
- return result;
+ return result;
}
return QString::localeAwareCompare( leftStr, rightStr ) < 0;
}
/*!
\brief Insert new child object to the children list at specified position.
-
+
Adds component in the study for this module object if it is not done yet.
-
+
\param obj object to be inserted
\param pos position at which data object should be inserted
*/
*/
LightApp_RootObject::LightApp_RootObject( LightApp_Study* study )
: CAM_DataObject( 0 ),
- LightApp_DataObject( 0 ),
- myStudy( study )
+ LightApp_DataObject( 0 ),
+ myStudy( study )
{
}
\param study pointer to the study
*/
void LightApp_RootObject::setStudy( LightApp_Study* study )
-{
- myStudy = study;
+{
+ myStudy = study;
}
/*
\return pointer to the study
*/
LightApp_Study* LightApp_RootObject::study() const
-{
- return myStudy;
-}
+{
+ return myStudy;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_DataObject.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#ifndef LIGHTAPP_DATAOBJECT_H
#define LIGHTAPP_DATAOBJECT_H
public:
//! Column id
enum {
- EntryId = NameId + 1 //!< entry column
+ EntryId = VisibilityId + 1, //!< entry column
+ RefEntryId //!< reference entry column
};
public:
virtual SUIT_DataObjectKey* key() const;
virtual QString entry() const;
+ virtual QString refEntry() const;
+ virtual bool isReference() const;
+
virtual QString text( const int = NameId ) const;
+ virtual QColor color( const ColorRole, const int = NameId ) const;
virtual SUIT_DataObject* componentObject() const;
virtual QString componentDataType() const;
virtual bool customSorting( const int = NameId ) const;
virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
virtual int groupId() const;
+ virtual QVariant customData(Qtx::CustomDataType type);
+
+ virtual bool isVisible() const;
+ virtual bool isDraggable() const;
+ virtual bool isDropAccepted() const;
+ virtual bool renameAllowed( const int = NameId ) const;
+ virtual bool setName( const QString& );
protected:
QString myCompDataType;
LightApp_RootObject( LightApp_Study* );
virtual ~LightApp_RootObject();
-
+
void setStudy( LightApp_Study* );
LightApp_Study* study() const;
-
+
private:
LightApp_Study* myStudy;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_DataOwner.h"
/*!Constructor. Initialize by \a theEntry.*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_DATAOWNER_H
#define LIGHTAPP_DATAOWNER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_DataSubOwner.h"
/*!Constructor.Initialize by \a entry and \a index*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_DATASUBOWNER_H
#define LIGHTAPP_DATASUBOWNER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Dialog.cxx
// Author: Alexander SOLOVYOV
//
{
return myObjects.contains( id ) &&
( myObjects[ id ].myEdit->isVisible() ||
- myObjects[ id ].myEdit->isVisibleTo( myObjects[ id ].myEdit->parentWidget() ) );
+ myObjects[ id ].myEdit->isVisibleTo( myObjects[ id ].myEdit->parentWidget() ) );
}
/*!
void LightApp_Dialog::selectObject( const QStringList& _names,
const TypesList& _types,
const QStringList& _ids,
- const bool update )
+ const bool update )
{
ObjectMap::iterator anIt = myObjects.begin(),
aLast = myObjects.end();
id = anIt.key();
if( id!=-1 )
+ {
if( on )
{
updateButtons( id );
}
else
emit objectDeactivated( id );
+ }
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Dialog.h
// Author: Alexander SOLOVYOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_Displayer.h"
#include "LightApp_Application.h"
#include "LightApp_Module.h"
+#include "LightApp_Study.h"
#include <CAM_Study.h>
#include <SUIT_ViewModel.h>
#include <SUIT_ViewWindow.h>
+#include <QStringList>
#include <QString>
#ifndef DISABLE_SALOMEOBJECT
#include "SALOME_InteractiveObject.hxx"
\param updateViewer - is it necessary to update viewer
\param theViewFrame - view
*/
-void LightApp_Displayer::Display( const QString& entry, const bool updateViewer, SALOME_View* theViewFrame )
+void LightApp_Displayer::Display( const QString& entry, const bool updateViewer,
+ SALOME_View* theViewFrame )
+{
+ QStringList aList;
+ aList.append( entry );
+ Display( aList, updateViewer, theViewFrame );
+}
+
+/*!
+ Displays object in view
+ \param list - object entries
+ \param updateViewer - is it necessary to update viewer
+ \param theViewFrame - view
+*/
+void LightApp_Displayer::Display( const QStringList& list, const bool updateViewer,
+ SALOME_View* theViewFrame )
{
- SALOME_Prs* prs = buildPresentation( entry, theViewFrame );
- if ( prs )
+ SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
+ QStringList::const_iterator it = list.constBegin();
+ for ( ; it != list.constEnd(); ++it)
{
- SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
- if ( vf )
+ SALOME_Prs* prs = buildPresentation( *it, vf );
+ if ( prs )
{
- vf->BeforeDisplay( this );
- vf->Display( prs );
- vf->AfterDisplay( this );
- if ( updateViewer )
- vf->Repaint();
+ if ( vf )
+ {
+ myLastEntry = *it;
+ vf->BeforeDisplay( this, prs );
+ vf->Display( prs );
+ vf->AfterDisplay( this, prs );
+ if ( updateViewer )
+ vf->Repaint();
+ }
delete prs; // delete presentation because displayer is its owner
+ setVisibilityState(*it, Qtx::ShownState);
}
+
}
}
SUIT_ViewModel* vmodel = vman->getViewModel();
if( !vmodel )
- continue;
-
+ continue;
+
SALOME_View* view = dynamic_cast<SALOME_View*>(vmodel);
if( view && ( IsDisplayed( entry, view ) || view == GetActiveView() ) )
{
- Erase( entry, true, false, view );
- Display( entry, updateViewer, view );
+ Erase( entry, true, false, view );
+ Display( entry, updateViewer, view );
}
}
}
\param theViewFrame - view
*/
void LightApp_Displayer::Erase( const QString& entry, const bool forced,
- const bool updateViewer, SALOME_View* theViewFrame )
+ const bool updateViewer,
+ SALOME_View* theViewFrame )
+{
+ QStringList aList;
+ aList.append( entry );
+ Erase( aList, forced, updateViewer, theViewFrame );
+}
+
+/*!
+ Erases object in view
+ \param list - object entries
+ \param forced - deletes object from viewer (otherwise it will be erased, but cached)
+ \param updateViewer - is it necessary to update viewer
+ \param theViewFrame - view
+*/
+void LightApp_Displayer::Erase( const QStringList& list, const bool forced,
+ const bool updateViewer,
+ SALOME_View* theViewFrame )
{
SALOME_View* vf = theViewFrame ? theViewFrame : GetActiveView();
- if ( vf ) {
- SALOME_Prs* prs = vf->CreatePrs( entry.toLatin1() );
+ if ( !vf )
+ return;
+
+ QStringList::const_iterator it = list.constBegin();
+ for ( ; it != list.constEnd(); ++it)
+ {
+ SALOME_Prs* prs = vf->CreatePrs( (*it).toLatin1().data() );
if ( prs ) {
+ myLastEntry = *it;
+ vf->BeforeErase( this, prs );
vf->Erase( prs, forced );
+ vf->AfterErase( this, prs );
if ( updateViewer )
- vf->Repaint();
+ vf->Repaint();
delete prs; // delete presentation because displayer is its owner
+ setVisibilityState(*it,Qtx::HiddenState);
}
}
}
if ( updateViewer )
vf->Repaint();
}
+
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
+ LightApp_Study* study = app ? dynamic_cast<LightApp_Study*>( app->activeStudy() ) : 0;
+ if(study)
+ study->setVisibilityStateForAll(Qtx::HiddenState);
}
/*!
if ( SUIT_Application* app = session->activeApplication() ) {
if ( LightApp_Application* sApp = dynamic_cast<LightApp_Application*>( app ) ) {
if( SUIT_ViewManager* vman = sApp->activeViewManager() ) {
- if ( SUIT_ViewModel* vmod = vman->getViewModel() )
- return dynamic_cast<SALOME_View*>( vmod );
+ if ( SUIT_ViewModel* vmod = vman->getViewModel() )
+ return dynamic_cast<SALOME_View*>( vmod );
}
}
}
if( SUIT_Application* app = session->activeApplication() )
if( LightApp_Application* sApp = dynamic_cast<LightApp_Application*>( app ) )
if( SUIT_ViewManager* vman = sApp->activeViewManager() )
- if( SUIT_ViewModel* vmod = vman->getViewModel() )
- viewerType = vmod->getType();
+ if( SUIT_ViewModel* vmod = vman->getViewModel() )
+ viewerType = vmod->getType();
return canBeDisplayed( entry, viewerType );
}
return 0;
LightApp_Module* m = dynamic_cast<LightApp_Module*>( app ? app->module( mod_name ) : 0 );
+ bool wasLoaded = false;
if( !m && load )
{
m = dynamic_cast<LightApp_Module*>( app->loadModule( mod_name, false ) );
- if( m )
+ if( m ) {
app->addModule( m );
+ wasLoaded = true;
+ }
}
if( m )
{
m->connectToStudy( dynamic_cast<CAM_Study*>( app->activeStudy() ) );
- if( m!=app->activeModule() && load )
- {
- m->setMenuShown( false );
- m->setToolShown( false );
- }
+ if( wasLoaded )
+ m->updateModuleVisibilityState();
}
return m ? m->displayer() : 0;
}
+
+/*!
+ Find the active study and set the 'visibility state' property of the object
+ \param mod_name - name of module
+ \param load - is module has to be forced loaded
+*/
+void LightApp_Displayer::setVisibilityState( const QString& theEntry, Qtx::VisibilityState theState) const {
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
+ LightApp_Study* study = app ? dynamic_cast<LightApp_Study*>( app->activeStudy() ) : 0;
+
+ if(study)
+ study->setVisibilityState( theEntry, theState);
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_DISPLAYER_HEADER
#define LIGHTAPP_DISPLAYER_HEADER
#include <SALOME_Prs.h>
+#include <Qtx.h>
+
class QString;
/*!
virtual ~LightApp_Displayer();
void Display( const QString&, const bool = true, SALOME_View* = 0 );
+ void Display( const QStringList&, const bool = true,
+ SALOME_View* = 0 );
+
void Redisplay( const QString&, const bool = true );
+
+ void Erase( const QStringList&, const bool forced = false,
+ const bool updateViewer = true, SALOME_View* = 0);
void Erase( const QString&, const bool forced = false, const bool updateViewer = true, SALOME_View* = 0 );
void EraseAll( const bool forced = false, const bool updateViewer = true, SALOME_View* = 0 ) const;
- bool IsDisplayed( const QString&, SALOME_View* = 0 ) const;
+
+ virtual bool IsDisplayed( const QString&, SALOME_View* = 0 ) const;
void UpdateViewer() const;
static SALOME_View* GetActiveView();
virtual bool canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const;
bool canBeDisplayed( const QString& /*entry*/ ) const;
+
+ void setVisibilityState (const QString& entry, Qtx::VisibilityState) const;
protected:
virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
+protected:
+ QString myLastEntry;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_Driver.h"
#include <TCollection_AsciiString.hxx>
{
}
-using namespace std;
-
/*!
Save in file 'theFileName' datas from this driver
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_DRIVER_H
#define LIGHTAPP_DRIVER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_EventFilter.h"
#include <SUIT_Desktop.h>
#include <QApplication>
+#include <SALOME_Event.h>
+
LightApp_EventFilter* LightApp_EventFilter::myFilter = NULL;
/*!Constructor.*/
SUIT_Desktop* aDesktop = 0;
while( parent )
- {
- if ( aDesktop = dynamic_cast<SUIT_Desktop*>(parent) )
- break;
- parent = parent->parentWidget();
- }
+ {
+ aDesktop = dynamic_cast<SUIT_Desktop*>(parent);
+ if ( aDesktop )
+ break;
+ parent = parent->parentWidget();
+ }
if ( aDesktop )
- aDesktop->emitActivated();
+ aDesktop->emitActivated();
+ }
+
+ else if(e->type() == SALOME_EVENT)
+ {
+ SALOME_Event* aSE = (SALOME_Event*)((SALOME_CustomEvent*)e)->data();
+ processEvent(aSE);
+ ((SALOME_CustomEvent*)e)->setData( 0 );
+ return true;
}
return QObject::eventFilter( o, e );
}
+/*!Process event.*/
+void LightApp_EventFilter::processEvent( SALOME_Event* theEvent )
+{
+ if(theEvent)
+ theEvent->ExecutePostedEvent();
+}
+
+
/*!Create new instance of LightApp_EventFilter*/
void LightApp_EventFilter::Init()
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_EVENTFILTER_H
#define LIGHTAPP_EVENTFILTER_H
#pragma warning( disable: 4251 )
#endif
+
+class SALOME_Event;
+
/*!
Class provide event filter.
*/
private:
/*! global event filter for qapplication */
virtual bool eventFilter( QObject* o, QEvent* e );
+ void processEvent( SALOME_Event* );
private:
static LightApp_EventFilter* myFilter;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_GLSelector.h"
#include "LightApp_DataOwner.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_GLSELECTOR_H
#define LIGHTAPP_GLSELECTOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_HDFDriver.h"
#include "HDFOI.hxx"
{
}
-using namespace std;
-
/*!
Saves in file 'theFileName' datas from this driver
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_HDFDRIVER_H
#define LIGHTAPP_HDFDRIVER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Module.cxx
// Created: 6/20/2005 16:30:56 AM
// Author: OCC team
-//
+
#include "LightApp_Module.h"
#include "CAM_Application.h"
#include <SUIT_Operation.h>
#include <SUIT_ViewManager.h>
#include <SUIT_ResourceMgr.h>
+#include <SUIT_ShortcutMgr.h>
#include <SUIT_Desktop.h>
#include <SUIT_TreeModel.h>
#include <QString>
#include <QStringList>
+#include <iostream>
/*!Constructor.*/
LightApp_Module::LightApp_Module( const QString& name )
{
LightApp_Selection* sel = createSelection();
sel->init( client, getApp()->selectionMgr() );
+
popupMgr()->setSelection( sel );
popupMgr()->setMenu( menu );
popupMgr()->updateMenu();
* For updating model or whole object browser use update() method can be used.
*/
void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel,
- SUIT_DataObject* theDataObject )
+ SUIT_DataObject* theDataObject )
{
bool upd = getApp()->objectBrowser()->autoUpdate();
getApp()->objectBrowser()->setAutoUpdate( false );
if( theIsUpdateDataModel ){
if( CAM_DataModel* aDataModel = dataModel() ){
if ( LightApp_DataModel* aModel = dynamic_cast<LightApp_DataModel*>( aDataModel ) ) {
- SUIT_DataObject* aParent = NULL;
- if(theDataObject && theDataObject != aDataModel->root())
- aParent = theDataObject->parent();
+ //SUIT_DataObject* aParent = NULL;
+ //if(theDataObject && theDataObject != aDataModel->root())
+ // aParent = theDataObject->parent();
- LightApp_DataObject* anObject = dynamic_cast<LightApp_DataObject*>(theDataObject);
- LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(getApp()->activeStudy());
+ LightApp_DataObject* anObject = dynamic_cast<LightApp_DataObject*>(theDataObject);
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(getApp()->activeStudy());
aModel->update( anObject, aStudy );
}
}
if ( mySwitchOp == 0 )
mySwitchOp = new LightApp_SwitchOp( this );
+ // Enable Display and Erase actions
+ if ( action(myDisplay) )
+ action(myDisplay)->setEnabled(true);
+ if ( action(myErase) )
+ action(myErase)->setEnabled(true);
+
+ application()->shortcutMgr()->setSectionEnabled( moduleName() );
+
+ /* BUG 0020498 : The Entry column is always shown at module activation
+ The registration of column is moved into LightApp_Application
+
QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
if( m )
SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
m->registerColumn( getApp()->objectBrowser(), EntryCol, LightApp_DataObject::EntryId );
treeModel->setAppropriate( EntryCol, Qtx::Toggled );
- }
+ }*/
return res;
}
mySwitchOp = 0;
disconnect( application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
- this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
+ this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );
disconnect( application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
- this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
+ this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
// abort all operations
MapOfOperation::const_iterator anIt;
anIt.value()->abort();
}
+ // Disable Display and Erase action
+ if ( action(myDisplay) )
+ action(myDisplay)->setEnabled(false);
+ if ( action(myErase) )
+ action(myErase)->setEnabled(false);
+
+ application()->shortcutMgr()->setSectionEnabled( moduleName(), false );
+
+ /* BUG 0020498 : The Entry column is always shown at module activation
QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
if( m )
treeModel->setAppropriate( EntryCol, Qtx::Shown );
m->unregisterColumn( getApp()->objectBrowser(), EntryCol );
}
+ */
return CAM_Module::deactivateModule( study );
}
{
}
+/*!NOT IMPLEMENTED*/
+void LightApp_Module::message( const QString& )
+{
+}
+
/*!Gets application.*/
LightApp_Application* LightApp_Module::getApp() const
{
QAction
*disp = createAction( -1, tr( "TOP_SHOW" ), p, tr( "MEN_SHOW" ), tr( "STB_SHOW" ),
- 0, d, false, this, SLOT( onShowHide() ) ),
+ 0, d, false, this, SLOT( onShowHide() ), QString("General:Show object(s)") ),
*erase = createAction( -1, tr( "TOP_HIDE" ), p, tr( "MEN_HIDE" ), tr( "STB_HIDE" ),
- 0, d, false, this, SLOT( onShowHide() ) ),
+ 0, d, false, this, SLOT( onShowHide() ) , QString("General:Hide object(s)") ),
*dispOnly = createAction( -1, tr( "TOP_DISPLAY_ONLY" ), p, tr( "MEN_DISPLAY_ONLY" ), tr( "STB_DISPLAY_ONLY" ),
- 0, d, false, this, SLOT( onShowHide() ) ),
+ 0, d, false, this, SLOT( onShowHide() ) ),
*eraseAll = createAction( -1, tr( "TOP_ERASE_ALL" ), p, tr( "MEN_ERASE_ALL" ), tr( "STB_ERASE_ALL" ),
- 0, d, false, this, SLOT( onShowHide() ) );
+ 0, d, false, this, SLOT( onShowHide() ) );
myDisplay = actionId( disp );
myErase = actionId( erase );
myDisplayOnly = actionId( dispOnly );
void LightApp_Module::startOperation( const int id )
{
LightApp_Operation* op = 0;
- if( myOperations.contains( id ) )
+ if( myOperations.contains( id ) && reusableOperation( id ) )
op = myOperations[ id ];
else
{
{
return myOperations.contains( id ) ? myOperations[id] : 0;
}
+
+/*!
+ virtual method called to manage the same operations
+*/
+bool LightApp_Module::reusableOperation( const int id )
+{
+ return true;
+}
+
+/*!
+ virtual method
+ \return true if module can copy the current selection
+*/
+bool LightApp_Module::canCopy() const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \return true if module can paste previously copied data
+*/
+bool LightApp_Module::canPaste() const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \brief Copies the current selection into clipboard
+*/
+void LightApp_Module::copy()
+{
+}
+
+/*!
+ virtual method
+ \brief Pastes the current data in the clipboard
+*/
+void LightApp_Module::paste()
+{
+}
+
+/*!
+ virtual method
+ \return true if module allows dragging the given object
+*/
+bool LightApp_Module::isDraggable( const SUIT_DataObject* /*what*/ ) const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \return true if module allows dropping one or more objects (currently selected) on the object \c where
+*/
+bool LightApp_Module::isDropAccepted( const SUIT_DataObject* /*where*/ ) const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ Complete drag-n-drop operation by processing objects \a what being dragged, dropped to the line \a row
+ within the object \a where. The drop action being performed is specified by \a action.
+*/
+void LightApp_Module::dropObjects( const DataObjectList& /*what*/, SUIT_DataObject* /*where*/,
+ const int /*row*/, Qt::DropAction /*action*/ )
+{
+}
+
+/*!
+ \brief Return \c true if object can be renamed
+*/
+bool LightApp_Module::renameAllowed( const QString& /*entry*/ ) const
+{
+ return false;
+}
+
+/*!
+ Rename object by entry.
+ \param entry entry of the object
+ \param name new name of the object
+ \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool LightApp_Module::renameObject( const QString& /*entry*/, const QString& /*name*/ )
+{
+ return false;
+}
+
+
+
+int LightApp_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx )
+{
+ return CAM_Module::createMenu( subMenu, menu, id, group, idx );
+}
+int LightApp_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx )
+{
+ return CAM_Module::createMenu( subMenu, menu, id, group, idx );
+}
+int LightApp_Module::createMenu( const int id, const int menu, const int group, const int idx )
+{
+ return CAM_Module::createMenu( id, menu, group, idx );
+}
+int LightApp_Module::createMenu( const int id, const QString& menu, const int group, const int idx )
+{
+ return CAM_Module::createMenu( id, menu, group, idx );
+}
+int LightApp_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
+{
+ return CAM_Module::createMenu( a, menu, id, group, idx );
+}
+int LightApp_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
+{
+ return CAM_Module::createMenu( a, menu, id, group, idx );
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Module.h
// Created: 6/20/2005 16:25:06 AM
// Author: OCC team
-//
+
#ifndef LIGHTAPP_MODULE_H
#define LIGHTAPP_MODULE_H
#include "LightApp_Preferences.h"
#include <CAM_Module.h>
+#include <SUIT_DataObject.h>
+
class LightApp_Application;
class LightApp_Selection;
class LightApp_Operation;
class LightApp_SelectionMgr;
class SUIT_Study;
-class SUIT_DataObject;
+//class SUIT_DataObject;
class SUIT_Operation;
class SUIT_ViewManager;
class CAM_Application;
virtual void update( const int );
// Update viewer or/and object browser etc. in accordance with update flags
- // ( see SalomeApp_UpdateFlags enumeration ). Derived modules can redefine this method
+ // (see SalomeApp_UpdateFlags enumeration). Derived modules can redefine this method
// for their own purposes
virtual void updateObjBrowser( bool = true, SUIT_DataObject* = 0 );
- // Update object bropwser ( for updating model or whole object browser use update() method
- // can be used )
+ // Update object browser (for updating model or whole object browser use update() method)
virtual void selectionChanged();
virtual void preferencesChanged( const QString&, const QString& );
+ virtual void message( const QString& );
virtual void studyActivated() {};
virtual LightApp_Displayer* displayer();
virtual LightApp_Selection* createSelection() const;
+ virtual bool canCopy() const;
+ virtual bool canPaste() const;
+ virtual bool isDraggable( const SUIT_DataObject* ) const;
+ virtual bool isDropAccepted( const SUIT_DataObject* ) const;
+ virtual void dropObjects( const DataObjectList&, SUIT_DataObject*,
+ const int, Qt::DropAction );
+ virtual void copy();
+ virtual void paste();
+ virtual bool renameAllowed( const QString& ) const;
+ virtual bool renameObject( const QString&, const QString& );
+
+ int createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
+ int createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
+ int createMenu( const int, const int, const int = -1, const int = -1 );
+ int createMenu( const int, const QString&, const int = -1, const int = -1 );
+ int createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
+ int createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
+
public slots:
virtual bool activateModule( SUIT_Study* );
virtual bool deactivateModule( SUIT_Study* );
virtual CAM_DataModel* createDataModel();
+ virtual bool reusableOperation( const int id );
+
int addPreference( const QString& label );
- int addPreference( const QString& label, const int pId, const int = LightApp_Preferences::Auto,
- const QString& section = QString(),
- const QString& param = QString() );
+ int addPreference( const QString& label, const int pId,
+ const int type = LightApp_Preferences::Auto,
+ const QString& section = QString(),
+ const QString& param = QString() );
QVariant preferenceProperty( const int, const QString& ) const;
void setPreferenceProperty( const int, const QString&, const QVariant& );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_ModuleAction.cxx
// Author : Sergey TELKOV, Vadim SANDLER
//
#include <QtxComboBox.h>
#include <QtxActionSet.h>
#include <QVBoxLayout>
+#include <QApplication>
+#include <QEvent>
/*!
\class LightApp_ModuleAction::ActionSet
\param item identifier
*/
+/*!
+ \class LightApp_ModuleAction::ActivateEvent
+ \brief Internal class to represent custom event for transfer the activation item id.
+ \internal
+*/
+class LightApp_ModuleAction::ActivateEvent : public QEvent
+{
+public:
+ ActivateEvent( QEvent::Type type, int id ) : QEvent( type ), myId( id ) {};
+ ~ActivateEvent() {};
+
+ int id() const { return myId; }
+
+private:
+ int myId;
+};
+
/*!
\class LightApp_ModuleAction
\brief An action, representing the list of modules to be inserted to the
const int idx )
{
QtxAction* a = new QtxAction( name, ico, name, 0, this, true );
- a->setStatusTip( tr( "Activate/deactivate %1 module" ).arg( name ) );
+ a->setStatusTip( tr( "ACTIVATE_MODULE_TOP" ).arg( name ) );
mySet->insertAction( a, -1, idx );
update();
w->removeAction( mySet );
}
+/*!
+ \brief Perform delayed activation with specified id.
+ \param e custom event
+ \return \c true if the event was processed successfully and \c false otherwise.
+*/
+bool LightApp_ModuleAction::event( QEvent* e )
+{
+ if ( e->type() == QEvent::MaxUser ) {
+ activate( ((ActivateEvent*)e)->id(), false );
+ return true;
+ }
+ return QtxAction::event( e );
+}
+
/*!
\fn void LightApp_ModuleAction::moduleActivated( const QString& name );
\brief Emitted when the module is activated
if ( !cb )
return;
+ bool blocked = cb->blockSignals( true );
int curId = mySet->moduleId( active() );
QList<QAction*> alist = mySet->actions();
cb->clear();
}
cb->setCurrentId( curId );
+ cb->blockSignals( blocked );
}
/*!
*/
void LightApp_ModuleAction::onComboActivated( int id )
{
- activate( id, false );
+ QApplication::postEvent( this, new ActivateEvent( QEvent::MaxUser, id ) );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_ModuleAction.h
// Author : Sergey TELKOV, Vadim SANDLER
//
private:
class ActionSet;
class ComboAction;
+ class ActivateEvent;
public:
enum { None = 0x00, Buttons = 0x01, ComboItem = 0x02, All = Buttons | ComboItem };
virtual void addedTo( QWidget* );
virtual void removedFrom( QWidget* );
+ virtual bool event( QEvent* );
+
signals:
void moduleActivated( const QString& );
QList<QtxComboBox*> widgets() const;
-protected:
- virtual QWidget* createWidget( QWidget* );
-
signals:
void activatedId( int );
+
+protected:
+ virtual QWidget* createWidget( QWidget* );
};
#endif // LIGHTAPP_MODULEACTION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_ModuleDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
\param icon module icon
*/
LightApp_ModuleDlg::LightApp_ModuleDlg( QWidget* parent,
- const QString& component,
- const QPixmap& icon )
+ const QString& component,
+ const QPixmap& icon )
: QDialog ( parent )
{
setModal( true );
// <Cancel>
QPushButton* cancelBtn = new QPushButton( tr( "CANCEL" ), this );
+ cancelBtn->setAutoDefault( true );
+
myButtonLayout->addSpacing( 70 );
myButtonLayout->addStretch();
myButtonLayout->addWidget( cancelBtn );
}
QPushButton* newButton = new QPushButton( button, this );
+ newButton->setAutoDefault( true );
- if ( myButtons.empty() ) newButton->setDefault( true );
+ if ( myButtons.empty() ) {
+ newButton->setDefault( true );
+ newButton->setFocus();
+ }
myButtons.insert( newButton, bid );
myButtonLayout->insertWidget( myButtonLayout->count()-3, newButton );
{
QPushButton* btn = 0;
for ( ButtonMap::ConstIterator it = myButtons.begin();
- it != myButtons.end() && !btn; ++it ) {
+ it != myButtons.end() && !btn; ++it ) {
if ( it.value() == id )
btn = it.key();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_ModuleDlg.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_NameDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include <QHBoxLayout>
#include <QVBoxLayout>
-#ifndef WIN32
-using namespace std;
-#endif
-
/*!
Constructor
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_NameDlg.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_OBFilter.h"
#include "LightApp_SelectionMgr.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_OBFILTER_H
#define LIGHTAPP_OBFILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_OBSelector.cxx
// Author :
//
#ifndef DISABLE_SALOMEOBJECT
Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
( obj->entry().toLatin1().constData(),
- obj->componentDataType().toLatin1().constData(),
- obj->name().toLatin1().constData() );
+ obj->componentDataType().toLatin1().constData(),
+ obj->name().toLatin1().constData() );
LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj );
#else
LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
if ( !myBrowser )
return;
- if( myEntries.count() == 0 || myModifiedTime < myBrowser->getModifiedTime() )
+ if( myEntries.count() == 0 || myModifiedTime < myBrowser->getModifiedTime() )
fillEntries( myEntries );
DataObjectList objList;
for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin();
- it != theList.end(); ++it ) {
+ it != theList.end(); ++it ) {
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
if ( owner && myEntries.contains( owner->entry() ) )
objList.append( myEntries[owner->entry()] );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_OBSelector.h
// Author :
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_DataOwner.h"
#include "LightApp_OCCSelector.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_OCCSELECTOR_H
#define LIGHTAPP_OCCSELECTOR_H
virtual void setSelection( const SUIT_DataOwnerPtrList& );
#ifndef DISABLE_OCCVIEWER
- QString entry( const Handle_AIS_InteractiveObject& ) const;
+ virtual QString entry( const Handle_AIS_InteractiveObject& ) const;
#endif
SUIT_DataOwnerPtrList mySelectedExternals;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_Operation.h
// Author : Sergey LITONIN
// Module : LightApp
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_Operation.h
// Author : Sergey LITONIN
// Module : LIGHT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_Plot2dSelector.h"
#include "LightApp_DataOwner.h"
#include "LightApp_DataObject.h"
#include "LightApp_Application.h"
+#include "SUIT_SelectionMgr.h"
+
+#include <SPlot2d_ViewModel.h>
+
+#include <SALOME_ListIO.hxx>
/*!
Constructor
*/
-LightApp_Plot2dSelector::LightApp_Plot2dSelector( SPlot2d_Viewer* v, SUIT_SelectionMgr* mgr )
-: SUIT_Selector( mgr, v )
+LightApp_Plot2dSelector::LightApp_Plot2dSelector( Plot2d_Viewer* v, SUIT_SelectionMgr* mgr )
+ : SUIT_Selector( mgr, v ),
+ myViewer(v)
{
if ( v )
connect( v, SIGNAL( legendSelected( const QString& ) ), this, SLOT( onSelectionChanged( const QString& ) ) );
+ connect( v, SIGNAL( clearSelected() ), this, SLOT( onClearSelected( ) ) );
}
/*!
void LightApp_Plot2dSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
{
if( !myCurEntry.isNull() )
- theList.append( new LightApp_DataOwner( myCurEntry ) );
+ theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qPrintable(myCurEntry),"","") ) );
}
/*!Sets selection.*/
void LightApp_Plot2dSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
{
- /* if( theList.count()>0 )
- myCurEntry = theList.first()->getEntry();
- else*/
- myCurEntry = QString::null;
+ SALOME_ListIO anIOList;
+ for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); it != theList.end(); ++it ) {
+ const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
+ if ( owner ) {
+ if( !owner->IO().IsNull() ) {
+ anIOList.Append(owner->IO());
+ } else if ( !owner->entry().isEmpty() ) {
+ anIOList.Append( new SALOME_InteractiveObject(qPrintable(owner->entry()),"","") );
+ }
+ }
+ }
+ SPlot2d_Viewer* v = dynamic_cast<SPlot2d_Viewer*>(myViewer);
+
+ if(v)
+ v->setObjectsSelected(anIOList);
}
/*!On selection changed.*/
{
myCurEntry = entry;
selectionChanged();
+ myCurEntry = QString();
+}
+
+/*!On clear selected.*/
+void LightApp_Plot2dSelector::onClearSelected( )
+{
+ selectionMgr()->clearSelected();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_PLOT2DSELECTOR_H
#define LIGHTAPP_PLOT2DSELECTOR_H
#include <SUIT_Selector.h>
#include <SUIT_DataOwner.h>
-#include <SPlot2d_ViewModel.h>
+#include <Plot2d_ViewModel.h>
class LightApp_DataObject;
Q_OBJECT
public:
- LightApp_Plot2dSelector( SPlot2d_Viewer*, SUIT_SelectionMgr* );
+ LightApp_Plot2dSelector( Plot2d_Viewer*, SUIT_SelectionMgr* );
virtual ~LightApp_Plot2dSelector();
/*!Return "ObjectBrowser"*/
private slots:
void onSelectionChanged( const QString& );
+ void onClearSelected();
protected:
virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
virtual void setSelection( const SUIT_DataOwnerPtrList& );
private:
- QString myCurEntry;
+ QString myCurEntry;
+ Plot2d_Viewer* myViewer;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Preferences.cxx
// Author: Sergey TELKOV
//
void LightApp_Preferences::changedResources( const ResourceMap& map )
{
for ( ResourceMap::ConstIterator it = map.begin();
- it != map.end(); ++it )
+ it != map.end(); ++it )
{
QString sec, param;
it.key()->resource( sec, param );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_Preferences.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_PreferencesDlg.cxx
// Author: Sergey TELKOV
//
void LightApp_PreferencesDlg::onDefault()
{
if( SUIT_MessageBox::Ok == SUIT_MessageBox::question( this, tr( "WARNING" ), tr( "DEFAULT_QUESTION" ),
- SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::Ok ) )
+ SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel,
+ SUIT_MessageBox::Ok ) )
{
if ( myPrefs && myPrefs->resourceMgr() )
- {
+ {
QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->workingMode();
- myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
- myPrefs->retrieve();
+ myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
+ myPrefs->retrieve();
myPrefs->resourceMgr()->setWorkingMode( prev );
- }
+ }
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: LightApp_PreferencesDlg.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_Selection.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_DataOwner.h"
#include "SUIT_Desktop.h"
#include "SUIT_Selector.h"
+#include <QtCore/QSet>
+
/*!
Constructor
*/
*/
void LightApp_Selection::init( const QString& client, LightApp_SelectionMgr* mgr)
{
- myPopupClient = client;
-
- if( mgr )
- {
- if( mgr->application() )
+ myContext = client;
+
+ if ( mgr ) {
+ if ( mgr->application() )
myStudy = dynamic_cast<LightApp_Study*>( mgr->application()->activeStudy() );
+
if( !myStudy )
return;
while ( it.hasNext() )
{
SUIT_Selector* selector = it.next();
- if( selector->type() != client && selector->isEnabled() )
- {
- //mgr->selected( cur_sel, selector->type() );
+ if ( selector->type() != client && selector->isEnabled() ) {
selector->selected( cur_sel );
- SUIT_DataOwnerPtrList::const_iterator aLIt = cur_sel.begin(), aLLast = cur_sel.end();
- for( ; aLIt!=aLLast; aLIt++ )
- sel.append( *aLIt ); //check entry and don't append if such entry is in list already
+
+ for ( SUIT_DataOwnerPtrList::const_iterator aLIt = cur_sel.begin(); aLIt != cur_sel.end(); ++aLIt )
+ sel.append( *aLIt ); //check entry and don't append if such entry is in list already
}
}
//3) to analyse owner and fill internal data structures
- SUIT_DataOwnerPtrList::const_iterator anIt = sel.begin(), aLast = sel.end();
- QMap<QString,int> entries;
- QString entry;
- int num=0;
- for( ; anIt!=aLast; anIt++ )
+
+ int num = 0;
+ QSet<QString> entries;
+ myObjects.resize( sel.size() );
+ myObjects.fill( ObjectInfo() );
+ for ( SUIT_DataOwnerPtrList::const_iterator anIt = sel.begin(); anIt != sel.end(); anIt++ )
{
LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>( (*anIt ).get() );
- if( sowner )
+ if ( sowner )
{
- entry = referencedToEntry( sowner->entry() );
- if( entries.contains( entry ) )
- continue;
-
- entries.insert( entry, 0 );
- myEntries.insert( num, entry );
- myIsReferences.insert( num, sowner->entry() != entry );
- processOwner( sowner );
- num++;
+ QString entry = referencedToEntry( sowner->entry() );
+ if ( entries.contains( entry ) )
+ continue;
+
+ entries.insert( entry );
+
+ setObjectInfo( num, OI_Entry, entry );
+ setObjectInfo( num, OI_Reference, sowner->entry() != entry );
+
+ if ( processOwner( sowner ) )
+ num++;
+ else
+ entries.remove( entry );
}
}
+
+ myObjects.resize( num );
+ /*
+ myContextParams.clear();
+ myObjectsParams.resize( num );
+ myObjectsParams.fill( ParameterMap() );
+ */
}
}
*/
int LightApp_Selection::count() const
{
- return myEntries.count();
+ return myObjects.size();
}
/*!
- Gets QVariant();
+ Gets global parameters.
*/
-QVariant LightApp_Selection::parameter( const int ind, const QString& p ) const
+/*
+QVariant LightApp_Selection::parameter( const QString& p ) const
{
- LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy ? myStudy->application() : 0 );
- if( !( ind>=0 && ind<count() ) || !app )
- return QVariant();
-
- if( p=="isVisible" )
- {
- QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
- LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
- // false in last parameter means that now we doesn't load module, if it isn't loaded
-
- bool vis = false;
- if( d )
- vis = d->IsDisplayed( myEntries[ ind ] );
- else
- {
- LightApp_Displayer local_d;
- vis = local_d.IsDisplayed( myEntries[ ind ] );
- }
- return QVariant( vis );
- }
-
- else if( p=="component" )
- {
- return myStudy->componentDataType( myEntries[ ind ] );
- }
-
- else if( p=="isComponent" )
- {
- return QVariant( myStudy->isComponent( myEntries[ ind ] ) );
+ QVariant v;
+ if ( myContextParams.contains( p ) )
+ v = myContextParams[p];
+ else
+ v = contextParameter( p );
+ if ( !v.isValid() )
+ v = QtxPopupSelection::parameter( p );
+ LightApp_Selection* that = (LightApp_Selection*)this;
+ that->myContextParams.insert( p, v );
}
+ return v;
+}
+*/
- else if( p=="isReference" )
- return QVariant( isReference( ind ) );
-
- else if( p=="displayer" )
- return parameter( ind, "component" );
-
- else if( p=="canBeDisplayed" )
- {
- QString mod_name = app->moduleTitle( parameter( ind, "component" ).toString() );
- LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
- // false in last parameter means that now we doesn't load module, if it isn't loaded
-
- if ( d )
- return d->canBeDisplayed( myEntries[ ind ] );
- else if ( myEntries[ ind ].startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) ) // object is a Save Point object
- return false;
-
- return true;
- //now if displayer is null, it means, that according module isn't loaded, so that we allow to all display/erase
- //operations under object
+/*!
+ Gets the object parameter.
+*/
+ /*
+QVariant LightApp_Selection::parameter( const int idx, const QString& p ) const
+{
+ QVariant v;
+ if ( 0 <= idx && idx < myObjectsParams.size() ) {
+ if ( myObjectsParams[idx].contains( p ) )
+ v = myObjectsParams[idx][p];
+ else {
+ v = objectParameter( idx, p );
+ LightApp_Selection* that = (LightApp_Selection*)this;
+ that->myObjectsParams[idx].insert( p, v );
+ }
}
-
- return QVariant();
+ return v;
}
-
+ */
/*!
Gets global parameters. client, isActiveView, activeView etc.
*/
+ //QVariant LightApp_Selection::contextParameter( const QString& p ) const
QVariant LightApp_Selection::parameter( const QString& p ) const
{
- if ( p == "client" ) return QVariant( myPopupClient );
- else if ( p == "activeModule" )
- {
+ QVariant v;
+
+ if ( p == "client" )
+ v = myContext;
+ else if ( p == "activeModule" ) {
LightApp_Application* app = dynamic_cast<LightApp_Application*>( myStudy->application() );
QString mod_name = app ? QString( app->activeModule()->name() ) : QString();
- //cout << "activeModule : " << mod_name.latin1() << endl;
- if( !mod_name.isEmpty() )
- return mod_name;
- else
- return QVariant();
+ if ( !mod_name.isEmpty() )
+ v = mod_name;
+ }
+ else if ( p == "isActiveView" )
+ v = activeVW() != 0;
+ else if ( p == "activeView" )
+ v = activeViewType();
+ else
+ v = QtxPopupSelection::parameter( p );
+
+ return v;
+}
+
+/*!
+ Gets the object parameter.
+*/
+//QVariant LightApp_Selection::objectParameter( const int idx, const QString& p ) const
+QVariant LightApp_Selection::parameter( const int idx, const QString& p ) const
+{
+ LightApp_Application* app = 0;
+ if ( myStudy )
+ app = dynamic_cast<LightApp_Application*>( myStudy->application() );
+
+ QVariant v;
+ if ( app ) {
+ QString e = entry( idx );
+ if ( !e.isEmpty() ) {
+ if ( p == "isVisible" ) {
+ QString mod_name = app->moduleTitle( myStudy->componentDataType( e ) );
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
+ // false in last parameter means that now we doesn't load module, if it isn't loaded
+
+ bool vis = false;
+ if ( d )
+ vis = d->IsDisplayed( e );
+ else
+ vis = LightApp_Displayer().IsDisplayed( e );
+ v = vis;
+ }
+ else if ( p == "component" || p == "displayer" )
+ v = myStudy->componentDataType( e );
+ else if ( p == "isComponent" )
+ v = myStudy->isComponent( e );
+ else if ( p == "isReference" )
+ v = isReference( idx );
+ else if ( p == "canBeDisplayed" ) {
+ QString mod_name = app->moduleTitle( myStudy->componentDataType( e ) );
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, false );
+ // false in last parameter means that now we doesn't load module, if it isn't loaded
+
+ if ( d )
+ v = d->canBeDisplayed( e );
+ else if ( e.startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) ) // object is a Save Point object
+ v = false;
+ else
+ v = true;
+ //now if displayer is null, it means, that according module isn't loaded, so that we allow to all display/erase
+ //operations under object
+ }
+ }
}
- else if ( p == "isActiveView" ) return QVariant( (bool)activeVW() );
- else if ( p == "activeView" ) return QVariant( activeViewType() );
- else return QtxPopupSelection::parameter( p );
+
+ return v;
}
/*!
- Do nothing. To be redefined by successors
+ Perform additional processing of the selected item (to be redefined by successors if necessary).
+ Returns \c true by default.
+ Note: if this method returns \c false, the item will be removed from the items list and
+ not taken into account when showing popup menu.
+
+ \param owner a data owner being processed
+ \return \c true if the owner should be collected and \c false otherwise
*/
-void LightApp_Selection::processOwner( const LightApp_DataOwner* )
+bool LightApp_Selection::processOwner( const LightApp_DataOwner* /*owner*/ )
{
+ return true;
}
/*!
*/
QString LightApp_Selection::entry( const int index ) const
{
- if ( index >= 0 && index < count() )
- return myEntries[ index ];
- return QString();
+ QVariant v = objectInfo( index, OI_Entry );
+ return v.canConvert( QVariant::String ) ? v.toString() : QString();
}
/*!
*/
bool LightApp_Selection::isReference( const int index ) const
{
- if( index >= 0 && index < count() )
- return myIsReferences[ index ];
- else
- return false;
+ QVariant v = objectInfo( index, OI_Reference );
+ return v.canConvert( QVariant::Bool ) ? v.toBool() : false;
}
/*!
SUIT_Application* app = session->activeApplication();
if ( app ) {
SUIT_Desktop* desk = app->desktop();
- if ( desk )
- return desk->activeWindow();
+ if ( desk )
+ return desk->activeWindow();
}
}
return 0;
}
+
+/*!
+ Gets specified information about object with index idx.
+*/
+QVariant LightApp_Selection::objectInfo( const int idx, const int inf ) const
+{
+ QVariant res;
+ if ( 0 <= idx && idx < myObjects.size() ) {
+ if ( myObjects[idx].contains( inf ) )
+ res = myObjects[idx][inf];
+ }
+ return res;
+}
+
+/*!
+ Sets specified information about object with index idx.
+*/
+void LightApp_Selection::setObjectInfo( const int idx, const int inf, const QVariant& val )
+{
+ if ( 0 <= idx && idx < myObjects.size() )
+ myObjects[idx].insert( inf, val );
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// LightApp_Selection
// File : LightApp_Selection.h
// Author : Alexander SOLOVYOV
-// Module : GUI
-// $Header$
-//
+
#ifndef LIGHTAPP_SELECTION_HeaderFile
#define LIGHTAPP_SELECTION_HeaderFile
*/
class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupSelection
{
+protected:
+ typedef enum { OI_Entry, OI_Reference, OI_User } ObjectInformation;
+
public:
LightApp_Selection();
virtual ~LightApp_Selection();
- virtual void init( const QString&, LightApp_SelectionMgr* );
- virtual void processOwner( const LightApp_DataOwner* );
+ virtual void init( const QString&, LightApp_SelectionMgr* );
+ virtual bool processOwner( const LightApp_DataOwner* );
- virtual int count() const;
- virtual QVariant parameter( const int, const QString& ) const;
- virtual QVariant parameter( const QString& ) const;
- void setModuleName( const QString );
+ virtual int count() const;
+ virtual QVariant parameter( const QString& ) const;
+ virtual QVariant parameter( const int, const QString& ) const;
+ void setModuleName( const QString );
protected:
- QString entry( const int ) const;
- bool isReference( const int ) const;
+ // virtual QVariant contextParameter( const QString& ) const;
+ // virtual QVariant objectParameter( const int, const QString& ) const;
+
+ QString entry( const int ) const;
+ bool isReference( const int ) const;
+
/*!Gets study.*/
- LightApp_Study* study() const { return myStudy; }
- QString activeViewType() const;
- SUIT_ViewWindow* activeVW() const;
- virtual QString referencedToEntry( const QString& ) const;
+ LightApp_Study* study() const { return myStudy; }
+ QString activeViewType() const;
+ SUIT_ViewWindow* activeVW() const;
+ virtual QString referencedToEntry( const QString& ) const;
+ QVariant objectInfo( const int, const int ) const;
+ void setObjectInfo( const int, const int, const QVariant& );
+
+private:
+ typedef QMap<int, QVariant> ObjectInfo;
+ typedef QVector<ObjectInfo> ObjectInfoVector;
+ /*
+ typedef QMap<QString, QVariant> ParameterMap;
+ typedef QVector<ParameterMap> ObjectParamVector;
+ */
private:
- QString myPopupClient;
- QMap<int,QString> myEntries; // entries of selected objects
- QMap<int,bool> myIsReferences; // whether i-th selected object was a reference
- LightApp_Study* myStudy;
+ LightApp_Study* myStudy;
+ QString myContext;
+
+ ObjectInfoVector myObjects;
+ /*
+ ParameterMap myContextParams;
+ ObjectParamVector myObjectsParams;
+ */
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_SelectionMgr.h"
#include "LightApp_Study.h"
#include "LightApp_Application.h"
#include <SUIT_Session.h>
+#include <SUIT_Selector.h>
#ifndef DISABLE_SALOMEOBJECT
#include <SALOME_ListIO.hxx>
#include <TCollection_AsciiString.hxx>
#endif
+#include <QtCore/QSet>
+
/*!
Constructor.
*/
LightApp_SelectionMgr::LightApp_SelectionMgr( LightApp_Application* app, const bool fb )
: SUIT_SelectionMgr( fb ),
-myApp( app )
+ myApp( app ),
+ myTimeStamp( QTime::currentTime() ),
+ myCacheState( false )
{
}
return myApp;
}
+void LightApp_SelectionMgr::setSelected( const SUIT_DataOwnerPtrList& lst, const bool append )
+{
+ SUIT_SelectionMgr::setSelected( lst, append );
+
+ myTimeStamp = QTime::currentTime();
+}
+
#ifndef DISABLE_SALOMEOBJECT
/*!
Get all selected objects from selection manager
void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QString& theType,
const bool convertReferences ) const
{
+ LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
+ if ( !study )
+ return;
+
theList.Clear();
- SUIT_DataOwnerPtrList aList;
- selected( aList, theType );
+ QList<Handle(SALOME_InteractiveObject)> selList;
- QMap<QString,int> entryMap;
+ if ( isActualSelectionCache( theType ) ) {
+ selList = selectionCache( theType );
+ }
+ else {
+ QStringList types;
+ if ( !theType.isEmpty() )
+ types.append( theType );
+ else
+ types = selectorTypes();
+
+ QSet<QString> aSet;
+ for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+ SUIT_DataOwnerPtrList aList;
+ selected( aList, *it );
+
+ QList<Handle(SALOME_InteractiveObject)> typeSelList;
+
+ for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) {
+ const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+ if ( !owner )
+ continue;
+
+ if ( !aSet.contains( owner->entry() ) ) {
+ selList.append( owner->IO() );
+ aSet.insert( owner->entry() );
+ }
- QString entry, checkEntry;
- for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
- {
- const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
- if( !owner )
- continue;
+ typeSelList.append( owner->IO() );
+ }
- LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
- if ( !study )
- return;
+ if ( isSelectionCacheEnabled() ) {
+ LightApp_SelectionMgr* that = (LightApp_SelectionMgr*)this;
+ that->myCacheSelection.insert( *it, typeSelList );
+ that->myCacheTimes.insert( *it, QTime::currentTime() );
+ }
+ }
+ }
- entry = owner->entry();
+ QSet<QString> entrySet;
+ for ( QList<Handle(SALOME_InteractiveObject)>::const_iterator itr = selList.begin(); itr != selList.end(); ++itr )
+ {
+ Handle(SALOME_InteractiveObject) io = *itr;
+ QString entry( io->getEntry() );
// Entry to check object uniqueness.
// It is selected owner entry in the case, when we do not convert references,
// and entry of a real object, when we convert references.
- checkEntry = entry;
if ( convertReferences ) {
QString refEntry = study->referencedToEntry( entry );
- checkEntry = refEntry;
- if ( !entryMap.contains( checkEntry ) ) {
+ if ( !entrySet.contains( refEntry ) ) {
if ( refEntry != entry ) {
- QString component = study->componentDataType( refEntry );
- theList.Append( new SALOME_InteractiveObject( refEntry.toLatin1().constData(), component.toLatin1().constData(), ""/*refobj->Name().c_str()*/ ) );
+ entry = refEntry;
+ QString component = study->componentDataType( entry );
+ theList.Append( new SALOME_InteractiveObject( (const char*)entry.toLatin1(),
+ (const char*)component.toLatin1(),
+ ""/*refobj->Name().c_str()*/ ) );
}
- else if( !owner->IO().IsNull() )
- theList.Append( owner->IO() );
+ else if ( !io.IsNull() )
+ theList.Append( io );
}
}
- else {
- if( !entryMap.contains( entry ) && !owner->IO().IsNull() )
- theList.Append( owner->IO() );
- }
+ else if ( !entrySet.contains( entry ) && !io.IsNull() )
+ theList.Append( io );
- entryMap.insert(checkEntry, 1);
+ entrySet.insert( entry );
}
}
void LightApp_SelectionMgr::selectedObjects( QStringList& theList, const QString& theType,
const bool convertReferences ) const
{
+ LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
+ if ( !study )
+ return;
+
theList.clear();
- SUIT_DataOwnerPtrList aList;
- selected( aList, theType );
+ QStringList selList;
- QString entry;
- for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
- {
- const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
- if( !owner )
- continue;
+ if ( isActualSelectionCache( theType ) )
+ selList = selectionCache( theType );
+ else {
+ QStringList types;
+ if ( !theType.isEmpty() )
+ types.append( theType );
+ else
+ types = selectorTypes();
+
+ QSet<QString> aSet;
+ for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+ SUIT_DataOwnerPtrList aList;
+ selected( aList, *it );
- LightApp_Study* study = dynamic_cast<LightApp_Study*>( application()->activeStudy() );
- if ( !study )
- return;
+ QStringList typeSelList;
+
+ for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) {
+ const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+ if ( !owner )
+ continue;
+
+ if ( !aSet.contains( owner->entry() ) ) {
+ selList.append( owner->entry() );
+ aSet.insert( owner->entry() );
+ }
- entry = owner->entry();
- if( !theList.contains( entry ) )
- theList.append( entry );
+ typeSelList.append( owner->entry() );
+ }
+
+ if ( isSelectionCacheEnabled() ) {
+ LightApp_SelectionMgr* that = (LightApp_SelectionMgr*)this;
+ that->myCacheSelection.insert( *it, typeSelList );
+ that->myCacheTimes.insert( *it, QTime::currentTime() );
+ }
+ }
}
+
+ theList = selList;
}
#endif
{
SUIT_SelectionMgr::selectionChanged( theSel );
+ myTimeStamp = QTime::currentTime();
+
emit currentSelectionChanged();
}
/*!
get map of indexes for the given SALOME_InteractiveObject
*/
-void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)& IObject,
+void LightApp_SelectionMgr::GetIndexes( const Handle(SALOME_InteractiveObject)& IObject,
TColStd_IndexedMapOfInteger& theIndex)
{
theIndex.Clear();
for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
{
- const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
- if ( subOwner )
- if ( subOwner->entry() == QString(IObject->getEntry()) )
- theIndex.Add( subOwner->index() );
+ LightApp_DataSubOwner* subOwner = dynamic_cast<LightApp_DataSubOwner*>( (*itr).operator->() );
+ if ( subOwner && subOwner->entry() == QString(IObject->getEntry()) )
+ theIndex.Add( subOwner->index() );
}
-
}
/*!
const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
if ( subOwner )
if ( subOwner->entry() == theEntry )
- theIndex.Add( subOwner->index() );
+ theIndex.Add( subOwner->index() );
}
}
bool modeShift)
{
SUIT_DataOwnerPtrList remainsOwners;
-
+
SUIT_DataOwnerPtrList aList;
selected( aList );
-
+
QString ioEntry (IObject->getEntry());
-
+
if ( !modeShift ) {
for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
{
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
if ( owner )
{
- if ( owner->entry() != ioEntry )
- {
- const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( owner );
- if ( subOwner )
- remainsOwners.append( new LightApp_DataSubOwner( subOwner->entry(), subOwner->index() ) );
- else
- remainsOwners.append( new LightApp_DataOwner( owner->entry() ) );
- }
+ if ( owner->entry() != ioEntry )
+ {
+ const LightApp_DataSubOwner* subOwner = dynamic_cast<const LightApp_DataSubOwner*>( owner );
+ if ( subOwner )
+ remainsOwners.append( new LightApp_DataSubOwner( subOwner->entry(), subOwner->index() ) );
+ else
+ remainsOwners.append( new LightApp_DataOwner( owner->entry() ) );
+ }
}
}
}
It.Initialize(theIndexes);
for(;It.More();It.Next())
remainsOwners.append( new LightApp_DataSubOwner( ioEntry, It.Key() ) );
-
+
bool append = false;
setSelected( remainsOwners, append );
/*!
select 'subobjects' with given indexes
*/
-void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject,
- TColStd_IndexedMapOfInteger theIndex, bool append )
+void LightApp_SelectionMgr::selectObjects( const Handle(SALOME_InteractiveObject)& IObject,
+ TColStd_IndexedMapOfInteger theIndex, bool append )
{
SUIT_DataOwnerPtrList aList;
{
int i;
for ( i = 1; i <= theIndex.Extent(); i++ )
- aList.append( new LightApp_DataSubOwner( QString(IObject->getEntry()), theIndex( i ) ) );
+ aList.append( new LightApp_DataSubOwner( QString(IObject->getEntry()), theIndex( i ) ) );
}
setSelected( aList, append );
-
}
/*!
SUIT_DataOwnerPtrList aList;
MapIOOfMapOfInteger::Iterator it(theMapIO);
- for ( ; it.More(); it.Next() )
+ for ( ; it.More(); it.Next() )
{
if ( it.Value().IsEmpty() )
- aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) );
+ aList.append( new LightApp_DataOwner( QString(it.Key()->getEntry()) ) );
else
- {
- int i;
- for ( i = 1; i <= it.Value().Extent(); i++ )
- aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
- }
+ {
+ int i;
+ for ( i = 1; i <= it.Value().Extent(); i++ )
+ aList.append( new LightApp_DataSubOwner( QString(it.Key()->getEntry()), it.Value()( i ) ) );
+ }
}
-
- setSelected( aList, append );
+ setSelected( aList, append );
}
/*!
{
const LightApp_DataSubOwner* subOwner =
dynamic_cast<const LightApp_DataSubOwner*>( (*itr).operator->() );
- if ( subOwner )
+ if ( subOwner )
{
-#ifndef WNT
+//#ifndef WNT
if ( !theMap.IsBound( TCollection_AsciiString(subOwner->entry().toLatin1().data()) ) )
-#else
- if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) )
-#endif
+//#else
+// if ( !theMap.IsBound( subOwner->entry().toLatin1().data() ) )
+//#endif
{
- anIndexes.Clear();
- //Bug 17269: GetIndexes( subOwner->entry(), anIndexes );
+ anIndexes.Clear();
+ //Bug 17269: GetIndexes( subOwner->entry(), anIndexes );
//Bug 17269: To avoid multiple calling of selected(aList)
for ( SUIT_DataOwnerPtrList::const_iterator itr2 = itr; itr2 != aList.end(); ++itr2 )
{
anIndexes.Add( subOwner2->index() );
}
//
- theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes );
+ theMap.Bind( subOwner->entry().toLatin1().data(), anIndexes );
}
}
}
}
#endif
+
+void LightApp_SelectionMgr::clearSelectionCache()
+{
+ myCacheTimes.clear();
+ myCacheSelection.clear();
+}
+
+bool LightApp_SelectionMgr::isSelectionCacheEnabled() const
+{
+ return myCacheState;
+}
+
+void LightApp_SelectionMgr::setSelectionCacheEnabled( bool on )
+{
+ if ( myCacheState == on )
+ return;
+
+ myCacheState = on;
+
+ if ( !myCacheState )
+ clearSelectionCache();
+}
+
+#ifndef DISABLE_SALOMEOBJECT
+
+QList<Handle_SALOME_InteractiveObject> LightApp_SelectionMgr::selectionCache( const QString& type ) const
+{
+ QList<Handle_SALOME_InteractiveObject> res;
+
+ QStringList types;
+ if ( !type.isEmpty() )
+ types.append( type );
+ else
+ types = selectorTypes();
+
+ QSet<QString> set;
+ for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+ if ( myCacheSelection.contains( *it ) ) {
+ const SelList& lst = myCacheSelection[*it];
+ for ( SelList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr ) {
+ if ( !(*itr).IsNull() && !set.contains( (*itr)->getEntry() ) ) {
+ res.append( *itr );
+ set.insert( (*itr)->getEntry() );
+ }
+ }
+ }
+ }
+ return res;
+}
+
+#else
+
+QStringList LightApp_SelectionMgr::selectionCache( const QString& type ) const
+{
+ QStringList res;
+
+ QStringList types;
+ if ( !type.isEmpty() )
+ types.append( type );
+ else
+ types = selectorTypes();
+
+ QSet<QString> set;
+ for ( QStringList::iterator it = types.begin(); it != types.end(); ++it ) {
+ if ( myCacheSelection.contains( *it ) ) {
+ const SelList& lst = myCacheSelection[*it];
+ for ( SelList::const_iterator itr = lst.begin(); itr != lst.end(); ++itr ) {
+ if ( !set.contains( *itr ) ) {
+ res.append( *itr );
+ set.insert( *itr );
+ }
+ }
+ }
+ }
+ return res;
+}
+
+#endif
+
+bool LightApp_SelectionMgr::isActualSelectionCache( const QString& type ) const
+{
+ bool ok = true;
+
+ QStringList types;
+ if ( !type.isEmpty() )
+ types.append( type );
+ else
+ types = selectorTypes();
+
+ for ( QStringList::iterator it = types.begin(); it != types.end() && ok; ++it )
+ ok = myCacheTimes.contains( *it ) && myCacheTimes[*it].isValid() && myCacheTimes[*it] >= myTimeStamp;
+
+ return ok;
+}
+
+QStringList LightApp_SelectionMgr::selectorTypes() const
+{
+ QStringList types;
+ QList<SUIT_Selector*> selectorList;
+ selectors( selectorList );
+ for ( QList<SUIT_Selector*>::const_iterator it = selectorList.begin(); it != selectorList.end(); ++it ) {
+ if ( (*it)->isEnabled() )
+ types.append( (*it)->type() );
+ }
+ return types;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_SELECTIONMGR_H
#define LIGHTAPP_SELECTIONMGR_H
#include <SUIT_SelectionMgr.h>
+#include <QtCore/QTime>
+
#ifndef DISABLE_SALOMEOBJECT
#include <SALOME_InteractiveObject.hxx>
#include <QMap>
LightApp_Application* application() const;
+ virtual void setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
+
#ifndef DISABLE_SALOMEOBJECT
typedef NCollection_DataMap< Handle(SALOME_InteractiveObject), TColStd_IndexedMapOfInteger > MapIOOfMapOfInteger;
typedef NCollection_DataMap< TCollection_AsciiString, TColStd_IndexedMapOfInteger > MapEntryOfMapOfInteger;
void setSelectedObjects( const SALOME_ListIO&, const bool = false );
void GetIndexes( const Handle(SALOME_InteractiveObject)& IObject,
- TColStd_IndexedMapOfInteger& theIndex );
+ TColStd_IndexedMapOfInteger& theIndex );
void GetIndexes( const QString& theEntry,
- TColStd_IndexedMapOfInteger& theIndex );
+ TColStd_IndexedMapOfInteger& theIndex );
//bool AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject,
void AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& IObject,
- const TColStd_MapOfInteger& theIndices,
- bool modeShift );
+ const TColStd_MapOfInteger& theIndices,
+ bool modeShift );
void selectObjects( const Handle(SALOME_InteractiveObject)& IObject,
- TColStd_IndexedMapOfInteger theIndex, bool append );
+ TColStd_IndexedMapOfInteger theIndex, bool append );
void selectObjects( MapIOOfMapOfInteger theMapIO, bool append );
void selectedSubOwners( MapEntryOfMapOfInteger& theMap );
void selectedObjects( QStringList&, const QString& = QString(), const bool = true ) const;
#endif
+ void clearSelectionCache();
+ bool isSelectionCacheEnabled() const;
+ void setSelectionCacheEnabled( bool );
+
signals:
void currentSelectionChanged();
private:
virtual void selectionChanged( SUIT_Selector* );
+#ifndef DISABLE_SALOMEOBJECT
+ QList<Handle_SALOME_InteractiveObject> selectionCache( const QString& = QString() ) const;
+#else
+ QStringList selectionCache( const QString& = QString() ) const;
+#endif
+ bool isActualSelectionCache( const QString& = QString() ) const;
+
+ QStringList selectorTypes() const;
+
+private:
+#ifndef DISABLE_SALOMEOBJECT
+ typedef Handle_SALOME_InteractiveObject SelObject;
+#else
+ typedef QString SelObject;
+#endif
+ typedef QList<SelObject> SelList;
+ typedef QMap<QString, QTime> TimeMap;
+ typedef QMap<QString, SelList> CacheMap;
+
private:
LightApp_Application* myApp;
+
+ QTime myTimeStamp;
+
+ bool myCacheState;
+ TimeMap myCacheTimes;
+ CacheMap myCacheSelection;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_ShowHideOp.h"
#include "LightApp_Application.h"
#include "LightApp_Module.h"
{
LightApp_Displayer* disp = LightApp_Displayer::FindDisplayer( app->moduleTitle( *anIt ), true );
if( disp )
- disp->EraseAll( false, false, 0 );
+ disp->EraseAll( false, false, 0 );
}
if( myActionType==ERASE_ALL )
{
entries.append( entry );
}
- for( QStringList::const_iterator it = entries.begin(), last = entries.end(); it!=last; it++ )
- {
- QString e = study->referencedToEntry( *it );
- if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY )
- d->Display( e, false, 0 );
- else if( myActionType==ERASE )
- d->Erase( e, false, false, 0 );
+ // be sure to use real obejct entries
+ QStringList objEntries;
+ QStringList::const_iterator it = entries.begin(), last = entries.end();
+ for ( ; it!=last; ++it )
+ objEntries.append( study->referencedToEntry( *it ) );
+
+ if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY ) {
+ d->Display( objEntries, false, 0 );
+ mgr->setSelectedObjects(selObjs);
+ }
+ else if( myActionType==ERASE ) {
+ d->Erase( objEntries, false, false, 0 );
}
+
d->UpdateViewer();
commit();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_SHOW_HIDE_OPERATION_HEADER
#define LIGHTAPP_SHOW_HIDE_OPERATION_HEADER
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_Study.h"
#include "CAM_DataModel.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_DataObjectIterator.h"
+#include "SUIT_DataBrowser.h"
+#include "SUIT_TreeModel.h"
#include <set>
-#include <QString>
/*!
Constructor.
myDriver->RemoveTemporaryFiles(theModuleName, isDirDeleted);
}
+/*!
+ Virtual method that creates the root object (module object) for the given data model.
+ The type of the created object depends on the study class, therefore data model classes
+ should not create their module objects directly and should instead use
+ LightApp_DataModel::createModuleObject() that in its turn relies on this method.
+
+ \param theDataModel - data model instance to create a module object for
+ \param theParent - the module object's parent (normally it's the study root)
+ \return the module object instance
+ \sa LightApp_DataModel class, SalomeApp_Study class, LightApp_ModuleObject class
+*/
+CAM_ModuleObject* LightApp_Study::createModuleObject( LightApp_DataModel* theDataModel,
+ SUIT_DataObject* theParent ) const
+{
+ // Calling addComponent() for symmetry with SalomeApp_Study
+ // Currently it has empty implementation, but maybe in the future things will change...
+ LightApp_Study* that = const_cast<LightApp_Study*>( this );
+ that->addComponent( theDataModel );
+
+ // Avoid creating multiple module objects for the same module
+ CAM_ModuleObject* res = 0;
+
+ DataObjectList children = root()->children();
+ DataObjectList::const_iterator anIt = children.begin(), aLast = children.end();
+ for( ; !res && anIt!=aLast; anIt++ )
+ {
+ LightApp_ModuleObject* obj = dynamic_cast<LightApp_ModuleObject*>( *anIt );
+ if ( obj && obj->name() == theDataModel->module()->moduleName() )
+ res = obj;
+ }
+
+ if ( !res ){
+ res = new LightApp_ModuleObject( theDataModel, theParent );
+ }
+
+ return res;
+}
+
/*!
Fills list with components names
\param comp - list to be filled
for( ; anIt!=aLast; anIt++ )
{
LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( *anIt );
- if( obj && obj->entry()!="Interface Applicative" )
+ if ( obj && obj->entry() != getVisualComponentName() )
comp.append( obj->entry() );
}
}
+
+/*!
+ Get the entry for the given module
+ \param comp - list to be filled
+ \return module root's entry
+*/
+QString LightApp_Study::centry( const QString& comp ) const
+{
+ QString e;
+ ModelList dmlist;
+ dataModels( dmlist );
+ QListIterator<CAM_DataModel*> it( dmlist );
+ while ( it.hasNext() && e.isEmpty() ) {
+ CAM_DataModel* dm = it.next();
+ if ( dm->module() && dm->module()->name() == comp ) {
+ LightApp_DataObject* r = dynamic_cast<LightApp_DataObject*>( dm->root() );
+ if ( r ) e = r->entry();
+ }
+ }
+ return e;
+}
+
+/*!
+ \return a name of the component where visual parameters are stored
+*/
+QString LightApp_Study::getVisualComponentName() const
+{
+ return "Interface Applicative";
+}
+
+
+
+
+
+/*!
+ Set a visual property of the object
+ \param theViewId - Id of the viewer namager
+ \param theEntry - Entry of the object
+ \param thePropName - the name of the visual property
+ \param theValue - the value of the visual property
+*/
+void LightApp_Study::setObjectProperty(int theViewId, QString theEntry, QString thePropName, QVariant theValue) {
+
+ //Try to find viewer manager in the map
+ ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewId);
+ if(v_it == myViewMgrMap.end()) {
+
+ //1) Create property map
+ PropMap aPropMap;
+ aPropMap.insert(thePropName, theValue);
+
+ //2) Create object map
+ ObjMap anObjMap;
+ anObjMap.insert(theEntry,aPropMap);
+
+ //3) Insert in the view manager map
+ myViewMgrMap.insert(theViewId, anObjMap);
+
+ } else {
+ ObjMap& anObjMap = v_it.value();
+ ObjMap::Iterator o_it = anObjMap.find(theEntry);
+ if(o_it == anObjMap.end()) {
+ //1) Create property map
+ PropMap aPropMap;
+ aPropMap.insert(thePropName, theValue);
+
+ //2) Insert in the object map
+ anObjMap.insert(theEntry, aPropMap);
+ } else {
+ PropMap& aPropMap = o_it.value();
+ aPropMap.insert(thePropName, theValue);
+ }
+ }
+}
+
+/*!
+ Get a visual property of the object identified by theViewMgrId, theEntry and thePropName.
+ \param theViewMgrId - Id of the viewer manager.
+ \param theEntry - Entry of the object.
+ \param thePropName - the name of the visual property.
+ \param theDefValue - the default value of the visual property.
+ \return value of the visual propetry. If value is't found then return theDefValue.
+*/
+QVariant LightApp_Study::getObjectProperty(int theViewMgrId, QString theEntry, QString thePropName, QVariant theDefValue) const {
+ QVariant& aResult = theDefValue;
+ ViewMgrMap::ConstIterator v_it = myViewMgrMap.find(theViewMgrId);
+ if(v_it != myViewMgrMap.end()){
+ const ObjMap& anObjectMap = v_it.value();
+ ObjMap::ConstIterator o_it = anObjectMap.find(theEntry);
+ if(o_it != anObjectMap.end()) {
+ const PropMap& aPropMap = o_it.value();
+ PropMap::ConstIterator p_it = aPropMap.find(thePropName);
+ if(p_it != aPropMap.end()) {
+ aResult = p_it.value();
+ }
+ }
+ }
+ return aResult;
+}
+
+/*!
+ Remove view manager with all objects.
+ \param theViewMgrId - Id of the viewer manager.
+*/
+void LightApp_Study::removeViewMgr( int theViewMgrId ) {
+ myViewMgrMap.remove(theViewMgrId);
+}
+
+
+/*!
+ Get a map of the properties of the object identified by theViewMgrId and theEntry.
+ \param theViewMgrId - Id of the viewer manager.
+ \param theEntry - Entry of the object.
+ \return a map of the properties of the object.
+*/
+const PropMap& LightApp_Study::getObjectPropMap(int theViewMgrId, QString theEntry) {
+ ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
+ if (v_it != myViewMgrMap.end()) {
+ ObjMap& anObjectMap = v_it.value();
+ ObjMap::Iterator o_it = anObjectMap.find(theEntry);
+ if(o_it != anObjectMap.end()) {
+ return o_it.value();
+ } else {
+ PropMap aPropMap;
+ anObjectMap.insert(theEntry, aPropMap);
+ return anObjectMap.find(theEntry).value();
+ }
+ } else {
+ PropMap aPropMap;
+ ObjMap anObjMap;
+ anObjMap.insert(theEntry,aPropMap);
+ myViewMgrMap.insert(theViewMgrId, anObjMap);
+
+ ObjMap& anObjectMap = myViewMgrMap.find(theViewMgrId).value();
+ return anObjectMap.find(theEntry).value();
+ }
+}
+
+/*!
+ Set a map of the properties of the object identified by theViewMgrId and theEntry.
+ \param theViewMgrId - Id of the viewer manager.
+ \param theEntry - Entry of the object.
+*/
+void LightApp_Study::setObjectPropMap(int theViewMgrId, QString theEntry, PropMap thePropMap) {
+ //Try to find viewer manager in the map
+ ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
+ if(v_it == myViewMgrMap.end()) {
+
+ //1) Create object map
+ ObjMap anObjMap;
+ anObjMap.insert(theEntry,thePropMap);
+
+ //3) Insert in the view manager map
+ myViewMgrMap.insert(theViewMgrId, anObjMap);
+ } else {
+ ObjMap& anObjMap = v_it.value();
+ anObjMap.insert(theEntry,thePropMap);
+ }
+}
+
+/*!
+ Remove object's properties from all view managers.
+ \param theEntry - Entry of the object.
+*/
+void LightApp_Study::removeObjectFromAll( QString theEntry ) {
+ ViewMgrMap::Iterator v_it = myViewMgrMap.begin();
+ for( ;v_it != myViewMgrMap.end(); v_it++ ) {
+ v_it.value().remove(theEntry);
+ }
+}
+
+/*!
+ Get all objects and it's properties from view manager identified by theViewMgrId.
+ \param theEntry - Entry of the object.
+*/
+const ObjMap& LightApp_Study::getObjectMap ( int theViewMgrId ) {
+ ViewMgrMap::Iterator v_it = myViewMgrMap.find(theViewMgrId);
+ if( v_it == myViewMgrMap.end() ) {
+ ObjMap anObjMap;
+ myViewMgrMap.insert(theViewMgrId , anObjMap);
+ return myViewMgrMap.find(theViewMgrId).value();
+ }
+ return v_it.value();
+}
+
+/*!
+ Set 'visibility state' property of the object.
+ \param theEntry - Entry of the object.
+ \param theState - visibility status
+*/
+void LightApp_Study::setVisibilityState(const QString& theEntry, Qtx::VisibilityState theState) {
+ LightApp_Application* app = (LightApp_Application*)application();
+ if(!app)
+ return;
+ SUIT_DataBrowser* db = app->objectBrowser();
+ if(!db)
+ return;
+
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
+
+ if(treeModel)
+ treeModel->setVisibilityState(theEntry,theState);
+}
+
+/*!
+ Set 'visibility state' property for all object.
+ \param theEntry - Entry of the object.
+*/
+void LightApp_Study::setVisibilityStateForAll(Qtx::VisibilityState theState) {
+
+ LightApp_Application* app = (LightApp_Application*)application();
+ if(!app)
+ return;
+ SUIT_DataBrowser* db = app->objectBrowser();
+ if(!db)
+ return;
+
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
+
+ if(treeModel)
+ treeModel->setVisibilityStateForAll(theState);
+}
+
+/*!
+ Get 'visibility state' property of the object.
+ \param theEntry - Entry of the object.
+ \return 'visibility state' property of the object.
+*/
+Qtx::VisibilityState LightApp_Study::visibilityState(const QString& theEntry) const {
+ LightApp_Application* app = (LightApp_Application*)application();
+ if(app) {
+
+ SUIT_DataBrowser* db = app->objectBrowser();
+ if(db) {
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>(db->model());
+ if(treeModel)
+ return treeModel->visibilityState(theEntry);
+ }
+ }
+ return Qtx::UnpresentableState;
+}
+
+/*!
+ Find a data object by the specified entry.
+ \param theEntry - Entry of the object.
+ \return data object.
+*/
+LightApp_DataObject* LightApp_Study::findObjectByEntry( const QString& theEntry )
+{
+ LightApp_DataObject* aCurObj;
+ for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
+ aCurObj = dynamic_cast<LightApp_DataObject*>( it.current() );
+ if ( aCurObj && aCurObj->entry() == theEntry )
+ return aCurObj;
+ }
+ return NULL;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_STUDY_H
#define LIGHTAPP_STUDY_H
#include "string"
#include "vector"
+#include <Qtx.h>
+
+#include <QMap>
+#include <QVariant>
class SUIT_Study;
class SUIT_Application;
class CAM_DataModel;
+class CAM_ModuleObject;
+class LightApp_DataObject;
+class LightApp_DataModel;
+
+//Map to store visual property of the object.
+//Key: Name of the visual property of the object.
+//Value: value of the visual property.
+typedef QMap<QString, QVariant> PropMap;
+
+//Map to store objects with it's visual properties.
+//Key: Entry of the object.
+//Value: Map of the visual properties of the object.
+typedef QMap<QString, PropMap> ObjMap;
+
+//Map to store view managers and all objects which displayed in views of the view managers.
+//Key: Id of the viewer.
+//Value: Map of the objects with it's visual properties.
+typedef QMap<int, ObjMap> ViewMgrMap;
+
/*!
Custom study, using for open/close of documents HDF format.
virtual bool isComponent( const QString& ) const;
virtual void children( const QString&, QStringList& ) const;
virtual void components( QStringList& ) const;
+ virtual QString centry( const QString& ) const;
+
+ virtual QString getVisualComponentName() const;
+
+ virtual void setObjectProperty ( int theViewMgrId, QString theEntry, QString thePropName, QVariant theValue );
+ virtual QVariant getObjectProperty ( int theViewMgrId, QString theEntry, QString thePropName, QVariant theDefValue ) const;
+ virtual void removeViewMgr ( int theViewMgrId );
+ virtual void setObjectPropMap ( int theViewMgrId, QString theEntry, PropMap thePropMap );
+ virtual const PropMap& getObjectPropMap ( int theViewMgrId, QString theEntry ) ;
+ virtual void removeObjectFromAll( QString theEntry );
+ virtual const ObjMap& getObjectMap ( int theViewMgrId );
+ virtual const ViewMgrMap& getViewMgrMap ( int theViewMgrId ) { return myViewMgrMap; };
+
+ virtual void setVisibilityState(const QString& theEntry, Qtx::VisibilityState theState);
+ virtual Qtx::VisibilityState visibilityState(const QString& theEntry) const;
+ virtual void setVisibilityStateForAll(Qtx::VisibilityState theState);
+
+ virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
protected:
virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles );
protected:
virtual bool openDataModel ( const QString&, CAM_DataModel* );
+ virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel,
+ SUIT_DataObject* theParent ) const;
signals:
void saved ( SUIT_Study* );
private:
LightApp_Driver* myDriver;
+ ViewMgrMap myViewMgrMap;
friend class LightApp_Application;
+ friend class LightApp_DataModel;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_SwitchOp.h"
#include "LightApp_Module.h"
#include "LightApp_Operation.h"
SUIT_Operation* anOp = anIter.next();
if ( anOp &&
- anOp->inherits( "LightApp_Operation" ) &&
+ anOp->inherits( "LightApp_Operation" ) &&
((LightApp_Operation*)anOp)->dlg() == aDlg )
return ((LightApp_Operation*)anOp);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LightApp_SwitchOp_H
#define LightApp_SwitchOp_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : LightApp_UpdateFlags.h
// Author : Sergey LITONIN
// Module : LIGHT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_VTKSelector.h"
#include "LightApp_DataOwner.h"
Constructor.
*/
LightApp_SVTKDataOwner::LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)& theIO,
- SUIT_Desktop* theDesktop )
+ SUIT_Desktop* theDesktop )
: LightApp_DataOwner( theIO ),
myDesktop( theDesktop )
{
{
if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow()){
using namespace SVTK;
- return Find<SALOME_Actor>(aViewWindow->getRenderer()->GetActors(),TIsSameIObject<SALOME_Actor>(IO()));
+ VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors());
+ return Find<SALOME_Actor>(aCopy.GetActors(),TIsSameIObject<SALOME_Actor>(IO()));
}
return NULL;
*/
LightApp_VTKSelector
::LightApp_VTKSelector( SVTK_ViewModelBase* viewer,
- SUIT_SelectionMgr* mgr ):
+ SUIT_SelectionMgr* mgr ):
SUIT_Selector( mgr, viewer ),
myViewer( viewer )
{
if(myViewer){
if(SUIT_ViewManager* aViewManager = myViewer->getViewManager()){
if(SVTK_ViewManager* aViewMgr = dynamic_cast<SVTK_ViewManager*>(aViewManager)){
- if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
- if(SVTK_Selector* aSelector = aView->GetSelector()){
- const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
- SALOME_ListIteratorOfListIO anIter(aListIO);
- for(; anIter.More(); anIter.Next()){
- Handle(SALOME_InteractiveObject) anIO = anIter.Value();
- if(anIO->hasEntry())
- aList.append(new LightApp_SVTKDataOwner(anIO,aViewMgr->getDesktop()));
- }
- }
- }
+ if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
+ if(SVTK_Selector* aSelector = aView->GetSelector()){
+ const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
+ SALOME_ListIteratorOfListIO anIter(aListIO);
+ for(; anIter.More(); anIter.Next()){
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+ if(anIO->hasEntry())
+ aList.append(new LightApp_SVTKDataOwner(anIO,aViewMgr->getDesktop()));
+ }
+ }
+ }
}
}
}
if(myViewer){
if(SUIT_ViewManager* aViewMgr = myViewer->getViewManager()){
if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewMgr->getActiveView())){
- if(SVTK_Selector* aSelector = aView->GetSelector()){
- SALOME_ListIO anAppendList;
- const SALOME_ListIO& aStoredList = aSelector->StoredIObjects();
- SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin();
- for(; anIter != theList.end(); ++anIter){
- const SUIT_DataOwner* aDataOwner = (*anIter).get();
- if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast<const LightApp_SVTKDataOwner*>(aDataOwner)){
- aSelector->SetSelectionMode(anOwner->GetMode());
- Handle(SALOME_InteractiveObject) anIO = anOwner->IO();
+ if(SVTK_Selector* aSelector = aView->GetSelector()){
+ SALOME_ListIO anAppendList;
+ const SALOME_ListIO& aStoredList = aSelector->StoredIObjects();
+ SUIT_DataOwnerPtrList::const_iterator anIter = theList.begin();
+ for(; anIter != theList.end(); ++anIter){
+ const SUIT_DataOwner* aDataOwner = (*anIter).get();
+ if(const LightApp_SVTKDataOwner* anOwner = dynamic_cast<const LightApp_SVTKDataOwner*>(aDataOwner)){
+ aSelector->SetSelectionMode(anOwner->GetMode());
+ Handle(SALOME_InteractiveObject) anIO = anOwner->IO();
- aSelector->AddIObject(anIO);
+ aSelector->AddIObject(anIO);
- anAppendList.Append(anIO);
- aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
- }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
- Handle(SALOME_InteractiveObject) anIO =
- new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
- aSelector->AddIObject(anIO);
- anAppendList.Append(anIO);
- }
- }
- // To remove IOs, which is not selected.
- QMap< QString, Handle( SALOME_InteractiveObject )> toRemove;
- SALOME_ListIteratorOfListIO anIt( aStoredList );
- for( ; anIt.More(); anIt.Next() )
- if( !anIt.Value().IsNull() )
- toRemove[ anIt.Value()->getEntry() ] = anIt.Value();
+ anAppendList.Append(anIO);
+ aSelector->AddOrRemoveIndex(anIO,anOwner->GetIds(),false);
+ }else if(const LightApp_DataOwner* anOwner = dynamic_cast<const LightApp_DataOwner*>(aDataOwner)){
+ Handle(SALOME_InteractiveObject) anIO =
+ new SALOME_InteractiveObject(anOwner->entry().toLatin1(),"");
+ aSelector->AddIObject(anIO);
+ anAppendList.Append(anIO);
+ }
+ }
+ // To remove IOs, which is not selected.
+ QMap< QString, Handle( SALOME_InteractiveObject )> toRemove;
+ SALOME_ListIteratorOfListIO anIt( aStoredList );
+ for( ; anIt.More(); anIt.Next() )
+ if( !anIt.Value().IsNull() )
+ toRemove[ anIt.Value()->getEntry() ] = anIt.Value();
- anIt = SALOME_ListIteratorOfListIO(anAppendList);
- for( ; anIt.More(); anIt.Next() )
- toRemove.remove( anIt.Value()->getEntry() );
+ anIt = SALOME_ListIteratorOfListIO(anAppendList);
+ for( ; anIt.More(); anIt.Next() )
+ toRemove.remove( anIt.Value()->getEntry() );
- QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
- REnd = toRemove.end();
- for( ; RIt!=REnd; RIt++ )
- aSelector->RemoveIObject( RIt.value() );
-
- aView->onSelectionChanged();
- }
+ QMap< QString, Handle( SALOME_InteractiveObject )>::const_iterator RIt = toRemove.begin(),
+ REnd = toRemove.end();
+ for( ; RIt!=REnd; RIt++ )
+ aSelector->RemoveIObject( RIt.value() );
+
+ aView->onSelectionChanged();
+ }
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef LIGHTAPP_VTKSELECTOR_H
#define LIGHTAPP_VTKSELECTOR_H
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : OCC team (OCN)
# Module : LightApp
# $Header$
-#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
+EXTRA_DIST += images
+
+QRC_FILES = qrc_LightApp.cxx
+
lib_LTLIBRARIES = libLightApp.la
salomeinclude_HEADERS = \
LightApp_SwitchOp.h \
LightApp_Preferences.h \
LightApp_PreferencesDlg.h \
- LightApp_UpdateFlags.h
+ LightApp_UpdateFlags.h \
+ LightApp_WgViewModel.h \
+ LightApp_FullScreenHelper.h
+
+if ENABLE_PYCONSOLE
+ salomeinclude_HEADERS += LightApp_PyInterp.h
+endif
# LightApp_OBFilter.h
LightApp_Study.cxx \
LightApp_SwitchOp.cxx \
LightApp_Preferences.cxx \
- LightApp_PreferencesDlg.cxx
+ LightApp_PreferencesDlg.cxx \
+ LightApp_WgViewModel.cxx \
+ LightApp_FullScreenHelper.cxx
+
+if ENABLE_PYCONSOLE
+ dist_libLightApp_la_SOURCES += LightApp_PyInterp.cxx
+endif
# LightApp_OBFilter.cxx
LightApp_Study_moc.cxx \
LightApp_SwitchOp_moc.cxx \
LightApp_Preferences_moc.cxx \
- LightApp_PreferencesDlg_moc.cxx
+ LightApp_PreferencesDlg_moc.cxx \
+ LightApp_WgViewModel_moc.cxx
if ENABLE_VTKVIEWER
if ENABLE_SALOMEOBJECT
if ENABLE_PLOT2DVIEWER
MOC_FILES += LightApp_Plot2dSelector_moc.cxx
endif
-nodist_libLightApp_la_SOURCES = $(MOC_FILES)
-
+nodist_libLightApp_la_SOURCES = $(MOC_FILES) $(QRC_FILES)
dist_salomeres_DATA = \
resources/icon_about.png \
resources/icon_applogo.png \
nodist_salomeres_DATA = \
LightApp_images.qm \
- LightApp_msg_en.qm
+ LightApp_msg_en.qm \
+ LightApp_msg_fr.qm
libLightApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(CAS_CPPFLAGS) \
$(HDF5_INCLUDES) @KERNEL_CXXFLAGS@ -I$(srcdir)/../SUIT -I$(srcdir)/../STD \
-I$(srcdir)/../CAM -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LogWindow \
- -I$(srcdir)/../Prs -I$(srcdir)/../Qtx -I$(srcdir)/../Event -I$(srcdir)/../Style
+ -I$(srcdir)/../Prs -I$(srcdir)/../Qtx -I$(srcdir)/../Event -I$(srcdir)/../Style \
+ -I$(srcdir)/../CASCatch
+
libLightApp_la_LDFLAGS = $(QT_MT_LIBS)
if ENABLE_VTKVIEWER
else
libLightApp_la_CPPFLAGS += -DDISABLE_PLOT2DVIEWER
endif
-libLightApp_la_CPPFLAGS+= -I$(srcdir)/../QxScene
-
if ENABLE_OCCVIEWER
libLightApp_la_CPPFLAGS += -I$(srcdir)/../OCCViewer
else !ENABLE_OCCVIEWER
libLightApp_la_CPPFLAGS += -DDISABLE_OCCVIEWER
endif
if ENABLE_PYCONSOLE
- libLightApp_la_CPPFLAGS += $(PYTHON_INCLUDES) -I$(srcdir)/../PyConsole -I$(srcdir)/../PyInterp
+ libLightApp_la_CPPFLAGS += $(PYTHON_INCLUDES) -I$(srcdir)/../PyConsole -I$(srcdir)/../PyInterp \
+ -I$(srcdir)/../SUITApp
libLightApp_la_LDFLAGS += $(PYTHON_LIBS)
else !ENABLE_PYCONSOLE
libLightApp_la_CPPFLAGS += -DDISABLE_PYCONSOLE
else !ENABLE_SUPERVGRAPHVIEWER
libLightApp_la_CPPFLAGS += -DDISABLE_SUPERVGRAPHVIEWER
endif
+###VSR: QxGraph has been replaced by QxScene
+###libLightApp_la_CPPFLAGS += -I$(srcdir)/../QxGraph
if ENABLE_QXGRAPHVIEWER
- libLightApp_la_CPPFLAGS += -I$(srcdir)/../QxGraph
+ libLightApp_la_CPPFLAGS += -I$(srcdir)/../QxScene
else !ENABLE_QXGRAPHVIEWER
libLightApp_la_CPPFLAGS += -DDISABLE_QXGRAPHVIEWER
endif
endif
else !ENABLE_SALOMEOBJECT
libLightApp_la_CPPFLAGS += -DDISABLE_SALOMEOBJECT
-
+
endif
libLightApp_la_LIBADD = ../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la \
libLightApp_la_LIBADD += ../SPlot2d/libSPlot2d.la
endif
endif
+
if ENABLE_PYCONSOLE
- libLightApp_la_LIBADD += ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la
+ libLightApp_la_LIBADD += ../PyInterp/libPyInterp.la ../PyConsole/libPyConsole.la \
+ ../SUITApp/libSUITApp.la
endif
+
if ENABLE_SUPERVGRAPHVIEWER
libLightApp_la_LIBADD += ../SUPERVGraph/libSUPERVGraph.la
endif
+###VSR: QxGraph has been replaced by QxScene
+###libLightApp_la_LIBADD += ../QxGraph/libQxGraph.la
if ENABLE_QXGRAPHVIEWER
- libLightApp_la_LIBADD += ../QxGraph/libQxGraph.la
-endif
libLightApp_la_LIBADD+= ../QxScene/libQxScene.la
+endif
+# 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
+#
+
# The resources mapping file for LightApp application
[language]
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ 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
<parameter name="file" value="no"/>
<parameter name="key" value="no"/>
<parameter name="interp" value="no"/>
- <parameter name="modules" value="LIGHT"/>
+ <parameter name="modules" value="LIGHT,PYLIGHT"/>
</section>
<section name="language">
<!-- Language settings (resource manager)-->
+ <parameter name="languages" value="en,fr"/>
<parameter name="language" value="en"/>
<parameter name="translators" value="%P_msg_%L.qm|%P_icons.qm|%P_images.qm"/>
</section>
<!-- Splash screen settings -->
<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="#eeeeff|#555555" />
+ <parameter name="text_colors" value="#ffffff|#777777" />
<parameter name="hide_on_click" value="no" />
<parameter name="show_progress" value="yes" />
<parameter name="show_message" value="yes" />
<parameter name="show_percents" value="yes" />
- <parameter name="margin" value="40" />
+ <parameter name="margin" value="50" />
<parameter name="progress_width" value="20" />
<parameter name="progress_flags" value="bottom,left_to_right" />
- <parameter name="opacity" value="0.70" />
+ <parameter name="opacity" value="0.85" />
<parameter name="font" value="Tahoma,12,normal" />
<parameter name="alignment" value="top,left" />
- <parameter name="progress_colors" value="#3b3e5d|#d14949|v" />
+ <parameter name="progress_colors" value="#929ca7|#aebac7|v" />
</section>
<section name="resources">
<!-- Resource directories (resource manager)-->
+ <parameter name="Qtx" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="Style" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="SUIT" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="STD" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="ViewerTools" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="Plot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="SPlot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="GLViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="CAM" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="LightApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="SVTK" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="SUPERVGraph" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="QxGraph" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
<parameter name="ToolsGUI" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
+ <parameter name="LogWindow" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
</section>
<section name="desktop" >
<!-- Default GUI desktop state, position, size -->
- <parameter name="geometry" value="80%x80%+10%+10%"/>
+ <parameter name="geometry" value="80%%x80%%+10%%+10%%"/>
+ <parameter name="opaque_resize" value="false"/>
</section>
<section name="PyConsole">
<!-- Python console preferences -->
+ <parameter name="show_banner" value="true" />
<parameter name="font" value="Helvetic,12" />
<parameter name="additional_families" value="Helvetic;Helvetica;Helvetica[Adobe];Times;Times[Adobe];Sans Serif;Serif;Monospace;Lucida"/>
</section>
<section name="ObjectBrowser" >
<!-- Object Browser preferences -->
<parameter name="auto_hide_search_tool" value="true" />
+ <parameter name="auto_size" value="false" />
+ <parameter name="auto_size_first" value="true" />
+ <parameter name="resize_on_expand_item" value="false" />
+ <parameter name="browse_published_object" value="1" />
</section>
<section name="FileDlg">
<!-- "Open/Save File" dialog box preferences-->
<parameter name="QuickDirList" value=""/>
+ <parameter name="ShowCurDirInitial" value="true" />
</section>
<section name="MRU" >
<!-- Show "Most recently used" studies-->
</section>
<section name="Study">
<!-- General study settings -->
- <parameter name="store_positions" value="true" />
+ <parameter name="store_positions" value="true" />
+ <parameter name="auto_save_interval" value="0" />
+ </section>
+ <section name="viewers" >
+ <!-- common viewers preferences -->
+ <parameter name="drop_down_buttons" value="true" />
</section>
<section name="OCCViewer" >
<!-- OCC viewer preferences -->
- <parameter name="background" value="35, 136, 145" />
+ <parameter name="xz_background" value="35, 136, 145" />
+ <parameter name="yz_background" value="35, 136, 145" />
+ <parameter name="xy_background" value="35, 136, 145" />
+ <parameter name="background" value="35, 136, 145" />
<parameter name="iso_number_u" value="1" />
<parameter name="iso_number_v" value="1" />
<parameter name="trihedron_size" value="100" />
+ <parameter name="navigation_mode" value="0" />
+ <parameter name="zooming_mode" value="0" />
+ <parameter name="show_static_trihedron" value="true"/>
+ <parameter name="relative_size" value="true"/>
</section>
<section name="VTKViewer" >
<!-- VTK viewer preferences -->
- <parameter name="background" value="0, 0, 0"/>
- <parameter name="projection_mode" value="0" />
- <parameter name="trihedron_size" value="100" />
- <parameter name="relative_size" value="true" />
- <parameter name="use_advanced_selection_algorithm" value="true" />
- <parameter name="navigation_mode" value="0" />
- <parameter name="speed_value" value="10" />
- <parameter name="speed_mode" value="0" />
- <parameter name="spacemouse_func1_btn" value="1" />
- <parameter name="spacemouse_func2_btn" value="2" />
- <parameter name="spacemouse_func5_btn" value="9" />
+ <parameter name="background" value="0, 0, 0"/>
+ <parameter name="projection_mode" value="0"/>
+ <parameter name="trihedron_size" value="105"/>
+ <parameter name="relative_size" value="true"/>
+ <parameter name="dynamic_preselection" value="true"/>
+ <parameter name="navigation_mode" value="0"/>
+ <parameter name="zooming_mode" value="0"/>
+ <parameter name="speed_value" value="10"/>
+ <parameter name="speed_mode" value="0"/>
+ <parameter name="show_static_trihedron" value="true"/>
+ <parameter name="spacemouse_func1_btn" value="1"/>
+ <parameter name="spacemouse_func2_btn" value="2"/>
+ <parameter name="spacemouse_func5_btn" value="5"/>
+ <parameter name="show_group_names" value="true"/>
+ <parameter name="group_names_text_color" value="255, 255, 255"/>
+ <parameter name="group_names_transparency" value="0.5"/>
+ <parameter name="recorder_mode" value="1"/>
+ <parameter name="recorder_fps" value="17.3"/>
+ <parameter name="recorder_quality" value="100" />
+ <parameter name="recorder_progressive" value="true"/>
</section>
<section name="Plot2d" >
<!-- Plot2d viewer preferences -->
<parameter name="Background" value="255, 255, 255" />
+ <parameter name="SelectionColor" value="80, 80, 80" />
+ <parameter name="DeviationMarkerColor" value="255, 0, 0" />
+ <parameter name="DeviationMarkerLineWidth" value="1" />
+ <parameter name="DeviationMarkerTickSize" value="2" />
<parameter name="CurveType" value="1" />
<parameter name="HorScaleMode" value="0" />
<parameter name="LegendPos" value="1" />
+ <parameter name="LegendFont" value="Helvetic,12" />
+ <parameter name="LegendFontColor" value="0, 0, 0" />
+ <parameter name="SelectedLegendFontColor" value="255, 255, 255" />
<parameter name="MarkerSize" value="9" />
<parameter name="ShowLegend" value="true" />
<parameter name="VerScaleMode" value="0" />
+ <parameter name="VerNormLMinMode" value="false"/>
+ <parameter name="VerNormLMaxMode" value="false"/>
+ <parameter name="VerNormRMinMode" value="false"/>
+ <parameter name="VerNormRMaxMode" value="false"/>
</section>
- <section name="SUPERVGraph" >
- <!-- Supervision viewer preferences -->
+ <section name="QxGraph" >
+ <!-- QxGraph viewer preferences -->
<parameter name="Background" value="144, 208, 211" />
<parameter name="Title" value="63, 213, 255" />
+ <parameter name="NodeBody" value="255, 249, 147" />
</section>
<section name="QxSceneViewer" >
<!-- QxGraph viewer preferences -->
<parameter name="Title" value="63, 213, 255" />
<parameter name="NodeBody" value="255, 249, 147" />
</section>
+ <section name="GUI" >
+ <parameter name="documentation" value="gui_help"/>
+ </section>
+ <section name="KERNEL" >
+ <parameter name="documentation" value="kernel_help"/>
+ </section>
+ <section name="gui_help" >
+ <parameter name="sub_menu" value="%1 module"/>
+ <parameter name="User's Guide" value="${GUI_ROOT_DIR}/share/doc/salome/gui/GUI/index.html"/>
+ <parameter name="Developer's Guide" value="${GUI_ROOT_DIR}/share/doc/salome/tui/GUI/index.html"/>
+ </section>
+ <section name="kernel_help" >
+ <parameter name="sub_menu" value="%1 module"/>
+ <parameter name="User's Guide" value="${KERNEL_ROOT_DIR}/share/doc/salome/gui/KERNEL/index.html"/>
+ <parameter name="Developer's Guide" value="${KERNEL_ROOT_DIR}/share/doc/salome/tui/KERNEL/index.html"/>
+ </section>
+ <!--Salome shortcut settings-->
+ <section name="shortcuts_settings">
+ <parameter name="general_sections" value="General;Viewers"/>
+ </section>
+ <section name="shortcuts:General">
+ <parameter name="Show object(s)" value="Ctrl+Alt+S"/>
+ <parameter name="Hide object(s)" value="Ctrl+Alt+H"/>
+ </section>
+ <section name="shortcuts:Viewers">
+ <parameter name="Front view" value="Ctrl+Alt+F"/>
+ <parameter name="Back view" value="Ctrl+Alt+B"/>
+ <parameter name="Top view" value="Ctrl+Alt+T"/>
+ <parameter name="Bottom view" value="Ctrl+Alt+O"/>
+ <parameter name="Left view" value="Ctrl+Alt+K"/>
+ <parameter name="Right view" value="Ctrl+Alt+R"/>
+ <parameter name="Reset view" value="Ctrl+Alt+E"/>
+ </section>
+ <section name="shortcuts:Geometry">
+ <parameter name="Increase number of isolines" value="Meta+I"/>
+ <parameter name="Decrease number of isolines" value="Meta+D"/>
+ <parameter name="Increase transparency" value="Meta+Y"/>
+ <parameter name="Decrease transparency" value="Meta+T"/>
+ </section>
+ <section name="ExternalBrowser" >
+ <!-- External HELP browser settings -->
+ <parameter value="C:\Program Files\Internet Explorer\iexplore.exe" name="winapplication" />
+ <parameter value="false" name="use_external_browser" />
+ <parameter value="/usr/bin/mozilla" name="application" />
+ </section>
</document>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: LightApp_images.po
-# Created: May, 2005
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ABOUT"
-msgstr "icon_about.png"
-
-msgid "ABOUT_SPLASH"
-msgstr "icon_about.png"
-
-msgid "APP_DEFAULT_ICO"
-msgstr "icon_default.png"
-
-msgid "APP_MODULE_ICO"
-msgstr "icon_module.png"
-
-msgid "APP_MODULE_BIG_ICO"
-msgstr "icon_module_big.png"
-
-msgid "ICON_SELECT"
-msgstr "icon_select.png"
-
-msgid "APP_BASE_LOGO"
-msgstr "icon_applogo.png"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>APP_MODULE_ICO</source>
<translation>icon_module.png</translation>
</message>
+ <message>
+ <source>BROWSER_ICON</source>
+ <translation>icon_default.png</translation>
+ </message>
+ <message>
+ <source>BROWSER_CLOSE_ICON</source>
+ <translation>close.png</translation>
+ </message>
</context>
</TS>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-
-//=======================================================================================
-
-msgid "APP_NAME"
-msgstr "SALOME"
-
-msgid "ABOUT_CAPTION"
-msgstr "About %1"
-
-msgid "ABOUT_VERSION"
-msgstr "Version %1"
-
-msgid "ABOUT_COPYRIGHT"
-msgstr "Copyright (C) 2003-2006 OPEN CASCADE, EADS/CCR, LIP6,\nCEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS"
-
-msgid "ABOUT_LICENSE"
-msgstr "GNU LGPL"
-
-//=======================================================================================
-
-msgid "LightApp_Application::ACTIVATING_MODULE"
-msgstr "Trying to activate module \"%1\""
-
-msgid "LightApp_Application::TOT_RENAME"
-msgstr "Rename"
-
-msgid "LightApp_Application::MEN_DESK_RENAME"
-msgstr "&Rename"
-
-msgid "LightApp_Application::PRP_RENAME"
-msgstr "Rename active window"
-
-msgid "LightApp_Application::TOT_DESK_PREFERENCES"
-msgstr "Preferences"
-
-msgid "LightApp_Application::MEN_DESK_PREFERENCES"
-msgstr "Pre&ferences..."
-
-msgid "LightApp_Application::TOT_DESK_MRU"
-msgstr "Most recently used"
-
-msgid "LightApp_Application::MEN_DESK_MRU"
-msgstr "Most recently used"
-
-msgid "LightApp_Application::PRP_DESK_PREFERENCES"
-msgstr "Allow to change the preferences"
-
-msgid "LightApp_Application::INF_TOOLBAR_MODULES"
-msgstr "Modules"
-
-msgid "LightApp_Application::PRP_APP_MODULE"
-msgstr "Switch to SALOME platform neutral point"
-
-msgid "LightApp_Application::PRP_MODULE"
-msgstr "Switch to the module \"%1\""
-
-msgid "LightApp_Application::NEW_WINDOW_0"
-msgstr "&GL View"
-
-msgid "LightApp_Application::NEW_WINDOW_1"
-msgstr "&Plot2d View"
-
-msgid "LightApp_Application::NEW_WINDOW_2"
-msgstr "&OCC View"
-
-msgid "LightApp_Application::NEW_WINDOW_3"
-msgstr "VT&K View"
-
-msgid "LightApp_Application::NEW_WINDOW_4"
-msgstr "&QxGraph View"
-
-msgid "LightApp_Application::NEW_WINDOW_5"
-msgstr "Qx&Scene View"
-
-msgid "LightApp_Application::INF_CANCELLED"
-msgstr "Module activation cancelled"
-
-msgid "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"
-msgstr "External browser \"%1\" can not show help page \"%2\". Do you want to change it in preferences?"
-
-msgid "LightApp_Application::DEFINE_EXTERNAL_BROWSER"
-msgstr "External browser is not found. Do you want to define it in preferences?"
-
-msgid "LightApp_Application::DATA_MODELS"
-msgstr "Data models"
-
-msgid "LightApp_Application::OBJECT_BROWSER"
-msgstr "Object Browser"
-
-msgid "LightApp_Application::OBJ_BROWSER_NAME"
-msgstr "Object"
-
-msgid "LightApp_Application::LOG_WINDOW"
-msgstr "Message Window"
-
-//=======================================================================================
-
-msgid "LightApp_Application::MEN_DESK_MODULE_HELP"
-msgstr "Module Help"
-
-//=======================================================================================
-
-msgid "LightApp_Application::PREFERENCES_NOT_LOADED"
-msgstr "Preferences for module \"<b>%1</b>\" will be available when the module will be loaded"
-
-msgid "LightApp_Application::PREF_CATEGORY_SALOME"
-msgstr "SALOME"
-
-msgid "LightApp_Application::PREF_TAB_GENERAL"
-msgstr "General"
-
-msgid "LightApp_Application::PREF_GROUP_STUDY"
-msgstr "Study properties"
-
-msgid "LightApp_Application::PREF_MULTI_FILE"
-msgstr "Multi file save"
-
-msgid "LightApp_Application::PREF_ASCII_FILE"
-msgstr "ASCII save"
-
-msgid "LightApp_Application::PREF_STORE_POS"
-msgstr "Store positions of windows"
-
-msgid "LightApp_Application::PREF_GROUP_EXT_BROWSER"
-msgstr "External browser"
-
-msgid "LightApp_Application::PREF_APP"
-msgstr "Application"
-
-msgid "LightApp_Application::PREF_PARAM"
-msgstr "Parameters"
-
-msgid "LightApp_Application::PREF_GROUP_PY_CONSOLE"
-msgstr "Python console properties"
-
-msgid "LightApp_Application::PREF_FONT"
-msgstr "Font"
-
-msgid "LightApp_Application::PREF_GROUP_STYLE"
-msgstr "Salome style"
-
-msgid "LightApp_Application::PREF_USE_SALOME_STYLE"
-msgstr "Use Salome style"
-
-msgid "LightApp_Application::PREF_TAB_OBJBROWSER"
-msgstr "Object browser"
-
-msgid "LightApp_Application::PREF_OBJ_BROWSER_SETTINGS"
-msgstr "Object browser settings"
-
-msgid "LightApp_Application::PREF_GROUP_DEF_COLUMNS"
-msgstr "Default columns"
-
-msgid "LightApp_Application::PREF_TAB_VIEWERS"
-msgstr "Viewers"
-
-msgid "LightApp_Application::PREF_GROUP_OCCVIEWER"
-msgstr "OCC Viewer 3d"
-
-msgid "LightApp_Application::PREF_GROUP_VTKVIEWER"
-msgstr "VTK Viewer 3d"
-
-msgid "LightApp_Application::PREF_VIEWER_BACKGROUND"
-msgstr "Background color"
-
-msgid "LightApp_Application::PREF_TRIHEDRON_SIZE"
-msgstr "Trihedron size"
-
-msgid "LightApp_Application::PREF_RELATIVE_SIZE"
-msgstr "Relative size"
-
-msgid "LightApp_Application::PREF_ISOS_U"
-msgstr "Number of isolines along U"
-msgid "LightApp_Application::PREF_ISOS_V"
-msgstr "Number of isolines along V"
-
-msgid "LightApp_Application::PREF_TRIHEDRON_SHOW"
-msgstr "Show trihedron"
-
-msgid "LightApp_Application::PREF_GROUP_PLOT2DVIEWER"
-msgstr "Plot2d Viewer"
-
-msgid "LightApp_Application::PREF_SHOW_LEGEND"
-msgstr "Show legend"
-
-msgid "LightApp_Application::PREF_LEGEND_POSITION"
-msgstr "Legend position:"
-
-msgid "LightApp_Application::PREF_LEFT"
-msgstr "Left"
-
-msgid "LightApp_Application::PREF_RIGHT"
-msgstr "Right"
-
-msgid "LightApp_Application::PREF_TOP"
-msgstr "Top"
-
-msgid "LightApp_Application::PREF_BOTTOM"
-msgstr "Bottom"
-
-msgid "LightApp_Application::PREF_CURVE_TYPE"
-msgstr "Curve type:"
-
-msgid "LightApp_Application::PREF_POINTS"
-msgstr "Points"
-
-msgid "LightApp_Application::PREF_LINES"
-msgstr "Lines"
-
-msgid "LightApp_Application::PREF_SPLINE"
-msgstr "Spline"
-
-msgid "LightApp_Application::PREF_MARKER_SIZE"
-msgstr "Marker size:"
-
-msgid "LightApp_Application::PREF_LINEAR"
-msgstr "Linear"
-
-msgid "LightApp_Application::PREF_LOGARITHMIC"
-msgstr "Logarithmic"
-
-msgid "LightApp_Application::PREF_HOR_AXIS_SCALE"
-msgstr "Horizontal axis scale:"
-
-msgid "LightApp_Application::PREF_VERT_AXIS_SCALE"
-msgstr "Vertical axis scale:"
-
-msgid "LightApp_Application::PREF_TAB_DIRECTORIES"
-msgstr "Directories"
-
-msgid "LightApp_Application::PREF_GROUP_DIRECTORIES"
-msgstr "Quick directory list"
-
-msgid "LightApp_Application::MEN_REFRESH"
-msgstr "Refresh"
-
-msgid "LightApp_Application::PREF_GROUP_SUPERV"
-msgstr "Graph Supervisor"
-
-msgid "LightApp_Application::PREF_SUPERV_TITLE_COLOR"
-msgstr "Title color"
-
-msgid "LightApp_Application::PREF_SUPERV_CTRL_COLOR"
-msgstr "Ctrl color"
-
-msgid "LightApp_Application::PREF_AUTO_SIZE"
-msgstr "Auto size for other columns"
-
-msgid "LightApp_Application::PREF_AUTO_SIZE_FIRST"
-msgstr "Auto size for first column"
-
-//=======================================================================================
-
-msgid "LightApp_PreferencesDlg::CAPTION"
-msgstr "Preferences"
-
-msgid "LightApp_PreferencesDlg::DEFAULT_BTN_TEXT"
-msgstr "Defaults"
-
-msgid "LightApp_PreferencesDlg::WARNING"
-msgstr "Warning"
-
-msgid "LightApp_PreferencesDlg::DEFAULT_QUESTION"
-msgstr "Do you want to retrieve default preferences?"
-
-msgid "LightApp_PreferencesDlg::IMPORT_PREFERENCES"
-msgstr "Import preferences"
-
-msgid "LightApp_PreferencesDlg::IMPORT_BTN_TEXT"
-msgstr "Import"
-
-//=======================================================================================
-
-msgid "LightApp_Module::TOP_DISPLAY"
-msgstr "Display"
-
-msgid "LightApp_Module::MEN_DISPLAY"
-msgstr "Display"
-
-msgid "LightApp_Module::STB_DISPLAY"
-msgstr "Display"
-
-msgid "LightApp_Module::TOP_ERASE"
-msgstr "Erase"
-
-msgid "LightApp_Module::MEN_ERASE"
-msgstr "Erase"
-
-msgid "LightApp_Module::STB_ERASE"
-msgstr "Erase"
-
-msgid "LightApp_Module::TOP_DISPLAY_ONLY"
-msgstr "Display only"
-
-msgid "LightApp_Module::MEN_DISPLAY_ONLY"
-msgstr "Display only"
-
-msgid "LightApp_Module::STB_DISPLAY_ONLY"
-msgstr "Display only"
-
-msgid "LightApp_Module::TOP_ERASE_ALL"
-msgstr "Erase all"
-
-msgid "LightApp_Module::MEN_ERASE_ALL"
-msgstr "Erase all"
-
-msgid "LightApp_Module::STB_ERASE_ALL"
-msgstr "Erase all"
-//=======================================================================================
-
-
-msgid "LightApp_ModuleDlg::CAPTION"
-msgstr "Activate module"
-
-msgid "LightApp_ModuleDlg::NEW"
-msgstr "&New"
-
-msgid "LightApp_ModuleDlg::OPEN"
-msgstr "&Open"
-
-msgid "LightApp_ModuleDlg::LOAD"
-msgstr "&Load"
-
-msgid "LightApp_ModuleDlg::CANCEL"
-msgstr "&Cancel"
-
-msgid "LightApp_ModuleDlg::ActivateComponent_DESCRIPTION"
-msgstr "Create, open or load study."
-
-msgid "LightApp_NameDlg::TLT_RENAME"
-msgstr "Rename"
-
-msgid "LightApp_NameDlg::NAME_LBL"
-msgstr "Name: "
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
</message>
<message>
<source>ABOUT_COPYRIGHT</source>
- <translation>Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ <translation>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</translation>
<source>ABOUT_CAPTION</source>
<translation>About %1</translation>
</message>
+ <message>
+ <source>ABOUT_BASE</source>
+ <translation>Base information</translation>
+ </message>
+ <message>
+ <source>ABOUT_MODULE_INFOS</source>
+ <translation>Modules information</translation>
+ </message>
+ <message>
+ <source>ABOUT_UNKNOWN_VERSION</source>
+ <translation>Unknown</translation>
+ </message>
+ <message>
+ <source>ABOUT_CLOSE</source>
+ <translation>&Close</translation>
+ </message>
<message>
<source>APP_NAME</source>
<translation>SALOME</translation>
<source>ENTRY_COLUMN</source>
<translation>Entry</translation>
</message>
+ <message>
+ <source>BROWSER_TITLE</source>
+ <translation>SALOME Help Browser</translation>
+ </message>
+ <message>
+ <source>BROWSER_TOOLBAR_TITLE</source>
+ <translation>Navigation</translation>
+ </message>
+ <message>
+ <source>BROWSER_FILEMENU</source>
+ <translation>&File</translation>
+ </message>
+ <message>
+ <source>BROWSER_CLOSE</source>
+ <translation>&Close</translation>
+ </message>
+ <message>
+ <source>BROWSER_BACK</source>
+ <translation>Go Back</translation>
+ </message>
+ <message>
+ <source>BROWSER_FORWARD</source>
+ <translation>Go Forward</translation>
+ </message>
+ <message>
+ <source>BROWSER_FIND</source>
+ <translation>&Find...</translation>
+ </message>
+ <message>
+ <source>BROWSER_FINDNEXT</source>
+ <translation>Find &next</translation>
+ </message>
+ <message>
+ <source>BROWSER_FINDPREV</source>
+ <translation>Find &previous</translation>
+ </message>
</context>
<context>
<name>LightApp_Application</name>
+ <message>
+ <source>LANG_CHANGED</source>
+ <translation>Application language has been changed.
+The changes will be applied on the next application session.</translation>
+ </message>
<message>
<source>MEN_DESK_THEME</source>
<translation>Theme</translation>
<source>PRP_THEME</source>
<translation>Change style properties</translation>
</message>
+ <message>
+ <source>TOT_FULLSCREEN</source>
+ <translation>Full screen</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_FULLSCREEN</source>
+ <translation>Full screen</translation>
+ </message>
+ <message>
+ <source>PRP_FULLSCREEN</source>
+ <translation>Switch to full screen mode</translation>
+ </message>
<message>
<source>INF_TOOLBAR_MODULES</source>
<translation>Modules</translation>
<source>PREF_TRIHEDRON_SHOW</source>
<translation>Show trihedron</translation>
</message>
+ <message>
+ <source>PREF_TRIHEDRON</source>
+ <translation>Trihedron</translation>
+ </message>
<message>
<source>PREF_TRIHEDRON_SIZE</source>
- <translation>Trihedron size</translation>
+ <translation>Size</translation>
</message>
<message>
<source>OBJECT_BROWSER</source>
</message>
<message>
<source>PREF_GROUP_VTKVIEWER</source>
- <translation>VTK Viewer 3d</translation>
+ <translation>VTK 3D Viewer</translation>
</message>
<message>
<source>PREF_STORE_POS</source>
<translation>Store positions of windows</translation>
</message>
+ <message>
+ <source>PREF_AUTO_SAVE</source>
+ <translation>Auto-save interval (min)</translation>
+ </message>
+ <message>
+ <source>PREF_AUTO_SAVE_DISABLED</source>
+ <translation>Disabled</translation>
+ </message>
<message>
<source>PREF_PROJECTION_MODE</source>
<translation>Projection mode:</translation>
</message>
<message>
<source>PREF_NAVIGATION</source>
- <translation>Navigation:</translation>
+ <translation>Navigation style</translation>
</message>
<message>
<source>PREF_STANDARD_STYLE</source>
<source>PREF_KEYFREE_STYLE</source>
<translation>Keyboard free style</translation>
</message>
+ <message>
+ <source>PREF_ZOOMING</source>
+ <translation>Zooming style</translation>
+ </message>
+ <message>
+ <source>PREF_ZOOMING_AT_CENTER</source>
+ <translation>Relative to the view's center</translation>
+ </message>
+ <message>
+ <source>PREF_ZOOMING_AT_CURSOR</source>
+ <translation>Relative to the cursor</translation>
+ </message>
<message>
<source>PREF_INCREMENTAL_SPEED</source>
<translation>Speed increment:</translation>
<source>PREF_FRAME_SPACEMOUSE</source>
<translation>Spacemouse</translation>
</message>
+ <message>
+ <source>PREF_SHOW_STATIC_TRIHEDRON</source>
+ <translation>Show static trihedron</translation>
+ </message>
<message>
<source>PREF_SPACEMOUSE_FUNC_1</source>
<translation>Decrease speed increment</translation>
<source>PREF_SKIPPED_FRAMES</source>
<translation>Recording at a given FPS</translation>
</message>
+ <message>
+ <source>PREF_FRAME_GROUP_NAMES</source>
+ <translation>Names of groups</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_NAMES_TEXT_COLOR</source>
+ <translation>Text color</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_NAMES_TRANSPARENCY</source>
+ <translation>Transparency</translation>
+ </message>
<message>
<source>PREF_BOTTOM</source>
<translation>Bottom</translation>
<source>PREF_CURVE_TYPE</source>
<translation>Curve type:</translation>
</message>
+ <message>
+ <source>PREF_ISOS</source>
+ <translation>Number of isolines</translation>
+ </message>
<message>
<source>PREF_ISOS_U</source>
- <translation>Number of isolines along U</translation>
+ <translation>Along U</translation>
</message>
<message>
<source>PREF_ISOS_V</source>
- <translation>Number of isolines along V</translation>
+ <translation>Along V</translation>
</message>
<message>
<source>PREF_POINTS</source>
<source>TOT_RENAME</source>
<translation>Rename</translation>
</message>
+ <message>
+ <source>MEN_RENAME_OBJ</source>
+ <translation>Rename</translation>
+ </message>
<message>
<source>LOG_WINDOW</source>
<translation>Message Window</translation>
</message>
<message>
<source>PREF_GROUP_PY_CONSOLE</source>
- <translation>Python console properties</translation>
+ <translation>Python console</translation>
+ </message>
+ <message>
+ <source>PREF_SHOW_BANNER</source>
+ <translation>Show banner</translation>
</message>
<message>
<source>PREF_GROUP_STYLE</source>
</message>
<message>
<source>PREF_AUTO_SIZE_FIRST</source>
- <translation>Auto size for first column</translation>
+ <translation>Auto size for "Name" column</translation>
</message>
<message>
<source>PREF_RESIZE_ON_EXPAND_ITEM</source>
<translation>Resize columns on expand item</translation>
</message>
+ <message>
+ <source>PREF_BROWSE_TO_THE_PUBLISHED_OBJECT</source>
+ <translation>Browse to the published object</translation>
+ </message>
+ <message>
+ <source>PREF_BROWSE_NEVER</source>
+ <translation>Never</translation>
+ </message>
+ <message>
+ <source>PREF_BROWSE_AFTER_APPLY_AND_CLOSE_ONLY</source>
+ <translation>After Apply & Close only</translation>
+ </message>
+ <message>
+ <source>PREF_BROWSE_ALWAYS</source>
+ <translation>Always</translation>
+ </message>
<message>
<source>PREF_GROUP_SUPERV</source>
<translation>Graph Supervisor</translation>
</message>
<message>
<source>NEW_WINDOW_0</source>
- <translation>&GL view</translation>
+ <translation>&GL 2D view</translation>
</message>
<message>
<source>NEW_WINDOW_1</source>
- <translation>&Plot2d view</translation>
+ <translation>&Plot 2D view</translation>
</message>
<message>
<source>NEW_WINDOW_2</source>
- <translation>&OCC view</translation>
+ <translation>&OCC 3D view</translation>
</message>
<message>
<source>NEW_WINDOW_3</source>
- <translation>VT&K view</translation>
+ <translation>VT&K 3D view</translation>
</message>
<message>
<source>NEW_WINDOW_4</source>
- <translation>&QxGraph view</translation>
+ <translation>&QxGraph 2D view</translation>
</message>
<message>
<source>NEW_WINDOW_5</source>
- <translation>Qx&Scene view</translation>
+ <translation>Qx&Scene 2D view</translation>
+ </message>
+ <message>
+ <source>CREATING_NEW_WINDOW</source>
+ <translation>Create new %1</translation>
</message>
<message>
<source>OBJ_BROWSER_NAME</source>
</message>
<message>
<source>PREF_RELATIVE_SIZE</source>
- <translation>Relative size</translation>
+ <translation>Relative</translation>
</message>
<message>
<source>PREF_VIEWER_BACKGROUND</source>
+ <translation>Background</translation>
+ </message>
+ <message>
+ <source>PREF_VIEWER_BACKGROUND_COLOR</source>
<translation>Background color</translation>
</message>
+ <message>
+ <source>PREF_VIEWER_SELECTION</source>
+ <translation>Selection color</translation>
+ </message>
+ <message>
+ <source>PREF_XYVIEWER_BACKGROUND</source>
+ <translation>XY View</translation>
+ </message>
+ <message>
+ <source>PREF_XZVIEWER_BACKGROUND</source>
+ <translation>XZ View</translation>
+ </message>
+ <message>
+ <source>PREF_YZVIEWER_BACKGROUND</source>
+ <translation>YZ View</translation>
+ </message>
+ <message>
+ <source>PREF_3DVIEWER_BACKGROUND</source>
+ <translation>3D View</translation>
+ </message>
<message>
<source>PREF_FONT</source>
<translation>Font</translation>
</message>
+ <message>
+ <source>PREF_LEGEND_FONT</source>
+ <translation>Legend font</translation>
+ </message>
+ <message>
+ <source>PREF_FONT_COLOR</source>
+ <translation>Legend font color</translation>
+ </message>
+ <message>
+ <source>PREF_SELECTED_FONT_COLOR</source>
+ <translation>Highlighted legend font color</translation>
+ </message>
<message>
<source>PREF_LEFT</source>
<translation>Left</translation>
<source>PREF_HOR_AXIS_SCALE</source>
<translation>Horizontal axis scale:</translation>
</message>
+ <message>
+ <source>PREF_GROUP_LANGUAGE</source>
+ <translation>Language</translation>
+ </message>
+ <message>
+ <source>PREF_CURRENT_LANGUAGE</source>
+ <translation>Current language</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_LOOK_AND_FEEL</source>
+ <translation>Look and feel</translation>
+ </message>
+ <message>
+ <source>PREF_OPAQUE_RESIZE</source>
+ <translation>Opaque resize</translation>
+ </message>
<message>
<source>PREF_GROUP_STUDY</source>
<translation>Study properties</translation>
<source>PREF_CATEGORY_SALOME</source>
<translation>SALOME</translation>
</message>
+ <message>
+ <source>PREF_DROP_DOWN_BUTTONS</source>
+ <translation>Drop-down buttons in toolbars for action groups</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_COMMON</source>
+ <translation>Common</translation>
+ </message>
<message>
<source>PREF_GROUP_OCCVIEWER</source>
- <translation>OCC Viewer 3d</translation>
+ <translation>OCC 3D Viewer</translation>
</message>
<message>
<source>PREF_LOGARITHMIC</source>
</message>
<message>
<source>PREF_GROUP_PLOT2DVIEWER</source>
- <translation>Plot2d Viewer</translation>
+ <translation>Plot 2D Viewer</translation>
+ </message>
+ <message>
+ <source>PREF_DEVIATION_COLOR</source>
+ <translation>Deviation marker color</translation>
+ </message>
+ <message>
+ <source>PREF_DEVIATION_MARKER_LW</source>
+ <translation>Deviation marker line width</translation>
+ </message>
+ <message>
+ <source>PREF_DEVIATION_MARKER_TS</source>
+ <translation>Deviation marker tick size</translation>
</message>
<message>
<source>MEN_DESK_MRU</source>
<translation>Python Console</translation>
</message>
<message>
- <source>PREF_USE_ADVANCED_SELECTION_ALGORITHM</source>
- <translation>Use Advanced Selection Algorithm</translation>
+ <source>PREF_DYNAMIC_PRESELECTION</source>
+ <translation>Dynamic pre-selection</translation>
</message>
<message>
<source>TOT_CLOSE</source>
</message>
<message>
<source>PREFERENCES_NOT_SUPPORTED</source>
- <translation>Preferences for module "%1" not supported</translation>
+ <translation>Preferences for module "%1" not supported</translation>
+ </message>
+ <message>
+ <source>PREF_TAB_SHORTCUTS</source>
+ <translation>Shortcuts</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_SHORTCUTS</source>
+ <translation>Shortcuts settings</translation>
</message>
</context>
<context>
<name>LightApp_ModuleDlg</name>
<message>
<source>DESCRIPTION</source>
- <translation>You're activating module
+ <translation>You're activating module
<b>%1</b>.<br>Please, select required action by pressing the corresponding button below.</translation>
</message>
<message>
<translation>Defaults</translation>
</message>
</context>
+<context>
+ <name>LightApp_ModuleAction</name>
+ <message>
+ <source>ACTIVATE_MODULE_TOP</source>
+ <translation>Activate/deactivate %1 module</translation>
+ </message>
+</context>
</TS>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// KERNEL SALOME_Event : Define event posting mechanism
// File : LogWindow.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// KERNEL SALOME_Event : Define event posting mechanism
// File : LogWindow.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#define LOGWINDOW_H
#if defined WIN32
-# if defined LOGWINDOW_EXPORTS
+# if defined LOGWINDOW_EXPORTS || defined LogWindow_EXPORTS
# define LOGWINDOW_EXPORT __declspec( dllexport )
# else
# define LOGWINDOW_EXPORT __declspec( dllimport )
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = LogWindow
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += LOGWINDOW_EXPORTS
-
-HEADERS = LogWindow.h
-
-SOURCES = LogWindow.cxx
-
-TRANSLATIONS = resources/LogWindow_msg_en.ts
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : LogWindow
nodist_libLogWindow_la_SOURCES = $(MOC_FILES)
nodist_salomeres_DATA = \
- LogWindow_msg_en.qm
+ LogWindow_msg_en.qm \
+ LogWindow_msg_fr.qm
libLogWindow_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
libLogWindow_la_LDFLAGS = $(QT_MT_LIBS)
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1">
-<!--
- Copyright (C) 2007-2008 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
--->
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>LogWindow</name>
<message>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# File : Makefile.in
+
+# File : Makefile.am
# Author : Patrick GOLDBRONN (CEA)
-# Module : SALOME
-# $Header$
-#
-SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event
+##
+# Common packages
+##
+SUBDIRS_COMMON = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils GUI_PY
+
+##
+# SALOME object
+##
if ENABLE_SALOMEOBJECT
- SUBDIRS += OBJECT
+ SUBDIRS_OBJECT = OBJECT
endif
+##
+# GL viewer
+##
if ENABLE_GLVIEWER
- SUBDIRS += GLViewer
+ SUBDIRS_GLVIEWER = GLViewer
endif
+##
+# VTK viewer
+##
if ENABLE_VTKVIEWER
- SUBDIRS += VTKViewer
+ SUBDIRS_VTKVIEWER = VTKViewer
if ENABLE_SALOMEOBJECT
- SUBDIRS += SVTK
+ SUBDIRS_VTKVIEWER += SVTK
+ SUBDIRS_VIEWERTOOLS = ViewerTools
endif
endif
+
+##
+# OCC viewer
+##
if ENABLE_OCCVIEWER
- SUBDIRS += OCCViewer
+ SUBDIRS_OCCVIEWER = OCCViewer
+ SUBDIRS_VIEWERTOOLS = ViewerTools
if ENABLE_SALOMEOBJECT
- SUBDIRS += SOCC
+ SUBDIRS_OCCVIEWER += SOCC
endif
endif
-if ENABLE_PYCONSOLE
- SUBDIRS += PyInterp PyConsole
-endif
+
+##
+# Plot2d viewer
+##
if ENABLE_PLOT2DVIEWER
- SUBDIRS += Plot2d
+ SUBDIRS_PLOT2DVIEWER = Plot2d
if ENABLE_SALOMEOBJECT
- SUBDIRS += SPlot2d
+ SUBDIRS_PLOT2DVIEWER += SPlot2d
endif
endif
+
+##
+# SUPERV graph viewer
+##
if ENABLE_SUPERVGRAPHVIEWER
- SUBDIRS += SUPERVGraph
+ SUBDIRS_SUPERVGRAPHVIEWER = SUPERVGraph
endif
+
+##
+# Qx scene viewer
+##
+###VSR: QxGraph has been replaced by QxScene
+###SUBDIRS_QXGRAPHVIEWER = QxGraph
if ENABLE_QXGRAPHVIEWER
- SUBDIRS += QxGraph
+ SUBDIRS_QXGRAPHVIEWER = QxScene
endif
-SUBDIRS += QxScene LightApp ResExporter
+##
+# Python console (base)
+##
+if ENABLE_PYCONSOLE
+ SUBDIRS_PYCONSOLE = PyInterp PyConsole
+endif
+
+##
+# Light SALOME packages
+##
+SUBDIRS_LIGHT = LightApp ResExporter
+
+##
+# Full (CORBA) SALOME packages
+##
if GUI_ENABLE_CORBA
- SUBDIRS += TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
+ SUBDIRS_CORBA = TOOLSGUI Session SalomeApp GuiHelpers TreeData
endif
-DIST_SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event \
- OBJECT GLViewer VTKViewer SVTK OCCViewer SOCC PyInterp PyConsole Plot2d SPlot2d SUPERVGraph \
- QxGraph QxScene LightApp ResExporter TOOLSGUI Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
+
+##
+# Extra Python packages
+##
+if ENABLE_PYCONSOLE
+ SUBDIRS_PY_LIGHT = SALOME_SWIG SALOME_PY SALOME_PYQT
+endif
+
+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)
+
+DIST_SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils \
+ OBJECT ViewerTools GLViewer VTKViewer SVTK OCCViewer SOCC Plot2d SPlot2d SUPERVGraph QxGraph QxScene \
+ PyInterp PyConsole LightApp ResExporter TOOLSGUI Session SalomeApp GuiHelpers TreeData \
+ SALOME_SWIG SALOME_PY SALOME_PYQT GUI_PY
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : Handle_SALOME_AISObject.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : Handle_SALOME_AISShape.hxx
// Module : SALOME
#include <Standard.hxx>
#endif
-#ifndef _Handle_AIS_Shape_HeaderFile
-#include <Handle_AIS_Shape.hxx>
+// #ifndef _Handle_AIS_Shape_HeaderFile
+// #include <Handle_AIS_Shape.hxx>
+// #endif
+#ifndef _AIS_TexturedShape_HeaderFile
+#include <AIS_TexturedShape.hxx>
#endif
class Standard_Transient;
\class Handle(AIS_Shape)
Smart pointer (handle) to AIS_Shape
*/
-class Handle(AIS_Shape);
+// class Handle(AIS_Shape);
+class Handle(AIS_TexturedShape);
class SALOME_AISShape;
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOME_AISShape);
\class Handle(SALOME_AISShape)
Smart pointer (handle) to SALOME_AISShape
*/
-class Handle(SALOME_AISShape) : public Handle(AIS_Shape) {
+class Handle(SALOME_AISShape) : public Handle(AIS_TexturedShape) {
public:
inline void* operator new(size_t,void* anAddress)
{
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
- Handle(SALOME_AISShape)():Handle(AIS_Shape)() {}
- Handle(SALOME_AISShape)(const Handle(SALOME_AISShape)& aHandle) : Handle(AIS_Shape)(aHandle)
+ Handle(SALOME_AISShape)():Handle(AIS_TexturedShape)() {}
+ Handle(SALOME_AISShape)(const Handle(SALOME_AISShape)& aHandle) : Handle(AIS_TexturedShape)(aHandle)
{
}
- Handle(SALOME_AISShape)(const SALOME_AISShape* anItem) : Handle(AIS_Shape)((AIS_Shape *)anItem)
+ Handle(SALOME_AISShape)(const SALOME_AISShape* anItem) : Handle(AIS_TexturedShape)((AIS_TexturedShape *)anItem)
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : Handle_SALOME_Filter.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : Handle_SALOME_InteractiveObject.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : Handle_SALOME_ListNodeOfListIO.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : Handle_SALOME_TypeFilter.hxx
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libSalomeObject.la
SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx \
SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
-libSalomeObject_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS)
+libSalomeObject_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@
libSalomeObject_la_LDFLAGS = $(QT_LIBS) $(CAS_LDPATH) -lTKV3d
# internal (non-distributed) headers
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = SalomeObject
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_LDPATH = -L$${CASROOT}/Linux/lib -lTKV3d
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS}
-LIBS += $${CAS_LDPATH}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = SALOME_InteractiveObject.hxx
-HEADERS += Handle_SALOME_InteractiveObject.hxx
-HEADERS += SALOME_AISShape.hxx
-HEADERS += Handle_SALOME_AISShape.hxx
-HEADERS += SALOME_AISObject.hxx
-HEADERS += Handle_SALOME_AISObject.hxx
-HEADERS += SALOME_ListIO.hxx
-HEADERS += SALOME_ListIteratorOfListIO.hxx
-HEADERS += Handle_SALOME_ListNodeOfListIO.hxx
-HEADERS += SALOME_ListNodeOfListIO.hxx
-HEADERS += Handle_SALOME_Filter.hxx
-HEADERS += SALOME_Filter.hxx
-HEADERS += Handle_SALOME_TypeFilter.hxx
-HEADERS += SALOME_TypeFilter.hxx
-HEADERS += SALOME_DataMapOfIOMapOfInteger.hxx
-HEADERS += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
-HEADERS += Handle_SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
-HEADERS += SALOME_Selection.h
-HEADERS += SALOME_AISObject.ixx
-HEADERS += SALOME_AISObject.jxx
-HEADERS += SALOME_AISShape.ixx
-HEADERS += SALOME_AISShape.jxx
-HEADERS += SALOME_Filter.ixx
-HEADERS += SALOME_Filter.jxx
-HEADERS += SALOME_InteractiveObject.ixx
-HEADERS += SALOME_InteractiveObject.jxx
-HEADERS += SALOME_TypeFilter.ixx
-HEADERS += SALOME_TypeFilter.jxx
-HEADERS += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
-
-SOURCES = SALOME_InteractiveObject.cxx
-SOURCES += SALOME_AISShape.cxx
-SOURCES += SALOME_AISObject.cxx
-SOURCES += SALOME_ListIO_0.cxx
-SOURCES += SALOME_ListIteratorOfListIO_0.cxx
-SOURCES += SALOME_ListNodeOfListIO_0.cxx
-SOURCES += SALOME_Filter.cxx
-SOURCES += SALOME_TypeFilter.cxx
-SOURCES += SALOME_DataMapOfIOMapOfInteger_0.cxx
-SOURCES += SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
-SOURCES += SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISObject.hxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//using namespace std;
-//
+
#include "SALOME_AISObject.ixx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISObject.hxx
// Module : SALOME
//
Standard_EXPORT friend Handle_Standard_Type& SALOME_AISObject_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISObject.ixx
// Module : SALOME
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SALOME_AISObject",
- sizeof(SALOME_AISObject),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(SALOME_AISObject),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISObject.jxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISShape.hxx
+// File : SALOME_AISShape.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//using namespace std;
-//
+
#include "SALOME_AISShape.ixx"
/*!
\param shape - TopoDS shape
*/
SALOME_AISShape::SALOME_AISShape(const TopoDS_Shape& shape)
-: AIS_Shape(shape)
+: AIS_TexturedShape(shape)
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISShape.hxx
// Module : SALOME
#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
#include <Handle_SALOME_InteractiveObject.hxx>
#endif
-#ifndef _AIS_Shape_HeaderFile
-#include <AIS_Shape.hxx>
+// #ifndef _AIS_Shape_HeaderFile
+// #include <AIS_Shape.hxx>
+// #endif
+#ifndef _AIS_TexturedShape_HeaderFile
+#include <AIS_TexturedShape.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
+
class SALOME_InteractiveObject;
class TopoDS_Shape;
class TColStd_IndexedMapOfInteger;
-class SALOME_AISShape : public AIS_Shape {
+class SALOME_AISShape : public AIS_TexturedShape {
public:
Standard_EXPORT SALOME_AISShape(const TopoDS_Shape& shape);
Standard_EXPORT virtual Handle_SALOME_InteractiveObject getIO() = 0;
Standard_EXPORT virtual Standard_Boolean hasIO() = 0;
+Standard_EXPORT virtual Standard_Boolean isTopLevel() = 0;
+Standard_EXPORT virtual Standard_Boolean switchTopLevel() = 0;
+Standard_EXPORT virtual Standard_Boolean toActivate() = 0;
+Standard_EXPORT virtual void setTopLevel(Standard_Boolean) = 0;
Standard_EXPORT virtual Standard_CString getName() = 0;
Standard_EXPORT virtual void setName(const Standard_CString aName) = 0;
Standard_EXPORT virtual void highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, const Standard_Boolean aHighlight ) = 0;
//
Standard_EXPORT friend Handle_Standard_Type& SALOME_AISShape_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Fields PRIVATE
//
-
+
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISShape.ixx
// Module : SALOME
Standard_EXPORT Handle_Standard_Type& SALOME_AISShape_Type_()
{
- static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_Shape);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_Shape);
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_TexturedShape);
+ if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_TexturedShape);
static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_InteractiveObject);
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_InteractiveObject);
static Handle_Standard_Type aType3 = STANDARD_TYPE(SelectMgr_SelectableObject);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,aType6,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SALOME_AISShape",
- sizeof(SALOME_AISShape),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(SALOME_AISShape),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_AISShape.jxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx
// Module : SALOME
#ifndef _SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_HeaderFile
#include "SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx"
#endif
-using namespace std;
-
#define TheKey Handle_SALOME_InteractiveObject
#define TheKey_hxx "SALOME_InteractiveObject.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_DataMapNodeOfDataMapOfIOMapOfInteger.hxx
// Module : SALOME
//
Standard_EXPORT friend Handle_Standard_Type& SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx
// Module : SALOME
#ifndef _SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_HeaderFile
#include "SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx"
#endif
-using namespace std;
/*!
Destructor
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SALOME_DataMapNodeOfDataMapOfIOMapOfInteger",
- sizeof(SALOME_DataMapNodeOfDataMapOfIOMapOfInteger),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(SALOME_DataMapNodeOfDataMapOfIOMapOfInteger),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_DataMapOfIOMapOfInteger.hxx
// Module : SALOME
-//
+
#ifndef _SALOME_DataMapOfIOMapOfInteger_HeaderFile
#define _SALOME_DataMapOfIOMapOfInteger_HeaderFile
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
+
class Standard_DomainError;
class Standard_NoSuchObject;
class SALOME_InteractiveObject;
class SALOME_DataMapNodeOfDataMapOfIOMapOfInteger;
class SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger;
-
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#include <Standard_Macro.hxx>
#endif
+#include <Basics_OCCTVersion.hxx>
+
class SALOME_DataMapOfIOMapOfInteger : public TCollection_BasicMap {
public:
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
-// inline void operator delete(void *anAddress, size_t size)
-// {
-// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
-// }
+
// Methods PUBLIC
//
Standard_EXPORT SALOME_DataMapOfIOMapOfInteger(const Standard_Integer NbBuckets = 1);
return ChangeFind(K);
}
-
-
-
-
-
-protected:
-
- // Methods PROTECTED
- //
-
-
- // Fields PROTECTED
- //
-
+#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
+Standard_EXPORT Standard_Address Find1 (const Handle(SALOME_InteractiveObject)& K) const;
+Standard_EXPORT Standard_Address ChangeFind1 (const Handle(SALOME_InteractiveObject)& K);
+#endif
private:
-
- // Methods PRIVATE
- //
Standard_EXPORT SALOME_DataMapOfIOMapOfInteger(const SALOME_DataMapOfIOMapOfInteger& Other);
-
-
- // Fields PRIVATE
- //
-
-
};
-
-
-
-
// other inline functions and methods (like "C++: function call" methods)
//
-
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_DataMapOfIOMapOfInteger_0.cxx
// Module : SALOME
#ifndef _SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_HeaderFile
#include "SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx"
#endif
-using namespace std;
-
#define TheKey Handle_SALOME_InteractiveObject
#define TheKey_hxx "SALOME_InteractiveObject.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Filter.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#include "SALOME_Filter.ixx"
-using namespace std;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Filter.hxx
// Module : SALOME
//
Standard_EXPORT friend Handle_Standard_Type& SALOME_Filter_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Filter.ixx
// Module : SALOME
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SALOME_Filter",
- sizeof(SALOME_Filter),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(SALOME_Filter),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Filter.jxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_InteractiveObject.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//using namespace std;
-//
+
/*!
\class SALOME_InteractiveObject SALOME_InteractiveObject.hxx
\brief ...
\param aName - name of object
*/
SALOME_InteractiveObject::SALOME_InteractiveObject(const char* anEntry,
- const char* aComponentDataType,
- const char* aName):
+ const char* aComponentDataType,
+ const char* aName):
myEntry(anEntry),
myName(aName),
myComponentDataType(aComponentDataType),
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_InteractiveObject.hxx
// Module : SALOME
#define _SALOME_InteractiveObject_HeaderFile
#ifndef _Standard_HeaderFile
+// E.A. : Standard.hxx defines PACKAGE and VERSION --> Pb in Werror mode
+// E.A. : --> Add the undef of PACKAGE and VERSION (really ugly !)
+#ifdef PACKAGE
+#undef PACKAGE
+#endif
+#ifdef VERSION
+#undef VERSION
+#endif
+#ifdef HAVE_FINITE
+#undef HAVE_FINITE
+#endif
#include <Standard.hxx>
#endif
#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
//
Standard_EXPORT SALOME_InteractiveObject();
Standard_EXPORT SALOME_InteractiveObject(const char* anEntry,
- const char* aComponentDataType,
- const char* aName = "");
+ const char* aComponentDataType,
+ const char* aName = "");
Standard_EXPORT void setEntry(const char* anEntry) ;
Standard_EXPORT const char* getEntry() ;
Standard_EXPORT void setName(const char* aName) ;
//
Standard_EXPORT friend Handle_Standard_Type& SALOME_InteractiveObject_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_InteractiveObject.ixx
// Module : SALOME
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SALOME_InteractiveObject",
- sizeof(SALOME_InteractiveObject),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(SALOME_InteractiveObject),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_InteractiveObject.jxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_ListIO.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_ListIO_0.cxx
-// Module : SALOME
-//
+
#include "SALOME_ListIO.hxx"
#ifndef _Standard_NoSuchObject_HeaderFile
#ifndef _SALOME_ListNodeOfListIO_HeaderFile
#include "SALOME_ListNodeOfListIO.hxx"
#endif
-using namespace std;
-
#define Item Handle_SALOME_InteractiveObject
#define Item_hxx "SALOME_InteractiveObject.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_ListIteratorOfListIO.hxx
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_ListIteratorOfListIO_0.cxx
-// Module : SALOME
-//
+
#include "SALOME_ListIteratorOfListIO.hxx"
#ifndef _Standard_NoMoreObject_HeaderFile
#ifndef _SALOME_ListNodeOfListIO_HeaderFile
#include "SALOME_ListNodeOfListIO.hxx"
#endif
-using namespace std;
-
+
#define Item Handle_SALOME_InteractiveObject
#define Item_hxx "SALOME_InteractiveObject.hxx"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_ListNodeOfListIO.hxx
// Module : SALOME
//
Standard_EXPORT friend Handle_Standard_Type& SALOME_ListNodeOfListIO_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_ListNodeOfListIO_0.cxx
-// Module : SALOME
-//
+
#include "SALOME_ListNodeOfListIO.hxx"
#ifndef _Standard_TypeMismatch_HeaderFile
#ifndef _SALOME_ListIteratorOfListIO_HeaderFile
#include "SALOME_ListIteratorOfListIO.hxx"
#endif
-using namespace std;
/*!
Destructor
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SALOME_ListNodeOfListIO",
- sizeof(SALOME_ListNodeOfListIO),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(SALOME_ListNodeOfListIO),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Selection : description of enumeration Selection_Mode
// File : SALOME_Selection.h
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SALOME_SELECTION_H
#define SALOME_SELECTION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_TypeFilter.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#include "SALOME_TypeFilter.ixx"
#include "SALOME_InteractiveObject.hxx"
-using namespace std;
/*!
Constructor
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_TypeFilter.hxx
// Module : SALOME
//
Standard_EXPORT friend Handle_Standard_Type& SALOME_TypeFilter_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
- Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
+ Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_TypeFilter.ixx
// Module : SALOME
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SALOME_TypeFilter",
- sizeof(SALOME_TypeFilter),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
+ sizeof(SALOME_TypeFilter),
+ 1,
+ (Standard_Address)_Ancestors,
+ (Standard_Address)NULL);
return _aType;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_TypeFilter.jxx
// Module : SALOME
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : OCCViewer
# $Header$
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libOCCViewer.la
OCCViewer_ClippingDlg.h \
OCCViewer_AxialScaleDlg.h \
OCCViewer_SetRotationPointDlg.h \
- OCCViewer_Trihedron.h
+ OCCViewer_Trihedron.h \
+ OCCViewer_FontWidget.h \
+ OCCViewer_CubeAxesDlg.h \
+ OCCViewer_ToolTip.h \
+ OCCViewer_ViewFrame.h
dist_libOCCViewer_la_SOURCES = \
OCCViewer_AISSelector.cxx \
OCCViewer_ClippingDlg.cxx \
OCCViewer_AxialScaleDlg.cxx \
OCCViewer_Trihedron.cxx \
- OCCViewer_ToolTip.cxx
+ OCCViewer_FontWidget.cxx \
+ OCCViewer_CubeAxesDlg.cxx \
+ OCCViewer_ToolTip.cxx \
+ OCCViewer_ViewFrame.cxx
MOC_FILES = \
OCCViewer_AISSelector_moc.cxx \
OCCViewer_SetRotationPointDlg_moc.cxx \
OCCViewer_ClippingDlg_moc.cxx \
OCCViewer_AxialScaleDlg_moc.cxx \
- OCCViewer_ToolTip_moc.cxx
-
+ OCCViewer_FontWidget_moc.cxx \
+ OCCViewer_CubeAxesDlg_moc.cxx \
+ OCCViewer_ToolTip_moc.cxx \
+ OCCViewer_ViewFrame_moc.cxx
+
nodist_libOCCViewer_la_SOURCES = $(MOC_FILES)
dist_salomeres_DATA = \
+ resources/occ_view_anticlockwise.png \
+ resources/occ_view_clockwise.png \
resources/occ_view_back.png \
resources/occ_view_bottom.png \
resources/occ_view_camera_dump.png \
resources/occ_view_clipping.png \
resources/occ_view_clipping_pressed.png \
resources/occ_view_scaling.png \
+ resources/occ_view_graduated_axes.png \
+ resources/occ_view_ambient.png \
resources/occ_view_fitall.png \
resources/occ_view_fitarea.png \
resources/occ_view_front.png \
resources/occ_view_top.png \
resources/occ_view_triedre.png \
resources/occ_view_zoom.png \
- resources/occ_view_rotation_point.png
+ resources/occ_view_rotation_point.png \
+ resources/occ_view_style_switch.png \
+ resources/occ_view_zooming_style_switch.png \
+ resources/occ_view_maximized.png \
+ resources/occ_view_minimized.png \
+ resources/occ_view_sync.png
nodist_salomeres_DATA = \
OCCViewer_images.qm \
- OCCViewer_msg_en.qm
+ OCCViewer_msg_en.qm \
+ OCCViewer_msg_fr.qm
-libOCCViewer_la_CPPFLAGS = $(QT_INCLUDES) $(OGL_INCLUDES) $(CAS_CPPFLAGS) \
- -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libOCCViewer_la_CPPFLAGS = $(QT_INCLUDES) $(OGL_INCLUDES) $(CAS_CPPFLAGS) @KERNEL_CXXFLAGS@ \
+ -I$(srcdir)/../SUIT -I$(srcdir)/../ViewerTools -I$(srcdir)/../Qtx \
+ -I$(srcdir)/../OpenGLUtils -I$(srcdir)/../CASCatch
libOCCViewer_la_LDFLAGS = $(OGL_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(CAS_VIEWER)
-libOCCViewer_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la
+
+libOCCViewer_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la \
+ ../ViewerTools/libViewerTools.la ../OpenGLUtils/libOpenGLUtils.la
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifdef WIN32
-#ifdef OCCVIEWER_EXPORTS
+#if defined OCCVIEWER_EXPORTS || defined OCCViewer_EXPORTS
#define OCCVIEWER_EXPORT __declspec(dllexport)
#else
#define OCCVIEWER_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = OCCViewer
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-OGL_INCLUDES =
-
-OGL_LIBS = -lGL -L/usr/X11R6/lib -lGLU
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-CAS_VIEWER = -L$${CASROOT}/Linux/lib -lTKV3d -lTKService
-
-INCLUDEPATH += ../../include $${OGL_INCLUDES} $${CAS_CPPFLAGS} ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit $${OGL_LIBS} $${CAS_KERNEL} $${CAS_VIEWER}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += OCCVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = OCCViewer_AISSelector.h
-HEADERS += OCCViewer_ViewManager.h
-HEADERS += OCCViewer_ViewModel.h
-HEADERS += OCCViewer_ViewPort3d.h
-HEADERS += OCCViewer_ViewPort.h
-HEADERS += OCCViewer_ViewWindow.h
-HEADERS += OCCViewer_VService.h
-HEADERS += OCCViewer_CreateRestoreViewDlg.h
-HEADERS += OCCViewer.h
-HEADERS += OCCViewer_ClippingDlg.h
-HEADERS += OCCViewer_SetRotationPointDlg.h
-
-SOURCES = OCCViewer_AISSelector.cxx
-SOURCES += OCCViewer_ViewManager.cxx
-SOURCES += OCCViewer_ViewModel.cxx
-SOURCES += OCCViewer_ViewPort3d.cxx
-SOURCES += OCCViewer_ViewPort.cxx
-SOURCES += OCCViewer_ViewWindow.cxx
-SOURCES += OCCViewer_VService.cxx
-SOURCES += OCCViewer_CreateRestoreViewDlg.cxx
-SOURCES += OCCViewer_SetRotationPointDlg.cxx
-SOURCES += OCCViewer_ClippingDlg.cxx
-
-TRANSLATIONS = resources/OCCViewer_images.ts \
- resources/OCCViewer_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_AISSelector.h"
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#if !defined( OCCVIEWER_AISSELECTOR_H )
#define OCCVIEWER_AISSELECTOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_AxialScaleDlg.h"
#include "OCCViewer_ViewWindow.h"
#include "OCCViewer_ViewPort3d.h"
\param view - view window
\param parent - parent widget
*/
-OCCViewer_AxialScaleDlg::OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow* view, QWidget* parent )
- : QDialog( parent ),
+OCCViewer_AxialScaleDlg::OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow* view )
+ : QDialog( view ),
myView( view )
{
setWindowTitle( tr( "DLG_SCALING" ) );
{
// Get values from the OCC view
double aScaleFactor[3];
- myView->getViewPort()->getView()->AxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
+ myView->getViewPort()->getAxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
m_sbXcoeff->setValue( aScaleFactor[0] );
m_sbYcoeff->setValue( aScaleFactor[1] );
m_sbZcoeff->setValue( aScaleFactor[2] );
bool OCCViewer_AxialScaleDlg::apply()
{
double aScaleFactor[3] = { m_sbXcoeff->value(), m_sbYcoeff->value(), m_sbZcoeff->value() };
- myView->getViewPort()->getView()->SetAxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
+ myView->getViewPort()->setAxialScale( aScaleFactor[0], aScaleFactor[1], aScaleFactor[2] );
return true;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_AXIALSCALEDLG_H
#define OCCVIEWER_AXIALSCALEDLG_H
Q_OBJECT
public:
- OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow*, QWidget* = 0 );
+ OCCViewer_AxialScaleDlg( OCCViewer_ViewWindow* );
~OCCViewer_AxialScaleDlg();
void Update();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_ClippingDlg.h"
#include <QtxDoubleSpinBox.h>
\param modal - is this dialog modal
\param fl - flags
*/
-OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl )
-: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+OCCViewer_ClippingDlg::OCCViewer_ClippingDlg( OCCViewer_ViewWindow* view, const char* name, bool modal, Qt::WindowFlags fl )
+: QDialog( view, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myView( view )
{
setObjectName( "OCCViewer_ClippingDlg" );
const double min = -1e+7;
const double max = 1e+7;
const double step = 5;
- const int precision = 3;
+ const int precision = -7;
TextLabelX = new QLabel( GroupPoint );
TextLabelX->setObjectName( "TextLabelX" );
SpinBox_X = new QtxDoubleSpinBox( min, max, step, GroupPoint );
SpinBox_X->setObjectName("SpinBox_X" );
- SpinBox_X->setDecimals( precision );
+ SpinBox_X->setPrecision( precision );
GroupPointLayout->addWidget( SpinBox_X, 0, 1 );
TextLabelY = new QLabel( GroupPoint );
SpinBox_Y = new QtxDoubleSpinBox( min, max, step, GroupPoint );
SpinBox_Y->setObjectName("SpinBox_Y" );
- SpinBox_Y->setDecimals( precision );
+ SpinBox_Y->setPrecision( precision );
GroupPointLayout->addWidget( SpinBox_Y, 0, 3 );
TextLabelZ = new QLabel( GroupPoint );
SpinBox_Z = new QtxDoubleSpinBox( min, max, step, GroupPoint );
SpinBox_Z->setObjectName("SpinBox_Z" );
- SpinBox_Z->setDecimals( precision );
+ SpinBox_Z->setPrecision( precision );
GroupPointLayout->addWidget( SpinBox_Z, 0, 5 );
resetButton = new QPushButton( GroupPoint );
SpinBox_Dx = new QtxDoubleSpinBox( min, max, step, GroupDirection );
SpinBox_Dx->setObjectName("SpinBox_Dx" );
- SpinBox_Dx->setDecimals( precision );
+ SpinBox_Dx->setPrecision( precision );
GroupDirectionLayout->addWidget( SpinBox_Dx, 0, 1 );
TextLabelDy = new QLabel( GroupDirection );
SpinBox_Dy = new QtxDoubleSpinBox( min, max, step, GroupDirection );
SpinBox_Dy->setObjectName("SpinBox_Dy" );
- SpinBox_Dy->setDecimals( precision );
+ SpinBox_Dy->setPrecision( precision );
GroupDirectionLayout->addWidget( SpinBox_Dy, 0, 3 );
TextLabelDz = new QLabel( GroupDirection );
SpinBox_Dz = new QtxDoubleSpinBox( min, max, step, GroupDirection );
SpinBox_Dz->setObjectName("SpinBox_Dz" );
- SpinBox_Dz->setDecimals( precision );
+ SpinBox_Dz->setPrecision( precision );
GroupDirectionLayout->addWidget( SpinBox_Dz, 0, 5 );
invertButton = new QPushButton( GroupDirection );
erasePreview();
// Set the clipping plane back
- Handle(V3d_View) aView3d = myView->getViewPort()->getView();
+ /*Handle(V3d_View) aView3d = myView->getViewPort()->getView();
if ( !aView3d.IsNull() && !myClippingPlane.IsNull() )
- aView3d->SetPlaneOn( myClippingPlane );
+ aView3d->SetPlaneOn( myClippingPlane );*/
myAction->setChecked( false );
*/
void OCCViewer_ClippingDlg::showEvent( QShowEvent* e )
{
- ReserveClippingPlane();
+ //ReserveClippingPlane();
QDialog::showEvent( e );
onPreview( PreviewChB->isChecked() );
erasePreview();
// Set the clipping plane back
- Handle(V3d_View) aView3d = myView->getViewPort()->getView();
+ /*Handle(V3d_View) aView3d = myView->getViewPort()->getView();
if ( !aView3d.IsNull() && !myClippingPlane.IsNull() )
aView3d->SetPlaneOn( myClippingPlane );
-
+ */
myAction->setChecked( false );
reject();
qApp->processEvents();
myView->setCuttingPlane( true, SpinBox_X->value() , SpinBox_Y->value() , SpinBox_Z->value(),
- SpinBox_Dx->value(), SpinBox_Dy->value(), SpinBox_Dz->value() );
+ SpinBox_Dx->value(), SpinBox_Dy->value(), SpinBox_Dz->value() );
QApplication::restoreOverrideCursor();
erasePreview();
- ReserveClippingPlane();
+ //ReserveClippingPlane();
}
/*!
intersector.Perform( gp_Lin( aCenter, aNormal), gp_Pln( aBasePnt, aNormal), Precision::Confusion() );
if ( intersector.IsDone() && intersector.NbPoints() == 1 )
- aBasePnt = intersector.Point( 1 );
+ aBasePnt = intersector.Point( 1 );
}
myPreviewPlane = new AIS_Plane( new Geom_Plane( aBasePnt, aNormal ) );
myPreviewPlane->SetSize( aSize, aSize );
// Deactivate clipping planes
- myView->getViewPort()->getView()->SetPlaneOff();
+ //myView->getViewPort()->getView()->SetPlaneOff();
+ //myView->setPlaneOff();
ic->Display( myPreviewPlane, 1, -1, false );
ic->SetWidth( myPreviewPlane, 10, false );
*/
void OCCViewer_ClippingDlg::ReserveClippingPlane()
{
- Handle(V3d_View) aView3d = myView->getViewPort()->getView();
+ /*Handle(V3d_View) aView3d = myView->getViewPort()->getView();
if ( !aView3d.IsNull() )
{
aView3d->InitActivePlanes();
if ( aView3d->MoreActivePlanes() )
- myClippingPlane = aView3d->ActivePlane();
- }
+ myClippingPlane = aView3d->ActivePlane();
+ }*/
}
void OCCViewer_ClippingDlg::onViewShow()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_CLIPPINGDLG_H
#define OCCVIEWER_CLIPPINGDLG_H
Q_OBJECT
public:
- OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
+ OCCViewer_ClippingDlg(OCCViewer_ViewWindow* , const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
~OCCViewer_ClippingDlg();
void SetAction( QtxAction* theAction ) { myAction = theAction; }
OCCViewer_ViewWindow* myView;
Handle(AIS_Plane) myPreviewPlane;
- Handle(V3d_Plane) myClippingPlane;
+ //Handle(V3d_Plane) myClippingPlane;
bool myBusy;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_CreateRestoreViewDlg.h"
-#include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewPort3d.h"
#include <QPushButton>
/*!
Constructor
*/
-OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, OCCViewer_Viewer* curModel )
+OCCViewer_CreateRestoreViewDlg::OCCViewer_CreateRestoreViewDlg( QWidget* aWin, OCCViewer_ViewWindow* theViewWindow )
: QDialog( aWin )
{
setWindowTitle( tr( "CAPTION" ) );
- myParametersMap = curModel->getViewAspects();
+ myParametersMap = theViewWindow->getViewAspects();
myKeyFlag = 0;
int aQuantityOfItems = myParametersMap.count();
-
+
setFixedSize( 400, 300 );
QGridLayout* aGrid = new QGridLayout( this );
QWidget* aWidget1 = new QWidget( this );
QWidget* aWidget2 = new QWidget( this );
-
+
QHBoxLayout* aLayout = new QHBoxLayout( aWidget1 );
-
+
myListBox = new QListWidget( aWidget1 );
myListBox->installEventFilter( this );
- myCurViewPort = new OCCViewer_ViewPort3d( aWidget1, curModel->getViewer3d(), V3d_ORTHOGRAPHIC );
+ myCurViewPort = new OCCViewer_ViewPort3d( aWidget1, theViewWindow->getViewPort()->getViewer(), V3d_ORTHOGRAPHIC );
myCurViewPort->getView()->SetBackgroundColor( Quantity_NOC_BLACK );
myListBox->setEditTriggers( QAbstractItemView::DoubleClicked );
-
+
if ( aQuantityOfItems )
{
myListBox->clear();
connect( myListBox, SIGNAL( itemClicked( QListWidgetItem* ) ), this, SLOT( changeImage( QListWidgetItem* ) ) );
connect( myListBox, SIGNAL( itemChanged( QListWidgetItem* ) ), this, SLOT( editItemText( QListWidgetItem* ) ) );
-
+
aLayout->addWidget( myListBox );
aLayout->addWidget( myCurViewPort, 30 );
aButtonLayout->setSpacing( 5 );
QPushButton* theOk = new QPushButton( tr( "Ok" ), aWidget2 ); theOk->setAutoDefault( false );
- QPushButton* theCancel = new QPushButton( tr( "Cancel" ), aWidget2 ); theCancel->setAutoDefault( false );
- QPushButton* theDelete = new QPushButton( tr( "Delete" ), aWidget2 ); theDelete->setAutoDefault( false );
+ QPushButton* theCancel = new QPushButton( tr( "Cancel" ), aWidget2 ); theCancel->setAutoDefault( false );
+ QPushButton* theDelete = new QPushButton( tr( "Delete" ), aWidget2 ); theDelete->setAutoDefault( false );
QPushButton* theClearAll = new QPushButton( tr( "Clear List" ), aWidget2 ); theClearAll->setAutoDefault( false );
aButtonLayout->addWidget( theOk );
aGrid->addWidget( aWidget1, 0, 0 );
aGrid->addWidget( aWidget2, 1, 0 );
-
+
connect( theOk, SIGNAL( clicked() ), this, SLOT( OKpressed() ) );
connect( theCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( theDelete, SIGNAL( clicked() ), this, SLOT( deleteSelectedItems() ) );
{
for( int i = 0; i < (int)myListBox->count(); i++ )
{
- if( myListBox->item( i )->isSelected() && i != index )
- {
- myListBox->clearSelection();
- if( i > index )
- {
- lowLevel = index;
- highLevel = i;
- }
- else
- {
- lowLevel = i;
- highLevel = index;
- }
- for( int j = lowLevel; j <= highLevel; j++ )
- myListBox->item( j )->setSelected( TRUE );
- break;
- }
- if( myListBox->item( i )->isSelected() && i == index )
- myListBox->item( i )->setSelected( TRUE );
+ if( myListBox->item( i )->isSelected() && i != index )
+ {
+ myListBox->clearSelection();
+ if( i > index )
+ {
+ lowLevel = index;
+ highLevel = i;
+ }
+ else
+ {
+ lowLevel = i;
+ highLevel = index;
+ }
+ for( int j = lowLevel; j <= highLevel; j++ )
+ myListBox->item( j )->setSelected( TRUE );
+ break;
+ }
+ if( myListBox->item( i )->isSelected() && i == index )
+ myListBox->item( i )->setSelected( TRUE );
}
}
*/
void OCCViewer_CreateRestoreViewDlg::deleteSelectedItems()
{
- if( myListBox->count() )
+ QList<QListWidgetItem*> selectedItems = myListBox->selectedItems();
+ if( myListBox->count() && selectedItems.count())
{
int curIndex = -1;
- for( int i = 0; i < (int)myListBox->count(); i++ )
- if( myListBox->item( i )->isSelected() && ( myListBox->item( i )->flags() & Qt::ItemIsEditable ) )
+ // Iterate by all selected items
+ for(int i = 0; i < selectedItems.count(); i++)
+ {
+ QListWidgetItem* item = selectedItems.at(i);
+ // get position of the selected item in the list
+ int position = myListBox->row(item);
+
+ //Calculate current index in case if "item" is last selected item.
+ if(i == selectedItems.count() - 1)
{
- QListWidgetItem* anItemToDelete = myListBox->takeItem( i );
- delete anItemToDelete;
- for( int j = i; j < (int)myParametersMap.count(); j++ )
- if( j != myParametersMap.count() - 1 )
- myParametersMap[ j ] = myParametersMap[ j + 1 ];
- else
- myParametersMap.removeAt( j );
- if( i != myListBox->count() )
- curIndex = i;
+ if(position != myListBox->count() - 1)
+ curIndex = position;
+ else
+ curIndex = position - 1;
+ }
+
+ //Delete item
+ delete item;
+
+ //Shift parameters in the map
+ for( int j = position; j < (int)myParametersMap.count(); j++ )
+ {
+ if( j != myParametersMap.count() - 1 )
+ myParametersMap[ j ] = myParametersMap[ j + 1 ];
else
- curIndex = i - 1;
- i--;
+ myParametersMap.removeAt( j );
}
+ }
if( curIndex >= 0 )
{
myListBox->setCurrentItem( myListBox->item( curIndex ) );
}
if( !myListBox->count() )
{
- myListBox->clear();
- myListBox->insertItem( 0, "No Items" );
+ clearList();
}
}
{
myListBox->clear();
myListBox->insertItem( 0, "No Items" );
-
myParametersMap.clear();
+
+ //Clear view
+ myCurViewPort->reset();
}
/*!
if( aKeyEv->key() == Qt::Key_Control )
{
myKeyFlag = 1;
- myListBox->setSelectionMode( QAbstractItemView::MultiSelection );
+ myListBox->setSelectionMode( QAbstractItemView::MultiSelection );
}
else if( aKeyEv->key() == Qt::Key_Shift )
{
myKeyFlag = 2;
- myListBox->setSelectionMode( QAbstractItemView::MultiSelection );
+ myListBox->setSelectionMode( QAbstractItemView::MultiSelection );
}
else
myListBox->setSelectionMode( QAbstractItemView::SingleSelection );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_CREATERESTOREVIEWDLG_H
#define OCCVIEWER_CREATERESTOREVIEWDLG_H
#include "OCCViewer.h"
-#include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewWindow.h"
#include <QtxDialog.h>
class OCCVIEWER_EXPORT OCCViewer_CreateRestoreViewDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- OCCViewer_CreateRestoreViewDlg( QWidget*, OCCViewer_Viewer* );
- virtual ~OCCViewer_CreateRestoreViewDlg();
+ OCCViewer_CreateRestoreViewDlg( QWidget*, OCCViewer_ViewWindow* );
+ virtual ~OCCViewer_CreateRestoreViewDlg();
- const viewAspectList& parameters() const;
- viewAspect currentItem() const;
- virtual bool eventFilter( QObject*, QEvent* );
+ const viewAspectList& parameters() const;
+ viewAspect currentItem() const;
+ virtual bool eventFilter( QObject*, QEvent* );
public slots:
- void OKpressed();
- void clearList();
- void editItemText( QListWidgetItem* );
- void changeImage( QListWidgetItem* );
- void deleteSelectedItems();
+ void OKpressed();
+ void clearList();
+ void editItemText( QListWidgetItem* );
+ void changeImage( QListWidgetItem* );
+ void deleteSelectedItems();
signals:
- void dlgOk();
+ void dlgOk();
private:
- int myKeyFlag;
- QListWidget* myListBox;
- OCCViewer_ViewPort3d* myCurViewPort;
- viewAspect myCurrentItem;
- viewAspectList myParametersMap;
+ int myKeyFlag;
+ QListWidget* myListBox;
+ OCCViewer_ViewPort3d* myCurViewPort;
+ viewAspect myCurrentItem;
+ viewAspectList myParametersMap;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_SetRotationPointDlg.h"
#include <QtxAction.h>
\param modal - is this dialog modal
\param fl - flags
*/
-OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl )
-: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, const char* name, bool modal, Qt::WindowFlags fl )
+: QDialog( view, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myView( view )
{
setObjectName( "OCCViewer_SetRotationPointDlg" );
}
else
myView->activateSetRotationSelected(myX->text().toDouble(),
- myY->text().toDouble(),
- myZ->text().toDouble());
+ myY->text().toDouble(),
+ myZ->text().toDouble());
}
void
mySelectPoint->toggle();
setCoords();
myView->activateSetRotationSelected(myX->text().toDouble(),
- myY->text().toDouble(),
- myZ->text().toDouble());
+ myY->text().toDouble(),
+ myZ->text().toDouble());
}
void
if ( !myIsBBCenter->isChecked() )
{
if ( mySelectPoint->isChecked()
- &&
- ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+ &&
+ ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
mySelectPoint->toggle();
myView->activateSetRotationSelected(myX->text().toDouble(),
- myY->text().toDouble(),
- myZ->text().toDouble());
+ myY->text().toDouble(),
+ myZ->text().toDouble());
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_SETROTATIONPOINTDLG_H
#define OCCVIEWER_SETROTATIONPOINTDLG_H
Q_OBJECT
public:
- OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* , QWidget* parent = 0,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
+ OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* ,
+ const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
~OCCViewer_SetRotationPointDlg();
void SetAction( QtxAction* theAction ) { myAction = theAction; }
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: OCCViewer_ToolTip.cxx
// Author: Alexandre SOLOVYOV
//
myWnd( wnd )
{
connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ),
- this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
+ this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_TOOLTIP_H
#define OCCVIEWER_TOOLTIP_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifdef WIN32
#include <windows.h>
#endif
* Redefined method. Calculates the object presentation.
*/
void OCCViewer_Trihedron::Compute( const Handle( PrsMgr_PresentationManager3d )&,
- const Handle( Prs3d_Presentation )& aPrs,
- const Standard_Integer aMode )
+ const Handle( Prs3d_Presentation )& aPrs,
+ const Standard_Integer aMode )
{
if( aPrs.IsNull() )
return;
* Redefined method. Does nothing.
*/
void OCCViewer_Trihedron::ComputeSelection( const Handle( SelectMgr_Selection )& theSelection,
- const Standard_Integer theMode )
+ const Standard_Integer theMode )
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_TRIHEDRON_H
#define OCCVIEWER_TRIHEDRON_H
virtual ~OCCViewer_Trihedron();
virtual void Compute( const Handle(PrsMgr_PresentationManager3d)&,
- const Handle(Prs3d_Presentation)&,
- const Standard_Integer );
+ const Handle(Prs3d_Presentation)&,
+ const Standard_Integer );
virtual void ComputeSelection( const Handle( SelectMgr_Selection )&,
- const Standard_Integer );
+ const Standard_Integer );
virtual void bounds( Graphic3d_CBounds& ) const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_VService.h"
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
#include <WNT_Window.hxx>
#include <Graphic3d_WNTGraphicDevice.hxx>
#include <WNT_GraphicDevice.hxx>
-#include <WNT_GraphicDevice.hxx>
#include <WNT_WDriver.hxx>
#include <InterfaceGraphic_WNT.hxx>
#else
#endif // WNT
/*!
- Maps CasCade view to the window [ static ]
+ Create native view window for CasCade view [ static ]
*/
-void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
- const Standard_Integer hiwin,
- const Standard_Integer lowin,
- const Xw_WindowQuality quality )
+Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& view,
+ const Standard_Integer hiwin,
+ const Standard_Integer lowin,
+ const Xw_WindowQuality quality )
{
#ifdef WNT
- Handle(WNT_Window) w =
- new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
- // Prevent flicker
- w->SetFlags( WDF_NOERASEBKGRND );
+ Handle(WNT_Window) viewWindow = new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin );
+ // Prevent flickering
+ viewWindow->SetFlags( WDF_NOERASEBKGRND );
#else
- Handle(Xw_Window) w =
- new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, quality );
+ Handle(Xw_Window) viewWindow = new Xw_Window( Handle(Graphic3d_GraphicDevice)::DownCast(view->Viewer()->Device()), hiwin, lowin, quality );
#endif
- view->SetWindow( w );
+ return viewWindow;
+}
+
+/*!
+ Maps CasCade view to the window [ static ]
+*/
+void OCCViewer_VService::SetWindow( const Handle(V3d_View)& view,
+ const Standard_Integer hiwin,
+ const Standard_Integer lowin,
+ const Xw_WindowQuality quality )
+{
+ view->SetWindow( OCCViewer_VService::CreateWindow( view, hiwin, lowin, quality ) );
}
/*!
Magnifies 'view' based on previous view [ static ]
*/
void OCCViewer_VService::SetMagnify( const Handle(V3d_View)& view,
- const Standard_Integer hiwin,
- const Standard_Integer lowin,
- const Handle(V3d_View)& prevView,
- const Standard_Integer x1,
- const Standard_Integer y1,
- const Standard_Integer x2,
- const Standard_Integer y2,
+ const Standard_Integer hiwin,
+ const Standard_Integer lowin,
+ const Handle(V3d_View)& prevView,
+ const Standard_Integer x1,
+ const Standard_Integer y1,
+ const Standard_Integer x2,
+ const Standard_Integer y2,
const Xw_WindowQuality aQuality )
{
#ifdef WNT
Creates view 2D and maps it to the window [ static ]
*/
/*Handle(V2d_View) OCCViewer_VService::View2d( const Handle(V2d_Viewer)& aViewer,
- const Standard_Integer hiwin,
- const Standard_Integer lowin,
- const Xw_WindowQuality aQuality,
- const Standard_Boolean Update,
- const Quantity_NameOfColor BackColor )
+ const Standard_Integer hiwin,
+ const Standard_Integer lowin,
+ const Xw_WindowQuality aQuality,
+ const Standard_Boolean Update,
+ const Quantity_NameOfColor BackColor )
{
#ifdef WNT
Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device());
Creates view 2D and maps it to the window [ static ]
*/
/*Handle(V2d_View) OCCViewer_VService::dpsView2d( const Handle(V2d_Viewer)& aViewer,
- const Standard_Integer hiwin,
- const Standard_Integer lowin,
- const Xw_WindowQuality aQuality,
- const Standard_Boolean Update,
- const Quantity_NameOfColor BackColor )
+ const Standard_Integer hiwin,
+ const Standard_Integer lowin,
+ const Xw_WindowQuality aQuality,
+ const Standard_Boolean Update,
+ const Quantity_NameOfColor BackColor )
{
#ifdef WNT
Handle(WNT_GraphicDevice) GD = Handle(WNT_GraphicDevice)::DownCast(aViewer->Device());
Creates viewer 2D [ static ]
*/
/*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay,
- const Standard_ExtString aName,
- const Standard_CString aDomain )
+ const Standard_ExtString aName,
+ const Standard_CString aDomain )
{
#ifdef WNT
if ( XServiceDefault2dDevice.IsNull() )
Creates viewer 2D [ static ]
*/
/*Handle(V2d_Viewer) OCCViewer_VService::Viewer2d( const Standard_CString aDisplay,
- const Handle(Graphic2d_View)& aView,
- const Standard_ExtString aName,
- const Standard_CString aDomain )
+ const Handle(Graphic2d_View)& aView,
+ const Standard_ExtString aName,
+ const Standard_CString aDomain )
{
#ifdef WNT
if ( XServiceDefault2dDevice.IsNull() )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_VSERVICE_H
#define OCCVIEWER_VSERVICE_H
#ifndef _Handle_Aspect_WindowDriver_HeaderFile
#include <Handle_Aspect_WindowDriver.hxx>
#endif
+#ifndef _Handle_Aspect_Window_HeaderFile
+#include <Handle_Aspect_Window.hxx>
+#endif
class V3d_View;
class V2d_View;
}
// STATIC METHODS
+ static Handle(Aspect_Window)
+ CreateWindow( const Handle(V3d_View)& view,
+ const Standard_Integer hiwin,
+ const Standard_Integer lowin,
+ const Xw_WindowQuality quality );
+
static void SetWindow( const Handle( V3d_View )& view,
const Standard_Integer hiwin,
const Standard_Integer lowin,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_ViewManager.h"
#include "OCCViewer_ViewWindow.h"
#include "SUIT_Desktop.h"
Constructor
*/
OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop, bool DisplayTrihedron )
-: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron, false ) )
-{
+: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) )
+{
setTitle( tr( "OCC_VIEW_TITLE" ) );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_VIEWMANAGER_H
#define OCCVIEWER_VIEWMANAGER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewFrame.h"
#include "OCCViewer_VService.h"
#include "OCCViewer_ViewPort3d.h"
#include "SUIT_ViewManager.h"
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
#include "QtxActionToolMgr.h"
+#include "QtxBackgroundTool.h"
#include <QPainter>
#include <QApplication>
#include <QColorDialog>
+#include <QFileDialog>
#include <QPalette>
+#include <QKeyEvent>
#include <QMenu>
#include <QMouseEvent>
#include <QToolBar>
#include <Prs3d_AngleAspect.hxx>
#include <Prs3d_TextAspect.hxx>
+#include <Visual3d_View.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
+// VSR: Uncomment below line to allow texture background support in OCC viewer
+#define OCC_ENABLE_TEXTURED_BACKGROUND
+
+/*!
+ Get data for supported background modes: gradient types, identifiers and supported image formats
+*/
+QString OCCViewer_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList )
+{
+ gradList << tr("GT_HORIZONTALGRADIENT") << tr("GT_VERTICALGRADIENT") <<
+ tr("GT_FIRSTDIAGONALGRADIENT") << tr("GT_SECONDDIAGONALGRADIENT") <<
+ tr("GT_FIRSTCORNERGRADIENT") << tr("GT_SECONDCORNERGRADIENT") <<
+ tr("GT_THIRDCORNERGRADIENT") << tr("GT_FORTHCORNERGRADIENT");
+ idList << HorizontalGradient << VerticalGradient <<
+ Diagonal1Gradient << Diagonal2Gradient <<
+ Corner1Gradient << Corner2Gradient <<
+ Corner3Gradient << Corner4Gradient;
+#if OCC_VERSION_LARGE > 0x06050200 // enabled since OCCT 6.5.3, since in previous version this functionality is buggy
+#ifdef OCC_ENABLE_TEXTURED_BACKGROUND
+ txtList << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
+#endif
+#endif
+ return tr("BG_IMAGE_FILES");
+}
+
/*!
Constructor
\param DisplayTrihedron - is trihedron displayed
*/
-OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTrihedron )
+OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
: SUIT_ViewModel(),
- myBgColor( Qt::black ),
- myShowStaticTrihedron( DisplayStaticTrihedron )
+ myBackgrounds(4, Qtx::BackgroundData( Qt::black )),
+ myIsRelative(true),
+ myTopLayerId( 0 ),
+ myTrihedronSize(100)
{
// init CasCade viewers
myV3dViewer = OCCViewer_VService::Viewer3d( "", (short*) "Viewer3d", "", 1000.,
drawer->AngleAspect()->SetTextAspect(ta);
drawer->LengthAspect()->SetTextAspect(ta);
- clearViewAspects();
-
/* create trihedron */
if( DisplayTrihedron )
{
myAISContext->Display(myTrihedron);
myAISContext->Deactivate(myTrihedron);
- }
+ }
+
+ // set interaction style to standard
+ myInteractionStyle = 0;
+
+ // set zooming style to standard
+ myZoomingStyle = 0;
// selection
mySelectionEnabled = true;
myMultiSelectionEnabled = true;
+
+
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ if(resMgr)
+ myShowStaticTrihedron = resMgr->booleanValue( "OCCViewer", "show_static_trihedron", true );
}
/*!
}
/*!
+ [obsolete]
\return background color of viewer
*/
QColor OCCViewer_Viewer::backgroundColor() const
{
- return myBgColor;
+ return backgroundColor(0);
+}
+
+/*!
+ \return background data of viewer
+*/
+Qtx::BackgroundData OCCViewer_Viewer::background() const
+{
+ return background(0);
}
/*!
- Sets background color
+ Sets background color [obsolete]
\param c - new background color
*/
void OCCViewer_Viewer::setBackgroundColor( const QColor& c )
{
- if ( c.isValid() )
- myBgColor = c;
+ setBackgroundColor( 0, c );
+}
+
+/*!
+ Sets background data
+ \param d - new background data
+*/
+void OCCViewer_Viewer::setBackground( const Qtx::BackgroundData& theBackground )
+{
+ setBackground( 0, theBackground );
}
/*!
if ( view ) {
view->initLayout();
view->initSketchers();
+ view->setInteractionStyle( interactionStyle() );
+ view->setZoomingStyle( zoomingStyle() );
OCCViewer_ViewPort3d* vp3d = view->getViewPort();
if ( vp3d )
- vp3d->setBackgroundColor( myBgColor );
+ {
+ vp3d->getView()->SetSurfaceDetail(V3d_TEX_ALL);
+ }
}
}
*/
SUIT_ViewWindow* OCCViewer_Viewer::createView( SUIT_Desktop* theDesktop )
{
- OCCViewer_ViewWindow* view = new OCCViewer_ViewWindow(theDesktop, this);
- initView( view );
+ // create view frame
+ OCCViewer_ViewFrame* view = new OCCViewer_ViewFrame(theDesktop, this);
+ // get main view window (created by view frame)
+ OCCViewer_ViewWindow* vw = view->getView(OCCViewer_ViewFrame::MAIN_VIEW);
+ // initialize main view window
+ initView( vw );
+ // set default background for view window
+ vw->setBackground( background(0) ); // 0 means MAIN_VIEW (other views are not yet created here)
return view;
}
SUIT_ViewModel::setViewManager(theViewManager);
if (theViewManager) {
connect(theViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
- this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
+ this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
connect(theViewManager, SIGNAL(mouseMove(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMouseMove(SUIT_ViewWindow*, QMouseEvent*)));
connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
+
+ connect(theViewManager, SIGNAL(keyPress(SUIT_ViewWindow*, QKeyEvent*)),
+ this, SLOT(onKeyPress(SUIT_ViewWindow*, QKeyEvent*)));
}
}
OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
if ( isSelectionEnabled() ) {
- if (aView->getViewPort()->isBusy()) return; // Check that the ViewPort initialization completed
+ if (aView->getViewPort()->isBusy()) {
+ QCoreApplication::processEvents();
+ return; // Check that the ViewPort initialization completed
// To Prevent call move event if the View port is not initialized
// IPAL 20883
+ }
Handle(V3d_View) aView3d = aView->getViewPort()->getView();
- if ( !aView3d.IsNull() )
+ if ( !aView3d.IsNull() ) {
myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d);
+ }
}
}
if (theEvent->button() != Qt::LeftButton) return;
if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
+ OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
+ if (!aView || aView->interactionStyle() != SUIT_ViewModel::STANDARD)
+ return;
myEndPnt.setX(theEvent->x()); myEndPnt.setY(theEvent->y());
- OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier);
if (!aHasShift) emit deselection();
emit selectionChanged();
}
+/*!
+ SLOT: called on key press, processes selection in "key free" interaction style
+*/
+void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEvent)
+{
+ if (!mySelectionEnabled) return;
+ if (theEvent->key() != Qt::Key_S) return;
+ if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
+
+ OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
+ if (!aView || aView->interactionStyle() != SUIT_ViewModel::KEY_FREE)
+ return;
+
+ emit deselection();
+ myAISContext->Select();
+
+ emit selectionChanged();
+}
+
+int OCCViewer_Viewer::getTopLayerId()
+{
+#if OCC_VERSION_LARGE > 0x06050200
+ if ( myTopLayerId == 0 && !myAISContext->CurrentViewer().IsNull() )
+ myAISContext->CurrentViewer()->AddZLayer( myTopLayerId );
+#endif
+
+ return myTopLayerId;
+}
+
+/*!
+ \return interaction style
+*/
+int OCCViewer_Viewer::interactionStyle() const
+{
+ return myInteractionStyle;
+}
+
+/*!
+ Sets interaction style: 0 - standard, 1 - keyboard free interaction
+ \param theStyle - new interaction style
+*/
+void OCCViewer_Viewer::setInteractionStyle( const int theStyle )
+{
+ myInteractionStyle = theStyle;
+ //!! To be done for view windows
+ if ( !myViewManager )
+ return;
+
+ QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
+ for ( int i = 0; i < (int)wins.count(); i++ )
+ {
+ OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+ if ( win )
+ win->setInteractionStyle( theStyle );
+ }
+}
+
+/*!
+ \return zooming style
+*/
+int OCCViewer_Viewer::zoomingStyle() const
+{
+ return myZoomingStyle;
+}
+
+/*!
+ Sets zooming style: 0 - standard, 1 - advanced (at cursor)
+ \param theStyle - new zooming style
+*/
+void OCCViewer_Viewer::setZoomingStyle( const int theStyle )
+{
+ myZoomingStyle = theStyle;
+ //!! To be done for view windows
+ if ( !myViewManager )
+ return;
+
+ QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
+ for ( int i = 0; i < (int)wins.count(); i++ )
+ {
+ OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+ if ( win )
+ win->setZoomingStyle( theStyle );
+ }
+}
/*!
Sets selection enabled status
void OCCViewer_Viewer::contextMenuPopup(QMenu* thePopup)
{
thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
- thePopup->addAction( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+ thePopup->addAction( tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
thePopup->addSeparator();
//Support of several toolbars in the popup menu
QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
- for( ; it!=last; it++ )
- thePopup->addAction( (*it)->toggleViewAction() );
+ for ( ; it!=last; it++ ) {
+ if ( (*it)->parentWidget()->isVisible() )
+ thePopup->addAction( (*it)->toggleViewAction() );
+ }
}
/*!
/*!
SLOT: called if background color is to be changed changed, passes new color to view port
*/
-void OCCViewer_Viewer::onChangeBgColor()
+void OCCViewer_Viewer::onChangeBackground()
{
- OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
- if( !aView )
- return;
- OCCViewer_ViewPort3d* aViewPort3d = aView->getViewPort();
- if( !aViewPort3d )
+ OCCViewer_ViewWindow* aView = dynamic_cast<OCCViewer_ViewWindow*>(myViewManager->getActiveView());
+ if ( !aView )
return;
- QColor aColorActive = aViewPort3d->backgroundColor();
- QColor selColor = QColorDialog::getColor( aColorActive, aView);
- if ( selColor.isValid() )
- aViewPort3d->setBackgroundColor(selColor);
+ // get supported gradient types
+ QStringList gradList;
+ QIntList idList, txtList;
+ QString formats = backgroundData( gradList, idList, txtList );
+
+ // invoke dialog box
+ Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(), // initial background
+ aView, // parent for dialog box
+ txtList, // allowed texture modes
+ true, // enable solid color mode
+ true, // enable gradient mode
+ false, // disable custom gradient mode
+ !txtList.isEmpty(), // enable/disable texture mode
+ gradList, // gradient names
+ idList, // gradient identifiers
+ formats ); // image formats
+
+ // set chosen background data to the viewer
+ if ( bgData.isValid() )
+ aView->setBackground( bgData );
}
/*!
emit selectionChanged();
}
-/*!
- SLOT, clears view aspects
-*/
-void OCCViewer_Viewer::onClearViewAspects()
-{
- clearViewAspects();
-}
-
-/*!
- Clears view aspects
-*/
-void OCCViewer_Viewer::clearViewAspects()
-{
- myViewAspects.clear();
-}
-
-/*!
- \return const reference to list of view aspects
-*/
-const viewAspectList& OCCViewer_Viewer::getViewAspects()
-{
- return myViewAspects;
-}
-
-/*!
- Appends new view aspect
- \param aParams - new view aspects
-*/
-void OCCViewer_Viewer::appendViewAspect( const viewAspect& aParams )
-{
- myViewAspects.append( aParams );
-}
-
-/*!
- Replaces old view aspects by new ones
- \param aViewList - list of new view aspects
-*/
-void OCCViewer_Viewer::updateViewAspects( const viewAspectList& aViewList )
-{
- myViewAspects = aViewList;
-}
-
/*!
Hilights/unhilights object in viewer
\param obj - object to be updated
Changes trihedron size
\param sz - new size
*/
-void OCCViewer_Viewer::setTrihedronSize( const double sz )
+void OCCViewer_Viewer::setTrihedronSize( const double sz, bool isRelative )
{
- if ( !myTrihedron.IsNull() )
- myTrihedron->SetSize( sz );
+ if ( myTrihedronSize != sz || isRelative != myIsRelative) {
+ myTrihedronSize = sz;
+ myIsRelative = isRelative;
+ updateTrihedron();
+ }
}
/*!
v = ic->IsoNumber( AIS_TOI_IsoV );
}
}
+
+/*
+ * Returns a new OCCViewer_ViewWindow instance which will be placed as a sub window in ViewFrame
+ */
+OCCViewer_ViewWindow* OCCViewer_Viewer::createSubWindow()
+{
+ return new OCCViewer_ViewWindow( 0, this);
+}
+
+// obsolete
+QColor OCCViewer_Viewer::backgroundColor( int theViewId ) const
+{
+ return background( theViewId ).color();
+}
+
+Qtx::BackgroundData OCCViewer_Viewer::background( int theViewId ) const
+{
+ return ( theViewId >= 0 && theViewId < myBackgrounds.count() ) ? myBackgrounds[theViewId] : Qtx::BackgroundData();
+}
+
+// obsolete
+void OCCViewer_Viewer::setBackgroundColor( int theViewId, const QColor& theColor )
+{
+ if ( theColor.isValid() ) {
+ Qtx::BackgroundData bg = background( theViewId );
+ bg.setColor( theColor );
+ setBackground( theViewId, bg );
+ }
+}
+
+void OCCViewer_Viewer::setBackground( int theViewId, const Qtx::BackgroundData& theBackground )
+{
+ if ( theBackground.isValid() && theViewId >= 0 && theViewId < myBackgrounds.count() )
+ myBackgrounds[theViewId] = theBackground;
+}
+
+
+/*!
+ Set the show static trihedron flag
+*/
+void OCCViewer_Viewer::setStaticTrihedronDisplayed(const bool on) {
+ if(myShowStaticTrihedron != on) {
+ OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
+ if(!aView)
+ return;
+
+ OCCViewer_ViewPort3d* vp3d = aView->getViewPort();
+ if(vp3d) {
+ myShowStaticTrihedron = on;
+ vp3d->updateStaticTriedronVisibility();
+ }
+ }
+}
+
+/*!
+ Get new and current trihedron size corresponding to the current model size
+*/
+bool OCCViewer_Viewer::computeTrihedronSize( double& theNewSize, double& theSize )
+{
+ theNewSize = 100;
+ theSize = 100;
+
+ //SRN: BUG IPAL8996, a usage of method ActiveView without an initialization
+ Handle(V3d_Viewer) viewer = getViewer3d();
+ viewer->InitActiveViews();
+ if(!viewer->MoreActiveViews()) return false;
+
+ Handle(V3d_View) view3d = viewer->ActiveView();
+ //SRN: END of fix
+
+ if ( view3d.IsNull() )
+ return false;
+
+ double Xmin = 0, Ymin = 0, Zmin = 0, Xmax = 0, Ymax = 0, Zmax = 0;
+ double aMaxSide;
+
+ view3d->View()->MinMaxValues( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
+
+ if ( Xmin == RealFirst() || Ymin == RealFirst() || Zmin == RealFirst() ||
+ Xmax == RealLast() || Ymax == RealLast() || Zmax == RealLast() )
+ return false;
+
+ aMaxSide = Xmax - Xmin;
+ if ( aMaxSide < Ymax -Ymin ) aMaxSide = Ymax -Ymin;
+ if ( aMaxSide < Zmax -Zmin ) aMaxSide = Zmax -Zmin;
+
+ // IPAL21687
+ // The boundary box of the view may be initialized but nullified
+ // (case of infinite objects)
+ if ( aMaxSide < Precision::Confusion() )
+ return false;
+
+ float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("OCCViewer","trihedron_size", 100.);
+
+ static float EPS = 5.0E-3;
+ theSize = getTrihedron()->Size();
+ theNewSize = aMaxSide*aSizeInPercents / 100.0;
+
+ return fabs( theNewSize - theSize ) > theSize * EPS ||
+ fabs( theNewSize - theSize) > theNewSize * EPS;
+}
+
+/*!
+ * Update the size of the trihedron
+ */
+void OCCViewer_Viewer::updateTrihedron() {
+ if(myIsRelative){
+ double newSz, oldSz;
+
+ if(computeTrihedronSize(newSz, oldSz))
+ myTrihedron->SetSize(newSz);
+
+ } else if(myTrihedron->Size() != myTrihedronSize) {
+ myTrihedron->SetSize(myTrihedronSize);
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_VIEWMODEL_H
#define OCCVIEWER_VIEWMODEL_H
#include <QColor>
#include <QPoint>
+#include <QVector>
#include "OCCViewer.h"
+#include "Qtx.h"
#include "SUIT_ViewModel.h"
#include <V3d_View.hxx>
#include <AIS_Trihedron.hxx>
#include <AIS_InteractiveContext.hxx>
+class QKeyEvent;
class QMouseEvent;
class SUIT_ViewWindow;
class AIS_ListOfInteractive;
-struct viewAspect
-{
-public:
- double scale;
- double centerX;
- double centerY;
- double projX;
- double projY;
- double projZ;
- double twist;
- double atX;
- double atY;
- double atZ;
- double eyeX;
- double eyeY;
- double eyeZ;
- double scaleX;
- double scaleY;
- double scaleZ;
- QString name;
- bool isVisible;
- double size;
-};
-
-typedef QList<viewAspect> viewAspectList;
-
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
Q_OBJECT
public:
- static QString Type() { return "OCCViewer"; }
+ /*! supported gradient types */
+ enum {
+ HorizontalGradient, VerticalGradient,
+ Diagonal1Gradient, Diagonal2Gradient,
+ Corner1Gradient, Corner2Gradient,
+ Corner3Gradient, Corner4Gradient,
+ LastGradient = Corner4Gradient
+ };
+
+ static QString Type() { return "OCCViewer"; }
+ static QString backgroundData( QStringList&, QIntList&, QIntList& );
- OCCViewer_Viewer( bool DisplayTrihedron = true, bool DisplayStaticTrihedron = true );
+ OCCViewer_Viewer( bool DisplayTrihedron = true);
virtual ~OCCViewer_Viewer();
void update();
void performSelectionChanged();
// emit signal selectionChanged
- virtual const viewAspectList& getViewAspects();
- virtual void appendViewAspect( const viewAspect& );
- virtual void updateViewAspects( const viewAspectList& );
- virtual void clearViewAspects();
+ QColor backgroundColor() const; // obsolete
+ void setBackgroundColor( const QColor& ); // obsolete
+ Qtx::BackgroundData background() const;
+ void setBackground( const Qtx::BackgroundData& );
- QColor backgroundColor() const;
- void setBackgroundColor( const QColor& );
+ QColor backgroundColor(int theViewId) const; // obsolete
+ void setBackgroundColor( int theViewId, const QColor& ); // obsolete
+ Qtx::BackgroundData background(int theViewId) const;
+ void setBackground( int theViewId, const Qtx::BackgroundData& );
//! returns true if 3d Trihedron in viewer was created
bool trihedronActivated() const { return !myTrihedron.IsNull(); }
virtual void setTrihedronShown( const bool );
double trihedronSize() const;
- virtual void setTrihedronSize( const double );
+ virtual void setTrihedronSize( const double , bool isRelative = true);
+
+ bool trihedronRelative() const {return myIsRelative; }
+
+ // a utility function, used by SALOME_View_s methods
+ bool computeTrihedronSize( double& theNewSize, double& theSize );
+
+ void updateTrihedron();
+
+
+ virtual OCCViewer_ViewWindow* createSubWindow();
-public slots:
- void onClearViewAspects();
-
public:
Handle(V3d_Viewer) getViewer3d() const { return myV3dViewer;}
Handle(V3d_Viewer) getCollector3d() const { return myV3dCollector; }
Handle(AIS_InteractiveContext) getAISContext() const { return myAISContext; }
Handle(AIS_Trihedron) getTrihedron() const { return myTrihedron; }
+ int getTopLayerId();
+
+ int interactionStyle() const;
+ void setInteractionStyle( const int );
+
+ int zoomingStyle() const;
+ void setZoomingStyle( const int );
+
void enableSelection(bool isEnabled);
bool isSelectionEnabled() const { return mySelectionEnabled; }
bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
int getSelectionCount() const { return (!myAISContext.IsNull())? myAISContext->NbSelected():0; }
+
bool isStaticTrihedronDisplayed() { return myShowStaticTrihedron; }
+ void setStaticTrihedronDisplayed(const bool on);
/* Selection management */
bool highlight( const Handle(AIS_InteractiveObject)&, bool, bool=true );
- bool unHighlightAll( bool=true );
+ bool unHighlightAll( bool=true );
bool isInViewer( const Handle(AIS_InteractiveObject)&, bool=false );
bool isVisible( const Handle(AIS_InteractiveObject)& );
void setIsos( const int u, const int v ); // number of isolines
void isos( int& u, int& v ) const;
+ void initView( OCCViewer_ViewWindow* view );
+
signals:
void selectionChanged();
void deselection();
-protected:
- void initView( OCCViewer_ViewWindow* view );
-
protected slots:
- void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
+ virtual void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
+ virtual void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
+ virtual void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
+ virtual void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
void onDumpView();
- void onChangeBgColor();
+ void onChangeBackground();
-private:
+protected:
Handle(V3d_Viewer) myV3dViewer;
Handle(V3d_Viewer) myV3dCollector;
Handle(AIS_Trihedron) myTrihedron;
- Handle(AIS_InteractiveContext) myAISContext;
+ Handle(AIS_InteractiveContext) myAISContext;
- viewAspectList myViewAspects;
+ int myInteractionStyle;
+ int myZoomingStyle;
bool mySelectionEnabled;
bool myMultiSelectionEnabled;
+ bool myIsRelative;
+
+ int myTopLayerId;
- QColor myBgColor;
+ //QColor myBgColor;
QPoint myStartPnt, myEndPnt;
bool myShowStaticTrihedron;
+
+ double myTrihedronSize;
+
+ QVector<Qtx::BackgroundData> myBackgrounds;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#if !defined WNT
#define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */
#endif
struct CMapEntry
{
- CMapEntry();
- ~CMapEntry();
- Colormap cmap;
- bool alloc;
- XStandardColormap scmap;
+ CMapEntry();
+ ~CMapEntry();
+ Colormap cmap;
+ bool alloc;
+ XStandardColormap scmap;
};
/*!
*/
CMapEntry::CMapEntry()
{
- cmap = 0;
- alloc = false;
- scmap.colormap = 0;
+ cmap = 0;
+ alloc = false;
+ scmap.colormap = 0;
}
/*!
*/
CMapEntry::~CMapEntry()
{
- if ( alloc )
- XFreeColormap( QX11Info::display(), cmap );
+ if ( alloc )
+ XFreeColormap( QX11Info::display(), cmap );
}
static QMultiHash<int,CMapEntry> *cmap_dict = 0;
static void cleanup_cmaps()
{
- if ( !cmap_dict )
- return;
- //while (!cmap_dict->isEmpty())
- // cmap_dict->erase(cmap_dict->begin());
- cmap_dict->clear();
- delete cmap_dict;
- cmap_dict = 0;
+ if ( !cmap_dict )
+ return;
+ //while (!cmap_dict->isEmpty())
+ // cmap_dict->erase(cmap_dict->begin());
+ cmap_dict->clear();
+ delete cmap_dict;
+ cmap_dict = 0;
}
static Colormap choose_cmap( Display *dpy, XVisualInfo *vi )
if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
{
#ifdef DEBUG
- cout << "Using x11AppColormap" << endl;
+// cout << "Using x11AppColormap" << endl;
#endif
return QX11Info::appColormap();
}
{
if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, hp_cmaps ) )
{
- i = 0;
- while ( i < n && x.cmap == 0 )
- {
- if ( c[i].visualid == vi->visual->visualid )
- {
- x.cmap = c[i].colormap;
- x.scmap = c[i];
- }
- i++;
- }
- XFree( (char*)c );
+ i = 0;
+ while ( i < n && x.cmap == 0 )
+ {
+ if ( c[i].visualid == vi->visual->visualid )
+ {
+ x.cmap = c[i].colormap;
+ x.scmap = c[i];
+ }
+ i++;
+ }
+ XFree( (char*)c );
}
}
}
{
if ( XGetRGBColormaps( dpy, RootWindow( dpy, vi->screen ), &c, &n, XA_RGB_DEFAULT_MAP ) )
{
- i = 0;
- while ( i < n && x.cmap == 0 )
- {
- if ( c[i].visualid == vi->visualid )
- {
- x.cmap = c[i].colormap;
- x.scmap = c[i];
- }
- i++;
- }
- XFree( (char *)c );
+ i = 0;
+ while ( i < n && x.cmap == 0 )
+ {
+ if ( c[i].visualid == vi->visualid )
+ {
+ x.cmap = c[i].colormap;
+ x.scmap = c[i];
+ }
+ i++;
+ }
+ XFree( (char *)c );
}
}
}
OCCViewer_ViewPort::OCCViewer_ViewPort( QWidget* parent )
: QWidget( parent )
{
- initialize();
+ initialize();
}
/*!
*/
OCCViewer_ViewPort::~OCCViewer_ViewPort()
{
- cleanup();
+ cleanup();
}
/*!
void OCCViewer_ViewPort::selectVisualId()
{
#if !defined WNT
- XVisualInfo* pVisualInfo;
- if ( QX11Info::display() )
- {
- /* Initialization with the default VisualID */
- Visual *v = DefaultVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
- int visualID = XVisualIDFromVisual( v );
+ XVisualInfo* pVisualInfo;
+ if ( QX11Info::display() )
+ {
+ /* Initialization with the default VisualID */
+ Visual *v = DefaultVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+ /*int visualID = */XVisualIDFromVisual( v );
+
+ /* Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */
+ int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None };
+
+ pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr );
+
+ if ( isVisible() )
+ hide();
+
+ XSetWindowAttributes a;
+
+ a.colormap = choose_cmap( QX11Info::display(), pVisualInfo ); /* find best colormap */
+ a.background_pixel = QColormap::instance().pixel( backgroundColor() );
+ a.border_pixel = QColormap::instance().pixel( Qt::black );
+ Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+ if ( parentWidget() )
+ p = parentWidget()->winId();
+
+ Window w;
+ /*
+ if ( type == Type2D ) // creating simple X window for 2d
+ {
+ unsigned long xbackground =
+ BlackPixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+ unsigned long xforeground =
+ WhitePixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
- /* Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */
- int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None };
+ w = XCreateSimpleWindow ( QX11Info::display(), p, x(), y(), width(),
+ height(), 0, xforeground, xbackground );
+ }
+ else if ( type == Type3D )
+ {
+ w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(),
+ 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
+ CWBackPixel | CWBorderPixel | CWColormap, &a );
+ }
+ else
+ return;
+ */
+ w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(),
+ 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
+ CWBackPixel | CWBorderPixel | CWColormap, &a );
+
+ Window *cmw;
+ Window *cmwret;
+ int count;
+ if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) )
+ {
+ cmw = new Window[count+1];
+ memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count );
+ XFree( (char*)cmwret );
+ int i;
- pVisualInfo = ::glXChooseVisual( QX11Info::display(), DefaultScreen( QX11Info::display() ), visualAttr );
+ for ( i = 0; i < count; i++ )
+ {
+ if ( cmw[i] == winId() ) /* replace old window */
+ {
+ cmw[i] = w;
+ break;
+ }
+ }
- if ( isVisible() )
- hide();
+ if ( i >= count ) /* append new window */
+ cmw[count++] = w;
+ }
+ else
+ {
+ count = 1;
+ cmw = new Window[count];
+ cmw[0] = w;
+ }
- XSetWindowAttributes a;
+ /* Creating new window (with good VisualID) for this widget */
+ create(w);
+ XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count );
+ delete[] cmw;
- a.colormap = choose_cmap( QX11Info::display(), pVisualInfo ); /* find best colormap */
- a.background_pixel = QColormap::instance().pixel( backgroundColor() );
- a.border_pixel = QColormap::instance().pixel( Qt::black );
- Window p = RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
- if ( parentWidget() )
- p = parentWidget()->winId();
+ if ( isVisible() )
+ show();
- Window w;
- /* if ( type == Type2D ) // creating simple X window for 2d
- {
- unsigned long xbackground =
- BlackPixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
- unsigned long xforeground =
- WhitePixel( QX11Info::display(), DefaultScreen( QX11Info::display() ) );
+ if ( pVisualInfo )
+ XFree( (char *)pVisualInfo );
- w = XCreateSimpleWindow ( QX11Info::display(), p, x(), y(), width(),
- height(), 0, xforeground, xbackground );
- }
- else if ( type == Type3D )
- {
- w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(),
- 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
- CWBackPixel | CWBorderPixel | CWColormap, &a );
- }
- else
- return;*/
- w = XCreateWindow( QX11Info::display(), p, x(), y(), width(), height(),
- 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
- CWBackPixel | CWBorderPixel | CWColormap, &a );
-
- Window *cmw;
- Window *cmwret;
- int count;
- if ( XGetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), &cmwret, &count ) )
- {
- cmw = new Window[count+1];
- memcpy( (char*)cmw, (char*)cmwret, sizeof(Window) * count );
- XFree( (char*)cmwret );
- int i;
-
- for ( i = 0; i < count; i++ )
- {
- if ( cmw[i] == winId() ) /* replace old window */
- {
- cmw[i] = w;
- break;
- }
- }
-
- if ( i >= count ) /* append new window */
- cmw[count++] = w;
- }
- else
- {
- count = 1;
- cmw = new Window[count];
- cmw[0] = w;
- }
-
- /* Creating new window (with good VisualID) for this widget */
- create(w);
- XSetWMColormapWindows( QX11Info::display(), topLevelWidget()->winId(), cmw, count );
- delete[] cmw;
-
- if ( isVisible() )
- show();
-
- if ( pVisualInfo )
- {
- XFree( (char *)pVisualInfo );
- }
- XFlush( QX11Info::display() );
- }
+ XFlush( QX11Info::display() );
+ }
#endif
}
*/
void OCCViewer_ViewPort::setBackgroundColor( const QColor& color )
{
- QPalette pal = palette();
- pal.setColor( QPalette::Background, color );
- setPalette( pal );
- repaint();
- emit vpChangeBGColor( color );
+ QPalette pal = palette();
+ pal.setColor( QPalette::Background, color );
+ setPalette( pal );
+ repaint();
+ emit vpChangeBGColor( color );
}
/*!
*/
QColor OCCViewer_ViewPort::backgroundColor() const
{
- return palette().color( QPalette::Active, QPalette::Background );
+ return palette().color( QPalette::Active, QPalette::Background );
}
/*!
*/
bool OCCViewer_ViewPort::isSketchingEnabled() const
{
- return myEnableSketching;
+ return myEnableSketching;
}
/*!
*/
void OCCViewer_ViewPort::setSketchingEnabled( bool enable )
{
- myEnableSketching = enable;
+ myEnableSketching = enable;
}
/*!
*/
bool OCCViewer_ViewPort::isTransformEnabled() const
{
- return myEnableTransform;
+ return myEnableTransform;
}
/*!
*/
void OCCViewer_ViewPort::setTransformEnabled( bool enable )
{
- myEnableTransform = enable;
+ myEnableTransform = enable;
}
/*!
*/
void OCCViewer_ViewPort::mouseMoveEvent( QMouseEvent* e )
{
- emit vpMouseEvent( e );
+ emit vpMouseEvent( e );
}
/*!
*/
void OCCViewer_ViewPort::mouseReleaseEvent( QMouseEvent *e )
{
- emit vpMouseEvent( e );
+ emit vpMouseEvent( e );
}
/*!
*/
void OCCViewer_ViewPort::mouseDoubleClickEvent( QMouseEvent *e )
{
- emit vpMouseEvent( e );
+ emit vpMouseEvent( e );
}
/*!
*/
void OCCViewer_ViewPort::keyPressEvent( QKeyEvent *e )
{
- emit vpKeyEvent( e );
+ emit vpKeyEvent( e );
}
/*!
*/
void OCCViewer_ViewPort::keyReleaseEvent( QKeyEvent *e )
{
- emit vpKeyEvent( e );
+ emit vpKeyEvent( e );
}
/*!
*/
void OCCViewer_ViewPort::paintEvent( QPaintEvent* )
{
- if ( myPaintersRedrawing )
- {
- QPainter p( this );
- emit vpDrawExternal( &p );
- myPaintersRedrawing = false;
- }
+ if ( myPaintersRedrawing )
+ {
+ QPainter p( this );
+ emit vpDrawExternal( &p );
+ myPaintersRedrawing = false;
+ }
}
/*!
*/
void OCCViewer_ViewPort::redrawPainters()
{
- myPaintersRedrawing = true;
- repaint();
+ myPaintersRedrawing = true;
+ repaint();
}
/*!
{
}
+/*!
+ Get paint engine for the OpenGL viewer. [ virtual public ]
+*/
+QPaintEngine* OCCViewer_ViewPort::paintEngine() const
+{
+ return 0;
+}
+
/*!
Creates the popup. [ virtual protected ]
*/
/*void OCCViewer_ViewPort::onCreatePopup( QPopupMenu* popup )
{
- if ( popup )
- {
- QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this );
- a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) );
- connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor()));
- myPopupActions.append( a );
- a->addTo( popup );
- }
+ if ( popup )
+ {
+ QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this );
+ a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) );
+ connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor()));
+ myPopupActions.append( a );
+ a->addTo( popup );
+ }
}*/
/*!
*/
/*void OCCViewer_ViewPort::onDestroyPopup( QPopupMenu* popup )
{
- if ( popup )
- {
- for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() )
- a->removeFrom( popup );
- //while (!myPopupActions.isEmpty())
- // delete myPopupActions.takeFirst();
- myPopupActions.clear();
- }
+ if ( popup )
+ {
+ for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() )
+ a->removeFrom( popup );
+ //while (!myPopupActions.isEmpty())
+ // delete myPopupActions.takeFirst();
+ myPopupActions.clear();
+ }
}*/
+/*!
+ Performs synchronization of view parameters with the specified view.
+ Returns \c true if synchronization is done successfully or \c false otherwise.
+ Default implementation does nothing (return \c false)
+*/
+bool OCCViewer_ViewPort::synchronize( OCCViewer_ViewPort* )
+{
+ return false;
+}
+
/*!
Sets the background color with color selection dialog. [ virtual protected slot ]
*/
-void OCCViewer_ViewPort::onChangeBgColor()
+void OCCViewer_ViewPort::onChangeBackground()
{
- QColor selColor = QColorDialog::getColor ( backgroundColor(), this );
- if ( selColor.isValid() )
- setBackgroundColor( selColor );
+ QColor selColor = QColorDialog::getColor ( backgroundColor(), this );
+ if ( selColor.isValid() )
+ setBackgroundColor( selColor );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_VIEWPORT_H
#define OCCVIEWER_VIEWPORT_H
virtual ~OCCViewer_ViewPort();
public:
- void setSketchingEnabled( bool );
+ void setSketchingEnabled( bool );
bool isSketchingEnabled() const;
- void setTransformEnabled( bool );
+ void setTransformEnabled( bool );
bool isTransformEnabled() const;
virtual QColor backgroundColor() const;
virtual void setBackgroundColor( const QColor& );
- void redrawPainters();
+ void redrawPainters();
virtual void onUpdate();
+ virtual QPaintEngine* paintEngine() const;
+
protected:
-// enum ViewType { Type2D, Type3D };
- void selectVisualId();
+// enum ViewType { Type2D, Type3D };
+ void selectVisualId();
// EVENTS
virtual void paintEvent( QPaintEvent *);
- virtual void mouseMoveEvent( QMouseEvent *);
- virtual void mouseReleaseEvent( QMouseEvent *);
- virtual void mousePressEvent( QMouseEvent *);
- virtual void mouseDoubleClickEvent( QMouseEvent *);
+ virtual void mouseMoveEvent( QMouseEvent *);
+ virtual void mouseReleaseEvent( QMouseEvent *);
+ virtual void mousePressEvent( QMouseEvent *);
+ virtual void mouseDoubleClickEvent( QMouseEvent *);
virtual void keyPressEvent( QKeyEvent *);
virtual void keyReleaseEvent( QKeyEvent *);
// TO BE REDEFINED
- virtual void reset() = 0;
- virtual void pan( int, int ) = 0;
- virtual void setCenter( int, int ) = 0;
- virtual void fitRect( const QRect& ) = 0;
- virtual void zoom( int, int, int, int ) = 0;
- virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
+ virtual void reset() = 0;
+ virtual void pan( int, int ) = 0;
+ virtual void setCenter( int, int ) = 0;
+ virtual void fitRect( const QRect& ) = 0;
+ virtual void zoom( int, int, int, int ) = 0;
+ virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
// POPUP
// void onCreatePopup( QPopupMenu* );
// void onDestroyPopup( QPopupMenu* );
+public slots:
+ virtual bool synchronize( OCCViewer_ViewPort* );
+
protected slots:
- virtual void onChangeBgColor();
+ virtual void onChangeBackground();
signals:
- void vpKeyEvent( QKeyEvent* );
- void vpMouseEvent( QMouseEvent* );
- void vpDrawExternal( QPainter* );
+ void vpKeyEvent( QKeyEvent* );
+ void vpMouseEvent( QMouseEvent* );
+ void vpDrawExternal( QPainter* );
void vpChangeBGColor( QColor );
+ void vpTransformed( OCCViewer_ViewPort* );
private:
- void initialize();
- void cleanup();
+ void initialize();
+ void cleanup();
protected:
Handle(Aspect_Window) myWindow;
- bool myEnableSketching;
- bool myEnableTransform;
- bool myPaintersRedrawing; /* set to draw externally */
+ bool myEnableSketching;
+ bool myEnableTransform;
+ bool myPaintersRedrawing; /* set to draw externally */
QList<QtxAction*> myPopupActions;
-
+
private:
- static int nCounter; /* objects counter */
+ static int nCounter; /* objects counter */
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_ViewPort3d.h"
#include "OCCViewer_VService.h"
#include "OCCViewer_ViewWindow.h"
#include "OCCViewer_ViewModel.h"
+#include <Basics_OCCTVersion.hxx>
+
#include <SUIT_ViewManager.h>
+#include <SUIT_ViewModel.h>
#include <QColor>
+#include <QFileInfo>
+#include <QString>
#include <QRect>
#include <QPaintEvent>
#include <QResizeEvent>
#include <V3d_PerspectiveView.hxx>
#include <V3d_OrthographicView.hxx>
+#include "utilities.h"
+
#if defined WNT
#include <WNT_Window.hxx>
#else
static int sy = 0;
static Standard_Boolean zRotation = Standard_False;
+//#include <Standard_Version.hxx>
+
/*!
- Constructor
+ Constructor
*/
OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView type )
-: OCCViewer_ViewPort( parent ),
-myScale( 1.0 ),
-myDegenerated( true ),
-myAnimate( false ),
-myBusy( true )
+ : OCCViewer_ViewPort( parent ),
+ myScale( 1.0 ),
+ myDegenerated( true ),
+ myAnimate( false ),
+ myBusy( true ),
+ myIsAdvancedZoomingEnabled( false )
{
- selectVisualId();
+ // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
+ //selectVisualId();
if ( type == V3d_ORTHOGRAPHIC ) {
myOrthoView = new V3d_OrthographicView( viewer );
}
if ( myDegenerated )
activeView()->SetDegenerateModeOn();
+ setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
}
/*!
- Destructor
+ Destructor
*/
OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
{
}
/*!
- Activates the desired 'type' of view in the viewer
- ( view of 'type' is created if it doesn't exist ). [ public ]
+ Activates the desired 'type' of view in the viewer
+ ( view of 'type' is created if it doesn't exist ). [ public ]
*/
/*void OCCViewer_ViewPort3d::setActive( V3d_TypeOfView type )
{
- if ( activeView().IsNull() )
- return;
+ if ( activeView().IsNull() )
+ return;
- if ( activeView()->Type() != type )
- {
- if ( type == V3d_ORTHOGRAPHIC )
- setView( myOrthoView );
- if ( type == V3d_PERSPECTIVE )
- setView( myPerspView );
- }
+ if ( activeView()->Type() != type )
+ {
+ if ( type == V3d_ORTHOGRAPHIC )
+ setView( myOrthoView );
+ if ( type == V3d_PERSPECTIVE )
+ setView( myPerspView );
+ }
}*/
/*!
- Maps CasCade 'view' to this viewport. [ private ]
+ Maps CasCade 'view' to this viewport. [ private ]
*/
bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
{
if ( !setWindow( view ) )
return false;
- if ( !mapped( view ) )
- {
- view->SetWindow( myWindow );
- if ( view != activeView() )
- view->View()->Deactivate();
- }
+ if ( !mapped( view ) ) {
+ view->SetWindow( myWindow );
+ if ( view != activeView() )
+ view->View()->Deactivate();
+ }
/* create static trihedron (16551: EDF PAL 501) */
- OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget() );
- if ( aVW ){
+ OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
+ if ( aVW ) {
OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
view->ZBufferTriedronSetup();
return true;
}
+
+
/*!
- Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
+ Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
*/
Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view )
{
if ( view == activeView() || !mapView( view ) )
return activeView();
- /* activate the new view*/
+ /* activate the new view*/
Handle( V3d_View ) oldView = activeView();
- if ( !oldView.IsNull() )
- {
- oldView->View()->Deactivate();
- view->SetBackgroundColor( oldView->BackgroundColor() );
- }
+ if ( !oldView.IsNull() ) {
+ if (oldView->View()->IsDefined())
+ oldView->View()->Deactivate();
+ view->SetBackgroundColor( oldView->BackgroundColor() );
+ }
+
if ( myDegenerated )
view->SetDegenerateModeOn();
else
view->View()->Activate();
activeView() = view;
- return oldView;
+ return oldView;
}
/*!
- Returns CasCade 3D view. [ public ]
+ Returns CasCade 3D view. [ public ]
*/
Handle(V3d_View) OCCViewer_ViewPort3d::getView() const
{
- return activeView();
+ return activeView();
}
/*!
- Returns CasCade 3D viewer [ public ]
+ Returns CasCade 3D viewer [ public ]
*/
Handle(V3d_Viewer) OCCViewer_ViewPort3d::getViewer() const
{
- Handle(V3d_Viewer) viewer;
- if ( !activeView().IsNull() )
+ Handle(V3d_Viewer) viewer;
+ if ( !activeView().IsNull() )
viewer = activeView()->Viewer();
- return viewer;
+ return viewer;
}
/*!
- Syncronizes visual state of this viewport with 'ref'
- ( scale, projection, eye etc ) Returns 'true' if copied OK,
- 'false' otherwise. [ virtual public ]
+ Syncronizes visual state of this viewport with 'ref'
+ ( scale, projection, eye etc ) Returns 'true' if copied OK,
+ 'false' otherwise. [ virtual public ]
*/
bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
{
Handle(V3d_View) tgtView = getView();
/* Syncronize view types */
-/* if ( tgtView->Type() != refView->Type() )
- {
- setActive( refView->Type() );
- tgtView = getView();
- }*/
+ /* if ( tgtView->Type() != refView->Type() )
+ {
+ setActive( refView->Type() );
+ tgtView = getView();
+ }*/
/* The following params are copied:
- view type( ortho/persp )
/* perspective */
if ( refView->Type() == V3d_PERSPECTIVE )
- tgtView->SetFocale( refView->Focale() );
+ tgtView->SetFocale( refView->Focale() );
/* copy params */
Standard_Real x, y, z;
}
/*!
- Returns Z-size of this view. [ public ]
+ Returns Z-size of this view. [ public ]
*/
double OCCViewer_ViewPort3d::getZSize() const
{
}
/*!
- Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
+ Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
*/
void OCCViewer_ViewPort3d::setZSize( double zsize )
{
myActiveView->SetZSize( zsize );
-/* if ( !myOrthoView.IsNull() )
+ /* if ( !myOrthoView.IsNull() )
myOrthoView->SetZSize( zsize );
- if ( !myPerspView.IsNull() )
+ if ( !myPerspView.IsNull() )
myPerspView->SetZSize( zsize );*/
}
/*!
- Returns the background color [ virtual public ]
+ Get axial scale to the view
+*/
+void OCCViewer_ViewPort3d::getAxialScale( double& xScale, double& yScale, double& zScale )
+{
+ xScale = yScale = zScale = 1.;
+
+ if ( !activeView().IsNull() )
+ activeView()->AxialScale( xScale, yScale, zScale );
+}
+
+/*!
+ Returns the background color [ virtual public ] [ obsolete ]
*/
QColor OCCViewer_ViewPort3d::backgroundColor() const
{
- if ( !activeView().IsNull() )
- {
- Standard_Real aRed, aGreen, aBlue;
- activeView()->BackgroundColor( Quantity_TOC_RGB, aRed, aGreen, aBlue );
- int red = (int) (aRed * 255);
- int green = (int) (aGreen * 255);
- int blue = (int) (aBlue * 255);
- return QColor( red, green, blue );
- }
- return OCCViewer_ViewPort::backgroundColor();
+ return background().color();
}
/*!
- Sets the background color [ virtual public ]
+ Sets the background color [ virtual public ] [ obsolete ]
*/
void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
{
- if ( !activeView().IsNull() )
- {
- activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
- color.green()/255., color.blue()/255.);
- activeView()->Update();
- emit vpChangeBGColor( color );
+ Qtx::BackgroundData bg = background();
+ bg.setColor( color );
+ setBackground( bg );
+}
+
+/*!
+ Returns the background data
+*/
+Qtx::BackgroundData OCCViewer_ViewPort3d::background() const
+{
+ return myBackground;
+}
+
+/*!
+ Sets the background data
+*/
+void OCCViewer_ViewPort3d::setBackground( const Qtx::BackgroundData& bgData )
+{
+ if ( bgData.isValid() ) {
+ myBackground = bgData;
+ updateBackground();
+ emit vpChangeBackground( myBackground );
+ }
+}
+
+void OCCViewer_ViewPort3d::updateBackground()
+{
+ if ( activeView().IsNull() ) return;
+ if ( !myBackground.isValid() ) return;
+
+ // VSR: Important note on below code.
+ // In OCCT (in version 6.5.2), things about the background drawing
+ // are not straightforward and not clearly understandable:
+ // - Horizontal gradient is drawn vertically (!), well ok, from top side to bottom one.
+ // - Vertical gradient is drawn horizontally (!), from right side to left one (!!!).
+ // - First and second diagonal gradients are confused.
+ // - Image texture, once set, can not be removed (!).
+ // - Texture image fill mode Aspect_FM_NONE is not taken into account (and means the same
+ // as Aspect_FM_CENTERED).
+ // - The only way to cancel gradient background (and get back to single colored) is to
+ // set gradient background style to Aspect_GFM_NONE while passing two colors is also needed
+ // (see V3d_View::SetBgGradientColors() function).
+ // - Also, it is impossible to draw texture image above the gradiented background (only above
+ // single-colored).
+ // In OCCT 6.5.3 all above mentioned problems are fixed; so, above comment should be removed as soon
+ // as SALOME is migrated to OCCT 6.5.3. The same concerns #ifdef statements in the below code
+ switch ( myBackground.mode() ) {
+ case Qtx::ColorBackground:
+ {
+ QColor c = myBackground.color();
+ if ( c.isValid() ) {
+ // Unset texture should be done here
+ // ...
+ Quantity_Color qCol( c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB );
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+ activeView()->SetBgGradientStyle( Aspect_GFM_NONE ); // cancel gradient background
+ activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
+#else
+ // cancel gradient background (in OCC before v6.5.3 the only way to do this is to set it to NONE type passing arbitrary colors as parameters)
+ activeView()->SetBgGradientColors( qCol, qCol, Aspect_GFM_NONE );
+#endif
+ // then change background color
+ activeView()->SetBackgroundColor( qCol );
+ // update viewer
+ activeView()->Update();
+ }
+ break;
+ }
+ case Qtx::SimpleGradientBackground:
+ {
+ QColor c1, c2;
+ int type = myBackground.gradient( c1, c2 );
+ if ( c1.isValid() && type >= OCCViewer_Viewer::HorizontalGradient && type <= OCCViewer_Viewer::LastGradient ) {
+ // Unset texture should be done here
+ // ...
+ // Get colors and set-up gradiented background
+ if ( !c2.isValid() ) c2 = c1;
+ Quantity_Color qCol1( c1.red()/255., c1.green()/255., c1.blue()/255., Quantity_TOC_RGB );
+ Quantity_Color qCol2( c2.red()/255., c2.green()/255., c2.blue()/255., Quantity_TOC_RGB );
+ activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
+ switch ( type ) {
+ case OCCViewer_Viewer::HorizontalGradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
+#else
+ // in OCCT before v6.5.3, to draw horizontal gradient it's necessary to use Aspect_GFM_VER type
+ // and interchange the colors
+ activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_VER, Standard_True );
+#endif
+ break;
+ case OCCViewer_Viewer::VerticalGradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_VER, Standard_True );
+#else
+ // in OCCT before v6.5.3, to draw vertical gradient it's necessary to use Aspect_GFM_HOR type
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
+#endif
+ break;
+ case OCCViewer_Viewer::Diagonal1Gradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
+#else
+ // in OCCT before v6.5.3, to draw 1st dialognal gradient it's necessary to use Aspect_GFM_DIAG2 type
+ // and interchange the colors
+ activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_DIAG2, Standard_True );
+#endif
+ break;
+ case OCCViewer_Viewer::Diagonal2Gradient:
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG2, Standard_True );
+#else
+ // in OCCT before v6.5.3, to draw 2nd dialognal gradient it's necessary to use Aspect_GFM_DIAG1 type
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
+#endif
+ break;
+ case OCCViewer_Viewer::Corner1Gradient:
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER1, Standard_True );
+ break;
+ case OCCViewer_Viewer::Corner2Gradient:
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER2, Standard_True );
+ break;
+ case OCCViewer_Viewer::Corner3Gradient:
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER3, Standard_True );
+ break;
+ case OCCViewer_Viewer::Corner4Gradient:
+ activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER4, Standard_True );
+ break;
+ default:
+ break;
}
+ }
+ break;
+ }
+ case Qtx::CustomGradientBackground:
+ {
+ // NOT IMPLEMENTED YET
+ break;
+ }
+ default:
+ break;
+ }
+#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
+ // VSR: In OCCT before v6.5.3 below code can't be used because of very ugly bug - it has been impossible to
+ // clear the background texture image as soon as it was once set to the viewer.
+ if ( myBackground.isTextureShown() ) {
+ QString fileName;
+ int textureMode = myBackground.texture( fileName );
+ QFileInfo fi( fileName );
+ if ( !fileName.isEmpty() && fi.exists() ) {
+ // set texture image: file name and fill mode
+ switch ( textureMode ) {
+ case Qtx::CenterTexture:
+ activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
+ break;
+ case Qtx::TileTexture:
+ activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
+ break;
+ case Qtx::StretchTexture:
+ activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
+ break;
+ default:
+ break;
+ }
+ activeView()->Update();
+ }
+ }
+#endif
}
/*!
*/
void OCCViewer_ViewPort3d::setAnimationMode(bool theDegenerated)
{
- if ( !activeView().IsNull() )
- {
+ if ( !activeView().IsNull() ) {
myAnimate = theDegenerated;
activeView()->SetAnimationMode(true, theDegenerated);
}
}
/*!
- Updates the active viewport. [ virtual public ]
+ Updates the active viewport. [ virtual public ]
*/
void OCCViewer_ViewPort3d::onUpdate()
{
}
/*!
- Called at 'window fit' transformation. [ virtual protected ]
+ Called at 'window fit' transformation. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
{
- if ( !activeView().IsNull() )
- activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
+ if ( !activeView().IsNull() ) {
+ activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
+ emit vpTransformed( this );
+ }
}
/*!
- Called at 'zoom' transformation. [ virtual protected ]
+ Inits 'zoom' transformation. [ protected ]
+*/
+void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
+{
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+ if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
+ activeView()->StartZoomAtPoint( x, y );
+#endif
+}
+
+/*!
+ Called at 'zoom' transformation. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
{
// as OCCT respects a sign of only dx,
// but we want both signes to be taken into account
//activeView()->Zoom( x0, y0, x, y );
- activeView()->Zoom( x0 + y0, 0, x + y, 0 );
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+ if ( isAdvancedZoomingEnabled() )
+ activeView()->ZoomAtPoint( x0, y0, x, y );
+ else
+#endif
+ activeView()->Zoom( x0 + y0, 0, x + y, 0 );
+ emit vpTransformed( this );
}
}
/*!
- Centers the viewport. [ virtual protected ]
+ Centers the viewport. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::setCenter( int x, int y )
{
- if ( !activeView().IsNull() )
- activeView()->Place( x, y, myScale );
+ if ( !activeView().IsNull() ) {
+ activeView()->Place( x, y, myScale );
+ emit vpTransformed( this );
+ }
}
/*!
- Called at 'pan' transformation. [ virtual protected ]
+ Called at 'pan' transformation. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::pan( int dx, int dy )
{
- if ( !activeView().IsNull() )
- activeView()->Pan( dx, dy, 1.0 );
+ if ( !activeView().IsNull() ) {
+ activeView()->Pan( dx, dy, 1.0 );
+ emit vpTransformed( this );
+ }
}
/*!
- Inits 'rotation' transformation. [ protected ]
+ Inits 'rotation' transformation. [ protected ]
*/
-void OCCViewer_ViewPort3d::startRotation( int x, int y,
- int theRotationPointType,
- const gp_Pnt& theSelectedPoint )
+void OCCViewer_ViewPort3d::startRotation( int x, int y,
+ int theRotationPointType,
+ const gp_Pnt& theSelectedPoint )
{
- if ( !activeView().IsNull() )
- {
- myDegenerated = activeView()->DegenerateModeIsOn();
- activeView()->SetDegenerateModeOn();
- if (myAnimate) activeView()->SetAnimationModeOn();
+ if ( !activeView().IsNull() ) {
+ myDegenerated = activeView()->DegenerateModeIsOn();
+ activeView()->SetDegenerateModeOn();
+ if (myAnimate) activeView()->SetAnimationModeOn();
- //double gx, gy, gz;
- //double gx = activeView()->gx;
- //activeView()->Gravity(gx,gy,gz);
+ //double gx, gy, gz;
+ //double gx = activeView()->gx;
+ //activeView()->Gravity(gx,gy,gz);
- switch ( theRotationPointType ) {
- case OCCViewer_ViewWindow::GRAVITY:
- activeView()->StartRotation( x, y, 0.45 );
- break;
- case OCCViewer_ViewWindow::SELECTED:
- sx = x; sy = y;
-
- double X,Y;
- activeView()->Size(X,Y);
- rx = Standard_Real(activeView()->Convert(X));
- ry = Standard_Real(activeView()->Convert(Y));
-
- activeView()->Rotate( 0., 0., 0.,
- theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
- Standard_True );
-
- Quantity_Ratio zRotationThreshold;
- zRotation = Standard_False;
- zRotationThreshold = 0.45;
- if( zRotationThreshold > 0. ) {
- Standard_Real dx = Abs(sx - rx/2.);
- Standard_Real dy = Abs(sy - ry/2.);
- Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
- if( dx > dd || dy > dd ) zRotation = Standard_True;
- }
- break;
- default:
- break;
+ switch ( theRotationPointType ) {
+ case OCCViewer_ViewWindow::GRAVITY:
+ activeView()->StartRotation( x, y, 0.45 );
+ break;
+ case OCCViewer_ViewWindow::SELECTED:
+ sx = x; sy = y;
+
+ double X,Y;
+ activeView()->Size(X,Y);
+ rx = Standard_Real(activeView()->Convert(X));
+ ry = Standard_Real(activeView()->Convert(Y));
+
+ activeView()->Rotate( 0., 0., 0.,
+ theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
+ Standard_True );
+
+ Quantity_Ratio zRotationThreshold;
+ zRotation = Standard_False;
+ zRotationThreshold = 0.45;
+ if( zRotationThreshold > 0. ) {
+ Standard_Real dx = Abs(sx - rx/2.);
+ Standard_Real dy = Abs(sy - ry/2.);
+ Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
+ if( dx > dd || dy > dd ) zRotation = Standard_True;
}
+ break;
+ default:
+ break;
}
+ activeView()->DepthFitAll();
+ }
}
/*!
- Rotates the viewport. [ protected ]
+ Rotates the viewport. [ protected ]
*/
-void OCCViewer_ViewPort3d::rotate( int x, int y,
- int theRotationPointType,
- const gp_Pnt& theSelectedPoint )
+void OCCViewer_ViewPort3d::rotate( int x, int y,
+ int theRotationPointType,
+ const gp_Pnt& theSelectedPoint )
{
if ( !activeView().IsNull() ) {
switch ( theRotationPointType ) {
case OCCViewer_ViewWindow::SELECTED:
double dx, dy, dz;
if( zRotation ) {
- dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) -
- atan2(sx-rx/2.,ry/2.-sy);
- dx = dy = 0.;
+ dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) -
+ atan2(sx-rx/2.,ry/2.-sy);
+ dx = dy = 0.;
}
else {
- dx = (Standard_Real(x) - sx) * Standard_PI/rx;
- dy = (sy - Standard_Real(y)) * Standard_PI/ry;
- dz = 0.;
+ dx = (Standard_Real(x) - sx) * M_PI/rx;
+ dy = (sy - Standard_Real(y)) * M_PI/ry;
+ dz = 0.;
}
-
- activeView()->Rotate( dx, dy, dz,
- theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
- Standard_False );
+
+ activeView()->Rotate( dx, dy, dz,
+ theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
+ Standard_False );
break;
default:
break;
}
+ emit vpTransformed( this );
}
// setZSize( getZSize() );
}
/*!
- Resets the viewport after 'rotation'. [ protected ]
+ Resets the viewport after 'rotation'. [ protected ]
*/
void OCCViewer_ViewPort3d::endRotation()
{
- if ( !activeView().IsNull() )
- {
- if (myAnimate) activeView()->SetAnimationModeOff();
- if ( !myDegenerated )
- activeView()->SetDegenerateModeOff();
- activeView()->ZFitAll(1.);
- activeView()->SetZSize(0.);
- activeView()->Update();
- }
+ if ( !activeView().IsNull() ) {
+ if (myAnimate) activeView()->SetAnimationModeOff();
+ if ( !myDegenerated )
+ activeView()->SetDegenerateModeOff();
+ activeView()->ZFitAll(1.);
+ activeView()->SetZSize(0.);
+ activeView()->Update();
+ emit vpTransformed( this );
+ }
}
/*!
- Repaints the viewport. [ virtual protected ]
+ Repaints the viewport. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
{
#ifndef WNT
- /* X11 : map before show doesn't work */
- if ( !mapped( activeView() ) )
- mapView( activeView() );
+ /* X11 : map before show doesn't work */
+ if ( !mapped( activeView() ) )
+ mapView( activeView() );
#endif
- if ( !myWindow.IsNull() )
- {
- QApplication::syncX();
- QRect rc = e->rect();
- if ( !myPaintersRedrawing )
- activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
- }
- OCCViewer_ViewPort::paintEvent( e );
- myBusy = false;
+ if ( !myWindow.IsNull() ) {
+ QApplication::syncX();
+ QRect rc = e->rect();
+ if ( !myPaintersRedrawing )
+ activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
+ }
+ OCCViewer_ViewPort::paintEvent( e );
+ myBusy = false;
}
/*!
- Resizes the viewport. [ virtual protected ]
+ Resizes the viewport. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
{
#ifdef WNT
- /* Win32 : map before first show to avoid flicker */
- if ( !mapped( activeView() ) )
- mapView( activeView() );
+ /* Win32 : map before first show to avoid flicker */
+ if ( !mapped( activeView() ) )
+ mapView( activeView() );
#endif
- QApplication::syncX();
- if ( !activeView().IsNull() )
- activeView()->MustBeResized();
+ QApplication::syncX();
+ if ( !activeView().IsNull() )
+ activeView()->MustBeResized();
}
/*!
- Fits all objects in view. [ virtual protected ]
+ Fits all objects in view. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
{
if ( activeView().IsNull() )
return;
-
if ( keepScale )
myScale = activeView()->Scale();
Standard_Real margin = 0.01;
activeView()->FitAll( margin, withZ, upd );
activeView()->SetZSize(0.);
+ emit vpTransformed( this );
}
/*!
- Resets the view. [ virtual protected ]
+ Resets the view. [ virtual protected ]
*/
void OCCViewer_ViewPort3d::reset()
{
-// double zsize = getZSize();
- if ( !activeView().IsNull() )
- activeView()->Reset();
-// setZSize( zsize );
+ // double zsize = getZSize();
+ if ( !activeView().IsNull() ) {
+ activeView()->Reset();
+ emit vpTransformed( this );
+ // setZSize( zsize );
+ }
}
/*!
- Passed the handle of native window of the component to CASCADE view. [ private ]
+ Rotate the view in the view plane (orthogonal to the view vector)
+*/
+void OCCViewer_ViewPort3d::rotateXY( double degrees )
+{
+ if ( activeView().IsNull() )
+ return;
+
+ int x = width()/2, y = height()/2;
+ double X, Y, Z;
+ activeView()->Convert( x, y, X, Y, Z );
+ activeView()->Rotate( 0, 0, degrees * M_PI / 180., X, Y, Z );
+ emit vpTransformed( this );
+}
+
+/*!
+ Set axial scale to the view
+*/
+void OCCViewer_ViewPort3d::setAxialScale( double xScale, double yScale, double zScale )
+{
+ if ( activeView().IsNull() )
+ return;
+
+ activeView()->SetAxialScale( xScale, yScale, zScale );
+ emit vpTransformed( this );
+}
+
+/*!
+ Passed the handle of native window of the component to CASCADE view. [ private ]
*/
bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view )
{
- if ( !myWindow.IsNull() )
- return true;
+ if ( !myWindow.IsNull() )
+ return true;
- if ( view.IsNull() )
- return false;
+ if ( view.IsNull() )
+ return false;
+
+ int hwnd = (int)winId();
+ if ( !hwnd )
+ return false;
- int hwnd = (int)winId();
- if ( !hwnd )
- return false;
+ /* set this widget as the drawing window */
+ short lo = (short)hwnd;
+ short hi = (short)( hwnd >> 16 );
- /* set this widget as the drawing window */
- short lo = (short)hwnd;
- short hi = (short)( hwnd >> 16 );
- OCCViewer_VService::SetWindow( view, (int)hi, (int)lo, Xw_WQ_SAMEQUALITY );
- myWindow = view->Window();
- return !myWindow.IsNull();
+ attachWindow( view, OCCViewer_VService::CreateWindow( view, (int)hi, (int)lo, Xw_WQ_SAMEQUALITY ) );
+
+ myWindow = view->Window();
+ return !myWindow.IsNull();
+}
+
+void OCCViewer_ViewPort3d::attachWindow( const Handle(V3d_View)& view,
+ const Handle(Aspect_Window)& window)
+{
+ if (!view.IsNull()) {
+ view->SetWindow( window );
+ updateBackground();
+ }
}
/*!
- Returns the current active view. [ private ]
+ Returns the current active view. [ private ]
*/
Handle(V3d_View) OCCViewer_ViewPort3d::activeView() const
{
- return myActiveView;
+ return myActiveView;
}
/*!
- Returns the current inactive view [ private ]
+ Returns the current inactive view [ private ]
*/
/*Handle(V3d_View) OCCViewer_ViewPort3d::inactiveView() const
-{
- return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
-}*/
+ {
+ return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
+ }*/
/*!
- Returns 'true' if the given view is mapped to window. [ private ]
+ Returns 'true' if the given view is mapped to window. [ private ]
*/
bool OCCViewer_ViewPort3d::mapped( const Handle(V3d_View)& view ) const
{
- return ( !view.IsNull() && view->View()->IsDefined() );
+ return ( !view.IsNull() && view->View()->IsDefined() );
+}
+
+/*!
+ Performs synchronization of view parameters with the specified view.
+ Returns \c true if synchronization is done successfully or \c false otherwise.
+ Default implementation does nothing (return \c false)
+*/
+bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view )
+{
+ bool ok = false;
+ OCCViewer_ViewPort3d* vp3d = qobject_cast<OCCViewer_ViewPort3d*>( view );
+ if ( vp3d ) {
+ bool blocked = blockSignals( false );
+ Handle(V3d_View) aView3d = getView();
+ Handle(V3d_View) aRefView3d = vp3d->getView();
+ aView3d->SetImmediateUpdate( Standard_False );
+ aView3d->SetViewMapping( aRefView3d->ViewMapping() );
+ aView3d->SetViewOrientation( aRefView3d->ViewOrientation() );
+ aView3d->ZFitAll();
+ aView3d->SetImmediateUpdate( Standard_True );
+ aView3d->Update();
+ blockSignals( blocked );
+ ok = true;
+ }
+ return ok;
+}
+
+/*
+ * Show/Hide static triedron
+ */
+void OCCViewer_ViewPort3d::updateStaticTriedronVisibility() {
+ OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
+ if ( aVW ) {
+ OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
+ Handle(V3d_View) aView = activeView();
+ if ( aViewModel ){
+ if(aViewModel->isStaticTrihedronDisplayed()) {
+ aView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
+ } else {
+ aView->TriedronErase();
+ }
+ aView->Update();
+ }
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_VIEWPORT3D_H
#define OCCVIEWER_VIEWPORT3D_H
#include "OCCViewer_ViewPort.h"
+#include "Qtx.h"
#include <V3d_View.hxx>
class QColor;
+class QString;
class QRect;
class Handle(V3d_Viewer);
virtual ~OCCViewer_ViewPort3d();
public:
- Handle(V3d_View) getView() const;
- Handle(V3d_View) setView( const Handle(V3d_View)& );
- Handle(V3d_Viewer) getViewer() const;
+ Handle(V3d_View) getView() const;
+ Handle(V3d_View) setView( const Handle(V3d_View)& );
+ Handle(V3d_Viewer) getViewer() const;
+
+ void setAnimationMode(bool theDegenerated);
+
+ virtual void setBackgroundColor( const QColor& color); // obsolete
+ virtual QColor backgroundColor() const; // obsolete
+ void setBackground( const Qtx::BackgroundData& color);
+ Qtx::BackgroundData background() const;
- void setAnimationMode(bool theDegenerated);
+ virtual int getBgImgHeight(){return myBgImgHeight; };
+ virtual int getBgImgWidth() {return myBgImgWidth; };
- virtual void setBackgroundColor( const QColor& color);
- virtual QColor backgroundColor() const;
+ virtual void updateStaticTriedronVisibility();
// void setActive( V3d_TypeOfView );
- virtual bool syncronize( const OCCViewer_ViewPort3d* );
+ virtual bool syncronize( const OCCViewer_ViewPort3d* );
- double getZSize() const;
- void setZSize( double );
+ double getZSize() const;
+ void setZSize( double );
- virtual void onUpdate();
+ void getAxialScale( double&, double&, double& );
+
+ virtual void onUpdate();
// TRANSFORMATIONS
- virtual void reset();
- virtual void pan( int , int );
- virtual void setCenter( int , int );
- virtual void fitRect( const QRect& );
- virtual void zoom( int, int, int, int );
- virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
-
- void startRotation( int, int, int, const gp_Pnt& );
- void rotate( int, int, int, const gp_Pnt& );
- void endRotation();
+ virtual void reset();
+ virtual void pan( int , int );
+ virtual void setCenter( int , int );
+ virtual void fitRect( const QRect& );
+ virtual void startZoomAtPoint( int, int );
+ virtual void zoom( int, int, int, int );
+ virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
+ virtual void rotateXY( double );
+ virtual void setAxialScale( double, double, double );
+
+ virtual void startRotation( int, int, int, const gp_Pnt& );
+ virtual void rotate( int, int, int, const gp_Pnt& );
+ virtual void endRotation();
bool isBusy() {return myBusy;} // check that View Port is fully initialized
+ void setAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
+ bool isAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
+
+signals:
+ void vpChangeBackground( const Qtx::BackgroundData& );
+
+public slots:
+ virtual bool synchronize( OCCViewer_ViewPort* );
+
protected:
// EVENTS
- virtual void paintEvent( QPaintEvent* );
+ virtual void paintEvent( QPaintEvent* );
virtual void resizeEvent( QResizeEvent* );
-private:
- Handle(V3d_View) activeView() const;
- Handle(V3d_View) inactiveView() const;
- bool mapView( const Handle(V3d_View)& );
- bool setWindow( const Handle(V3d_View)& );
- bool mapped( const Handle(V3d_View)& ) const;
+ // initialization
+ virtual void attachWindow( const Handle(V3d_View)&, const Handle(Aspect_Window)& );
private:
- Handle(V3d_View) myOrthoView;
- Handle(V3d_View) myPerspView;
- Handle(V3d_View) myActiveView;
- bool myDegenerated;
+ Handle(V3d_View) activeView() const;
+ Handle(V3d_View) inactiveView() const;
+ bool mapView( const Handle(V3d_View)& );
+ bool setWindow( const Handle(V3d_View)& );
+ bool mapped( const Handle(V3d_View)& ) const;
+ void updateBackground();
+
+private:
+ Handle(V3d_View) myOrthoView;
+ Handle(V3d_View) myPerspView;
+ Handle(V3d_View) myActiveView;
+ bool myDegenerated;
bool myAnimate;
bool myBusy;
- double myScale;
+ double myScale;
+ bool myIsAdvancedZoomingEnabled;
+ Qtx::BackgroundData myBackground;
+ int myBgImgHeight;
+ int myBgImgWidth;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OCCViewer_ViewSketcher.h"
#include "OCCViewer_ViewWindow.h"
#include "OCCViewer_ViewPort3d.h"
myResult = Accept;
QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
e->globalPos(), e->button(),
- e->buttons(), e->modifiers() ) );
+ e->buttons(), e->modifiers() ) );
}
}
myResult = Reject;
QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(),
e->globalPos(), e->button(),
- e->buttons(), e->modifiers() ) );
+ e->buttons(), e->modifiers() ) );
}
else if ( e->type() == QEvent::MouseButtonRelease && ( e->button() & myAddButton ) )
{
}
bool OCCViewer_PolygonSketcher::isIntersect( const QPoint& aStart1, const QPoint& anEnd1,
- const QPoint& aStart2, const QPoint& anEnd2 ) const
+ const QPoint& aStart2, const QPoint& anEnd2 ) const
{
if ( ( aStart1 == aStart2 && anEnd1 == anEnd2 ) ||
( aStart1 == anEnd2 && anEnd1 == aStart2 ) )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_VIEWSKETCHER_H
#define OCCVIEWER_VIEWSKETCHER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : OCCViewer_ViewWindow.cxx
// Author :
-//
+
#include "OCCViewer_ViewWindow.h"
#include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewPort3d.h"
#include "OCCViewer_ClippingDlg.h"
#include "OCCViewer_SetRotationPointDlg.h"
#include "OCCViewer_AxialScaleDlg.h"
+#include "OCCViewer_CubeAxesDlg.h"
+
+#include <Basics_OCCTVersion.hxx>
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
#include <SUIT_Tools.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_MessageBox.h>
+#include <SUIT_Application.h>
#include <QtxActionToolMgr.h>
#include <QtxMultiAction.h>
#include <QtxRubberBand.h>
+#include <OpenGLUtils_FrameBuffer.h>
+
#include <QPainter>
#include <QTime>
#include <QImage>
+#include <QKeyEvent>
#include <QMouseEvent>
#include <QApplication>
-
-#include <V3d_Plane.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Pln.hxx>
-#include <TColgp_Array1OfPnt2d.hxx>
+#include <QMenu>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_Shape.hxx>
#include <BRep_Tool.hxx>
+#include <BRepBndLib.hxx>
#include <TopoDS.hxx>
-#include <BRepBndLib.hxx>
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
-#include <Visual3d_View.hxx>
#include <Graphic3d_MapOfStructure.hxx>
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_ExportFormat.hxx>
+#include <Visual3d_View.hxx>
+#include <V3d_Plane.hxx>
+#include <V3d_Light.hxx>
+
+#include <gp_Dir.hxx>
+#include <gp_Pln.hxx>
+#include <TColgp_Array1OfPnt2d.hxx>
+
+#include <Standard_Version.hxx>
+
+#include "utilities.h"
+
+// // OpenCV includes
+// #include <cv.h>
+// #include <highgui.h>
+
static QEvent* l_mbPressEvent = 0;
#ifdef WIN32
# include <QWindowsStyle>
#endif
+#include <GL/gl.h>
+
const char* imageZoomCursor[] = {
"32 32 3 1",
". c None",
\param theModel OCC 3D viewer
*/
OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop* theDesktop,
- OCCViewer_Viewer* theModel )
+ OCCViewer_Viewer* theModel )
: SUIT_ViewWindow( theDesktop )
{
myModel = theModel;
myRestoreFlag = 0;
myEnableDrawMode = false;
+ myDrawRect=false;
updateEnabledDrawMode();
myClippingDlg = 0;
myScalingDlg = 0;
mySetRotationPointDlg = 0;
myRectBand = 0;
+
+ IsSketcherStyle = false;
mypSketcher = 0;
myCurSketch = -1;
+ my2dMode = No2dMode;
+
+ myInteractionStyle = SUIT_ViewModel::STANDARD;
+
+ clearViewAspects();
+
}
/*!
void OCCViewer_ViewWindow::initLayout()
{
myViewPort = new OCCViewer_ViewPort3d( this, myModel->getViewer3d(), V3d_ORTHOGRAPHIC );
- myViewPort->setBackgroundColor(Qt::black);
myViewPort->installEventFilter(this);
setCentralWidget(myViewPort);
myOperation = NOTHING;
createActions();
createToolBar();
+
+ switch (my2dMode) {
+ case XYPlane:
+ onTopView();
+ break;
+ case XZPlane:
+ onLeftView();
+ break;
+ case YZPlane:
+ onFrontView();
+ break;
+ }
+
+ // Graduated axes dialog
+ QtxAction* anAction = dynamic_cast<QtxAction*>( toolMgr()->action( GraduatedAxesId ) );
+ myCubeAxesDlg = new OCCViewer_CubeAxesDlg( anAction, this, "OCCViewer_CubeAxesDlg" );
+ myCubeAxesDlg->initialize();
+}
+
+OCCViewer_ViewWindow* OCCViewer_ViewWindow::getView( const int mode ) const
+{
+ return mode == get2dMode() ? const_cast<OCCViewer_ViewWindow*>( this ) : 0;
}
/*!
\return type of the operation
*/
OCCViewer_ViewWindow::OperationType
-OCCViewer_ViewWindow::getButtonState( QMouseEvent* theEvent )
+OCCViewer_ViewWindow::getButtonState( QMouseEvent* theEvent, int theInteractionStyle )
{
OperationType aOp = NOTHING;
- if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ZOOM]) &&
- (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ZOOM]) )
+ SUIT_ViewModel::InteractionStyle aStyle = (SUIT_ViewModel::InteractionStyle)theInteractionStyle;
+ if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::ZOOM]) &&
+ (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::ZOOM]) )
aOp = ZOOMVIEW;
- else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::PAN]) &&
- (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::PAN]) )
+ else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::PAN]) &&
+ (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::PAN]) )
aOp = PANVIEW;
- else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ROTATE]) &&
- (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ROTATE]) )
+ else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::ROTATE]) &&
+ (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::ROTATE]) &&
+ (my2dMode == No2dMode))
aOp = ROTATE;
return aOp;
case QEvent::Wheel:
{
QWheelEvent* aEvent = (QWheelEvent*) e;
- double aDelta = aEvent->delta();
- double aScale = (aDelta < 0) ? 100./(-aDelta) : aDelta/100.;
- myViewPort->getView()->SetZoom(aScale);
+ myViewPort->startZoomAtPoint( aEvent->x(), aEvent->y() );
+ double delta = (double)( aEvent->delta() ) / ( 15 * 8 );
+ int x = aEvent->x();
+ int y = aEvent->y();
+ int x1 = (int)( aEvent->x() + width()*delta/100 );
+ int y1 = (int)( aEvent->y() + height()*delta/100 );
+ myViewPort->zoom( x, y, x1, y1 );
}
return true;
}
return true;
+ case QEvent::KeyPress:
+ emit keyPressed(this, (QKeyEvent*) e);
+ return true;
+
default:
break;
}
{
myStartX = theEvent->x();
myStartY = theEvent->y();
+ int anInteractionStyle = interactionStyle();
+
+ // in "key free" interaction style zoom operation is activated by two buttons (simultaneously pressed),
+ // which are assigned for pan and rotate - these operations are activated immediately after pressing
+ // of the first button, so it is necessary to switch to zoom when the second button is pressed
+ bool aSwitchToZoom = false;
+ if ( anInteractionStyle == SUIT_ViewModel::KEY_FREE &&
+ ( myOperation == PANVIEW || myOperation == ROTATE ) ) {
+ aSwitchToZoom = getButtonState( theEvent, anInteractionStyle ) == ZOOMVIEW;
+ }
+
switch ( myOperation ) {
case WINDOWFIT:
if ( theEvent->button() == Qt::LeftButton )
break;
case ZOOMVIEW:
- if ( theEvent->button() == Qt::LeftButton )
+ if ( theEvent->button() == Qt::LeftButton ) {
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
emit vpTransformationStarted ( ZOOMVIEW );
+ }
break;
case PANVIEW:
- if ( theEvent->button() == Qt::LeftButton )
+ if ( aSwitchToZoom ) {
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
+ activateZoom();
+ }
+ else if ( theEvent->button() == Qt::LeftButton )
emit vpTransformationStarted ( PANVIEW );
break;
case ROTATE:
- if ( theEvent->button() == Qt::LeftButton ) {
- myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
- emit vpTransformationStarted ( ROTATE );
- }
+ if ( aSwitchToZoom ) {
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
+ activateZoom();
+ }
+ else if ( theEvent->button() == Qt::LeftButton ) {
+ myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
+ emit vpTransformationStarted ( ROTATE );
+ }
break;
default:
/* Try to activate a transformation */
- switch ( getButtonState(theEvent) ) {
+ switch ( getButtonState(theEvent, anInteractionStyle) ) {
case ZOOMVIEW:
- activateZoom();
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
+ activateZoom();
break;
case PANVIEW:
- activatePanning();
+ activatePanning();
break;
case ROTATE:
- activateRotation();
- myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
+ activateRotation();
+ myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
break;
default:
if ( myRotationPointSelection )
{
- if ( theEvent->button() == Qt::LeftButton )
- {
- Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
- ic->Select();
- for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
- {
- TopoDS_Shape aShape = ic->SelectedShape();
- if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
- {
- gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
- if ( mySetRotationPointDlg )
- {
- myRotationPointSelection = false;
- mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
- }
- }
- else
- {
- myCurrPointType = myPrevPointType;
- break;
- }
- }
- if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType;
- if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange();
- ic->CloseAllContexts();
- myOperation = NOTHING;
- myViewPort->setCursor( myCursor );
- myCursorIsHand = false;
- myRotationPointSelection = false;
- }
+ if ( theEvent->button() == Qt::LeftButton )
+ {
+ Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
+ ic->Select();
+ for ( ic->InitSelected(); ic->MoreSelected(); ic->NextSelected() )
+ {
+ TopoDS_Shape aShape = ic->SelectedShape();
+ if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
+ {
+ gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
+ if ( mySetRotationPointDlg )
+ {
+ myRotationPointSelection = false;
+ mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
+ }
+ }
+ else
+ {
+ myCurrPointType = myPrevPointType;
+ break;
+ }
+ }
+ if ( ic->NbSelected() == 0 ) myCurrPointType = myPrevPointType;
+ if ( mySetRotationPointDlg ) mySetRotationPointDlg->toggleChange();
+ ic->CloseAllContexts();
+ myOperation = NOTHING;
+ myViewPort->setCursor( myCursor );
+ myCursorIsHand = false;
+ myRotationPointSelection = false;
+ }
}
else
- emit mousePressed(this, theEvent);
+ emit mousePressed(this, theEvent);
break;
}
/* notify that we start a transformation */
if ( transformRequested() )
- emit vpTransformationStarted ( myOperation );
+ emit vpTransformationStarted ( myOperation );
}
if ( transformRequested() )
setTransformInProcess( true );
void OCCViewer_ViewWindow::activateZoom()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); /* save old cursor */
+ myCursor = cursor(); /* save old cursor */
if ( myOperation != ZOOMVIEW ) {
QPixmap zoomPixmap (imageZoomCursor);
QCursor zoomCursor (zoomPixmap);
- setTransformRequested ( ZOOMVIEW );
- myViewPort->setCursor( zoomCursor );
+ if( setTransformRequested ( ZOOMVIEW ) )
+ myViewPort->setCursor( zoomCursor );
}
}
void OCCViewer_ViewWindow::activatePanning()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); // save old cursor
+ myCursor = cursor(); // save old cursor
if ( myOperation != PANVIEW ) {
QCursor panCursor (Qt::SizeAllCursor);
- setTransformRequested ( PANVIEW );
- myViewPort->setCursor( panCursor );
+ if( setTransformRequested ( PANVIEW ) )
+ myViewPort->setCursor( panCursor );
}
}
void OCCViewer_ViewWindow::activateRotation()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); // save old cursor
+ myCursor = cursor(); // save old cursor
if ( myOperation != ROTATE ) {
QPixmap rotatePixmap (imageRotateCursor);
QCursor rotCursor (rotatePixmap);
- setTransformRequested ( ROTATE );
- myViewPort->setCursor( rotCursor );
+ if( setTransformRequested ( ROTATE ) )
+ myViewPort->setCursor( rotCursor );
}
}
QCursor glPanCursor (globalPanPixmap);
myCurScale = aView3d->Scale();
aView3d->FitAll(0.01, false);
- myCursor = cursor(); // save old cursor
+ myCursor = cursor(); // save old cursor
myViewPort->fitAll(); // fits view before selecting a new scene center
- setTransformRequested( PANGLOBAL );
- myViewPort->setCursor( glPanCursor );
+ if( setTransformRequested( PANGLOBAL ) )
+ myViewPort->setCursor( glPanCursor );
}
}
void OCCViewer_ViewWindow::activateWindowFit()
{
if ( !transformRequested() && !myCursorIsHand )
- myCursor = cursor(); /* save old cursor */
+ myCursor = cursor(); /* save old cursor */
if ( myOperation != WINDOWFIT ) {
QCursor handCursor (Qt::PointingHandCursor);
- setTransformRequested ( WINDOWFIT );
- myViewPort->setCursor ( handCursor );
- myCursorIsHand = true;
+ if( setTransformRequested ( WINDOWFIT ) )
+ {
+ myViewPort->setCursor ( handCursor );
+ myCursorIsHand = true;
+ }
}
}
/*!
\brief Start delayed viewer operation.
*/
-void OCCViewer_ViewWindow::setTransformRequested( OperationType op )
+bool OCCViewer_ViewWindow::setTransformRequested( OperationType op )
{
- myOperation = op;
- myViewPort->setMouseTracking( myOperation == NOTHING );
+ bool ok = transformEnabled( op );
+ myOperation = ok ? op : NOTHING;
+ myViewPort->setMouseTracking( myOperation == NOTHING );
+ return ok;
}
-
/*!
\brief Handle mouse move event.
\param theEvent mouse event
break;
default:
- if ( myRotationPointSelection )
+ if ( myRotationPointSelection || isSketcherStyle() )
+ {
emit mouseMoving( this, theEvent );
+ }
else
{
int aState = theEvent->modifiers();
int aButton = theEvent->buttons();
- if ( aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
- myDrawRect = myEnableDrawMode;
- if ( myDrawRect ) {
- drawRect();
- if ( !myCursorIsHand ) { // we are going to sketch a rectangle
- QCursor handCursor (Qt::PointingHandCursor);
- myCursorIsHand = true;
- myCursor = cursor();
- myViewPort->setCursor( handCursor );
- }
- }
+ int anInteractionStyle = interactionStyle();
+ if ( anInteractionStyle == SUIT_ViewModel::STANDARD &&
+ aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
+ myDrawRect = myEnableDrawMode;
+ if ( myDrawRect ) {
+ drawRect();
+ if ( !myCursorIsHand ) { // we are going to sketch a rectangle
+ QCursor handCursor (Qt::PointingHandCursor);
+ myCursorIsHand = true;
+ myCursor = cursor();
+ myViewPort->setCursor( handCursor );
+ }
+ }
+ emit mouseMoving( this, theEvent );
}
- else if ( aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
- OCCViewer_ViewSketcher* sketcher = 0;
- QList<OCCViewer_ViewSketcher*>::Iterator it;
- for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it )
- {
- OCCViewer_ViewSketcher* sk = (*it);
- if( sk->isDefault() && sk->sketchButton() == aButton )
- sketcher = sk;
- }
- if ( sketcher && myCurSketch == -1 )
- {
- activateSketching( sketcher->type() );
- if ( mypSketcher )
- {
- myCurSketch = mypSketcher->sketchButton();
-
- if ( l_mbPressEvent )
- {
- QApplication::sendEvent( getViewPort(), l_mbPressEvent );
- delete l_mbPressEvent;
- l_mbPressEvent = 0;
- }
- QApplication::sendEvent( getViewPort(), theEvent );
- }
- }
+ else if ( anInteractionStyle == SUIT_ViewModel::STANDARD &&
+ aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
+ OCCViewer_ViewSketcher* sketcher = 0;
+ QList<OCCViewer_ViewSketcher*>::Iterator it;
+ for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it )
+ {
+ OCCViewer_ViewSketcher* sk = (*it);
+ if( sk->isDefault() && sk->sketchButton() == aButton )
+ sketcher = sk;
+ }
+ if ( sketcher && myCurSketch == -1 )
+ {
+ activateSketching( sketcher->type() );
+ if ( mypSketcher )
+ {
+ myCurSketch = mypSketcher->sketchButton();
+
+ if ( l_mbPressEvent )
+ {
+ QApplication::sendEvent( getViewPort(), l_mbPressEvent );
+ delete l_mbPressEvent;
+ l_mbPressEvent = 0;
+ }
+ QApplication::sendEvent( getViewPort(), theEvent );
+ }
+ }
}
else
- emit mouseMoving( this, theEvent );
+ emit mouseMoving( this, theEvent );
}
}
}
int prevState = myCurSketch;
if(theEvent->button() == Qt::RightButton)
{
- QList<OCCViewer_ViewSketcher*>::Iterator it;
- for ( it = mySketchers.begin(); it != mySketchers.end() && myCurSketch != -1; ++it )
- {
- OCCViewer_ViewSketcher* sk = (*it);
- if( ( sk->sketchButton() & theEvent->button() ) && sk->sketchButton() == myCurSketch )
- myCurSketch = -1;
- }
+ QList<OCCViewer_ViewSketcher*>::Iterator it;
+ for ( it = mySketchers.begin(); it != mySketchers.end() && myCurSketch != -1; ++it )
+ {
+ OCCViewer_ViewSketcher* sk = (*it);
+ if( ( sk->sketchButton() & theEvent->button() ) && sk->sketchButton() == myCurSketch )
+ myCurSketch = -1;
+ }
}
emit mouseReleased(this, theEvent);
// Projections
aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_FRONT" ) ),
- tr( "MNU_FRONT_VIEW" ), 0, this);
+ tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view");
aAction->setStatusTip(tr("DSC_FRONT_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onFrontView()));
+ this->addAction(aAction);
toolMgr()->registerAction( aAction, FrontId );
aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_BACK" ) ),
- tr( "MNU_BACK_VIEW" ), 0, this);
+ tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view");
aAction->setStatusTip(tr("DSC_BACK_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onBackView()));
+ this->addAction(aAction);
toolMgr()->registerAction( aAction, BackId );
aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_TOP" ) ),
- tr( "MNU_TOP_VIEW" ), 0, this);
+ tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view");
aAction->setStatusTip(tr("DSC_TOP_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onTopView()));
+ this->addAction(aAction);
toolMgr()->registerAction( aAction, TopId );
aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_BOTTOM" ) ),
- tr( "MNU_BOTTOM_VIEW" ), 0, this);
+ tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view");
aAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onBottomView()));
+ this->addAction(aAction);
toolMgr()->registerAction( aAction, BottomId );
-
+
aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_LEFT" ) ),
- tr( "MNU_LEFT_VIEW" ), 0, this);
+ tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view");
aAction->setStatusTip(tr("DSC_LEFT_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onLeftView()));
+ this->addAction(aAction);
toolMgr()->registerAction( aAction, LeftId );
aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RIGHT" ) ),
- tr( "MNU_RIGHT_VIEW" ), 0, this);
+ tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view");
aAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onRightView()));
+ this->addAction(aAction);
toolMgr()->registerAction( aAction, RightId );
+ // rotate anticlockwise
+ aAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_ANTICLOCKWISE" ) ),
+ tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate anticlockwise");
+ aAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
+ this->addAction(aAction);
+ toolMgr()->registerAction( aAction, AntiClockWiseId );
+
+ // rotate clockwise
+ aAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_CLOCKWISE" ) ),
+ tr( "MNU_CLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate clockwise");
+ aAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
+ this->addAction(aAction);
+ toolMgr()->registerAction( aAction, ClockWiseId );
+
// Reset
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RESET" ) ),
- tr( "MNU_RESET_VIEW" ), 0, this);
+ tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onResetView()));
+ this->addAction(aAction);
toolMgr()->registerAction( aAction, ResetId );
- // Reset
- aAction = new QtxAction(tr("MNU_CLONE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLONE_VIEW" ) ),
- tr( "MNU_CLONE_VIEW" ), 0, this);
+ // Clone
+ aAction = new QtxAction(tr("MNU_CLONE_VIEW"),
+ aResMgr->loadPixmap("OCCViewer", tr("ICON_OCCVIEWER_CLONE_VIEW")),
+ tr("MNU_CLONE_VIEW"), 0, this);
aAction->setStatusTip(tr("DSC_CLONE_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onCloneView()));
toolMgr()->registerAction( aAction, CloneId );
aAction->setStatusTip(tr("DSC_SCALING"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onAxialScale()));
toolMgr()->registerAction( aAction, AxialScaleId );
+
+ // Graduated axes
+ aAction = new QtxAction(tr("MNU_GRADUATED_AXES"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_GRADUATED_AXES" ) ),
+ tr( "MNU_GRADUATED_AXES" ), 0, this);
+ aAction->setStatusTip(tr("DSC_GRADUATED_AXES"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onGraduatedAxes()));
+ toolMgr()->registerAction( aAction, GraduatedAxesId );
+
+ // Active only ambient light or not
+ aAction = new QtxAction(tr("MNU_AMBIENT"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_AMBIENT" ) ),
+ tr( "MNU_AMBIENT" ), 0, this);
+ aAction->setStatusTip(tr("DSC_AMBIENT"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onAmbientToogle()));
+ toolMgr()->registerAction( aAction, AmbientId );
+
+ // Switch between interaction styles
+ aAction = new QtxAction(tr("MNU_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_STYLE_SWITCH" ) ),
+ tr( "MNU_STYLE_SWITCH" ), 0, this);
+ aAction->setStatusTip(tr("DSC_STYLE_SWITCH"));
+ aAction->setCheckable(true);
+ connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
+ toolMgr()->registerAction( aAction, SwitchInteractionStyleId );
+
+ // Switch between zooming styles
+ aAction = new QtxAction(tr("MNU_ZOOMING_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_ZOOMING_STYLE_SWITCH" ) ),
+ tr( "MNU_ZOOMING_STYLE_SWITCH" ), 0, this);
+ aAction->setStatusTip(tr("DSC_ZOOMING_STYLE_SWITCH"));
+ aAction->setCheckable(true);
+ connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchZoomingStyle(bool)));
+ toolMgr()->registerAction( aAction, SwitchZoomingStyleId );
+
+ // Maximized view
+ aAction = new QtxAction(tr("MNU_MINIMIZE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MINIMIZE" ) ),
+ tr( "MNU_MINIMIZE_VIEW" ), 0, this );
+ aAction->setStatusTip(tr("DSC_MINIMIZE_VIEW"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onMaximizedView()));
+ toolMgr()->registerAction( aAction, MaximizedId );
+
+ // Synchronize view
+ aAction = new QtxAction(tr("MNU_SYNCHRONIZE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_SYNC" ) ),
+ tr( "MNU_SYNCHRONIZE_VIEW" ), 0, this );
+ aAction->setStatusTip(tr("DSC_SYNCHRONIZE_VIEW"));
+ aAction->setMenu( new QMenu( this ) );
+ aAction->setCheckable(true);
+ connect(aAction->menu(), SIGNAL(aboutToShow()), this, SLOT(updateSyncViews()));
+ connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onSynchronizeView(bool)));
+ toolMgr()->registerAction( aAction, SynchronizeId );
}
/*!
*/
void OCCViewer_ViewWindow::createToolBar()
{
- int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+ QString aToolbarName;
+ switch (my2dMode) {
+ case XYPlane:
+ aToolbarName = tr( "LBL_XYTOOLBAR_LABEL" );
+ break;
+ case XZPlane:
+ aToolbarName = tr( "LBL_XZTOOLBAR_LABEL" );
+ break;
+ case YZPlane:
+ aToolbarName = tr( "LBL_YZTOOLBAR_LABEL" );
+ break;
+ default:
+ aToolbarName = tr( "LBL_3DTOOLBAR_LABEL" );
+ }
+
+ int tid = toolMgr()->createToolBar( aToolbarName, false );
toolMgr()->append( DumpId, tid );
- if( myModel->trihedronActivated() )
+ toolMgr()->append( SwitchInteractionStyleId, tid );
+#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
+ toolMgr()->append( SwitchZoomingStyleId, tid );
+#endif
+ if( myModel->trihedronActivated() )
toolMgr()->append( TrihedronShowId, tid );
QtxMultiAction* aScaleAction = new QtxMultiAction( this );
aPanningAction->insertAction( toolMgr()->action( GlobalPanId ) );
toolMgr()->append( aPanningAction, tid );
- toolMgr()->append( ChangeRotationPointId, tid );
- toolMgr()->append( RotationId, tid );
+ if (my2dMode == No2dMode) {
+ toolMgr()->append( ChangeRotationPointId, tid );
+ toolMgr()->append( RotationId, tid );
+
+ QtxMultiAction* aViewsAction = new QtxMultiAction( this );
+ aViewsAction->insertAction( toolMgr()->action( FrontId ) );
+ aViewsAction->insertAction( toolMgr()->action( BackId ) );
+ aViewsAction->insertAction( toolMgr()->action( TopId ) );
+ aViewsAction->insertAction( toolMgr()->action( BottomId ) );
+ aViewsAction->insertAction( toolMgr()->action( LeftId ) );
+ aViewsAction->insertAction( toolMgr()->action( RightId ) );
+ toolMgr()->append( aViewsAction, tid );
- QtxMultiAction* aViewsAction = new QtxMultiAction( this );
- aViewsAction->insertAction( toolMgr()->action( FrontId ) );
- aViewsAction->insertAction( toolMgr()->action( BackId ) );
- aViewsAction->insertAction( toolMgr()->action( TopId ) );
- aViewsAction->insertAction( toolMgr()->action( BottomId ) );
- aViewsAction->insertAction( toolMgr()->action( LeftId ) );
- aViewsAction->insertAction( toolMgr()->action( RightId ) );
- toolMgr()->append( aViewsAction, tid );
+ toolMgr()->append( AntiClockWiseId, tid );
+ toolMgr()->append( ClockWiseId, tid );
- toolMgr()->append( ResetId, tid );
+ toolMgr()->append( ResetId, tid );
+ }
QtxMultiAction* aMemAction = new QtxMultiAction( this );
aMemAction->insertAction( toolMgr()->action( MemId ) );
toolMgr()->append( toolMgr()->separator(), tid );
toolMgr()->append( ClippingId, tid );
toolMgr()->append( AxialScaleId, tid );
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
+ toolMgr()->append( GraduatedAxesId, tid );
+#endif
+ toolMgr()->append( AmbientId, tid );
+
+ toolMgr()->append( MaximizedId, tid );
+ toolMgr()->append( SynchronizeId, tid );
}
/*!
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xpos);
onViewFitAll();
+ emit vpTransformationFinished ( FRONTVIEW );
}
/*!
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Xneg);
onViewFitAll();
+ emit vpTransformationFinished ( BACKVIEW );
}
/*!
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zpos);
onViewFitAll();
+ emit vpTransformationFinished ( TOPVIEW );
}
/*!
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Zneg);
onViewFitAll();
+ emit vpTransformationFinished ( BOTTOMVIEW );
}
/*!
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Yneg);
onViewFitAll();
+ emit vpTransformationFinished ( LEFTVIEW );
}
/*!
Handle(V3d_View) aView3d = myViewPort->getView();
if ( !aView3d.IsNull() ) aView3d->SetProj (V3d_Ypos);
onViewFitAll();
+ emit vpTransformationFinished ( RIGHTVIEW );
+}
+
+/*!
+ \brief Rotate view 90 degrees clockwise
+*/
+void OCCViewer_ViewWindow::onClockWiseView()
+{
+ emit vpTransformationStarted ( CLOCKWISEVIEW );
+ myViewPort->rotateXY( 90. );
+ emit vpTransformationFinished ( CLOCKWISEVIEW );
+}
+
+/*!
+ \brief Rotate view 90 degrees conterclockwise
+*/
+void OCCViewer_ViewWindow::onAntiClockWiseView()
+{
+ emit vpTransformationStarted ( ANTICLOCKWISEVIEW );
+ myViewPort->rotateXY( -90. );
+ emit vpTransformationFinished ( ANTICLOCKWISEVIEW );
}
/*!
myViewPort->fitAll( false, true, false );
myViewPort->getView()->SetImmediateUpdate( upd );
myViewPort->getView()->Update();
+ emit vpTransformationFinished( RESETVIEW );
}
/*!
{
emit vpTransformationStarted( FITALLVIEW );
myViewPort->fitAll();
+ emit vpTransformationFinished( FITALLVIEW );
}
/*!
*/
void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
{
- if ( on )
+ if (on)
+ {
+ if (!mySetRotationPointDlg)
{
- if ( !mySetRotationPointDlg )
- {
- mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg( this, myDesktop );
- mySetRotationPointDlg->SetAction( mySetRotationPointAction );
- }
+ mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg (this);
+ mySetRotationPointDlg->SetAction(mySetRotationPointAction);
+ }
- if ( !mySetRotationPointDlg->isVisible() )
+ if (!mySetRotationPointDlg->isVisible())
+ {
+ //if (mySetRotationPointDlg->IsFirstShown())
+ if (myCurrPointType == GRAVITY)
{
- if ( mySetRotationPointDlg->IsFirstShown() )
- {
- Standard_Real Xcenter, Ycenter, Zcenter;
- if ( computeGravityCenter( Xcenter, Ycenter, Zcenter ) )
- mySetRotationPointDlg->setCoords( Xcenter, Ycenter, Zcenter );
- }
- mySetRotationPointDlg->show();
+ Standard_Real Xcenter, Ycenter, Zcenter;
+ if (computeGravityCenter(Xcenter, Ycenter, Zcenter))
+ mySetRotationPointDlg->setCoords(Xcenter, Ycenter, Zcenter);
}
+ mySetRotationPointDlg->show();
}
+ }
else
- {
- if ( mySetRotationPointDlg->isVisible() )
- mySetRotationPointDlg->hide();
- }
+ {
+ if (mySetRotationPointDlg->isVisible())
+ mySetRotationPointDlg->hide();
+ }
}
/*!
else
myActionsMap[ ClippingId ]->setIcon(aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLIPPING" )));
*/
+ OCCViewer_ViewWindow* aParent = dynamic_cast<OCCViewer_ViewWindow*>(parent()->parent());
+ if (!aParent)
+ aParent = this;
if ( on )
- {
- if ( !myClippingDlg )
{
- myClippingDlg = new OCCViewer_ClippingDlg( this, myDesktop );
- myClippingDlg->SetAction( myClippingAction );
- }
+ if ( !myClippingDlg )
+ {
+ myClippingDlg = new OCCViewer_ClippingDlg( aParent );
+ myClippingDlg->SetAction( myClippingAction );
+ }
- if ( !myClippingDlg->isVisible() )
- myClippingDlg->show();
- }
+ if ( !myClippingDlg->isVisible() )
+ myClippingDlg->show();
+ }
else
- {
- if ( myClippingDlg->isVisible() )
- myClippingDlg->hide();
- setCuttingPlane(false);
- }
+ {
+ if ( myClippingDlg->isVisible() )
+ myClippingDlg->hide();
+ aParent->setCuttingPlane(false);
+ }
}
/*!
void OCCViewer_ViewWindow::onAxialScale()
{
if ( !myScalingDlg )
- myScalingDlg = new OCCViewer_AxialScaleDlg( this, myDesktop );
+ myScalingDlg = new OCCViewer_AxialScaleDlg( this );
if ( !myScalingDlg->isVisible() )
myScalingDlg->show();
}
+/*!
+ Shows Graduated Axes dialog
+*/
+void OCCViewer_ViewWindow::onGraduatedAxes()
+{
+ myCubeAxesDlg->Update();
+ myCubeAxesDlg->show();
+}
+
+void OCCViewer_ViewWindow::onAmbientToogle()
+{
+ Handle(V3d_Viewer) viewer = myViewPort->getViewer();
+ viewer->InitDefinedLights();
+ while(viewer->MoreDefinedLights())
+ {
+ Handle(V3d_Light) light = viewer->DefinedLight();
+ if(light->Type() != V3d_AMBIENT)
+ {
+ Handle(V3d_View) aView3d = myViewPort->getView();
+ if( aView3d->IsActiveLight(light) ) viewer->SetLightOff(light);
+ else viewer->SetLightOn(light);
+ }
+ viewer->NextDefinedLights();
+ }
+ viewer->Update();
+}
+
/*!
\brief Store view parameters.
*/
void OCCViewer_ViewWindow::onMemorizeView()
{
- myModel->appendViewAspect( getViewParams() );
+ appendViewAspect( getViewParams() );
}
/*!
*/
void OCCViewer_ViewWindow::onRestoreView()
{
- OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), myModel );
+ OCCViewer_CreateRestoreViewDlg* aDlg = new OCCViewer_CreateRestoreViewDlg( centralWidget(), this );
connect( aDlg, SIGNAL( dlgOk() ), this, SLOT( setRestoreFlag() ) );
aDlg->exec();
- myModel->updateViewAspects( aDlg->parameters() );
+ updateViewAspects( aDlg->parameters() );
if( myRestoreFlag && aDlg->parameters().count() )
performRestoring( aDlg->currentItem() );
}
\brief Restore view parameters.
\param anItem view parameters
*/
-void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
+void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool baseParamsOnly )
{
Handle(V3d_View) aView3d = myViewPort->getView();
aView3d->SetEye( anItem.eyeX, anItem.eyeY, anItem.eyeZ );
aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ );
- myModel->setTrihedronShown( anItem.isVisible );
- myModel->setTrihedronSize( anItem.size );
-
+
+ if ( !baseParamsOnly ) {
+
+ myModel->setTrihedronShown( anItem.isVisible );
+ myModel->setTrihedronSize( anItem.size );
+
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
+ // graduated trihedron
+ bool anIsVisible = anItem.gtIsVisible;
+ OCCViewer_AxisWidget::AxisData anAxisData[3];
+ anAxisData[0].DrawName = anItem.gtDrawNameX;
+ anAxisData[1].DrawName = anItem.gtDrawNameZ;
+ anAxisData[2].DrawName = anItem.gtDrawNameZ;
+ anAxisData[0].Name = anItem.gtNameX;
+ anAxisData[1].Name = anItem.gtNameZ;
+ anAxisData[2].Name = anItem.gtNameZ;
+ anAxisData[0].NameColor = QColor( anItem.gtNameColorRX,
+ anItem.gtNameColorGX,
+ anItem.gtNameColorBX );
+ anAxisData[1].NameColor = QColor( anItem.gtNameColorRY,
+ anItem.gtNameColorGY,
+ anItem.gtNameColorBY );
+ anAxisData[2].NameColor = QColor( anItem.gtNameColorRZ,
+ anItem.gtNameColorGZ,
+ anItem.gtNameColorBZ );
+ anAxisData[0].DrawValues = anItem.gtDrawValuesX;
+ anAxisData[1].DrawValues = anItem.gtDrawValuesY;
+ anAxisData[2].DrawValues = anItem.gtDrawValuesZ;
+ anAxisData[0].NbValues = anItem.gtNbValuesX;
+ anAxisData[1].NbValues = anItem.gtNbValuesY;
+ anAxisData[2].NbValues = anItem.gtNbValuesZ;
+ anAxisData[0].Offset = anItem.gtOffsetX;
+ anAxisData[1].Offset = anItem.gtOffsetY;
+ anAxisData[2].Offset = anItem.gtOffsetZ;
+ anAxisData[0].Color = QColor( anItem.gtColorRX,
+ anItem.gtColorGX,
+ anItem.gtColorBX );
+ anAxisData[1].Color = QColor( anItem.gtColorRY,
+ anItem.gtColorGY,
+ anItem.gtColorBY );
+ anAxisData[2].Color = QColor( anItem.gtColorRZ,
+ anItem.gtColorGZ,
+ anItem.gtColorBZ );
+ anAxisData[0].DrawTickmarks = anItem.gtDrawTickmarksX;
+ anAxisData[1].DrawTickmarks = anItem.gtDrawTickmarksY;
+ anAxisData[2].DrawTickmarks = anItem.gtDrawTickmarksZ;
+ anAxisData[0].TickmarkLength = anItem.gtTickmarkLengthX;
+ anAxisData[1].TickmarkLength = anItem.gtTickmarkLengthY;
+ anAxisData[2].TickmarkLength = anItem.gtTickmarkLengthZ;
+
+ myCubeAxesDlg->SetData( anIsVisible, anAxisData );
+ myCubeAxesDlg->ApplyData( aView3d );
+#endif
+
+ } // if ( !baseParamsOnly )
+
myRestoreFlag = 0;
}
myModel->toggleTrihedron();
}
+/*!
+ \brief Switches "keyboard free" interaction style on/off
+*/
+void OCCViewer_ViewWindow::onSwitchInteractionStyle( bool on )
+{
+ myInteractionStyle = on ? (int)SUIT_ViewModel::KEY_FREE : (int)SUIT_ViewModel::STANDARD;
+
+ // update action state if method is called outside
+ QtxAction* a = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchInteractionStyleId ) );
+ if ( a->isChecked() != on )
+ a->setChecked( on );
+}
+
+/*!
+ \brief Toogles advanced zooming style (relatively to the cursor position) on/off
+*/
+void OCCViewer_ViewWindow::onSwitchZoomingStyle( bool on )
+{
+ myViewPort->setAdvancedZoomingEnabled( on );
+
+ // update action state if method is called outside
+ QtxAction* a = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
+ if ( a->isChecked() != on )
+ a->setChecked( on );
+}
+
+/*!
+ \brief Get current interaction style
+ \return interaction style
+*/
+int OCCViewer_ViewWindow::interactionStyle() const
+{
+ return myInteractionStyle;
+}
+
+/*!
+ \brief Set current interaction style
+ \param theStyle interaction style
+*/
+void OCCViewer_ViewWindow::setInteractionStyle( const int theStyle )
+{
+ onSwitchInteractionStyle( theStyle == (int)SUIT_ViewModel::KEY_FREE );
+}
+
+/*!
+ \brief Get current zooming style
+ \return zooming style
+*/
+int OCCViewer_ViewWindow::zoomingStyle() const
+{
+ return myViewPort->isAdvancedZoomingEnabled() ? 1 : 0;
+}
+
+/*!
+ \brief Set current zooming style
+ \param theStyle zooming style
+*/
+void OCCViewer_ViewWindow::setZoomingStyle( const int theStyle )
+{
+ onSwitchZoomingStyle( theStyle == 1 );
+}
+
/*!
\brief Dump view window contents to the pixmap.
\return pixmap containing all scene rendered in the window
*/
QImage OCCViewer_ViewWindow::dumpView()
{
- QPixmap px = QPixmap::grabWindow( myViewPort->winId() );
- return px.toImage();
+ Handle(V3d_View) view = myViewPort->getView();
+ if ( view.IsNull() )
+ return QImage();
+
+ int aWidth = myViewPort->width();
+ int aHeight = myViewPort->height();
+ QApplication::syncX();
+ view->Redraw(); // In order to reactivate GL context
+ //view->Update();
+
+ OpenGLUtils_FrameBuffer aFrameBuffer;
+ if( aFrameBuffer.init( aWidth, aHeight ) )
+ {
+ QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
+
+ glPushAttrib( GL_VIEWPORT_BIT );
+ glViewport( 0, 0, aWidth, aHeight );
+ aFrameBuffer.bind();
+
+ // draw scene
+ view->Redraw();
+
+ aFrameBuffer.unbind();
+ glPopAttrib();
+
+ aFrameBuffer.bind();
+ glReadPixels( 0, 0, aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
+ aFrameBuffer.unbind();
+
+ anImage = anImage.rgbSwapped();
+ anImage = anImage.mirrored();
+ return anImage;
+ }
+ // if frame buffers are unsupported, use old functionality
+ //view->Redraw();
+
+ unsigned char* data = new unsigned char[ aWidth*aHeight*4 ];
+
+ QPoint p = myViewPort->mapFromParent(myViewPort->geometry().topLeft());
+
+ glReadPixels( p.x(), p.y(), aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE,
+ data);
+
+ QImage anImage( data, aWidth, aHeight, QImage::Format_ARGB32 );
+ anImage = anImage.mirrored();
+ anImage = anImage.rgbSwapped();
+ return anImage;
}
bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img,
- const QString& fileName,
- const QString& format )
+ const QString& fileName,
+ const QString& format )
{
if ( format != "PS" && format != "EPS")
return SUIT_ViewWindow::dumpViewToFormat( img, fileName, format );
Handle(Visual3d_View) a3dView = myViewPort->getView()->View();
if (format == "PS")
- a3dView->Export(qPrintable(fileName), Graphic3d_EF_PostScript);
+ a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_PostScript);
else if (format == "EPS")
- a3dView->Export(qPrintable(fileName), Graphic3d_EF_EnhPostScript);
+ a3dView->Export(strdup(qPrintable(fileName)), Graphic3d_EF_EnhPostScript);
return true;
}
\param dz Z coordinate of plane normal
*/
void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x, const double y, const double z,
- const double dx, const double dy, const double dz )
+ const double dx, const double dy, const double dz )
{
Handle(V3d_View) view = myViewPort->getView();
if ( view.IsNull() )
// try to use already existing plane or create a new one
Handle(V3d_Plane) clipPlane;
view->InitActivePlanes();
- if ( view->MoreActivePlanes() )
+
+ // calculate new a,b,c,d values for the plane
+ gp_Pln pln (gp_Pnt(x, y, z), gp_Dir(dx, dy, dz));
+ double a, b, c, d;
+ pln.Coefficients(a, b, c, d);
+
+#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
+ if (view->MoreActivePlanes()) {
+ clipPlane = view->ActivePlane();
+ clipPlane->SetPlane(a, b, c, d);
+ }
+ else
+ clipPlane = new V3d_Plane (a, b, c, d);
+#else
+ if (view->MoreActivePlanes())
clipPlane = view->ActivePlane();
else
- clipPlane = new V3d_Plane( viewer );
+ clipPlane = new V3d_Plane (viewer);
- // set new a,b,c,d values for the plane
- gp_Pln pln( gp_Pnt( x, y, z ), gp_Dir( dx, dy, dz ) );
- double a, b, c, d;
- pln.Coefficients( a, b, c, d );
- clipPlane->SetPlane( a, b, c, d );
+ clipPlane->SetPlane(a, b, c, d);
+#endif
- view->SetPlaneOn( clipPlane );
+ view->SetPlaneOn(clipPlane);
}
else
view->SetPlaneOff();
view->Redraw();
}
+void OCCViewer_ViewWindow::setCuttingPlane( bool on, const gp_Pln pln )
+{
+ gp_Dir aDir = pln.Axis().Direction();
+ gp_Pnt aPnt = pln.Location();
+ setCuttingPlane(on, aPnt.X(), aPnt.Y(), aPnt.Z(), aDir.X(), aDir.Y(), aDir.Z());
+}
+
+
/*!
\brief Check if any cutting plane is enabled
\return \c true if at least one cutting plane is enabled
params.scaleX = aScaleX;
params.scaleY = aScaleY;
params.scaleZ = aScaleZ;
- params.name = aName;
+ params.name = aName;
params.isVisible= isShown;
params.size = size;
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
+ // graduated trihedron
+ bool anIsVisible = false;
+ OCCViewer_AxisWidget::AxisData anAxisData[3];
+ myCubeAxesDlg->GetData( anIsVisible, anAxisData );
+
+ params.gtIsVisible = anIsVisible;
+ params.gtDrawNameX = anAxisData[0].DrawName;
+ params.gtDrawNameY = anAxisData[1].DrawName;
+ params.gtDrawNameZ = anAxisData[2].DrawName;
+ params.gtNameX = anAxisData[0].Name;
+ params.gtNameY = anAxisData[1].Name;
+ params.gtNameZ = anAxisData[2].Name;
+ params.gtNameColorRX = anAxisData[0].NameColor.red();
+ params.gtNameColorGX = anAxisData[0].NameColor.green();
+ params.gtNameColorBX = anAxisData[0].NameColor.blue();
+ params.gtNameColorRY = anAxisData[1].NameColor.red();
+ params.gtNameColorGY = anAxisData[1].NameColor.green();
+ params.gtNameColorBY = anAxisData[1].NameColor.blue();
+ params.gtNameColorRZ = anAxisData[2].NameColor.red();
+ params.gtNameColorGZ = anAxisData[2].NameColor.green();
+ params.gtNameColorBZ = anAxisData[2].NameColor.blue();
+ params.gtDrawValuesX = anAxisData[0].DrawValues;
+ params.gtDrawValuesY = anAxisData[1].DrawValues;
+ params.gtDrawValuesZ = anAxisData[2].DrawValues;
+ params.gtNbValuesX = anAxisData[0].NbValues;
+ params.gtNbValuesY = anAxisData[1].NbValues;
+ params.gtNbValuesZ = anAxisData[2].NbValues;
+ params.gtOffsetX = anAxisData[0].Offset;
+ params.gtOffsetY = anAxisData[1].Offset;
+ params.gtOffsetZ = anAxisData[2].Offset;
+ params.gtColorRX = anAxisData[0].Color.red();
+ params.gtColorGX = anAxisData[0].Color.green();
+ params.gtColorBX = anAxisData[0].Color.blue();
+ params.gtColorRY = anAxisData[1].Color.red();
+ params.gtColorGY = anAxisData[1].Color.green();
+ params.gtColorBY = anAxisData[1].Color.blue();
+ params.gtColorRZ = anAxisData[2].Color.red();
+ params.gtColorGZ = anAxisData[2].Color.green();
+ params.gtColorBZ = anAxisData[2].Color.blue();
+ params.gtDrawTickmarksX = anAxisData[0].DrawTickmarks;
+ params.gtDrawTickmarksY = anAxisData[1].DrawTickmarks;
+ params.gtDrawTickmarksZ = anAxisData[2].DrawTickmarks;
+ params.gtTickmarkLengthX = anAxisData[0].TickmarkLength;
+ params.gtTickmarkLengthY = anAxisData[1].TickmarkLength;
+ params.gtTickmarkLengthZ = anAxisData[2].TickmarkLength;
+#endif
+
return params;
}
QString OCCViewer_ViewWindow::getVisualParameters()
{
viewAspect params = getViewParams();
- QString retStr;
- retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", params.scale,
- params.centerX, params.centerY, params.projX, params.projY, params.projZ, params.twist,
- params.atX, params.atY, params.atZ, params.eyeX, params.eyeY, params.eyeZ,
- params.scaleX, params.scaleY, params.scaleZ );
- retStr += QString().sprintf("*%u*%.2f", params.isVisible, params.size );
- return retStr;
+
+ QStringList data;
+
+ data << QString( "scale=%1" ) .arg( params.scale, 0, 'e', 12 );
+ data << QString( "centerX=%1" ) .arg( params.centerX, 0, 'e', 12 );
+ data << QString( "centerY=%1" ) .arg( params.centerY, 0, 'e', 12 );
+ data << QString( "projX=%1" ) .arg( params.projX, 0, 'e', 12 );
+ data << QString( "projY=%1" ) .arg( params.projY, 0, 'e', 12 );
+ data << QString( "projZ=%1" ) .arg( params.projZ, 0, 'e', 12 );
+ data << QString( "twist=%1" ) .arg( params.twist, 0, 'e', 12 );
+ data << QString( "atX=%1" ) .arg( params.atX, 0, 'e', 12 );
+ data << QString( "atY=%1" ) .arg( params.atY, 0, 'e', 12 );
+ data << QString( "atZ=%1" ) .arg( params.atZ, 0, 'e', 12 );
+ data << QString( "eyeX=%1" ) .arg( params.eyeX, 0, 'e', 12 );
+ data << QString( "eyeY=%1" ) .arg( params.eyeY, 0, 'e', 12 );
+ data << QString( "eyeZ=%1" ) .arg( params.eyeZ, 0, 'e', 12 );
+ data << QString( "scaleX=%1" ) .arg( params.scaleX, 0, 'e', 12 );
+ data << QString( "scaleY=%1" ) .arg( params.scaleY, 0, 'e', 12 );
+ data << QString( "scaleZ=%1" ) .arg( params.scaleZ, 0, 'e', 12 );
+ data << QString( "isVisible=%1" ).arg( params.isVisible );
+ data << QString( "size=%1" ) .arg( params.size, 0, 'f', 2 );
+
+#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 or newer version
+ // graduated trihedron
+ data << QString( "gtIsVisible=%1" ) .arg( params.gtIsVisible );
+ data << QString( "gtDrawNameX=%1" ) .arg( params.gtDrawNameX );
+ data << QString( "gtDrawNameY=%1" ) .arg( params.gtDrawNameY );
+ data << QString( "gtDrawNameZ=%1" ) .arg( params.gtDrawNameZ );
+ data << QString( "gtNameX=%1" ) .arg( params.gtNameX );
+ data << QString( "gtNameY=%1" ) .arg( params.gtNameY );
+ data << QString( "gtNameZ=%1" ) .arg( params.gtNameZ );
+ data << QString( "gtNameColorRX=%1" ) .arg( params.gtNameColorRX );
+ data << QString( "gtNameColorGX=%1" ) .arg( params.gtNameColorGX );
+ data << QString( "gtNameColorBX=%1" ) .arg( params.gtNameColorBX );
+ data << QString( "gtNameColorRY=%1" ) .arg( params.gtNameColorRY );
+ data << QString( "gtNameColorGY=%1" ) .arg( params.gtNameColorGY );
+ data << QString( "gtNameColorBY=%1" ) .arg( params.gtNameColorBY );
+ data << QString( "gtNameColorRZ=%1" ) .arg( params.gtNameColorRZ );
+ data << QString( "gtNameColorGZ=%1" ) .arg( params.gtNameColorGZ );
+ data << QString( "gtNameColorBZ=%1" ) .arg( params.gtNameColorBZ );
+ data << QString( "gtDrawValuesX=%1" ) .arg( params.gtDrawValuesX );
+ data << QString( "gtDrawValuesY=%1" ) .arg( params.gtDrawValuesY );
+ data << QString( "gtDrawValuesZ=%1" ) .arg( params.gtDrawValuesZ );
+ data << QString( "gtNbValuesX=%1" ) .arg( params.gtNbValuesX );
+ data << QString( "gtNbValuesY=%1" ) .arg( params.gtNbValuesY );
+ data << QString( "gtNbValuesZ=%1" ) .arg( params.gtNbValuesZ );
+ data << QString( "gtOffsetX=%1" ) .arg( params.gtOffsetX );
+ data << QString( "gtOffsetY=%1" ) .arg( params.gtOffsetY );
+ data << QString( "gtOffsetZ=%1" ) .arg( params.gtOffsetZ );
+ data << QString( "gtColorRX=%1" ) .arg( params.gtColorRX );
+ data << QString( "gtColorGX=%1" ) .arg( params.gtColorGX );
+ data << QString( "gtColorBX=%1" ) .arg( params.gtColorBX );
+ data << QString( "gtColorRY=%1" ) .arg( params.gtColorRY );
+ data << QString( "gtColorGY=%1" ) .arg( params.gtColorGY );
+ data << QString( "gtColorBY=%1" ) .arg( params.gtColorBY );
+ data << QString( "gtColorRZ=%1" ) .arg( params.gtColorRZ );
+ data << QString( "gtColorGZ=%1" ) .arg( params.gtColorGZ );
+ data << QString( "gtColorBZ=%1" ) .arg( params.gtColorBZ );
+ data << QString( "gtDrawTickmarksX=%1" ) .arg( params.gtDrawTickmarksX );
+ data << QString( "gtDrawTickmarksY=%1" ) .arg( params.gtDrawTickmarksY );
+ data << QString( "gtDrawTickmarksZ=%1" ) .arg( params.gtDrawTickmarksZ );
+ data << QString( "gtTickmarkLengthX=%1" ).arg( params.gtTickmarkLengthX );
+ data << QString( "gtTickmarkLengthY=%1" ).arg( params.gtTickmarkLengthY );
+ data << QString( "gtTickmarkLengthZ=%1" ).arg( params.gtTickmarkLengthZ );
+#endif
+ QString bg = Qtx::backgroundToString( background() ).replace( "=", "$" );
+ data << QString( "background=%1" ).arg( bg );
+
+ return data.join("*");
}
/*!
*/
void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters )
{
- QStringList paramsLst = parameters.split( '*' );
- if ( paramsLst.size() >= 15 ) {
- viewAspect params;
- params.scale = paramsLst[0].toDouble();
- params.centerX = paramsLst[1].toDouble();
- params.centerY = paramsLst[2].toDouble();
- params.projX = paramsLst[3].toDouble();
- params.projY = paramsLst[4].toDouble();
- params.projZ = paramsLst[5].toDouble();
- params.twist = paramsLst[6].toDouble();
- params.atX = paramsLst[7].toDouble();
- params.atY = paramsLst[8].toDouble();
- params.atZ = paramsLst[9].toDouble();
- params.eyeX = paramsLst[10].toDouble();
- params.eyeY = paramsLst[11].toDouble();
- params.eyeZ = paramsLst[12].toDouble();
- if ( paramsLst.size() == 18 ) {
- params.scaleX = paramsLst[13].toDouble();
- params.scaleY = paramsLst[14].toDouble();
- params.scaleZ = paramsLst[15].toDouble();
- params.isVisible = paramsLst[16].toDouble();
- params.size = paramsLst[17].toDouble();
- }
- else {
- params.scaleX = 1.;
- params.scaleY = 1.;
- params.scaleZ = 1.;
+ viewAspect params;
+
+ QStringList data = parameters.split( '*' );
+ Qtx::BackgroundData bgData;
+ if ( parameters.contains( '=' ) ) // new format - "scale=1.000e+00*centerX=0.000e+00..."
+ {
+ foreach( QString param, data ) {
+ QString paramName = param.section( '=', 0, 0 ).trimmed();
+ QString paramValue = param.section( '=', 1, 1 ).trimmed();
+ if ( paramName == "scale" ) params.scale = paramValue.toDouble();
+ else if ( paramName == "centerX" ) params.centerX = paramValue.toDouble();
+ else if ( paramName == "centerY" ) params.centerY = paramValue.toDouble();
+ else if ( paramName == "projX" ) params.projX = paramValue.toDouble();
+ else if ( paramName == "projY" ) params.projY = paramValue.toDouble();
+ else if ( paramName == "projZ" ) params.projZ = paramValue.toDouble();
+ else if ( paramName == "twist" ) params.twist = paramValue.toDouble();
+ else if ( paramName == "atX" ) params.atX = paramValue.toDouble();
+ else if ( paramName == "atY" ) params.atY = paramValue.toDouble();
+ else if ( paramName == "atZ" ) params.atZ = paramValue.toDouble();
+ else if ( paramName == "eyeX" ) params.eyeX = paramValue.toDouble();
+ else if ( paramName == "eyeY" ) params.eyeY = paramValue.toDouble();
+ else if ( paramName == "eyeZ" ) params.eyeZ = paramValue.toDouble();
+ else if ( paramName == "scaleX" ) params.scaleX = paramValue.toDouble();
+ else if ( paramName == "scaleY" ) params.scaleY = paramValue.toDouble();
+ else if ( paramName == "scaleZ" ) params.scaleZ = paramValue.toDouble();
+ else if ( paramName == "isVisible" ) params.isVisible = paramValue.toInt();
+ else if ( paramName == "size" ) params.size = paramValue.toDouble();
+ // graduated trihedron
+ else if ( paramName == "gtIsVisible" ) params.gtIsVisible = paramValue.toInt();
+ else if ( paramName == "gtDrawNameX" ) params.gtDrawNameX = paramValue.toInt();
+ else if ( paramName == "gtDrawNameY" ) params.gtDrawNameY = paramValue.toInt();
+ else if ( paramName == "gtDrawNameZ" ) params.gtDrawNameZ = paramValue.toInt();
+ else if ( paramName == "gtNameX" ) params.gtNameX = paramValue;
+ else if ( paramName == "gtNameY" ) params.gtNameY = paramValue;
+ else if ( paramName == "gtNameZ" ) params.gtNameZ = paramValue;
+ else if ( paramName == "gtNameColorRX" ) params.gtNameColorRX = paramValue.toInt();
+ else if ( paramName == "gtNameColorGX" ) params.gtNameColorGX = paramValue.toInt();
+ else if ( paramName == "gtNameColorBX" ) params.gtNameColorBX = paramValue.toInt();
+ else if ( paramName == "gtNameColorRY" ) params.gtNameColorRY = paramValue.toInt();
+ else if ( paramName == "gtNameColorGY" ) params.gtNameColorGY = paramValue.toInt();
+ else if ( paramName == "gtNameColorBY" ) params.gtNameColorBY = paramValue.toInt();
+ else if ( paramName == "gtNameColorRZ" ) params.gtNameColorRZ = paramValue.toInt();
+ else if ( paramName == "gtNameColorGZ" ) params.gtNameColorGZ = paramValue.toInt();
+ else if ( paramName == "gtNameColorBZ" ) params.gtNameColorBZ = paramValue.toInt();
+ else if ( paramName == "gtDrawValuesX" ) params.gtDrawValuesX = paramValue.toInt();
+ else if ( paramName == "gtDrawValuesY" ) params.gtDrawValuesY = paramValue.toInt();
+ else if ( paramName == "gtDrawValuesZ" ) params.gtDrawValuesZ = paramValue.toInt();
+ else if ( paramName == "gtNbValuesX" ) params.gtNbValuesX = paramValue.toInt();
+ else if ( paramName == "gtNbValuesY" ) params.gtNbValuesY = paramValue.toInt();
+ else if ( paramName == "gtNbValuesZ" ) params.gtNbValuesZ = paramValue.toInt();
+ else if ( paramName == "gtOffsetX" ) params.gtOffsetX = paramValue.toInt();
+ else if ( paramName == "gtOffsetY" ) params.gtOffsetY = paramValue.toInt();
+ else if ( paramName == "gtOffsetZ" ) params.gtOffsetZ = paramValue.toInt();
+ else if ( paramName == "gtColorRX" ) params.gtColorRX = paramValue.toInt();
+ else if ( paramName == "gtColorGX" ) params.gtColorGX = paramValue.toInt();
+ else if ( paramName == "gtColorBX" ) params.gtColorBX = paramValue.toInt();
+ else if ( paramName == "gtColorRY" ) params.gtColorRY = paramValue.toInt();
+ else if ( paramName == "gtColorGY" ) params.gtColorGY = paramValue.toInt();
+ else if ( paramName == "gtColorBY" ) params.gtColorBY = paramValue.toInt();
+ else if ( paramName == "gtColorRZ" ) params.gtColorRZ = paramValue.toInt();
+ else if ( paramName == "gtColorGZ" ) params.gtColorGZ = paramValue.toInt();
+ else if ( paramName == "gtColorBZ" ) params.gtColorBZ = paramValue.toInt();
+ else if ( paramName == "gtDrawTickmarksX" ) params.gtDrawTickmarksX = paramValue.toInt();
+ else if ( paramName == "gtDrawTickmarksY" ) params.gtDrawTickmarksY = paramValue.toInt();
+ else if ( paramName == "gtDrawTickmarksZ" ) params.gtDrawTickmarksZ = paramValue.toInt();
+ else if ( paramName == "gtTickmarkLengthX" ) params.gtTickmarkLengthX = paramValue.toInt();
+ else if ( paramName == "gtTickmarkLengthY" ) params.gtTickmarkLengthY = paramValue.toInt();
+ else if ( paramName == "gtTickmarkLengthZ" ) params.gtTickmarkLengthZ = paramValue.toInt();
+ else if ( paramName == "background" ) {
+ QString bg = paramValue.replace( "$", "=" );
+ bgData = Qtx::stringToBackground( bg );
+ }
}
- performRestoring( params );
}
+ else // old format - "1.000e+00*0.000e+00..."
+ {
+ int idx = 0;
+ params.scale = data.count() > idx ? data[idx++].toDouble() : 1.0;
+ params.centerX = data.count() > idx ? data[idx++].toDouble() : 0.0;
+ params.centerY = data.count() > idx ? data[idx++].toDouble() : 0.0;
+ params.projX = data.count() > idx ? data[idx++].toDouble() : sqrt(1./3);
+ params.projY = data.count() > idx ? data[idx++].toDouble() : -sqrt(1./3);
+ params.projZ = data.count() > idx ? data[idx++].toDouble() : sqrt(1./3);
+ params.twist = data.count() > idx ? data[idx++].toDouble() : 0.0;
+ params.atX = data.count() > idx ? data[idx++].toDouble() : 0.0;
+ params.atY = data.count() > idx ? data[idx++].toDouble() : 0.0;
+ params.atZ = data.count() > idx ? data[idx++].toDouble() : 0.0;
+ params.eyeX = data.count() > idx ? data[idx++].toDouble() : sqrt(250000./3);
+ params.eyeY = data.count() > idx ? data[idx++].toDouble() : -sqrt(250000./3);
+ params.eyeZ = data.count() > idx ? data[idx++].toDouble() : sqrt(250000./3);
+ params.scaleX = data.count() > idx ? data[idx++].toDouble() : 1.0;
+ params.scaleY = data.count() > idx ? data[idx++].toDouble() : 1.0;
+ params.scaleZ = data.count() > idx ? data[idx++].toDouble() : 1.0;
+ params.isVisible = data.count() > idx ? data[idx++].toInt() : 1;
+ params.size = data.count() > idx ? data[idx++].toDouble() : 100.0;
+ }
+ performRestoring( params );
+ setBackground( bgData );
}
/*!
*/
void OCCViewer_ViewWindow::onSketchingFinished()
{
+ MESSAGE("OCCViewer_ViewWindow::onSketchingFinished()")
if ( mypSketcher && mypSketcher->result() == OCCViewer_ViewSketcher::Accept )
{
Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
{
case Rect:
{
- QRect* aRect = (QRect*)mypSketcher->data();
- if( aRect )
- {
- int aLeft = aRect->left();
- int aRight = aRect->right();
- int aTop = aRect->top();
- int aBottom = aRect->bottom();
-
- if( append )
- ic->ShiftSelect( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
- else
- ic->Select( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
- }
+ QRect* aRect = (QRect*)mypSketcher->data();
+ if( aRect )
+ {
+ int aLeft = aRect->left();
+ int aRight = aRect->right();
+ int aTop = aRect->top();
+ int aBottom = aRect->bottom();
+// myRect = aRect;
+
+ if( append )
+ ic->ShiftSelect( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
+ else
+ ic->Select( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
+ }
}
break;
case Polygon:
QPolygon* aPolygon = (QPolygon*)mypSketcher->data();
if( aPolygon )
{
- int size = aPolygon->size();
- TColgp_Array1OfPnt2d anArray( 1, size );
-
- QPolygon::Iterator it = aPolygon->begin();
- QPolygon::Iterator itEnd = aPolygon->end();
- for( int index = 1; it != itEnd; ++it, index++ )
- {
- QPoint aPoint = *it;
- anArray.SetValue( index, gp_Pnt2d( aPoint.x(), aPoint.y() ) );
- }
-
- if( append )
- ic->ShiftSelect( anArray, getViewPort()->getView(), Standard_False );
- else
- ic->Select( anArray, getViewPort()->getView(), Standard_False );
+ int size = aPolygon->size();
+ TColgp_Array1OfPnt2d anArray( 1, size );
+
+ QPolygon::Iterator it = aPolygon->begin();
+ QPolygon::Iterator itEnd = aPolygon->end();
+ for( int index = 1; it != itEnd; ++it, index++ )
+ {
+ QPoint aPoint = *it;
+ anArray.SetValue( index, gp_Pnt2d( aPoint.x(), aPoint.y() ) );
+ }
+
+ if( append )
+ ic->ShiftSelect( anArray, getViewPort()->getView(), Standard_False );
+ else
+ ic->Select( anArray, getViewPort()->getView(), Standard_False );
}
}
break;
{
myEventStarted = bOn;
}
+
+/*!
+ Set enabled state of transformation (rotate, zoom, etc)
+*/
+void OCCViewer_ViewWindow::setTransformEnabled( const OperationType id, const bool on )
+{
+ if ( id != NOTHING ) myStatus.insert( id, on );
+}
+
+/*!
+ \return enabled state of transformation (rotate, zoom, etc)
+*/
+bool OCCViewer_ViewWindow::transformEnabled( const OperationType id ) const
+{
+ return myStatus.contains( id ) ? myStatus[ id ] : true;
+}
+
+void OCCViewer_ViewWindow::onMaximizedView()
+{
+ setMaximized(!isMaximized());
+}
+
+
+void OCCViewer_ViewWindow::setMaximized(bool toMaximize, bool toSendSignal)
+{
+ QAction* anAction = toolMgr()->action( MaximizedId );
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ if ( toMaximize ) {
+ anAction->setText( tr( "MNU_MINIMIZE_VIEW" ) );
+ anAction->setToolTip( tr( "MNU_MINIMIZE_VIEW" ) );
+ anAction->setIcon( aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MINIMIZE" ) ) );
+ anAction->setStatusTip( tr( "DSC_MINIMIZE_VIEW" ) );
+ if (toSendSignal) {
+ emit maximized( this, true );
+ }
+ }
+ else {
+ anAction->setText( tr( "MNU_MAXIMIZE_VIEW" ) );
+ anAction->setToolTip( tr( "MNU_MAXIMIZE_VIEW" ) );
+ anAction->setIcon( aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MAXIMIZE" ) ) );
+ anAction->setStatusTip( tr( "DSC_MAXIMIZE_VIEW" ) );
+ if (toSendSignal) {
+ emit maximized( this, false );
+ }
+ }
+}
+
+
+bool OCCViewer_ViewWindow::isMaximized() const
+{
+ return !(toolMgr()->action( MaximizedId )->text() == tr( "MNU_MAXIMIZE_VIEW" ));
+}
+
+void OCCViewer_ViewWindow::setSketcherStyle( bool enable )
+{
+ IsSketcherStyle = enable;
+}
+
+bool OCCViewer_ViewWindow::isSketcherStyle() const
+{
+ return IsSketcherStyle;
+}
+
+
+void OCCViewer_ViewWindow::set2dMode(Mode2dType theType)
+{
+ my2dMode = theType;
+}
+
+// obsolete
+QColor OCCViewer_ViewWindow::backgroundColor() const
+{
+ return myViewPort ? myViewPort->backgroundColor() : Qt::black;
+}
+
+// obsolete
+void OCCViewer_ViewWindow::setBackgroundColor( const QColor& theColor )
+{
+ if ( myViewPort ) myViewPort->setBackgroundColor( theColor );
+}
+
+Qtx::BackgroundData OCCViewer_ViewWindow::background() const
+{
+ return myViewPort ? myViewPort->background() : Qtx::BackgroundData();
+}
+
+void OCCViewer_ViewWindow::setBackground( const Qtx::BackgroundData& theBackground )
+{
+ if ( myViewPort ) myViewPort->setBackground( theBackground );
+}
+
+/*!
+ Clears view aspects
+*/
+void OCCViewer_ViewWindow::clearViewAspects()
+{
+ myViewAspects.clear();
+}
+
+/*!
+ \return const reference to list of view aspects
+*/
+const viewAspectList& OCCViewer_ViewWindow::getViewAspects()
+{
+ return myViewAspects;
+}
+
+/*!
+ Appends new view aspect
+ \param aParams - new view aspects
+*/
+void OCCViewer_ViewWindow::appendViewAspect( const viewAspect& aParams )
+{
+ myViewAspects.append( aParams );
+}
+
+/*!
+ Replaces old view aspects by new ones
+ \param aViewList - list of new view aspects
+*/
+void OCCViewer_ViewWindow::updateViewAspects( const viewAspectList& aViewList )
+{
+ myViewAspects = aViewList;
+}
+
+void OCCViewer_ViewWindow::synchronizeView( OCCViewer_ViewWindow* viewWindow, int id )
+{
+ OCCViewer_ViewWindow* otherViewWindow = 0;
+ QList<OCCViewer_ViewWindow*> compatibleViews;
+
+ bool isSync = viewWindow->toolMgr()->action( SynchronizeId )->isChecked();
+
+ int vwid = viewWindow->getId();
+
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( !app ) return;
+
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( viewWindow->getViewManager()->getType(), wmlist );
+
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+
+ foreach( SUIT_ViewWindow* vw, vwlist ) {
+ OCCViewer_ViewWindow* occVW = dynamic_cast<OCCViewer_ViewWindow*>( vw );
+ if ( !occVW ) continue;
+
+ // check only compatible types
+ occVW = occVW->getView( viewWindow->get2dMode() );
+ if ( occVW ) {
+ if ( occVW->getId() == id )
+ otherViewWindow = occVW;
+ else if ( occVW != viewWindow )
+ compatibleViews.append( occVW );
+ }
+ }
+ }
+
+ if ( isSync && id ) {
+ // remove all possible disconnections
+ foreach( OCCViewer_ViewWindow* vw, compatibleViews ) {
+ // disconnect target view
+ vw->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), viewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ viewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), vw->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ if ( otherViewWindow ) {
+ // disconnect source view
+ vw->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), otherViewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ otherViewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), vw->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ }
+ QAction* a = vw->toolMgr()->action( SynchronizeId );
+ if ( a ) {
+ int anid = a->data().toInt();
+ if ( a->isChecked() && ( anid == id || anid == vwid ) ) {
+ bool blocked = a->blockSignals( true );
+ a->setChecked( false );
+ a->blockSignals( blocked );
+ }
+ }
+ }
+ if ( otherViewWindow ) {
+ // reconnect source and target view
+ otherViewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), viewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ viewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), otherViewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ otherViewWindow->getViewPort()->connect( viewWindow->getViewPort(), SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ viewWindow->getViewPort()->connect( otherViewWindow->getViewPort(), SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ // synchronize target view with source view
+ viewWindow->getViewPort()->synchronize( otherViewWindow->getViewPort() );
+ viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+ QAction* anOtherAcion = otherViewWindow->toolMgr()->action( SynchronizeId );
+ if (anOtherAcion) {
+ anOtherAcion->setData( viewWindow->getId() );
+ if ( !anOtherAcion->isChecked() ) {
+ bool blocked = anOtherAcion->blockSignals( true );
+ anOtherAcion->setChecked( true );
+ anOtherAcion->blockSignals( blocked );
+ }
+ }
+ }
+ }
+ else if ( otherViewWindow ) {
+ // reconnect source and target view
+ otherViewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), viewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ viewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), otherViewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
+ viewWindow->getViewPort()->synchronize( otherViewWindow->getViewPort() );
+ viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+ QAction* anOtherAcion = otherViewWindow->toolMgr()->action( SynchronizeId );
+ if (anOtherAcion) {
+ if ( anOtherAcion->data().toInt() == viewWindow->getId() && anOtherAcion->isChecked() ) {
+ bool blocked = anOtherAcion->blockSignals( true );
+ anOtherAcion->setChecked( false );
+ anOtherAcion->blockSignals( blocked );
+ }
+ }
+ }
+}
+
+/*!
+ "Synchronize View" action slot.
+*/
+void OCCViewer_ViewWindow::onSynchronizeView(bool checked)
+{
+ QAction* a = qobject_cast<QAction*>( sender() );
+ if ( a ) {
+ synchronizeView( this, a->data().toInt() );
+ }
+}
+
+/*!
+ Update list of available view for the "Synchronize View" action
+*/
+void OCCViewer_ViewWindow::updateSyncViews()
+{
+ QAction* anAction = toolMgr()->action( SynchronizeId );
+ if ( anAction && anAction->menu() ) {
+ int currentId = anAction->data().toInt();
+ anAction->menu()->clear();
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( app ) {
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( getViewManager()->getType(), wmlist );
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist ) {
+ OCCViewer_ViewWindow* occVW = dynamic_cast<OCCViewer_ViewWindow*>( vw );
+ if ( !occVW || occVW == this ) continue;
+ // list only compatible types
+ OCCViewer_ViewWindow* subWindow = occVW->getView( get2dMode() );
+ if ( subWindow && subWindow != this ) {
+ QAction* a = anAction->menu()->addAction( occVW->windowTitle() );
+ if ( subWindow->getId() == currentId ) {
+ QFont f = a->font();
+ f.setBold( true );
+ a->setFont( f );
+ }
+ a->setData( subWindow->getId() );
+ connect( a, SIGNAL( triggered(bool) ), this, SLOT( onSynchronizeView(bool) ) );
+ }
+ }
+ }
+ }
+ if ( anAction->menu()->actions().isEmpty() ) {
+ anAction->setData( 0 );
+ anAction->menu()->addAction( tr( "MNU_SYNC_NO_VIEW" ) );
+ }
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OCCVIEWER_VIEWWINDOW_H
#define OCCVIEWER_VIEWWINDOW_H
#include "OCCViewer.h"
+#include "Qtx.h"
#include "SUIT_ViewWindow.h"
#include <gp_Pnt.hxx>
+#include <V3d_Plane.hxx>
class QtxRectRubberBand;
class SUIT_Desktop;
class OCCViewer_AxialScaleDlg;
class OCCViewer_SetRotationPointDlg;
class OCCViewer_Viewer;
-class viewAspect;
+class OCCViewer_CubeAxesDlg;
class QtxAction;
+struct viewAspect
+{
+public:
+ double scale;
+ double centerX;
+ double centerY;
+ double projX;
+ double projY;
+ double projZ;
+ double twist;
+ double atX;
+ double atY;
+ double atZ;
+ double eyeX;
+ double eyeY;
+ double eyeZ;
+ double scaleX;
+ double scaleY;
+ double scaleZ;
+ QString name;
+ bool isVisible;
+ double size;
+ // graduated trihedron
+ bool gtIsVisible;
+ bool gtDrawNameX;
+ bool gtDrawNameY;
+ bool gtDrawNameZ;
+ QString gtNameX;
+ QString gtNameY;
+ QString gtNameZ;
+ int gtNameColorRX;
+ int gtNameColorGX;
+ int gtNameColorBX;
+ int gtNameColorRY;
+ int gtNameColorGY;
+ int gtNameColorBY;
+ int gtNameColorRZ;
+ int gtNameColorGZ;
+ int gtNameColorBZ;
+ bool gtDrawValuesX;
+ bool gtDrawValuesY;
+ bool gtDrawValuesZ;
+ int gtNbValuesX;
+ int gtNbValuesY;
+ int gtNbValuesZ;
+ int gtOffsetX;
+ int gtOffsetY;
+ int gtOffsetZ;
+ int gtColorRX;
+ int gtColorGX;
+ int gtColorBX;
+ int gtColorRY;
+ int gtColorGY;
+ int gtColorBY;
+ int gtColorRZ;
+ int gtColorGZ;
+ int gtColorBZ;
+ bool gtDrawTickmarksX;
+ bool gtDrawTickmarksY;
+ bool gtDrawTickmarksZ;
+ int gtTickmarkLengthX;
+ int gtTickmarkLengthY;
+ int gtTickmarkLengthZ;
+};
+
+typedef QList<viewAspect> viewAspectList;
+
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
public:
enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
- ChangeRotationPointId, RotationId,
- FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId,
- TrihedronShowId, AxialScaleId };
+ ChangeRotationPointId, RotationId,
+ FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
+ ResetId, CloneId, ClippingId, MemId, RestoreId,
+ TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId,
+ SwitchInteractionStyleId, SwitchZoomingStyleId, MaximizedId, SynchronizeId, UserId };
enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE,
- PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
- FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW };
+ PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
+ FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW, LEFTVIEW, RIGHTVIEW,
+ CLOCKWISEVIEW, ANTICLOCKWISEVIEW };
enum RotationPointType{ GRAVITY, SELECTED };
enum SketchingType { NoSketching, Rect, Polygon };
+ enum Mode2dType { No2dMode, XYPlane, XZPlane, YZPlane};
+
+
OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel);
virtual ~OCCViewer_ViewWindow();
- OCCViewer_ViewPort3d* getViewPort();
+ virtual OCCViewer_ViewWindow* getView( const int ) const;
+
+ virtual OCCViewer_ViewPort3d* getViewPort();
- bool eventFilter(QObject* watched, QEvent* e);
+ virtual bool eventFilter(QObject* watched, QEvent* e);
- void performRestoring( const viewAspect& );
+ virtual void performRestoring( const viewAspect&, bool = false );
virtual void initLayout();
- void updateEnabledDrawMode();
+ virtual void updateEnabledDrawMode();
- void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
- const double dx = 0, const double dy = 0, const double dz = 1);
+ virtual void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
+ const double dx = 0, const double dy = 0, const double dz = 1);
- bool isCuttingPlane();
+ virtual void setCuttingPlane( bool on, const gp_Pln thePln );
+
+ virtual bool isCuttingPlane();
virtual QString getVisualParameters();
virtual void setVisualParameters( const QString& parameters );
- virtual void initSketchers();
- OCCViewer_ViewSketcher* getSketcher( const int );
+ virtual void initSketchers();
+ virtual OCCViewer_ViewSketcher* getSketcher( const int );
+
+ virtual void activateSketching( int );
- void activateSketching( int );
+ virtual int interactionStyle() const;
+ virtual void setInteractionStyle( const int );
+
+ virtual int zoomingStyle() const;
+ virtual void setZoomingStyle( const int );
+ void setTransformEnabled( const OperationType, const bool );
+ bool transformEnabled( const OperationType ) const;
+
+
+ void set2dMode( Mode2dType );
+ Mode2dType get2dMode() const { return my2dMode; }
+
+ void setMaximized( bool, bool = true );
+ bool isMaximized() const;
+
+ void setSketcherStyle( bool enable );
+ bool isSketcherStyle() const;
+
+ virtual QColor backgroundColor() const; // obsolete
+ virtual void setBackgroundColor( const QColor& ); // obsolete
+
+ virtual Qtx::BackgroundData background() const;
+ virtual void setBackground( const Qtx::BackgroundData& );
+
+ virtual const viewAspectList& getViewAspects();
+ virtual void appendViewAspect( const viewAspect& );
+ virtual void updateViewAspects( const viewAspectList& );
+ virtual void clearViewAspects();
+
public slots:
- void onFrontView();
- void onViewFitAll();
- void onBackView();
- void onTopView();
- void onBottomView();
- void onLeftView();
- void onRightView();
- void onResetView();
- void onFitAll();
- void activateZoom();
- void activateWindowFit();
- void activateRotation();
- void activatePanning();
- void activateGlobalPanning();
- void onSetRotationPoint( bool on );
- void onCloneView();
- void onClipping( bool on );
- void onAxialScale();
- void onMemorizeView();
- void onRestoreView();
- void onTrihedronShow();
- void setRestoreFlag();
-
- void activateSetRotationGravity();
- void activateSetRotationSelected( double theX, double theY, double theZ );
- void activateStartPointSelection();
- void updateGravityCoords();
+ virtual void onFrontView();
+ virtual void onViewFitAll();
+ virtual void onBackView();
+ virtual void onTopView();
+ virtual void onBottomView();
+ virtual void onLeftView();
+ virtual void onRightView();
+ virtual void onClockWiseView();
+ virtual void onAntiClockWiseView();
+ virtual void onResetView();
+ virtual void onFitAll();
+ virtual void activateZoom();
+ virtual void activateWindowFit();
+ virtual void activateRotation();
+ virtual void activatePanning();
+ virtual void activateGlobalPanning();
+ virtual void onSetRotationPoint( bool on );
+ virtual void onCloneView();
+ virtual void onClipping( bool on );
+ virtual void onAxialScale();
+ virtual void onGraduatedAxes();
+ virtual void onAmbientToogle();
+ virtual void onMemorizeView();
+ virtual void onRestoreView();
+ virtual void onTrihedronShow();
+ virtual void setRestoreFlag();
+ virtual void onSwitchInteractionStyle( bool on );
+ virtual void onSwitchZoomingStyle( bool on );
+
+ virtual void activateSetRotationGravity();
+ virtual void activateSetRotationSelected( double theX, double theY, double theZ );
+ virtual void activateStartPointSelection();
+ virtual void updateGravityCoords();
virtual void showEvent( QShowEvent * );
virtual void hideEvent( QHideEvent * );
+ virtual void onMaximizedView();
signals:
void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
void Show( QShowEvent * );
void Hide( QHideEvent * );
+ void maximized( OCCViewer_ViewWindow*, bool );
-protected:
+public:
virtual QImage dumpView();
virtual bool dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
+
+protected:
virtual QString filter() const;
/* Transformation selected but not started yet */
bool transformRequested() const;
- void setTransformRequested ( OperationType );
+ bool setTransformRequested ( OperationType );
/* Transformation is selected and already started */
- bool transformInProcess() const;
- void setTransformInProcess( bool );
+ bool transformInProcess() const;
+ void setTransformInProcess( bool );
void vpMousePressEvent(QMouseEvent* theEvent);
void vpMouseReleaseEvent(QMouseEvent* theEvent);
void createActions();
void createToolBar();
- virtual OperationType getButtonState(QMouseEvent* theEvent);
+ virtual OperationType getButtonState(QMouseEvent* theEvent, int theInteractionStyle);
viewAspect getViewParams() const;
OCCViewer_Viewer* myModel;
OCCViewer_ViewPort3d* myViewPort;
+ OCCViewer_CubeAxesDlg* myCubeAxesDlg;
+
RotationPointType myCurrPointType;
RotationPointType myPrevPointType;
gp_Pnt mySelectedPoint;
bool myRotationPointSelection;
- int myRestoreFlag;
+ int myRestoreFlag;
- int myStartX;
- int myStartY;
- int myCurrX;
- int myCurrY;
+ int myStartX;
+ int myStartY;
+ int myCurrX;
+ int myCurrY;
- bool myEventStarted; // set when transformation is in process
- bool myCursorIsHand;
- bool myDrawRect; // set when a rect is used for selection or magnify
- bool myEnableDrawMode;
- bool myPaintersRedrawing; // set to draw with external painters
-
- QCursor myCursor;
+ bool myEventStarted; // set when transformation is in process
+ bool myCursorIsHand;
+ bool myDrawRect; // set when a rect is used for selection or magnify
+ bool myEnableDrawMode;
+ bool myPaintersRedrawing; // set to draw with external painters
+ bool IsSketcherStyle;
+
+ QCursor myCursor;
double myCurScale;
+private slots:
+ void onSynchronizeView(bool);
+ void updateSyncViews();
+
+private:
+ static void synchronizeView( OCCViewer_ViewWindow*, int );
+
private:
OCCViewer_ClippingDlg* myClippingDlg;
QtxAction* myClippingAction;
QtxAction* mySetRotationPointAction;
QtxRectRubberBand* myRectBand; //!< selection rectangle rubber band
+
+ int myInteractionStyle;
+
+ typedef QMap<OperationType, bool> MapOfTransformStatus;
+ MapOfTransformStatus myStatus;
+
+ Mode2dType my2dMode;
+
+ Handle(V3d_Plane) myReserveClippingPlane;
+
+ viewAspectList myViewAspects;
};
#ifdef WIN32
+++ /dev/null
-# Copyright (C) 2007-2008 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 SALOMEGUI : implementation of desktop and GUI kernel
-# File : SALOMEGUI_icons.po
-# Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_OCCVIEWER_VIEW_BACK"
-msgstr "view_back.png"
-
-msgid "ICON_OCCVIEWER_VIEW_BOTTOM"
-msgstr "view_bottom.png"
-
-msgid "ICON_OCCVIEWER_VIEW_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_OCCVIEWER_VIEW_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_OCCVIEWER_VIEW_FRONT"
-msgstr "view_front.png"
-
-msgid "ICON_OCCVIEWER_VIEW_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_OCCVIEWER_VIEW_LEFT"
-msgstr "view_left.png"
-
-msgid "ICON_OCCVIEWER_VIEW_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_OCCVIEWER_VIEW_RESET"
-msgstr "view_reset.png"
-
-msgid "ICON_OCCVIEWER_VIEW_RIGHT"
-msgstr "view_right.png"
-
-msgid "ICON_OCCVIEWER_VIEW_ROTATION_POINT"
-msgstr "view_rotation_point.png"
-
-msgid "ICON_OCCVIEWER_VIEW_ROTATE"
-msgstr "view_rotate.png"
-
-msgid "ICON_OCCVIEWER_VIEW_TOP"
-msgstr "view_top.png"
-
-msgid "ICON_OCCVIEWER_VIEW_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_OCCVIEWER_VIEW_TRIHEDRON"
-msgstr "view_triedre.png"
-
-msgid "ICON_OCCVIEWER_VIEW_DUMP"
-msgstr "view_camera_dump.png"
-
-msgid "ICON_OCCVIEWER_CLONE_VIEW"
-msgstr "view_clone.png"
-
-msgid "ICON_OCCVIEWER_CLIPPING"
-msgstr "view_clipping.png"
-
-msgid "ICON_OCCVIEWER_CLIPPING_PRESSED"
-msgstr "view_clipping_pressed.png"
-
-msgid "ICON_OCCVIEWER_SHOOT_VIEW"
-msgstr "view_shoot.png"
-
-msgid "ICON_OCCVIEWER_PRESETS_VIEW"
-msgstr "view_presets.png"
-
-
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>ICON_OCCVIEWER_VIEW_RIGHT</source>
<translation>occ_view_right.png</translation>
</message>
+ <message>
+ <source>ICON_OCCVIEWER_VIEW_CLOCKWISE</source>
+ <translation>occ_view_clockwise.png</translation>
+ </message>
+ <message>
+ <source>ICON_OCCVIEWER_VIEW_ANTICLOCKWISE</source>
+ <translation>occ_view_anticlockwise.png</translation>
+ </message>
<message>
<source>ICON_OCCVIEWER_CLIPPING</source>
<translation>occ_view_clipping.png</translation>
<source>ICON_OCCVIEWER_SCALING</source>
<translation>occ_view_scaling.png</translation>
</message>
+ <message>
+ <source>ICON_OCCVIEWER_GRADUATED_AXES</source>
+ <translation>occ_view_graduated_axes.png</translation>
+ </message>
+ <message>
+ <source>ICON_OCCVIEWER_AMBIENT</source>
+ <translation>occ_view_ambient.png</translation>
+ </message>
+ <message>
+ <source>ICON_OCCVIEWER_STYLE_SWITCH</source>
+ <translation>occ_view_style_switch.png</translation>
+ </message>
+ <message>
+ <source>ICON_OCCVIEWER_ZOOMING_STYLE_SWITCH</source>
+ <translation>occ_view_zooming_style_switch.png</translation>
+ </message>
+ <message>
+ <source>ICON_OCCVIEWER_MAXIMIZE</source>
+ <translation>occ_view_maximized.png</translation>
+ </message>
+ <message>
+ <source>ICON_OCCVIEWER_MINIMIZE</source>
+ <translation>occ_view_minimized.png</translation>
+ </message>
+ <message>
+ <source>ICON_OCCVIEWER_SYNC</source>
+ <translation>occ_view_sync.png</translation>
+ </message>
</context>
</TS>
+++ /dev/null
-# Copyright (C) 2007-2008 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 SALOMEGUI : implementation of desktop and GUI kernel
-# File : SALOMEGUI_msg_en.po
-# Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_FRONT_VIEW"
-msgstr "Front View"
-
-msgid "MNU_FRONT_VIEW"
-msgstr "Front"
-
-msgid "DSC_BACK_VIEW"
-msgstr "Back View"
-
-msgid "MNU_BACK_VIEW"
-msgstr "Back"
-
-msgid "DSC_TOP_VIEW"
-msgstr "Top View"
-
-msgid "MNU_TOP_VIEW"
-msgstr "Top"
-
-msgid "DSC_BOTTOM_VIEW"
-msgstr "Bottom View"
-
-msgid "MNU_BOTTOM_VIEW"
-msgstr "Bottom"
-
-msgid "DSC_LEFT_VIEW"
-msgstr "Left View"
-
-msgid "MNU_LEFT_VIEW"
-msgstr "Left"
-
-msgid "DSC_RIGHT_VIEW"
-msgstr "Right View"
-
-msgid "MNU_RIGHT_VIEW"
-msgstr "Right"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change the point, around which the rotation is performed"
-
-msgid "DSC_ROTATE_VIEW"
-msgstr "Rotation of the point of view around the scene center"
-
-msgid "OCCViewer_SetRotationPointDlg::CAPTION"
-msgstr "Set Rotation Point"
-
-msgid "OCCViewer_SetRotationPointDlg::USE_BBCENTER"
-msgstr "Use Bounding Box Center"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_TOORIGIN"
-msgstr "Set to Origin"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_SELECTPOINT"
-msgstr "Select Point from View"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_X"
-msgstr "X :"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_Y"
-msgstr "Y :"
-
-msgid "OCCViewer_SetRotationPointDlg::LBL_Z"
-msgstr "Z :"
-
-msgid "MNU_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change Rotation Point"
-
-msgid "MNU_ROTATIONPOINTGRAVITY_VIEW"
-msgstr "Rotation Point : the gravity center"
-
-msgid "MNU_ROTATIONPOINT000_VIEW"
-msgstr "Rotation Point : (0,0,0)"
-
-msgid "MNU_ROTATIONPOINTSELECTED_VIEW"
-msgstr "Rotation Point : the point selected by the user"
-
-msgid "MNU_ROTATE_VIEW"
-msgstr "Rotation"
-
-msgid "DSC_CLONE_VIEW"
-msgstr "Create new OCC viewer for the active scene"
-
-msgid "MNU_CLONE_VIEW"
-msgstr "Clone View"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "DSC_CLIPPING"
-msgstr "Set clipping plane"
-
-msgid "MNU_CLIPPING"
-msgstr "Clipping"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_SHOOT_VIEW"
-msgstr "Memorize View"
-
-msgid "DSC_SHOOT_VIEW"
-msgstr "Memorizes the state of the active view and adds it to the list"
-
-msgid "MNU_PRESETS_VIEW"
-msgstr "Restore View"
-
-msgid "DSC_PRESETS_VIEW"
-msgstr "Selection of the memorized state of the active view"
-
-msgid "OCC_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "INF_APP_SHOOT_VIEW"
-msgstr "Memorize view"
-
-msgid "INF_APP_PRESETS_VIEW"
-msgstr "Restore view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "OCCViewer_Viewer::MEN_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "OCCViewer_Viewer::MEN_SHOW_TOOLBAR"
-msgstr "Show toolbar"
-
-msgid "OCCViewer_Viewer::MEN_CHANGE_BACKGROUD"
-msgstr "Change background..."
-
-msgid "OCCViewer_ViewManager::OCC_VIEW_TITLE"
-msgstr "OCC scene:%M - viewer:%V"
-
-
-msgid "OCCViewer_CreateRestoreViewDlg::CAPTION"
-msgstr "Restore view"
-
-msgid "MNU_SHOW_TRIHEDRE"
-msgstr "Show/Hide trihedron"
-
-msgid "DSC_SHOW_TRIHEDRE"
-msgstr "Show/Hide trihedron in the current view"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>MNU_ROTATE_VIEW</source>
<translation>Rotation</translation>
</message>
- <message>
- <source>OCC_IMAGE_FILES</source>
- <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
- </message>
<message>
<source>DSC_FRONT_VIEW</source>
<translation>Front View</translation>
<source>DSC_RIGHT_VIEW</source>
<translation>Right View</translation>
</message>
+ <message>
+ <source>DSC_ANTICLOCKWISE_VIEW</source>
+ <translation>Rotate view counterclockwise</translation>
+ </message>
+ <message>
+ <source>DSC_CLOCKWISE_VIEW</source>
+ <translation>Rotate View Clockwise</translation>
+ </message>
<message>
<source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
<translation>Change Rotation Point</translation>
<source>MNU_PRESETS_VIEW</source>
<translation>Restore View</translation>
</message>
+ <message>
+ <source>MNU_ANTICLOCKWISE_VIEW</source>
+ <translation>Rotate counterclockwise</translation>
+ </message>
+ <message>
+ <source>MNU_CLOCKWISE_VIEW</source>
+ <translation>Rotate clockwise</translation>
+ </message>
<message>
<source>MNU_RIGHT_VIEW</source>
<translation>Right</translation>
<translation>Restore view</translation>
</message>
<message>
- <source>LBL_TOOLBAR_LABEL</source>
- <translation>View Operations</translation>
+ <source>LBL_XYTOOLBAR_LABEL</source>
+ <translation>XY View Operations</translation>
+ </message>
+ <message>
+ <source>LBL_XZTOOLBAR_LABEL</source>
+ <translation>XZ View Operations</translation>
+ </message>
+ <message>
+ <source>LBL_YZTOOLBAR_LABEL</source>
+ <translation>YZ View Operations</translation>
+ </message>
+ <message>
+ <source>LBL_3DTOOLBAR_LABEL</source>
+ <translation>3D View Operations</translation>
</message>
<message>
<source>DSC_BACK_VIEW</source>
<source>MNU_SCALING</source>
<translation>Scaling</translation>
</message>
+ <message>
+ <source>DSC_GRADUATED_AXES</source>
+ <translation>Graduated axes</translation>
+ </message>
+ <message>
+ <source>MNU_GRADUATED_AXES</source>
+ <translation>Graduated axes</translation>
+ </message>
+ <message>
+ <source>DSC_AMBIENT</source>
+ <translation>Toogle keep only ambient light</translation>
+ </message>
+ <message>
+ <source>MNU_AMBIENT</source>
+ <translation>Toogle keep only ambient light</translation>
+ </message>
+ <message>
+ <source>DSC_STYLE_SWITCH</source>
+ <translation>Interaction style switch</translation>
+ </message>
+ <message>
+ <source>MNU_STYLE_SWITCH</source>
+ <translation>Interaction style switch</translation>
+ </message>
+ <message>
+ <source>DSC_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zooming style switch</translation>
+ </message>
+ <message>
+ <source>MNU_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zooming style switch</translation>
+ </message>
<message>
<source>OCC_IMAGE_FILES</source>
<translation>Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
</message>
+ <message>
+ <source>OCC_TEXTURE_FILES</source>
+ <translation>Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</translation>
+ </message>
+ <message>
+ <source>DSC_MAXIMIZE_VIEW</source>
+ <translation>Maximize view</translation>
+ </message>
+ <message>
+ <source>DSC_MINIMIZE_VIEW</source>
+ <translation>Minimize view</translation>
+ </message>
+ <message>
+ <source>DSC_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize view</translation>
+ </message>
+ <message>
+ <source>MNU_MAXIMIZE_VIEW</source>
+ <translation>Maximize</translation>
+ </message>
+ <message>
+ <source>MNU_MINIMIZE_VIEW</source>
+ <translation>Minimize</translation>
+ </message>
+ <message>
+ <source>MNU_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize</translation>
+ </message>
+ <message>
+ <source>MNU_SYNC_NO_VIEW</source>
+ <translation>[ No appropriate view ]</translation>
+ </message>
</context>
<context>
<name>OCCViewer_CreateRestoreViewDlg</name>
<translation>Show Toolbar</translation>
</message>
<message>
- <source>MEN_CHANGE_BACKGROUD</source>
+ <source>MEN_CHANGE_BACKGROUND</source>
<translation>Change Background...</translation>
</message>
+ <message>
+ <source>MEN_CHANGE_IMAGE</source>
+ <translation>Set/Change Background Image...</translation>
+ </message>
+ <message>
+ <source>SELECT_IMAGE</source>
+ <translation>Select image...</translation>
+ </message>
+ <message>
+ <source>CENTERED</source>
+ <translation>in centered mode</translation>
+ </message>
+ <message>
+ <source>TILED</source>
+ <translation>in tiled mode</translation>
+ </message>
+ <message>
+ <source>STRETCHED</source>
+ <translation>in stretched mode</translation>
+ </message>
+ <message>
+ <source>GT_HORIZONTALGRADIENT</source>
+ <translation>Horizontal gradient</translation>
+ </message>
+ <message>
+ <source>GT_VERTICALGRADIENT</source>
+ <translation>Vertical gradient</translation>
+ </message>
+ <message>
+ <source>GT_FIRSTDIAGONALGRADIENT</source>
+ <translation>First diagonal gradient</translation>
+ </message>
+ <message>
+ <source>GT_SECONDDIAGONALGRADIENT</source>
+ <translation>Second diagonal gradient</translation>
+ </message>
+ <message>
+ <source>GT_FIRSTCORNERGRADIENT</source>
+ <translation>First corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_SECONDCORNERGRADIENT</source>
+ <translation>Second corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_THIRDCORNERGRADIENT</source>
+ <translation>Third corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_FORTHCORNERGRADIENT</source>
+ <translation>Fourth corner gradient</translation>
+ </message>
+ <message>
+ <source>BG_IMAGE_FILES</source>
+ <translation>Image files (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</translation>
+ </message>
</context>
<context>
<name>OCCViewer_AxialScaleDlg</name>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : ObjectBrowser
nodist_libObjBrowser_la_SOURCES = $(MOC_FILES)
-nodist_salomeres_DATA = OB_msg_en.qm
+nodist_salomeres_DATA = OB_msg_en.qm OB_msg_fr.qm
libObjBrowser_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx
libObjBrowser_la_LDFLAGS = $(QT_MT_LIBS)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OB_H
#define OB_H
#if defined WIN32
-# if defined OB_EXPORTS || defined OBJBROWSER_EXPORTS
+# if defined OB_EXPORTS || defined OBJBROWSER_EXPORTS || defined ObjBrowser_EXPORTS
# define OB_EXPORT __declspec( dllexport )
# else
# define OB_EXPORT __declspec( dllimport )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : OB_Browser.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#include "OB_Browser.h"
//#include "OB_Filter.h"
void OB_Browser::ToolTip::maybeTip( const QPoint& pos )
{
if ( !parentWidget() || !myBrowser || !myBrowser->isShowToolTips() )
- return;
+ return;
QListView* lv = myBrowser->listView();
: QWidget( parent ),
myAutoOpenLevel( 0 )
{
- myView = new QtxTreeView( this );
- myView->setRootIsDecorated( true );
- myView->setSelectionMode( QAbstractItemView::ExtendedSelection );
- myView->setAllColumnsShowFocus( true );
-
- mySearchTool = new QtxSearchTool( this, myView );
- mySearchTool->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
- mySearchTool->setActivators( QtxSearchTool::StandardKey | QtxSearchTool::SlashKey );
- mySearchTool->setSearcher( new QtxTreeViewSearcher( myView ) );
+ // set-up tree view
+ myView = new QtxTreeView( this ); // create tree view
+ myView->setRootIsDecorated( true ); // show root item
+ myView->setSelectionMode( QAbstractItemView::ExtendedSelection ); // enable extended selection mode
+ myView->setAllColumnsShowFocus( true ); // focus is shown in all columns
+
+ // enable drag-n-drop support
+ myView->setDragDropMode( QAbstractItemView::DragDrop ); // enable both drag and drop operations
+ myView->setDropIndicatorShown( true ); // show drag indicator on dragging
+
+ // set-up search tool
+ mySearchTool = new QtxSearchTool( this, myView ); // create search tool
+ mySearchTool->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); // do not show frame
+ mySearchTool->setActivators( QtxSearchTool::StandardKey | QtxSearchTool::SlashKey ); // set activation mode
+ mySearchTool->setSearcher( new QtxTreeViewSearcher( myView ) ); // assign searcher (for tree view)
+ // layout widgets
QVBoxLayout* main = new QVBoxLayout( this );
main->addWidget( myView );
main->addWidget( mySearchTool );
setModel( model );
connect( myView, SIGNAL( selectionChanged() ),
- this, SIGNAL( selectionChanged() ) );
-
+ this, SIGNAL( selectionChanged() ) );
}
/*!
*/
int OB_Browser::numberOfSelected() const
{
- return myView->selectionModel() ? myView->selectionModel()->selectedIndexes().count() : 0;
+ // we take selection by rows
+ return myView->selectionModel() ? myView->selectionModel()->selectedRows().count() : 0;
}
/*!
*/
QModelIndexList OB_Browser::selectedIndexes() const
{
- return myView->selectionModel() ? myView->selectionModel()->selectedIndexes() : QModelIndexList();
+ // we take selection by rows
+ return myView->selectionModel() ? myView->selectionModel()->selectedRows() : QModelIndexList();
}
/*!
myView->blockSignals( true );
QModelIndex idx;
- bool first = true;
if ( !indexes.isEmpty() ) {
- foreach( idx, indexes ) {
- select( idx, on, first ? keepSelection : true );
- first = false;
+ QItemSelection mysel;
+ // select by range if indexes are contiguous
+ QModelIndex first=indexes.at(0);
+ QModelIndex last=first;
+ if (indexes.size() > 1) {
+ for (int i = 1; i < indexes.size(); ++i)
+ {
+ idx=indexes.at(i);
+ if(idx.parent().internalId()==last.parent().internalId() && idx.row()==last.row()+1 && idx.column()==last.column())
+ {
+ // index is contiguous to last: extend the range
+ last=idx;
+ }
+ else
+ {
+ // index idx is not contiguous: create a new range
+ mysel.select(first,last);
+ first=idx;
+ last=idx;
+ }
+ }
+ }
+ mysel.select(first,last);
+
+ if ( myView->selectionModel() ) {
+ QItemSelectionModel::SelectionFlags f = on ? QItemSelectionModel::Select : QItemSelectionModel::Deselect;
+ f = f | QItemSelectionModel::Rows;
+ if ( !keepSelection )
+ f = f | QItemSelectionModel::Clear;
+ myView->selectionModel()->select( mysel, f );
}
}
- else if ( !keepSelection ) {
+ else if ( !keepSelection )
+ {
myView->clearSelection();
}
{
bool parentOpen = true;
if( item && item->parent() )
- parentOpen = item->parent()->isOpen();
+ parentOpen = item->parent()->isOpen();
if ( openObjs[obj] && parentOpen )
lv->setOpen( item, true );
{
bool parentOpen = true;
if( item && item->parent() )
- parentOpen = item->parent()->isOpen();
+ parentOpen = item->parent()->isOpen();
if( parentOpen )
- lv->setOpen( item, true );
+ lv->setOpen( item, true );
}
if ( !curItem && ( curObj == obj || ( !curKey.isNull() && curKey == key )) )
bool closed = false, opened = false;
for ( QModelIndexList::Iterator it = indexes.begin();
- it != indexes.end() && !closed; ++it ) {
+ it != indexes.end() && !closed; ++it ) {
closed = hasCollased( *it );
}
for ( QModelIndexList::Iterator it = indexes.begin();
- it != indexes.end() && !opened; ++it ) {
+ it != indexes.end() && !opened; ++it ) {
opened = hasExpanded( *it );
}
if ( !result && hasChildren ) {
int rows = model()->rowCount( index );
for ( int i = 0; i < rows && !result; i ++ ) {
- QModelIndex child = model()->index( i, 0, index );
- result = hasCollased( child );
+ QModelIndex child = model()->index( i, 0, index );
+ result = hasCollased( child );
}
}
}
if ( !result && hasChildren ) {
int rows = model()->rowCount( index );
for ( int i = 0; i < rows && !result; i ++ ) {
- QModelIndex child = model()->index( i, 0, index );
- result = hasExpanded( child );
+ QModelIndex child = model()->index( i, 0, index );
+ result = hasExpanded( child );
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : OB_Browser.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#ifndef OB_BROWSER_H
#define OB_BROWSER_H
QtxSearchTool* searchTool() const;
bool isSearchToolEnabled() const;
void setSearchToolEnabled( const bool );
-
+
int autoOpenLevel() const;
void setAutoOpenLevel( const int );
void openLevels( const int = -1 );
unsigned long getModifiedTime() const;
void setModified();
-
+
// san - moved to SUIT_TreeModel
//OB_Updater* getUpdater() const;
//virtual void setUpdater( OB_Updater* theUpdate = 0 );
private slots:
void onExpandAll();
void onCollapseAll();
- //void onDestroyed( SUIT_DataObject* );
- //void onDoubleClicked ( QListViewItem* );
- //void onDropped( QPtrList<QListViewItem>, QListViewItem*, int );
-
+ //void onDestroyed( SUIT_DataObject* );
+ //void onDoubleClicked ( QListViewItem* );
+ //void onDropped( QPtrList<QListViewItem>, QListViewItem*, int );
+
protected:
//void adjustWidth( QListViewItem* );
//virtual void updateText();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "OB_Filter.h"
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef OB_FILTER_H
#define OB_FILTER_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "MEN_EXPAND_ALL"
-msgstr "Expand All"
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>OB_Browser</name>
<message>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : Plot2d
lib_LTLIBRARIES = libPlot2d.la
# header files
-salomeinclude_HEADERS = \
- Plot2d.h \
- Plot2d_Curve.h \
- Plot2d_FitDataDlg.h \
- Plot2d_Prs.h \
- Plot2d_SetupViewDlg.h \
- Plot2d_ViewFrame.h \
- Plot2d_ViewManager.h \
- Plot2d_ViewModel.h \
- Plot2d_ViewWindow.h \
- Plot2d_SetupCurveDlg.h \
- Plot2d_ToolTip.h
+salomeinclude_HEADERS = \
+ 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
+salomeinclude_HEADERS += \
+ Plot2d_AnalyticalCurve.h \
+ Plot2d_AnalyticalCurveDlg.h \
+ Plot2d_AnalyticalParser.h
+endif
+
dist_libPlot2d_la_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_ViewManager.cxx \
Plot2d_ViewModel.cxx \
Plot2d_ViewWindow.cxx \
+ Plot2d_Algorithm.cxx \
+ Plot2d_NormalizeAlgorithm.cxx \
Plot2d_SetupCurveDlg.cxx \
- Plot2d_ToolTip.cxx
+ Plot2d_SetupCurveScaleDlg.cxx \
+ Plot2d_ToolTip.cxx
+
+if ENABLE_PYCONSOLE
+dist_libPlot2d_la_SOURCES += \
+ Plot2d_AnalyticalCurve.cxx \
+ Plot2d_AnalyticalCurveDlg.cxx \
+ Plot2d_AnalyticalParser.cxx
+endif
MOC_FILES = \
Plot2d_FitDataDlg_moc.cxx \
Plot2d_ViewModel_moc.cxx \
Plot2d_ViewWindow_moc.cxx \
Plot2d_SetupCurveDlg_moc.cxx \
+ Plot2d_Algorithm_moc.cxx \
+ Plot2d_NormalizeAlgorithm_moc.cxx \
+ Plot2d_SetupCurveScaleDlg_moc.cxx \
Plot2d_ToolTip_moc.cxx
+
+if ENABLE_PYCONSOLE
+MOC_FILES += Plot2d_AnalyticalCurveDlg_moc.cxx
+endif
+
nodist_libPlot2d_la_SOURCES = $(MOC_FILES)
dist_salomeres_DATA = \
resources/plot2d_log_y.png \
resources/plot2d_pan.png \
resources/plot2d_points.png \
+ resources/plot2d_print.png \
resources/plot2d_settings.png \
resources/plot2d_splines.png \
+ resources/plot2d_analytical_curve.png \
+ resources/plot2d_lmax_normalization.png \
+ resources/plot2d_lmin_normalization.png \
+ resources/plot2d_rmax_normalization.png \
+ resources/plot2d_rmin_normalization.png \
resources/plot2d_zoom.png
nodist_salomeres_DATA = \
Plot2d_images.qm \
- Plot2d_msg_en.qm
+ Plot2d_msg_en.qm \
+ Plot2d_msg_fr.qm
libPlot2d_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(QWT_INCLUDES) \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-libPlot2d_la_LDFLAGS = $(QWT_LIBS) $(QT_MT_LIBS) ../SUIT/libsuit.la
+libPlot2d_la_LDFLAGS = $(QWT_LIBS) $(QT_MT_LIBS) $(PYTHON_LIBS) ../SUIT/libsuit.la
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include <QPainter>
+#include <qwt_plot.h>
+#include <qwt_plot_curve.h>
+
+const int MSIZE = 9;
+const int MAX_ATTEMPTS = 10; // max attempts
+
+// color tolerance (used to compare color values)
+const long COLOR_DISTANCE = 100;
+
+
+
+/*!
+ Constructor
+*/
+Plot2d_Point::Plot2d_Point()
+ : x( 0. ), y( 0. ), deviationPtr(0)
+{
+}
+
+/*!
+ Constructor
+*/
+Plot2d_Point::Plot2d_Point( double theX, double theY, const QString& theText )
+ : x( theX ), y( theY ), text( theText ), deviationPtr(0)
+{
+}
+
+/*!
+ Destructor.
+*/
+Plot2d_Point::~Plot2d_Point() {
+ clearDeviation();
+}
+
+/*!
+ Free memory allocated for the deviation data.
+*/
+void Plot2d_Point::clearDeviation() {
+ if(deviationPtr)
+ delete deviationPtr;
+ deviationPtr = 0;
+}
+
+/*!
+ Return true in case if deviation data is assigned to the point.
+*/
+bool Plot2d_Point::hasDeviation() const {
+ return !(deviationPtr == 0);
+}
+
+/*!
+ Assign deviation data to the point.
+*/
+void Plot2d_Point::setDeviation(double min, double max) {
+ clearDeviation();
+ deviationPtr = new double[2];
+ deviationPtr[0] = min;deviationPtr[1] = max;
+}
+
+/*!
+ Return true in case if deviation data is assigned to the point
+ and store deviation data in the input parameters.
+*/
+bool Plot2d_Point::deviation(double& min, double& max) const {
+ if(hasDeviation()) {
+ min = deviationPtr[0];
+ max = deviationPtr[1];
+ }
+ return false;
+}
+
+/*!
+ Return minimal deviation value.
+*/
+bool Plot2d_Point::minDeviation(double& min) const {
+ if(hasDeviation()) {
+ min = deviationPtr[0];
+ return true;
+ } else {
+ min = 0;
+ }
+ return false;
+}
+
+/*!
+ Return minimal deviation value.
+*/
+bool Plot2d_Point::maxDeviation(double& max) const {
+ if(hasDeviation()) {
+ max = deviationPtr[1];
+ return true;
+ } else {
+ max = 0;
+ }
+ return false;
+}
+
+
+
/*!
\brief Convert Plot2d marker type to Qwt marker type.
\param m Plot2d marker type
\param width line width
*/
void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2,
- Qt::PenStyle type, const QColor& color, int width )
+ Qt::PenStyle type, const QColor& color, int width )
{
painter->save();
QPen pen( type );
\param width line width
*/
void Plot2d::drawLine( QPainter* painter, const QPoint& p1, const QPoint& p2,
- Plot2d::LineType type, const QColor& color, int width )
+ Plot2d::LineType type, const QColor& color, int width )
{
drawLine( painter, p1, p2, plot2qwtLine( type ), color, width );
}
\param width line width
*/
void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
- Qt::PenStyle type, const QColor& color, int width )
+ Qt::PenStyle type, const QColor& color, int width )
{
drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ), type, color, width );
}
\param width line width
*/
void Plot2d::drawLine( QPainter* painter, int x1, int y1, int x2, int y2,
- Plot2d::LineType type, const QColor& color, int width )
+ Plot2d::LineType type, const QColor& color, int width )
{
drawLine( painter, QPoint( x1, y1 ), QPoint( x2, y2 ),
- plot2qwtLine( type), color, width );
+ plot2qwtLine( type), color, width );
}
/*!
\param color marker color
*/
void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
- QwtSymbol::Style type, const QColor& color )
+ QwtSymbol::Style type, const QColor& color )
{
painter->save();
painter->setPen( color );
\param color marker color
*/
void Plot2d::drawMarker( QPainter* painter, const QPoint& p, const QRect& r,
- Plot2d::MarkerType type, const QColor& color )
+ Plot2d::MarkerType type, const QColor& color )
{
drawMarker( painter, p, r, plot2qwtMarker( type ), color );
}
\param color marker color
*/
void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h,
- QwtSymbol::Style type, const QColor& color )
+ QwtSymbol::Style type, const QColor& color )
{
drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), type, color );
}
\param color marker color
*/
void Plot2d::drawMarker( QPainter* painter, int x, int y, int w, int h,
- Plot2d::MarkerType type, const QColor& color )
+ Plot2d::MarkerType type, const QColor& color )
{
drawMarker( painter, QPoint( x, y ), QRect( 0, 0, w, h ), plot2qwtMarker( type ), color );
}
+
+
+/*!
+ \brief Create icon pixmap according to the marker type.
+ \param size icon size
+ \param type marker type
+ \param color icon color
+ \return icon
+*/
+QPixmap Plot2d::markerIcon(const QSize &size, const QColor& color, Plot2d::MarkerType type )
+{
+
+ QPixmap px( size );
+ px.fill( QColor( 255, 255, 255, 0 ) );
+ QPainter p( &px );
+ Plot2d::drawMarker( &p, size.width()/2, size.height()/2, MSIZE, MSIZE, type, color );
+ return px;
+}
+
+
+/*!
+ \brief Create icon pixmap according to the line type.
+ \param size icon size
+ \param type line type
+ \param color icon color
+ \return icon
+*/
+QPixmap Plot2d::lineIcon( const QSize& size, const QColor& color, Plot2d::LineType type )
+{
+
+ QPixmap px( size );
+ px.fill( QColor( 255, 255, 255, 0 ) );
+ QPainter p( &px );
+ drawLine( &p, 5, size.height()/2, size.width()-5, size.height()/2, type,
+ color, 1 );
+ return px;
+}
+
+/*!
+ Gets new unique marker for item if possible
+*/
+void Plot2d::getNextMarker( const int rtti, const QwtPlot* thePlot, QwtSymbol::Style& typeMarker,
+ QColor& color, Qt::PenStyle& typeLine )
+{
+ bool bOk = false;
+ int cnt = 0;
+ while ( !bOk ) {
+ int aRed = (int)( 256.0 * rand() / RAND_MAX ); // generate random color
+ int aGreen = (int)( 256.0 * rand() / RAND_MAX ); // ...
+ int aBlue = (int)( 256.0 * rand() / RAND_MAX ); // ...
+ int aMarker = (int)( 9.0 * rand() / RAND_MAX ) + 1;// 9 markers types( not including empty )
+ int aLine = (int)( 5.0 * rand() / RAND_MAX ) + 1;// 5 line types ( not including empty )
+
+ typeMarker = ( QwtSymbol::Style )aMarker;
+ color = QColor( aRed, aGreen, aBlue );
+ typeLine = ( Qt::PenStyle )aLine;
+
+ bOk = ( ++cnt == MAX_ATTEMPTS ) || !existMarker( rtti, thePlot, typeMarker, color, typeLine );
+ }
+}
+
+/*!
+ Checks if marker belongs to any enitity
+*/
+bool Plot2d::existMarker( const int rtti, const QwtPlot* thePlot, const QwtSymbol::Style typeMarker,
+ const QColor& color, const Qt::PenStyle typeLine )
+{
+ bool ok = false;
+
+ QColor bgColor = thePlot->palette().color( QPalette::Background );
+ if ( closeColors( color, bgColor ) ) {
+ ok = true;
+ }
+ else {
+ QwtPlotItemList anItems = thePlot->itemList();
+ QwtPlotItemIterator anIt = anItems.begin(), aLast = anItems.end();
+ QwtPlotItem* anItem;
+ for ( ; anIt != aLast && !ok; anIt++ ) {
+ anItem = *anIt;
+ if ( anItem && anItem->rtti() == rtti ) {
+ QwtPlotCurve* crv = dynamic_cast<QwtPlotCurve*>( anItem );
+ if ( crv ) {
+ QwtSymbol::Style aStyle = crv->symbol().style();
+ QColor aColor = crv->pen().color();
+ Qt::PenStyle aLine = crv->pen().style();
+ ok = closeColors( aColor, color ) && aStyle == typeMarker && aLine == typeLine;
+ }
+ }
+ }
+ }
+ return ok;
+}
+
+/*!
+ Checks if two colors are close to each other
+ uses COLOR_DISTANCE variable as max tolerance for comparing of colors
+*/
+
+bool Plot2d::closeColors( const QColor& color1,
+ const QColor& color2,
+ int distance )
+{
+ long tol =
+ qAbs( color2.red() - color1.red() ) +
+ qAbs( color2.green() - color1.green() ) +
+ qAbs( color2.blue() - color1.blue() ) -
+ ( distance < 0 ? COLOR_DISTANCE : distance );
+
+ return tol <= 0;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#define PLOT2D_H
#ifdef WIN32
-# ifdef PLOT2D_EXPORTS
+# if defined PLOT2D_EXPORTS || defined Plot2d_EXPORTS
# define PLOT2D_EXPORT __declspec(dllexport)
# else
# define PLOT2D_EXPORT __declspec(dllimport)
#include <Qt>
class QPainter;
+class QwtPlot;
+
+// Properties on the deviation marker.
+#define PLOT2D_DEVIATION_COLOR "DEVIATION_COLOR"
+#define PLOT2D_DEVIATION_LW "DEVIATION_LW"
+#define PLOT2D_DEVIATION_TS "DEVIATION_TS"
+
+struct PLOT2D_EXPORT Plot2d_Point
+{
+ double x;
+ double y;
+ double* deviationPtr;
+ QString text;
+ Plot2d_Point();
+ Plot2d_Point( double theX, double theY, const QString& theText = QString() );
+ ~Plot2d_Point();
+ bool deviation(double& min, double& max) const;
+ bool hasDeviation() const;
+ void setDeviation(double min, double max);
+ void clearDeviation();
+ bool minDeviation(double& min) const;
+ bool maxDeviation(double& max) const;
+};
+
+typedef QList<Plot2d_Point> pointList;
+
namespace Plot2d
{
typedef enum { None,
- Circle,
- Rectangle,
- Diamond,
- DTriangle,
- UTriangle,
- LTriangle,
- RTriangle,
- Cross,
- XCross
+ Circle,
+ Rectangle,
+ Diamond,
+ DTriangle,
+ UTriangle,
+ LTriangle,
+ RTriangle,
+ Cross,
+ XCross
} MarkerType;
typedef enum {
LineType qwt2plotLine( Qt::PenStyle );
void drawLine( QPainter*, const QPoint&, const QPoint&,
- Qt::PenStyle = Qt::SolidLine,
- const QColor& = Qt::black, int = 0 );
+ Qt::PenStyle = Qt::SolidLine,
+ const QColor& = Qt::black, int = 0 );
void drawLine( QPainter*, const QPoint&, const QPoint&,
- LineType = Solid,
- const QColor& = Qt::black, int = 0 );
+ LineType = Solid,
+ const QColor& = Qt::black, int = 0 );
void drawLine( QPainter*, int, int, int, int,
- Qt::PenStyle = Qt::SolidLine,
- const QColor& = Qt::black, int = 0 );
+ Qt::PenStyle = Qt::SolidLine,
+ const QColor& = Qt::black, int = 0 );
void drawLine( QPainter*, int, int, int, int,
- LineType = Solid,
- const QColor& = Qt::black, int = 0 );
+ LineType = Solid,
+ const QColor& = Qt::black, int = 0 );
void drawMarker( QPainter*, const QPoint&, const QRect&,
- QwtSymbol::Style = QwtSymbol::Ellipse,
- const QColor& = Qt::black );
+ QwtSymbol::Style = QwtSymbol::Ellipse,
+ const QColor& = Qt::black );
void drawMarker( QPainter*, const QPoint&, const QRect&,
- MarkerType = Circle,
- const QColor& = Qt::black );
+ MarkerType = Circle,
+ const QColor& = Qt::black );
void drawMarker( QPainter*, int, int, int, int,
- QwtSymbol::Style = QwtSymbol::Ellipse,
- const QColor& = Qt::black );
+ QwtSymbol::Style = QwtSymbol::Ellipse,
+ const QColor& = Qt::black );
void drawMarker( QPainter*, int, int, int, int,
- MarkerType = Circle,
- const QColor& = Qt::black );
+ MarkerType = Circle,
+ const QColor& = Qt::black );
+
+ QPixmap markerIcon( const QSize&, const QColor&,
+ Plot2d::MarkerType );
+
+ QPixmap lineIcon( const QSize&, const QColor&,
+ Plot2d::LineType );
+
+ void getNextMarker( const int rtti, const QwtPlot*, QwtSymbol::Style&,
+ QColor&, Qt::PenStyle& );
+
+ bool existMarker( const int rtti , const QwtPlot*, const QwtSymbol::Style,
+ const QColor&, const Qt::PenStyle );
+
+
+ bool closeColors( const QColor&,
+ const QColor&,
+ int distance = -1 );
+
}
#if defined WIN32
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = Plot2d
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHONVER=2.4
-PYTHONHOME=$$(PYTHONHOME)
-PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
-
-QWTHOME=$$(QWTHOME)
-QWTINC=$${QWTHOME}/include
-QWTLIB=$${QWTHOME}/lib
-
-INCLUDEPATH += ../../include $${QWTINC} $${PYTHONINC}
-INCLUDEPATH += ../Qtx ../SUIT
-unix:LIBS += -L$${QWTLIB} -lqwt
-win32:LIBS += /LIBPATH:$$(QWTLIB)
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PLOT2D_EXPORTS
-
-HEADERS = Plot2d.h
-HEADERS += Plot2d_Curve.h
-HEADERS += Plot2d_FitDataDlg.h
-HEADERS += Plot2d_Prs.h
-HEADERS += Plot2d_SetupViewDlg.h
-HEADERS += Plot2d_ViewFrame.h
-HEADERS += Plot2d_ViewManager.h
-HEADERS += Plot2d_ViewModel.h
-HEADERS += Plot2d_ViewWindow.h
-HEADERS += Plot2d_SetupCurveDlg.h
-HEADERS += Plot2d_ToolTip.h
-
-SOURCES = Plot2d_Curve.cxx
-SOURCES += Plot2d_FitDataDlg.cxx
-SOURCES += Plot2d_Prs.cxx
-SOURCES += Plot2d_SetupViewDlg.cxx
-SOURCES += Plot2d_ViewFrame.cxx
-SOURCES += Plot2d_ViewManager.cxx
-SOURCES += Plot2d_ViewModel.cxx
-SOURCES += Plot2d_ViewWindow.cxx
-SOURCES += Plot2d_SetupCurveDlg.cxx
-SOURCES += Plot2d_ToolTip.cxx
-
-TRANSLATIONS = resources/Plot2d_msg_en.ts \
- resources/Plot2d_images.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// File : Plot2d_Curve.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : Plot2d_Curve.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
#include "Plot2d_Curve.h"
-#include <QColor>
+#include "Plot2d_PlotItems.h"
+#include <qwt_plot_curve.h>
+
+const int DEFAULT_LINE_WIDTH = 0; // (default) line width
+const int DEFAULT_MARKER_SIZE = 9; // default marker size
/*!
Constructor
*/
Plot2d_Curve::Plot2d_Curve()
-: myHorTitle( "" ), myVerTitle( "" ),
- myHorUnits( "" ), myVerUnits( "" ),
- myAutoAssign( true ),
- myColor( 0,0,0 ),
+: Plot2d_Object(),
+ myColor( 0, 0, 0 ),
myMarker( Plot2d::Circle ),
+ myMarkerSize( 0 ),
myLine( Plot2d::Solid ),
- myLineWidth( 0 ),
- myYAxis( QwtPlot::yLeft )
+ myLineWidth( 0 )
{
}
}
/*!
- Copy constructor. Makes deep copy of data.
+ Copy constructor. Makes deep copy of data
*/
Plot2d_Curve::Plot2d_Curve( const Plot2d_Curve& curve )
+: Plot2d_Object( curve )
{
- myAutoAssign = curve.isAutoAssign();
- myHorTitle = curve.getHorTitle();
- myVerTitle = curve.getVerTitle();
- myHorUnits = curve.getHorUnits();
- myVerUnits = curve.getVerUnits();
myColor = curve.getColor();
myMarker = curve.getMarker();
+ myMarkerSize = curve.getMarkerSize();
myLine = curve.getLine();
myLineWidth = curve.getLineWidth();
- myPoints = curve.getPointList();
}
/*!
- operator=. Makes deep copy of data.
+ operator=. Makes deep copy of data
*/
Plot2d_Curve& Plot2d_Curve::operator=( const Plot2d_Curve& curve )
{
- myAutoAssign = curve.isAutoAssign();
- myHorTitle = curve.getHorTitle();
- myVerTitle = curve.getVerTitle();
- myHorUnits = curve.getHorUnits();
- myVerUnits = curve.getVerUnits();
+ Plot2d_Object::operator=(curve);
myColor = curve.getColor();
myMarker = curve.getMarker();
+ myMarkerSize = curve.getMarkerSize();
myLine = curve.getLine();
myLineWidth = curve.getLineWidth();
- myPoints = curve.getPointList();
return *this;
}
/*!
- \return title of table
-*/
-QString Plot2d_Curve::getTableTitle() const
-{
- return QString();
-}
-
-/*!
- Sets curve's horizontal title
-*/
-void Plot2d_Curve::setHorTitle( const QString& title )
-{
- myHorTitle = title;
-}
-
-/*!
- Gets curve's horizontal title
-*/
-QString Plot2d_Curve::getHorTitle() const
-{
- return myHorTitle;
-}
-
-/*!
- Sets curve's vertical title
-*/
-void Plot2d_Curve::setVerTitle( const QString& title )
-{
- myVerTitle = title;
-}
-
-/*!
- Gets curve's vertical title
+ Get typeid for the plot2d curve class
*/
-QString Plot2d_Curve::getVerTitle() const
+int Plot2d_Curve::rtti()
{
- return myVerTitle;
+ return QwtPlotItem::Rtti_PlotCurve;
}
/*!
- Sets curve's horizontal units
+ Create plot object for the curve
*/
-void Plot2d_Curve::setHorUnits( const QString& units )
+QwtPlotItem* Plot2d_Curve::createPlotItem()
{
- myHorUnits = units;
+ QwtPlotCurve* aCurve = new Plot2d_QwtPlotCurve( getVerTitle(), getYAxis() );
+ updatePlotItem( aCurve );
+ return aCurve;
}
/*!
- Gets curve's horizontal units
+ Auto fill parameters of object by plot view
*/
-QString Plot2d_Curve::getHorUnits() const
+void Plot2d_Curve::autoFill( const QwtPlot* thePlot )
{
- return myHorUnits;
-}
+ QwtSymbol::Style typeMarker;
+ QColor color;
+ Qt::PenStyle typeLine;
+ Plot2d::getNextMarker( rtti(), thePlot, typeMarker, color, typeLine );
-/*!
- Sets curve's vertical units
-*/
-void Plot2d_Curve::setVerUnits( const QString& units )
-{
- myVerUnits = units;
+ setColor( color );
+ setLine( Plot2d::qwt2plotLine( typeLine ), DEFAULT_LINE_WIDTH );
+ setMarker( Plot2d::qwt2plotMarker( typeMarker ) );
}
/*!
- Gets curve's vertical units
+ Updates curve fields
*/
-QString Plot2d_Curve::getVerUnits() const
+void Plot2d_Curve::updatePlotItem( QwtPlotItem* theItem )
{
- return myVerUnits;
-}
+ if ( theItem->rtti() != rtti() )
+ return;
-/*!
- Adds one point for curve.
-*/
-void Plot2d_Curve::addPoint(double theX, double theY, const QString& txt )
-{
- Plot2d_Point aPoint;
- aPoint.x = theX;
- aPoint.y = theY;
- aPoint.text = txt;
- myPoints.append(aPoint);
-}
+ Plot2d_QwtPlotCurve* aCurve = dynamic_cast<Plot2d_QwtPlotCurve*>( theItem );
+ if ( !aCurve )
+ return;
-/*!
- Insert one point for curve on some position.
-*/
-void Plot2d_Curve::insertPoint(int thePos, double theX, double theY, const QString& txt)
-{
- Plot2d_Point aPoint;
- aPoint.x = theX;
- aPoint.y = theY;
- aPoint.text = txt;
-
- pointList::iterator aIt;
- int aCurrent = 0;
- for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
- if (thePos == aCurrent) {
- myPoints.insert(aIt, aPoint);
- return;
+ Plot2d_Object::updatePlotItem( theItem );
+
+ Qt::PenStyle ps = Plot2d::plot2qwtLine( getLine() );
+ QwtSymbol::Style ms = Plot2d::plot2qwtMarker( getMarker() );
+
+ QColor aColor = isSelected() ? Plot2d_Object::selectionColor() : getColor();
+ int lineW = getLineWidth();
+ if ( isSelected() ) lineW += (lineW == 0 ? 3 : 2);
+
+ int markerS = isSelected() ? getMarkerSize() + 2 : getMarkerSize();
+
+ aCurve->setSelected(isSelected());
+
+ aCurve->setPen( QPen(aColor , lineW, ps ) );
+ aCurve->setSymbol( QwtSymbol( ms, QBrush( aColor ),
+ QPen( aColor ),
+ QSize( markerS , markerS ) ) );
+
+ aCurve->setLegendPen(QPen(getColor(), getLineWidth(), ps ));
+ aCurve->setLegendSymbol( QwtSymbol( ms, QBrush( getColor() ),
+ QPen( getColor() ),
+ QSize( getMarkerSize() , getMarkerSize() )));
+
+ double *x, *y, *min, *max;
+ long nb = getData( &x, &y );
+ if(nb > 0 && x && y) {
+ aCurve->setData( x, y, nb );
+ delete [] x;
+ delete [] y;
+ QList<int> idx;
+ getDeviationData(min, max, idx);
+ if(idx.size() > 0 && min && max) {
+ aCurve->setDeviationData(min,max,idx);
+ delete min;
+ delete max;
+ } else {
+ aCurve->clearDeviationData();
}
- aCurrent++;
}
- myPoints.append(aPoint);
}
/*!
- Delete one point for curve on some position.
+ Sets curve's color ( and resets AutoAssign flag )
*/
-void Plot2d_Curve::deletePoint(int thePos)
+void Plot2d_Curve::setColor( const QColor& color )
{
- if ( thePos >= 0 && thePos < myPoints.count() )
- myPoints.removeAt( thePos );
+ myColor = color;
+ setAutoAssign( false );
}
/*!
- Remove all points for curve.
+ Gets curve's color
*/
-void Plot2d_Curve::clearAllPoints()
+QColor Plot2d_Curve::getColor() const
{
- myPoints.clear();
+ return myColor;
}
/*!
- Gets curve's data : abscissas of points
+ Sets marker type and size ( and resets AutoAssign flag )
*/
-pointList Plot2d_Curve::getPointList() const
+void Plot2d_Curve::setMarker( Plot2d::MarkerType marker, const int markerSize )
{
- return myPoints;
+ setMarker( marker );
+ setMarkerSize( markerSize );
+ setAutoAssign( false );
}
/*!
- Sets curve's data.
+ Sets marker type ( and resets AutoAssign flag )
*/
-void Plot2d_Curve::setData( const double* hData, const double* vData, long size, const QStringList& lst )
+void Plot2d_Curve::setMarker( Plot2d::MarkerType marker )
{
- clearAllPoints();
- QStringList::const_iterator anIt = lst.begin(), aLast = lst.end();
- for( long i = 0; i < size; i++, anIt++ )
- addPoint( hData[i], vData[i], anIt==aLast ? QString() : *anIt );
+ myMarker = marker;
+ setAutoAssign( false );
}
-/*!
- Gets curve's data : abscissas of points
-*/
-double* Plot2d_Curve::horData() const
+/* Sets Qwt marker type
+ */
+void Plot2d_Curve::setMarkerStyle( QwtSymbol::Style style)
{
- int aNPoints = nbPoints();
- double* aX = new double[aNPoints];
- for (int i = 0; i < aNPoints; i++) {
- aX[i] = myPoints[i].x;
- }
- return aX;
+ myMarkerStyle = style;
}
/*!
- Gets curve's data : ordinates of points
+ Gets marker type
*/
-double* Plot2d_Curve::verData() const
+Plot2d::MarkerType Plot2d_Curve::getMarker() const
{
- int aNPoints = nbPoints();
- double* aY = new double[aNPoints];
- for (int i = 0; i < aNPoints; i++) {
- aY[i] = myPoints[i].y;
- }
- return aY;
+ return myMarker;
}
-/*!
- Gets curve's data : number of points
-*/
-int Plot2d_Curve::nbPoints() const
-{
- return myPoints.count();
-}
-/*!
- Returns true if curve has no data
-*/
-bool Plot2d_Curve::isEmpty() const
+/* Gets Qwt marker type
+ */
+QwtSymbol::Style Plot2d_Curve::getMarkerStyle() const
{
- return myPoints.isEmpty();
+ return myMarkerStyle;
}
-/*!
- Sets curve's AutoAssign flag - in this case attributes will be set automatically
-*/
-void Plot2d_Curve::setAutoAssign( bool on )
-{
- myAutoAssign = on;
-}
-/*!
- Gets curve's AutoAssign flag state
-*/
-bool Plot2d_Curve::isAutoAssign() const
-{
- return myAutoAssign;
-}
/*!
- Sets curve's color ( and resets AutoAssign flag )
+ Sets new marker size ( and resets AutoAssign flag )
*/
-void Plot2d_Curve::setColor( const QColor& color )
+void Plot2d_Curve::setMarkerSize( const int theSize )
{
- myColor = color;
- myAutoAssign = false;
+ myMarkerSize = theSize < 0 ? 0 : theSize;
+ setAutoAssign( false );
}
/*!
- Gets curve's color
+ Gets marker size
*/
-QColor Plot2d_Curve::getColor() const
+int Plot2d_Curve::getMarkerSize() const
{
- return myColor;
+ return myMarkerSize;
}
/*!
- Sets curve's marker ( and resets AutoAssign flag )
+ Sets line type and width ( and resets AutoAssign flag )
+ NOTE : A line width of 0 will produce a 1 pixel wide line using a fast algorithm for diagonals.
+ A line width of 1 will also produce a 1 pixel wide line, but uses a slower more accurate
+ algorithm for diagonals.
+ For horizontal and vertical lines a line width of 0 is the same as a line width of 1.
*/
-void Plot2d_Curve::setMarker( Plot2d::MarkerType marker )
+void Plot2d_Curve::setLine( Plot2d::LineType line, const int lineWidth )
{
- myMarker = marker;
- myAutoAssign = false;
+ setLine( line );
+ setLineWidth( lineWidth );
+ setAutoAssign( false );
}
/*!
- Gets curve's marker
+ Sets line type ( and resets AutoAssign flag )
*/
-Plot2d::MarkerType Plot2d_Curve::getMarker() const
+void Plot2d_Curve::setLine( Plot2d::LineType line )
{
- return myMarker;
+ myLine = line;
+ setAutoAssign( false );
}
/*!
- Sets curve's line type and width ( and resets AutoAssign flag )
- NOTE : A line width of 0 will produce a 1 pixel wide line using a fast algorithm for diagonals.
- A line width of 1 will also produce a 1 pixel wide line, but uses a slower more accurate
- algorithm for diagonals.
- For horizontal and vertical lines a line width of 0 is the same as a line width of 1.
+ Gets line type
*/
-void Plot2d_Curve::setLine( Plot2d::LineType line, const int lineWidth )
+Plot2d::LineType Plot2d_Curve::getLine() const
{
- myLine = line;
- myLineWidth = lineWidth;
- if ( myLineWidth < 0 ) myLineWidth = 0;
- myAutoAssign = false;
+ return myLine;
}
/*!
- Gets curve's line type
+ Sets line width ( and resets AutoAssign flag )
*/
-Plot2d::LineType Plot2d_Curve::getLine() const
+void Plot2d_Curve::setLineWidth( const int lineWidth )
{
- return myLine;
+ myLineWidth = lineWidth < 0 ? 0 : lineWidth;
+ setAutoAssign( false );
}
/*!
- Gets curve's line width
+ Gets line width
*/
int Plot2d_Curve::getLineWidth() const
{
return myLineWidth;
}
-
/*!
- Sets curve's y axis
+ Sets deviation data on the curve.
*/
-void Plot2d_Curve::setYAxis(QwtPlot::Axis theYAxis)
-{
- if(theYAxis == QwtPlot::yLeft || theYAxis == QwtPlot::yRight)
- myYAxis = theYAxis;
+void Plot2d_Curve::setDeviationData( const double* min, const double* max,const QList<int>& idx) {
+ for( int i = 0; i < idx.size(); i++ ) {
+ if(idx[i] < myPoints.size()) {
+ myPoints[idx[i]].setDeviation(min[i], max[i]);
+ }
+ }
}
/*!
- Gets curve's y axis
+ Gets object's data
*/
-QwtPlot::Axis Plot2d_Curve::getYAxis() const
+void Plot2d_Curve::getDeviationData( double*& theMin, double*& theMax, QList<int>& idx) const
{
- return myYAxis;
+ int aNb = 0;
+ idx.clear();
+ for (int i = 0; i < nbPoints(); i++)
+ if(myPoints[i].hasDeviation())
+ aNb++;
+ if(aNb) {
+ double min, max;
+ theMin = new double[aNb];
+ theMax = new double[aNb];
+ for (int i = 0; i < nbPoints(); i++)
+ if(myPoints[i].hasDeviation()) {
+ myPoints[i].deviation(min,max);
+ theMin[i] = min;
+ theMax[i] = max;
+ idx.push_back(i);
+ }
+ }
}
/*!
- Gets curve's minimal abscissa
+ Clear deviation data on the curve.
*/
-double Plot2d_Curve::getMinX() const
-{
- pointList::const_iterator aIt;
- double aMinX = 1e150;
- //int aCurrent = 0;
- for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
- if ( (*aIt).x < aMinX )
- aMinX = (*aIt).x;
- }
- return aMinX;
+void Plot2d_Curve::clearDeviationData() {
+ for( int i=0; i < myPoints.size(); i++ )
+ myPoints[i].clearDeviation();
}
/*!
- Gets curve's minimal ordinate
+ Gets object's minimal ordinate
*/
double Plot2d_Curve::getMinY() const
{
- pointList::const_iterator aIt;
double aMinY = 1e150;
- //int aCurrent = 0;
- for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
- if ( (*aIt).y < aMinY )
- aMinY = (*aIt).y;
+ pointList::const_iterator aIt;
+ double coeff = 0.0;
+ for (aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
+ aMinY = qMin( aMinY, myScale * (*aIt).y );
+ if((*aIt).minDeviation(coeff))
+ aMinY = qMin( aMinY, coeff );
}
return aMinY;
}
/*!
- Changes text assigned to point of curve
- \param ind -- index of point
- \param txt -- new text
+ Gets object's maximal ordinate
*/
-void Plot2d_Curve::setText( const int ind, const QString& txt )
+double Plot2d_Curve::getMaxY() const
{
- if( ind<0 || ind>=myPoints.count() )
- return;
-
- myPoints[ind].text = txt;
-}
-
-/*!
- \return text assigned to point
- \param ind -- index of point
-*/
-QString Plot2d_Curve::text( const int ind ) const
-{
- if( ind<0 || ind>=myPoints.count() )
- return QString();
- else
- return myPoints[ind].text;
+ double aMaxY = -1e150;
+ pointList::const_iterator aIt;
+ double coeff = 0.0;
+ for (aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
+ aMaxY = qMax( aMaxY, myScale * (*aIt).y);
+ if((*aIt).maxDeviation(coeff))
+ aMaxY = qMax( aMaxY, coeff);
+ }
+ return aMaxY;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// File : Plot2d_Curve.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : Plot2d_Curve.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
#ifndef PLOT2D_CURVE_H
#define PLOT2D_CURVE_H
#include "Plot2d.h"
+#include "Plot2d_Object.h"
-#include <QList>
-#include <qwt_plot.h>
-
-class QColor;
+#include <qwt_symbol.h>
-typedef struct
-{
- double x;
- double y;
- QString text;
-} Plot2d_Point;
-
-typedef QList<Plot2d_Point> pointList;
-
-class PLOT2D_EXPORT Plot2d_Curve
+class PLOT2D_EXPORT Plot2d_Curve : public Plot2d_Object
{
public:
+
Plot2d_Curve();
- virtual ~Plot2d_Curve();
Plot2d_Curve( const Plot2d_Curve& );
- Plot2d_Curve& operator= ( const Plot2d_Curve& );
- virtual QString getTableTitle() const;
-
- void setHorTitle( const QString& );
- QString getHorTitle() const;
- void setVerTitle( const QString& );
- QString getVerTitle() const;
-
- void setHorUnits( const QString& );
- QString getHorUnits() const;
- void setVerUnits( const QString& );
- QString getVerUnits() const;
-
- void addPoint( double, double, const QString& = QString() );
- void insertPoint( int, double, double, const QString& = QString() );
- void deletePoint( int );
- void clearAllPoints();
- pointList getPointList() const;
-
- void setData( const double*, const double*,
- long, const QStringList& = QStringList() );
- double* horData() const;
- double* verData() const;
-
- void setText( const int, const QString& );
- QString text( const int ) const;
-
- int nbPoints() const;
- bool isEmpty() const;
+ virtual ~Plot2d_Curve();
+ Plot2d_Curve& operator= ( const Plot2d_Curve& );
- void setAutoAssign( bool );
- bool isAutoAssign() const;
+ virtual int rtti();
+ virtual QwtPlotItem* createPlotItem();
+ virtual void autoFill( const QwtPlot* );
+ virtual void updatePlotItem( QwtPlotItem* );
- void setColor( const QColor& );
- QColor getColor() const;
+ void setColor( const QColor& );
+ QColor getColor() const;
- void setMarker( Plot2d::MarkerType );
- Plot2d::MarkerType getMarker() const;
+ void setMarker( Plot2d::MarkerType, const int );
+ void setMarker( Plot2d::MarkerType );
+ void setMarkerStyle( QwtSymbol::Style style);
+ Plot2d::MarkerType getMarker() const;
+ QwtSymbol::Style getMarkerStyle() const;
+ void setMarkerSize( const int );
+ int getMarkerSize() const;
- void setLine( Plot2d::LineType, const int = 0 );
- Plot2d::LineType getLine() const;
- int getLineWidth() const;
+ void setLine( Plot2d::LineType, const int );
+ void setLine( Plot2d::LineType );
+ Plot2d::LineType getLine() const;
+ void setLineWidth( const int );
+ int getLineWidth() const;
+ void setDeviationData( const double*, const double*, const QList<int>&);
+ void getDeviationData( double*&, double*&, QList<int>& ) const;
+ void clearDeviationData();
- void setYAxis( QwtPlot::Axis );
- QwtPlot::Axis getYAxis() const;
+ virtual double getMinY() const;
+ virtual double getMaxY() const;
- // Protection against QwtCurve::drawLines() bug in Qwt 0.4.x:
- // it crashes if switched to X/Y logarithmic mode, when one or more points have
- // non-positive X/Y coordinate
- double getMinX() const;
- double getMinY() const;
protected:
- bool myAutoAssign;
- QString myHorTitle;
- QString myVerTitle;
- QString myHorUnits;
- QString myVerUnits;
- QColor myColor;
- Plot2d::MarkerType myMarker;
- Plot2d::LineType myLine;
- int myLineWidth;
- QwtPlot::Axis myYAxis;
-
- pointList myPoints;
+
+ QColor myColor;
+ Plot2d::MarkerType myMarker;
+ QwtSymbol::Style myMarkerStyle;
+ int myMarkerSize;
+ Plot2d::LineType myLine;
+ int myLineWidth;
};
typedef QList<Plot2d_Curve*> curveList;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d_FitDataDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef PLOT2D_FITDATADLG_H
#define PLOT2D_FITDATADLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SALOME OCCViewer : build OCC Viewer into Salome desktop
-// File : Plot2d_Prs.cxx
-// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
-#include <qwt_plot.h>
+
#include "Plot2d_Prs.h"
/*!
/*!
Standard constructor
*/
-Plot2d_Prs::Plot2d_Prs( const Plot2d_Curve* obj, bool theDelete )
+Plot2d_Prs::Plot2d_Prs( Plot2d_Object* obj, bool theDelete )
: mySecondY( false), myIsAutoDel( theDelete )
{
AddObject( obj );
Plot2d_Prs::~Plot2d_Prs()
{
if ( myIsAutoDel )
- qDeleteAll( myCurves );
+ qDeleteAll( myObjects );
}
/*!
- Get curves list
+ Get objects list
*/
-curveList Plot2d_Prs::getCurves() const
+objectList Plot2d_Prs::getObjects() const
{
- return myCurves;
+ return myObjects;
}
/*!
Add curve
*/
-void Plot2d_Prs::AddObject( const Plot2d_Curve* obj )
+void Plot2d_Prs::AddObject( Plot2d_Object* obj )
{
- myCurves.append((Plot2d_Curve*)obj);
+ myObjects.append(obj);
if (obj->getYAxis() == QwtPlot::yRight)
mySecondY = true;
*/
bool Plot2d_Prs::IsNull() const
{
- return myCurves.isEmpty();
+ return myObjects.isEmpty();
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef PLOT2D_PRS_H
#define PLOT2D_PRS_H
#include "Plot2d.h"
-#include "Plot2d_Curve.h"
+#include "Plot2d_Object.h"
class PLOT2D_EXPORT Plot2d_Prs
{
public:
Plot2d_Prs( bool theDelete = false );
- Plot2d_Prs( const Plot2d_Curve* obj, bool theDelete = false );
+ Plot2d_Prs( Plot2d_Object* obj, bool theDelete = false );
~Plot2d_Prs();
- curveList getCurves() const;
- void AddObject( const Plot2d_Curve* obj );
+ objectList getObjects() const;
+ void AddObject( Plot2d_Object* obj );
- bool IsNull() const;
+ bool IsNull() const;
- bool isSecondY() const;
+ bool isSecondY() const;
- void setAutoDel(bool theDel);
+ void setAutoDel(bool theDel);
protected:
- curveList myCurves;
- bool mySecondY;
- bool myIsAutoDel;
+ objectList myObjects;
+ bool mySecondY;
+ bool myIsAutoDel;
};
-#endif
+#endif // PLOT2D_PRS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d_SetupCurveDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
myLineCombo = new QComboBox( this );
myLineCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myLineCombo->setMinimumWidth( MIN_COMBO_WIDTH );
- myLineCombo->setIconSize( QSize( 40, 16 ) );
+ QSize lsz( 40, 16 );
+ myLineCombo->setIconSize( lsz );
// curve width
QLabel* aLineWidthLab = new QLabel( tr( "CURVE_LINE_WIDTH_LAB" ), this );
myMarkerCombo = new QComboBox( this );
myMarkerCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myMarkerCombo->setMinimumWidth( MIN_COMBO_WIDTH );
- myMarkerCombo->setIconSize( QSize( 16, 16 ) );
+ QSize sz(16, 16);
+ myMarkerCombo->setIconSize(sz);
// curve color
QLabel* aColorLab = new QLabel( tr( "CURVE_COLOR_LAB" ), this );
topLayout->addLayout( btnLayout, 5, 0, 1, 3 );
// fill then combo boxes
- myLineCombo->addItem( lineIcon( Plot2d::NoPen ), tr( "NONE_LINE_LBL" ) );
- myLineCombo->addItem( lineIcon( Plot2d::Solid ), tr( "SOLID_LINE_LBL" ) );
- myLineCombo->addItem( lineIcon( Plot2d::Dash ), tr( "DASH_LINE_LBL" ) );
- myLineCombo->addItem( lineIcon( Plot2d::Dot ), tr( "DOT_LINE_LBL" ) );
- myLineCombo->addItem( lineIcon( Plot2d::DashDot ), tr( "DASHDOT_LINE_LBL" ) );
- myLineCombo->addItem( lineIcon( Plot2d::DashDotDot ), tr( "DAHSDOTDOT_LINE_LBL" ) );
-
- myMarkerCombo->addItem( markerIcon( Plot2d::None ), tr( "NONE_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::Circle ), tr( "CIRCLE_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::Rectangle ), tr( "RECTANGLE_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::Diamond ), tr( "DIAMOND_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::DTriangle ), tr( "DTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::UTriangle ), tr( "UTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::LTriangle ), tr( "LTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::RTriangle ), tr( "RTRIANGLE_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::Cross ), tr( "CROSS_MARKER_LBL" ) );
- myMarkerCombo->addItem( markerIcon( Plot2d::XCross ), tr( "XCROSS_MARKER_LBL" ) );
+ QColor cl = myLineCombo->palette().color( QPalette::Text );
+
+ myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::NoPen ), tr( "NONE_LINE_LBL" ) );
+ myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::Solid ), tr( "SOLID_LINE_LBL" ) );
+ myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::Dash ), tr( "DASH_LINE_LBL" ) );
+ myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::Dot ), tr( "DOT_LINE_LBL" ) );
+ myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::DashDot ), tr( "DASHDOT_LINE_LBL" ) );
+ myLineCombo->addItem( Plot2d::lineIcon( lsz, cl, Plot2d::DashDotDot ), tr( "DAHSDOTDOT_LINE_LBL" ) );
+
+ cl = myMarkerCombo->palette().color( QPalette::Text );
+
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::None ), tr( "NONE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Circle ), tr( "CIRCLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Rectangle ), tr( "RECTANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Diamond ), tr( "DIAMOND_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::DTriangle ), tr( "DTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::UTriangle ), tr( "UTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::LTriangle ), tr( "LTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::RTriangle ), tr( "RTRIANGLE_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::Cross ), tr( "CROSS_MARKER_LBL" ) );
+ myMarkerCombo->addItem( Plot2d::markerIcon( sz, cl, Plot2d::XCross ), tr( "XCROSS_MARKER_LBL" ) );
// default settings
setLine( Plot2d::Solid, 0 ); // solid line, width = 0
return myColorBtn->color();
}
-/*!
- \brief Create icon pixmap according to the line type.
- \param type line type
- \return icon
-*/
-QPixmap Plot2d_SetupCurveDlg::lineIcon( Plot2d::LineType type ) const
-{
- QSize sz = myLineCombo->iconSize();
- QPixmap px( sz );
- px.fill( QColor( 255, 255, 255, 0 ) );
- QPainter p( &px );
- Plot2d::drawLine( &p, 5, sz.height()/2, sz.width()-5, sz.height()/2, type,
- myLineCombo->palette().color( QPalette::Text ), 1 );
- return px;
-}
-
-/*!
- \brief Create icon pixmap according to the marker type.
- \param type marker type
- \return icon
-*/
-QPixmap Plot2d_SetupCurveDlg::markerIcon( Plot2d::MarkerType type ) const
-{
- QSize sz = myMarkerCombo->iconSize();
- QPixmap px( sz );
- px.fill( QColor( 255, 255, 255, 0 ) );
- QPainter p( &px );
- Plot2d::drawMarker( &p, sz.width()/2, sz.height()/2, MSIZE, MSIZE, type,
- myMarkerCombo->palette().color( QPalette::Text ) );
- return px;
-}
-
/*
\brief Update preview widget.
*/
QPainter p( &px );
Plot2d::drawLine( &p, 5+MSIZE/2, sz.height()/2, sz.width()-5-MSIZE/2, sz.height()/2,
- getLine(), getColor(), getLineWidth() );
+ getLine(), getColor(), getLineWidth() );
Plot2d::drawMarker( &p, 5+MSIZE/2, sz.height()/2, MSIZE, MSIZE,
- getMarker(), getColor() );
+ getMarker(), getColor() );
Plot2d::drawMarker( &p, sz.width()-5-MSIZE/2, sz.height()/2, MSIZE, MSIZE,
- getMarker(), getColor() );
+ getMarker(), getColor() );
myPreview->setPixmap( px );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d_SetupCurveDlg.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
void setColor( const QColor& );
QColor getColor() const;
-private:
- QPixmap lineIcon( Plot2d::LineType ) const;
- QPixmap markerIcon( Plot2d::MarkerType ) const;
private slots:
void updatePreview();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d_SetupViewDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include <SUIT_Session.h>
#include <SUIT_Application.h>
#include <QtxColorButton.h>
+#include <QtxFontEdit.h>
#include <QCheckBox>
#include <QLineEdit>
\param secondAxisY if \c true, show widgets for the second (right) vertical axis
*/
Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
- bool showDefCheck,
- bool secondAxisY )
+ bool showDefCheck,
+ bool secondAxisY )
: QDialog( parent ),
mySecondAxisY( secondAxisY )
{
// legend
myLegendCheck = new QCheckBox( tr( "PLOT2D_ENABLE_LEGEND" ), this );
myLegendCombo = new QComboBox( this );
+ myLegendFont = new QtxFontEdit( this );
+ myLegendColor = new QtxColorButton( this );
+ QLabel* aLegendFontLab = new QLabel( tr( "PLOT2D_LEGEND_FONT" ), this );
myLegendCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myLegendCombo->setMinimumWidth( MIN_COMBO_WIDTH );
myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
QLabel* aBGLab = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
myBackgroundBtn = new QtxColorButton( this );
+ //Deviation marker parameters
+ QGroupBox* aDeviationGrp = new QGroupBox( tr( "PLOT2D_DEVIATION_MARKER_TLT" ), this );
+ QHBoxLayout* aDeviationLayout = new QHBoxLayout(aDeviationGrp);
+
+ //Deviation marker parameters : Line width
+ QLabel* aDeviationLwLbl = new QLabel( tr( "PLOT2D_DEVIATION_LW_LBL" ), aDeviationGrp );
+ myDeviationLw = new QSpinBox( aDeviationGrp );
+ myDeviationLw->setMinimum( 1 );
+ myDeviationLw->setMaximum( 5 );
+ myDeviationLw->setSingleStep( 1 );
+ myDeviationLw->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ //Deviation marker parameters : Line width
+ QLabel* aDeviationTsLbl = new QLabel( tr( "PLOT2D_DEVIATION_TS_LBL" ), aDeviationGrp );
+ myDeviationTs = new QSpinBox( aDeviationGrp );
+ myDeviationTs->setMinimum( 1 );
+ myDeviationTs->setMaximum( 5 );
+ myDeviationTs->setSingleStep( 1 );
+ myDeviationTs->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ //Deviation marker parameters : Color
+ QLabel* aDeviationClLbl = new QLabel( tr( "PLOT2D_DEVIATION_CL_LBL" ), aDeviationGrp );
+ myDeviationCl = new QtxColorButton( aDeviationGrp );
+
+ aDeviationLayout->addWidget( aDeviationLwLbl );
+ aDeviationLayout->addWidget( myDeviationLw );
+ aDeviationLayout->addWidget( aDeviationTsLbl );
+ aDeviationLayout->addWidget( myDeviationTs );
+ aDeviationLayout->addWidget( aDeviationClLbl );
+ aDeviationLayout->addWidget( myDeviationCl );
+
+ // normalize mode
+ QGroupBox* aNormalizeGrp = new QGroupBox( tr( "PLOT2D_NORMALIZE_TLT" ), this );
+ QGridLayout* aNormalizeLayout = new QGridLayout( aNormalizeGrp );
+ aNormalizeLayout->setMargin( MARGIN_SIZE ); aNormalizeLayout->setSpacing( SPACING_SIZE );
+ aNormalizeGrp->setLayout( aNormalizeLayout );
+ QLabel* aYLeftLab = new QLabel( tr( "PLOT2D_NORMALIZE_LEFT_AXIS" ), aNormalizeGrp );
+ myNormLMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
+ myNormLMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
+ QLabel* aYRightLab = new QLabel( tr( "PLOT2D_NORMALIZE_RIGHT_AXIS" ), aNormalizeGrp );
+ myNormRMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
+ myNormRMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
+
+ aNormalizeLayout->addWidget( aYLeftLab, 0, 0 );
+ aNormalizeLayout->addWidget( myNormLMaxCheck, 0, 1 );
+ aNormalizeLayout->addWidget( myNormLMinCheck, 0, 2 );
+ aNormalizeLayout->addWidget( aYRightLab, 1, 0 );
+ aNormalizeLayout->addWidget( myNormRMaxCheck, 1, 1 );
+ aNormalizeLayout->addWidget( myNormRMinCheck, 1, 2 );
+
// scale mode
QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp );
myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
aGridLayoutY->addWidget( myYGridCheck, 0, 0 );
- aGridLayoutY->addWidget( aYMajLbl, 0, 1 );
+ aGridLayoutY->addWidget( aYMajLbl, 0, 1 );
aGridLayoutY->addWidget( myYGridSpin, 0, 2 );
aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
aGridLayoutY->addWidget( aYMinLbl, 1, 1 );
// layout widgets
topLayout->addWidget( myTitleCheck, 0, 0 );
topLayout->addWidget( myTitleEdit, 0, 1, 1, 3 );
- topLayout->addWidget( aCurveLab, 1, 0 );
- topLayout->addWidget( myCurveCombo, 1, 1 );
- topLayout->addWidget( myLegendCheck, 1, 2 );
- topLayout->addWidget( myLegendCombo, 1, 3 );
- topLayout->addWidget( aMarkerLab, 2, 0 );
- topLayout->addWidget( myMarkerSpin, 2, 1 );
+ topLayout->addWidget( myLegendCheck, 1, 0 );
+ topLayout->addWidget( myLegendCombo, 1, 1 );
+ topLayout->addWidget( aCurveLab, 1, 2 );
+ topLayout->addWidget( myCurveCombo, 1, 3 );
+ topLayout->addWidget( aLegendFontLab,2, 0 );
+ topLayout->addWidget( myLegendFont, 2, 1 );
+ topLayout->addWidget( myLegendColor, 2, 2 );
+
+ topLayout->addWidget( aMarkerLab, 3, 0 );
+ topLayout->addWidget( myMarkerSpin, 3, 1 );
QHBoxLayout* bgLayout = new QHBoxLayout;
bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
- topLayout->addWidget( aBGLab, 2, 2 );
- topLayout->addLayout( bgLayout, 2, 3 );
- topLayout->addWidget( aScaleGrp, 3, 0, 1, 4 );
- topLayout->addWidget( aTabWidget, 4, 0, 1, 4 );
- topLayout->addWidget( myDefCheck, 5, 0, 1, 4 );
- topLayout->setRowStretch( 5, 5 );
-
- topLayout->addLayout( btnLayout, 6, 0, 1, 4 );
+ topLayout->addWidget( aBGLab, 3, 2 );
+ topLayout->addLayout( bgLayout, 3, 3 );
+ topLayout->addWidget( aDeviationGrp, 4, 0, 1, 4 );
+ topLayout->addWidget( aNormalizeGrp, 5, 0, 1, 4 );
+ topLayout->addWidget( aScaleGrp, 6, 0, 1, 4 );
+ topLayout->addWidget( aTabWidget, 7, 0, 1, 4 );
+ topLayout->addWidget( myDefCheck, 8, 0, 1, 4 );
+ topLayout->setRowStretch( 9, 5 );
+
+ topLayout->addLayout( btnLayout, 10, 0, 1, 4 );
if ( !showDefCheck )
myDefCheck->hide();
connect( myYGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
connect( myXMinGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMinorChecked() ) );
connect( myYMinGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMinorChecked() ) );
+ connect( myNormLMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormLMaxChecked() ) );
+ connect( myNormLMinCheck, SIGNAL( clicked() ), this, SLOT( onNormLMinChecked() ) );
+ connect( myNormRMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormRMaxChecked() ) );
+ connect( myNormRMinCheck, SIGNAL( clicked() ), this, SLOT( onNormRMinChecked() ) );
+
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
onXGridMajorChecked();
onYGridMajorChecked();
onXGridMinorChecked();
+ onNormLMaxChecked();
+ onNormLMinChecked();
+ onNormRMaxChecked();
+ onNormRMinChecked();
if ( mySecondAxisY ) {
onY2TitleChecked();
onY2GridMajorChecked();
return myCurveCombo->currentIndex();
}
+/*!
+ \brief Set normalization to maximum by left Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMaxNormMode()
+*/
+void Plot2d_SetupViewDlg::setLMaxNormMode( const bool type )
+{
+ myNormLMaxCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to maximum by left Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMaxNormMode()
+*/
+bool Plot2d_SetupViewDlg::getLMaxNormMode()
+{
+ return myNormLMaxCheck->isChecked();
+}
+
+/*!
+ \brief Set normalization to minimum by left Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMinNormMode()
+*/
+void Plot2d_SetupViewDlg::setLMinNormMode( const bool type )
+{
+ myNormLMinCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to minimum by left Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMinNormMode()
+*/
+bool Plot2d_SetupViewDlg::getLMinNormMode()
+{
+ return myNormLMinCheck->isChecked();
+}
+
+/*!
+ \brief Set normalization to maximum by right Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMaxNormMode()
+*/
+void Plot2d_SetupViewDlg::setRMaxNormMode( const bool type )
+{
+ myNormRMaxCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to maximum by right Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMaxNormMode()
+*/
+bool Plot2d_SetupViewDlg::getRMaxNormMode()
+{
+ return myNormRMaxCheck->isChecked();
+}
+
+/*!
+ \brief Set normalization to minimum by right Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMinNormMode()
+*/
+void Plot2d_SetupViewDlg::setRMinNormMode( const bool type )
+{
+ myNormRMinCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to minimum by right Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMinNormMode()
+*/
+bool Plot2d_SetupViewDlg::getRMinNormMode()
+{
+ return myNormRMinCheck->isChecked();
+}
+
/*!
\brief Set legend attribute.
\param if \c true legend is shown
\param pos legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
- \sa isLegendEnabled(), getLegendPos()
+ \param fnt legend font
+ \param col legend font color
+ \sa isLegendEnabled(), getLegendPos(), getLegendFont()
*/
-void Plot2d_SetupViewDlg::setLegend( bool enable, int pos )
+void Plot2d_SetupViewDlg::setLegend( bool enable, int pos, const QFont& fnt, const QColor& col )
{
myLegendCheck->setChecked( enable );
myLegendCombo->setCurrentIndex( pos );
+ myLegendFont->setCurrentFont( fnt );
+ myLegendColor->setColor( col );
onLegendChecked();
}
return myLegendCombo->currentIndex();
}
+/*!
+ \brief Get legend font.
+ \return legend font
+ \sa setLegend()
+*/
+QFont Plot2d_SetupViewDlg::getLegendFont()
+{
+ return myLegendFont->currentFont();
+}
+
+/*!
+ \brief Get legend font color.
+ \return legend font color
+ \sa setLegend()
+*/
+QColor Plot2d_SetupViewDlg::getLegendColor()
+{
+ return myLegendColor->color();
+}
+
/*!
\brief Set marker size.
\param size marker size
{
return myMarkerSpin->value();
}
+/*!
+ \brief Set deviation marker line width.
+ \param width marker line width
+ \sa getDeviationMarkerLw()
+*/
+void Plot2d_SetupViewDlg::setDeviationMarkerLw( const int width ){
+ myDeviationLw->setValue(width);
+}
+
+/*!
+ \brief Get deviation marker line width.
+ \return marker line width
+ \sa setMarkerSize()
+*/
+int Plot2d_SetupViewDlg::getDeviationMarkerLw() const {
+ return myDeviationLw->value();
+}
+
+/*!
+ \brief Set deviation marker tick size.
+ \param size marker tick size
+ \sa getDeviationMarkerTs()
+*/
+void Plot2d_SetupViewDlg::setDeviationMarkerTs( const int size) {
+ myDeviationTs->setValue(size);
+}
+
+/*!
+ \brief Get deviation marker tick size.
+ \return marker tick size
+ \sa setDeviationMarkerTs()
+*/
+int Plot2d_SetupViewDlg::getDeviationMarkerTs() const {
+ return myDeviationTs->value();
+}
+
+/*!
+ \brief Set color of the deviation marker.
+ \param color marker color
+ \sa getDeviationMarkerCl()
+*/
+void Plot2d_SetupViewDlg::setDeviationMarkerCl( const QColor& col) {
+ myDeviationCl->setColor( col );
+}
+
+/*!
+ \brief Get color of the deviation marker.
+ \return marker color
+ \sa setDeviationMarkerCl()
+*/
+QColor Plot2d_SetupViewDlg::getDeviationMarkerCl() const {
+ return myDeviationCl->color();
+}
/*!
\brief Set background color.
{
}
+/*!
+ \brief Called when user clicks "Left Y Axis: Normalize to maximum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormLMaxChecked()
+{
+}
+
+/*!
+ \brief Called when user clicks "Left Y Axis: Normalize to minimum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormLMinChecked()
+{
+}
+
+/*!
+ \brief Called when user clicks "Right Y Axis: Normalize to maximum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormRMaxChecked()
+{
+}
+
+/*!
+ \brief Called when user clicks "Right Y Axis: Normalize to minimum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormRMinChecked()
+{
+}
+
/*!
\brief Get "Set settings as default" check box value.
\return \c true if "Set settings as default" check box is on
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d_SetupViewDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
class QComboBox;
class QPushButton;
class QtxColorButton;
+class QtxFontEdit;
class PLOT2D_EXPORT Plot2d_SetupViewDlg : public QDialog
{
void setCurveType( const int );
int getCurveType();
- void setLegend( bool, int );
+ bool getLMaxNormMode();
+ void setLMaxNormMode(const bool);
+ bool getLMinNormMode();
+ void setLMinNormMode(const bool);
+ bool getRMaxNormMode();
+ void setRMaxNormMode(const bool);
+ bool getRMinNormMode();
+ void setRMinNormMode(const bool);
+
+ void setLegend( bool, int, const QFont&, const QColor& );
bool isLegendEnabled();
int getLegendPos();
+ QFont getLegendFont();
+ QColor getLegendColor();
void setMarkerSize( const int );
int getMarkerSize();
int getXScaleMode();
int getYScaleMode();
+ void setDeviationMarkerLw( const int);
+ int getDeviationMarkerLw() const;
+
+ void setDeviationMarkerTs( const int);
+ int getDeviationMarkerTs() const;
+
+ void setDeviationMarkerCl( const QColor&);
+ QColor getDeviationMarkerCl() const;
+
bool isSetAsDefault();
protected slots:
void onXGridMinorChecked();
void onYGridMinorChecked();
void onY2GridMinorChecked();
+ void onNormLMaxChecked();
+ void onNormLMinChecked();
+ void onNormRMaxChecked();
+ void onNormRMinChecked();
void onHelp();
private:
QLineEdit* myTitleYEdit;
QLineEdit* myTitleY2Edit;
QtxColorButton* myBackgroundBtn;
+ QtxColorButton* myLegendColor;
+ QtxFontEdit* myLegendFont;
QCheckBox* myXGridCheck;
QSpinBox* myXGridSpin;
QCheckBox* myYGridCheck;
QSpinBox* myMarkerSpin;
QComboBox* myXModeCombo;
QComboBox* myYModeCombo;
+ QCheckBox* myNormLMaxCheck;
+ QCheckBox* myNormLMinCheck;
+ QCheckBox* myNormRMaxCheck;
+ QCheckBox* myNormRMinCheck;
QComboBox* myY2ModeCombo;
QCheckBox* myDefCheck;
QPushButton* myOkBtn;
QPushButton* myCancelBtn;
QPushButton* myHelpBtn;
+ QSpinBox* myDeviationLw;
+ QSpinBox* myDeviationTs;
+ QtxColorButton* myDeviationCl;
bool mySecondAxisY;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// File: Plot2d_ToolTip.cxx
-// Author: Alexandre SOLOVYOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : Plot2d_ToolTip.cxx
+// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
+
#include "Plot2d_ToolTip.h"
#include "Plot2d_ViewFrame.h"
#include "Plot2d_Curve.h"
const int maxDist = 3, tip_margin = 10;
-Plot2d_ToolTip::Plot2d_ToolTip( Plot2d_ViewFrame* frame, Plot2d_Plot2d* plot )
-: QtxToolTip( plot->canvas() ),
- myFrame( frame ),
- myPlot( plot )
+Plot2d_ToolTip::Plot2d_ToolTip( Plot2d_ViewFrame* frame )
+: QtxToolTip( frame->getPlotCanvas() ),
+ myFrame( frame )
{
connect( this, SIGNAL( maybeTip( QPoint, QString&, QFont&, QRect&, QRect& ) ),
- this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
+ this, SLOT( onToolTip( QPoint, QString&, QFont&, QRect&, QRect& ) ) );
}
Plot2d_ToolTip::~Plot2d_ToolTip()
int pInd;
double dist;
- Plot2d_Curve* c = myPlot->getClosestCurve( p, dist, pInd );
+ Plot2d_Curve* c = myFrame->getClosestCurve( p, dist, pInd );
if( !c || dist>maxDist )
return;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// File: Plot2d_ToolTip.h
-// Author: Alexandre SOLOVYOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : Plot2d_ToolTip.h
+// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
+
#ifndef PLOT2D_TOOLTIP_H
#define PLOT2D_TOOLTIP_H
#include <QtxToolTip.h>
class Plot2d_ViewFrame;
-class Plot2d_Plot2d;
class PLOT2D_EXPORT Plot2d_ToolTip : public QtxToolTip
{
Q_OBJECT
public:
- Plot2d_ToolTip( Plot2d_ViewFrame*, Plot2d_Plot2d* );
+ Plot2d_ToolTip( Plot2d_ViewFrame* );
virtual ~Plot2d_ToolTip();
virtual bool eventFilter( QObject*, QEvent* );
private:
Plot2d_ViewFrame* myFrame;
- Plot2d_Plot2d* myPlot;
};
-#endif
+#endif // PLOT2D_TOOLTIP_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Plot2d_ViewFrame.h"
#include "Plot2d_Prs.h"
#include "Plot2d_Curve.h"
+#include "Plot2d_PlotItems.h"
#include "Plot2d_FitDataDlg.h"
#include "Plot2d_ViewWindow.h"
#include "Plot2d_SetupViewDlg.h"
+#include "Plot2d_AnalyticalCurveDlg.h"
+#include "Plot2d_AnalyticalCurve.h"
#include "Plot2d_ToolTip.h"
#include "SUIT_Tools.h"
#include <QPrinter>
#include <QPalette>
#include <QLocale>
+#include <QXmlStreamWriter>
+#include <QXmlStreamReader>
#include <qwt_math.h>
#include <qwt_plot_canvas.h>
#include <qwt_scale_div.h>
+#include <qwt_plot_marker.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_scale_engine.h>
#include <qwt_plot_zoomer.h>
#include <qwt_curve_fitter.h>
-#include <iostream>
#include <stdlib.h>
#include <qprinter.h>
"................................",
"................................"};
-
/*!
Constructor
*/
: QWidget (parent, 0),
myOperation( NoOpId ),
myCurveType( 1 ),
- myShowLegend( true ), myLegendPos( 1 ),
+ myShowLegend( true ), myLegendPos( 1 ), myLegendFont("Helvetic",12),
+ myLegendColor(Qt::black),
myMarkerSize( DEFAULT_MARKER_SIZE ),
- myTitle( "" ), myXTitle( "" ), myYTitle( "" ), myY2Title( "" ),
myBackground( Qt::white ),
+ myTitle( "" ), myXTitle( "" ), myYTitle( "" ), myY2Title( "" ),
myTitleEnabled( true ), myXTitleEnabled( true ),
myYTitleEnabled( true ), myY2TitleEnabled (true),
myXGridMajorEnabled( true ), myYGridMajorEnabled( true ), myY2GridMajorEnabled( true ),
myXGridMinorEnabled( false ), myYGridMinorEnabled( false ), myY2GridMinorEnabled( false ),
myXGridMaxMajor( 8 ), myYGridMaxMajor( 8 ), myY2GridMaxMajor( 8 ),
myXGridMaxMinor( 5 ), myYGridMaxMinor( 5 ), myY2GridMaxMinor( 5 ),
- myXMode( 0 ), myYMode( 0 ), mySecondY( false )
+ myXMode( 0 ), myYMode( 0 ),myNormLMin(false), myNormLMax(false), myNormRMin(false), myNormRMax(false),
+ mySecondY( false ), myIsDefTitle( true )
{
setObjectName( title );
+ myRNormAlgo = new Plot2d_NormalizeAlgorithm(this);
+ myLNormAlgo = new Plot2d_NormalizeAlgorithm(this);
/* Plot 2d View */
QVBoxLayout* aLayout = new QVBoxLayout( this );
myPlot = new Plot2d_Plot2d( this );
- new Plot2d_ToolTip( this, myPlot );
+ new Plot2d_ToolTip( this );
aLayout->addWidget( myPlot );
// createActions();
connect( myPlot, SIGNAL( legendClicked( QwtPlotItem* ) ),
- this, SIGNAL( legendClicked( QwtPlotItem* ) ) );
+ this, SIGNAL( legendClicked( QwtPlotItem* ) ) );
- connect( myPlot->axisWidget( QwtPlot::xBottom ), SIGNAL( scaleDivChanged() ),
- myPlot, SLOT( onScaleDivChanged() ) );
+ // IPAL 21465
+ /* connect( myPlot->axisWidget( QwtPlot::xBottom ), SIGNAL( scaleDivChanged() ),
+ myPlot, SLOT( onScaleDivChanged() ) );
connect( myPlot->axisWidget( QwtPlot::yLeft ), SIGNAL( scaleDivChanged() ),
- myPlot, SLOT( onScaleDivChanged() ) );
+ myPlot, SLOT( onScaleDivChanged() ) );
if (mySecondY)
connect( myPlot->axisWidget( QwtPlot::yRight ), SIGNAL( scaleDivChanged() ),
- myPlot, SLOT( onScaleDivChanged() ) );
-
+ myPlot, SLOT( onScaleDivChanged() ) );*/
/* Initial Setup - get from the preferences */
readPreferences();
if (mySecondY)
setTitle( myY2TitleEnabled, myY2Title, Y2Title, false );
+ setHorScaleMode( myXMode, false );
+ setVerScaleMode( myYMode, false );
setBackgroundColor( myBackground );
setLegendPos( myLegendPos );
+ setLegendFont( myLegendFont );
+ setLegendFontColor( myLegendColor );
showLegend( myShowLegend, false );
myPlot->replot();
*/
void Plot2d_ViewFrame::DisplayAll()
{
- curveList clist;
- getCurves( clist );
- for ( int i = 0; i < (int)clist.count(); i++ ) {
- updateCurve( clist.at( i ), false );
- }
+ objectList olist;
+ getObjects( olist );
+ foreach ( Plot2d_Object* o, olist )
+ updateObject( o, false );
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
Removes all curves from the view
*/
void Plot2d_ViewFrame::EraseAll()
{
- myPlot->clear();
- myPlot->getCurves().clear();
+ objectList anObjects;
+ getObjects( anObjects );
+ eraseObjects( anObjects, false );
+ myObjects.clear();
+
+ // 1)- Erase all the intermittent segments who connect curves
+
+ int nbSeg = myIntermittentSegmentList.size();
+ if (nbSeg > 0)
+ {
+ for (int iseg=0; iseg < nbSeg; iseg++)
+ {
+ QwtPlotCurve *segment = myIntermittentSegmentList[iseg];
+
+ segment->detach(); // erase in QwtPlot window
+ delete segment;
+ }
+ myIntermittentSegmentList.clear();
+ }
+
+ // 2)- Erase all curves points markers
+
+ int nbMark = myMarkerList.size();
+ if (nbMark > 0)
+ {
+ for (int imar=0; imar < nbMark; imar++)
+ {
+ QwtPlotMarker *marker = myMarkerList[imar];
+
+ marker->detach(); // erase in QwtPlot window
+ delete marker;
+ }
+ myMarkerList.clear();
+ }
+
+ // The graphic view's picker
+ Plot2d_QwtPlotPicker *picker = myPlot->getPicker();
+
+ // Clear points markers list and associations (marker,tooltip)
+ picker->pMarkers.clear(); // QList<QwtPlotMarker*>
+ picker->pMarkersToolTip.clear(); // QMap<QwtPlotMarker*, QwtText>
+
+ // 3)- Erase all QwtPlotCurve associated with the Plot2d_Curve
+
+ int nbCur1 = myQwtPlotCurveList.size();
+ if (nbCur1 > 0)
+ {
+ for (int icur=0; icur < nbCur1; icur++)
+ {
+ QwtPlotItem *curve0 = myQwtPlotCurveList[icur];
+ QwtPlotCurve *curve = static_cast<QwtPlotCurve*>(curve0);
+
+ if (curve)
+ {
+ delete curve;
+ }
+ }
+ myQwtPlotCurveList.clear();
+ }
+
+ // 4)- Erase all curves Plot2d_Curve
+
+ int nbCur = myPlot2dCurveList.size();
+ if (nbCur > 0)
+ {
+ for (int icur=0; icur < nbCur; icur++)
+ {
+ Plot2d_Curve *curve = myPlot2dCurveList[icur];
+
+ if (curve)
+ {
+ delete curve;
+ }
+ }
+ myPlot2dCurveList.clear();
+ }
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
Redraws viewframe contents
if ( !prs || prs->IsNull() )
return;
- if (prs->isSecondY()) {
- myPlot->enableAxis(QwtPlot::yRight, true);
- mySecondY = true;
- }
- else {
- myPlot->enableAxis(QwtPlot::yRight, false);
- mySecondY = false;
- }
+ setEnableAxis( QwtPlot::yRight, prs->isSecondY() ); // VSR: is it correct? maybe we should only enable second Y axis if required
- // display all curves from presentation
- curveList aCurves = prs->getCurves();
- displayCurves( aCurves );
+ // display all objects from presentation
+ objectList anObjects = prs->getObjects();
+ displayObjects( anObjects );
setXGrid( myXGridMajorEnabled, myXGridMaxMajor, myXGridMinorEnabled, myXGridMaxMinor, true );
setYGrid( myYGridMajorEnabled, myYGridMaxMajor, myYGridMinorEnabled, myYGridMaxMinor,
myY2GridMajorEnabled, myY2GridMaxMajor, myY2GridMinorEnabled, myY2GridMaxMinor, true );
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
if ( !prs || prs->IsNull() )
return;
- // erase all curves from presentation
- curveList aCurves = prs->getCurves();
- eraseCurves( aCurves );
+ // erase all objects from presentation
+ objectList anObjects = prs->getObjects();
+ eraseObjects( anObjects );
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
bool Plot2d_ViewFrame::eventFilter( QObject* watched, QEvent* e )
if ( plotMouseMoved( m ) )
return true;
}
- break;
+ break;
}
case QEvent::MouseButtonPress: {
QMouseEvent* me = (QMouseEvent*)e;
}
break;
}
+ case QEvent::ContextMenu:
+ // Fix from SLN
+ // Do nothing because context menu is called from MouseRelease
+ return true;
}
}
return QWidget::eventFilter( watched, e );
void Plot2d_ViewFrame::setTitle( const QString& title )
{
setTitle( myTitleEnabled, title, MainTitle, true );
+ myIsDefTitle = false;
+}
+
+/*!
+ Gets title
+*/
+QString Plot2d_ViewFrame::getTitle() const
+{
+ return myTitle;
}
/*!
myShowLegend = resMgr->booleanValue( "Plot2d", "ShowLegend", myShowLegend );
myLegendPos = resMgr->integerValue( "Plot2d", "LegendPos", myLegendPos );
+ myLegendFont = resMgr->fontValue( "Plot2d", "LegendFont", myLegendFont );
+ myLegendColor = resMgr->colorValue( "Plot2d", "LegendFontColor", myLegendColor );
myMarkerSize = resMgr->integerValue( "Plot2d", "MarkerSize", myMarkerSize );
myBackground = resMgr->colorValue( "Plot2d", "Background", myBackground );
if ( mySecondY )
myY2GridMaxMinor = resMgr->integerValue( "Plot2d", "VerMinorGridMax", myY2GridMaxMinor );
- int newXMode = resMgr->integerValue( "Plot2d", "HorScaleMode", myXMode );
- newXMode = qMax( 0, qMin( 1, newXMode ) );
- setHorScaleMode( newXMode, false );
+ setHorScaleMode( qMax( 0, qMin( 1, resMgr->integerValue( "Plot2d", "HorScaleMode", myXMode ) ) ), false );
+ setVerScaleMode( qMax( 0, qMin( 1, resMgr->integerValue( "Plot2d", "VerScaleMode", myYMode ) ) ), false );
+ setNormLMinMode( resMgr->booleanValue( "Plot2d", "VerNormLMinMode", myNormLMin ) );
+ setNormLMaxMode( resMgr->booleanValue( "Plot2d", "VerNormLMaxMode", myNormLMax ) );
+ setNormRMinMode( resMgr->booleanValue( "Plot2d", "VerNormRMinMode", myNormRMin ) );
+ setNormRMaxMode( resMgr->booleanValue( "Plot2d", "VerNormRMaxMode", myNormRMax ) );
+ QColor c = resMgr->colorValue( "Plot2d", "DeviationMarkerColor", QColor(255,0,0));
+ myPlot->setProperty(PLOT2D_DEVIATION_COLOR, c);
+ myPlot->setProperty(PLOT2D_DEVIATION_LW,
+ resMgr->integerValue( "Plot2d", "DeviationMarkerLineWidth", 1));
+ myPlot->setProperty(PLOT2D_DEVIATION_TS,
+ resMgr->integerValue( "Plot2d", "DeviationMarkerTickSize", 2));
- int newYMode = resMgr->integerValue( "Plot2d", "VerScaleMode", myYMode );
- newYMode = qMax( 0, qMin( 1, newYMode ) );
- setVerScaleMode( newYMode, false );
}
/*!
resMgr->setValue( "Plot2d", "CurveType", myCurveType );
resMgr->setValue( "Plot2d", "ShowLegend", myShowLegend );
resMgr->setValue( "Plot2d", "LegendPos", myLegendPos );
+ resMgr->setValue( "Plot2d", "LegendFont", myLegendFont );
+ resMgr->setValue( "Plot2d", "LegendFontColor", myLegendColor );
resMgr->setValue( "Plot2d", "MarkerSize", myMarkerSize );
resMgr->setValue( "Plot2d", "Background", myBackground );
resMgr->setValue( "Plot2d", "ShowTitle", myTitleEnabled );
}
resMgr->setValue( "Plot2d", "VerScaleMode", myYMode );
+ resMgr->setValue( "Plot2d", "VerNormLMinMode", myNormLMin );
+ resMgr->setValue( "Plot2d", "VerNormLMaxMode", myNormLMax );
+ resMgr->setValue( "Plot2d", "VerNormRMinMode", myNormRMin );
+ resMgr->setValue( "Plot2d", "VerNormRMaxMode", myNormRMax );
}
/*!
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
+ * - a second level list contains NbComponents curves
+ * | system 1 | system 2 | ..... | system N |
+ * | compo1 compo2 ... compoM | compo1 compo2 ... compoM | ..... | compo1 compo2 ... compoM |
+ *
+ * Draw points markers and create associated tooltips.
+ * Draw connection segments (intermittent line) between all the curves of a component.
+ */
+void Plot2d_ViewFrame::displayPlot2dCurveList( QList< QList<Plot2d_Curve*> > sysCoCurveList,
+ Plot2d_QwtPlotPicker* picker,
+ bool displayLegend)
+{
+ //std::cout << "Plot2d_ViewFrame::displayPlot2dCurveList() 1" << std::endl;
+
+ // Systems number
+ int nbSystem = sysCoCurveList.size();
+
+ // Composants number by system
+ 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
+
+ // | component 1 | component 2 | ..... | component M |
+ // | syst1 syst2 ... systN | syst1 syst2 ... systN | ..... | syst1 syst2 ... systN |
+
+ QList<Plot2d_Curve*> plot2dCurveCoSysList;
+
+ //std::cout << " Liste par composant et par systeme :" << std::endl;
+
+ 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);
+ }
+ }
+
+ // 2)- Display list curves by a component's curves group
+ // Draw connection segments (intermittent line) between the curves
+
+ displayPlot2dCurveList( plot2dCurveCoSysList, nbSystem, picker, displayLegend);
+
+ // 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 !!
+
+ QFont xFont = myPlot->axisFont(QwtPlot::xBottom);
+ xFont.setPointSize(8);
+ myPlot->setAxisFont( QwtPlot::xBottom, xFont);
+
+ //std::cout << "Ok for Plot2d_ViewFrame::displayPlot2dCurveList() 1" << std::endl;
+}
+
+
+/*!
+ * Display list of curves by group of consecutive curves.
+ *
+ * Draw points markers and create associated tooltips
+ * Draw connection segments (intermittent line) between the curves
+ */
+void Plot2d_ViewFrame::displayPlot2dCurveList( QList<Plot2d_Curve*> curveList,
+ int groupSize,
+ Plot2d_QwtPlotPicker* picker,
+ bool displayLegend)
+{
+ //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;
+ 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;
+
+ icur1 = 0;
+ for (ig=0; ig < nbGroups; ig++) //*1*
+ {
+ icur2 = icur1 + groupSize -1;
+
+ // For all curves in one group
+ double XgroupMin, XgroupMax;
+ double YgroupMin, YgroupMax;
+
+ // For one curve
+ double XcurveMin, XcurveMax;
+ double YcurveMin, YcurveMax;
+ double *Xval;
+ double *Yval;
+ int nbPoints;
+
+ // Compute X range and Y range for all the curves' points in the group
+
+ for (icur=icur1; icur <= icur2; icur++) //*2*
+ {
+ Plot2d_Curve *plot2dCurve = curveList.at(icur);
+
+ // Curve points
+ nbPoints = plot2dCurve->getData( &Xval, &Yval); // dynamic allocation
+
+ for (int ip=0; ip < nbPoints; ip++)
+ {
+ if (ip == 0) // first point
+ {
+ XcurveMin = Xval[ip]; XcurveMax = Xval[ip];
+ YcurveMin = Yval[ip]; YcurveMax = Yval[ip];
+ }
+ else
+ {
+ if (Xval[ip] < XcurveMin) XcurveMin = Xval[ip];
+ else if (Xval[ip] > XcurveMax) XcurveMax = Xval[ip];
+ if (Yval[ip] < YcurveMin) YcurveMin = Yval[ip];
+ else if (Yval[ip] > YcurveMax) YcurveMax = Yval[ip];
+ }
+ }
+ 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;
+ YgroupMin = YcurveMin; YgroupMax = YcurveMax;
+ }
+ else
+ {
+ if (XcurveMin < XgroupMin) XgroupMin = XcurveMin;
+ if (XcurveMax > XgroupMax) XgroupMax = XcurveMax;
+ if (YcurveMin < YgroupMin) YgroupMin = YcurveMin;
+ if (YcurveMax > YgroupMax) YgroupMax = YcurveMax;
+ }
+ } //*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;
+ }
+ else
+ {
+ if (XgroupMin < XallGroupMin) XallGroupMin = XgroupMin;
+ if (XgroupMax > XallGroupMax) XallGroupMax = XgroupMax;
+ if (YgroupMin < YallGroupMin) YallGroupMin = YgroupMin;
+ if (YgroupMax > YallGroupMax) YallGroupMax = 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);
+
+ // 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_Curve *plot2dCurve1 = curveList.at(icur1);
+ //
+ QColor color1 = plot2dCurve1->getColor();
+ 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);
+ }
+ }
+
+ // 2)- Display the group's curves
+
+ for (icur=icur1; icur <= icur2; 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);
+
+ // Get the graphic curve
+ QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
+
+ // 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);
+ //
+ plotCurve->setPen( QPen( color1, lineWidth1));
+ plotCurve->setSymbol( symbol);
+
+ if (icur > icur1)
+ {
+ //std::cout << " courbe d'indice " << icur << " sans entree dans la legende" << std::endl;
+
+ // The curve must not have legend's entry
+ plotCurve->setItemAttribute( QwtPlotItem::Legend, false);
+ }
+ else
+ {
+ plotCurve->setItemAttribute( QwtPlotItem::Legend, true);
+ }
+ }
+
+ // 3)- Intermittent segments to connect all the group's curves
+
+ if (nbCurves > 1)
+ {
+ double *Xval;
+ double *Yval;
+ int nbPoints;
+ double Xseg[2], Yseg[2];
+ Plot2d_Curve *plot2dCurve1 = curveList.at(icur1);
+
+ // Last point of the first curve
+ nbPoints = plot2dCurve1->getData( &Xval, &Yval); // dynamic allocation
+ Xseg[0] = Xval[ nbPoints -1];
+ Yseg[0] = Yval[ nbPoints -1];
+ delete [] Xval;
+ delete [] Yval;
+
+ for (icur=icur1 +1; icur <= icur2; icur++)
+ {
+ Plot2d_Curve *plot2dCurve = curveList.at(icur);
+
+ // First curve's point
+ nbPoints = plot2dCurve->getData( &Xval, &Yval);
+ Xseg[1] = Xval[0];
+ Yseg[1] = Yval[0];
+
+ createSegment( Xseg, Yseg, 2,
+ Qt::DotLine,
+ lineWidth1,
+ color1,
+ QwtSymbol::NoSymbol);
+
+ // Last curve's point
+ Xseg[0] = Xval[ nbPoints -1];
+ Yseg[0] = Yval[ nbPoints -1];
+ delete [] Xval;
+ delete [] Yval;
+ }
+ }
+ // First curve of the following group
+ icur1 = icur2 + 1;
+ }
+
+ if (displayLegend)
+ {
+ // Consider the new legend's entries
+ showLegend( true, true); // show, update
+ }
+
+ //std::cout << "Ok for Plot2d_ViewFrame::displayPlot2dCurveList() 2" << std::endl;
+}
+
+
+/*!
+ * Create and display an y=f(x) curve of points
+ * Parameters :
+ * toDraw : true => Display the created curve
+ * Draw the points'markers and create associated tooltips
+ */
+Plot2d_Curve* Plot2d_ViewFrame::createPlot2dCurve( QString & title,
+ QString & unit,
+ QList<double> & xList,
+ QList<double> & yList,
+ QList<QString> & tooltipList,
+ Plot2d::LineType lineKind,
+ int lineWidth,
+ QColor & lineColor,
+ QwtSymbol::Style markerKind,
+ Plot2d_QwtPlotPicker* picker,
+ bool toDraw,
+ bool displayLegend)
+{
+ //std::cout << "Plot2d_ViewFrame::createPlot2dCurve()" << std::endl;
+
+ // Mathematical curve
+ Plot2d_Curve* plot2dCurve = new Plot2d_Curve();
+
+ // To deallocate in EraseAll()
+ myPlot2dCurveList.append( plot2dCurve);
+
+ int nbPoint = xList.size();
+ double xVal, yVal;
+ QString tooltip;
+
+ for (int ip=0; ip < nbPoint; ip++)
+ {
+ xVal = xList.at(ip);
+ yVal = yList.at(ip);
+ tooltip = tooltipList.at(ip);
+
+ plot2dCurve->addPoint( xVal, yVal, tooltip);
+ }
+
+ plot2dCurve->setVerTitle( title);
+ plot2dCurve->setVerUnits( unit);
+ if (lineColor.isValid())
+ {
+ plot2dCurve->setColor( lineColor);
+ }
+ plot2dCurve->setLine( lineKind, lineWidth);
+ plot2dCurve->setMarkerStyle( markerKind);
+ plot2dCurve->setMarkerSize(1);
+
+ // Graphical curve (QwtPlotCurve) in the drawing zone (QwtPlot) myPlot
+ if (toDraw)
+ {
+ if (!displayLegend)
+ {
+ myPlot->insertLegend( (QwtLegend*)NULL);
+ }
+ displayCurve( plot2dCurve);
+
+ // plot points marker create associated tooltips
+ createCurveTooltips( plot2dCurve, picker);
+
+ // Get the graphical curve
+ QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
+
+ QColor theColor;
+
+ if (lineColor.isValid())
+ {
+ //std::cout << " valid color" << std::endl;
+ theColor = lineColor;
+ }
+ else
+ {
+ //std::cout << " valid color" << std::endl;
+ QPen pen = plotCurve->pen();
+ theColor = pen.color();
+ }
+
+ // Modify points' markers
+ QwtSymbol symbol (plotCurve->symbol()) ;
+ symbol.setStyle( markerKind);
+ //
+ if (markerKind != QwtSymbol::NoSymbol)
+ {
+ symbol.setPen( QPen( theColor, lineWidth));
+ symbol.setBrush( QBrush( theColor));
+ QSize size = 2.0*(symbol.size()); //0.5
+ symbol.setSize(size);
+ }
+
+ plotCurve->setSymbol( symbol);
+ plotCurve->setStyle( QwtPlotCurve::Lines);
+ plotCurve->setPen( QPen( theColor, lineWidth));
+
+ // The curve must not have legend's entry
+ plotCurve->setItemAttribute( QwtPlotItem::Legend, false);
+ }
+ return plot2dCurve;
+}
+
+
+/*!
+ * Get curve's color
+ */
+QColor Plot2d_ViewFrame::getPlot2dCurveColor( Plot2d_Curve* plot2dCurve)
+{
+
+ // Get graphical curve
+ QwtPlotCurve* plotCurve = dynamic_cast<QwtPlotCurve *>( getPlotObject( plot2dCurve));
+
+ QPen pen = plotCurve->pen();
+ QColor color = pen.color();
+
+ return color;
+}
+
+
+/*!
+ * 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* aPCurve = new QwtPlotCurve();
+
+ aPCurve->setData( X, Y, nbPoint);
+
+ aPCurve->setPen( QPen( lineColor, lineWidth, lineKind));
+ QwtSymbol aSymbol;
+ aSymbol.setStyle( markerKind);
+ aPCurve->setSymbol( aSymbol);
+
+ // The segment must not have legend's entry
+ aPCurve->setItemAttribute( QwtPlotItem::Legend, false);
+
+ aPCurve->attach( myPlot);
+ // To deallocate in EraseAll()
+ myIntermittentSegmentList.append( aPCurve);
+}
+
/*!
Adds curve into view
*/
void Plot2d_ViewFrame::displayCurve( Plot2d_Curve* curve, bool update )
{
- if ( !curve )
- return;
+ QwtPlotItem* anItem = displayObject( curve, update );
+ // To deallocate in EraseAll()
+ myQwtPlotCurveList.append( anItem);
+}
+
+/*!
+ Adds curves into view
+*/
+void Plot2d_ViewFrame::displayCurves( const curveList& curves, bool update )
+{
+ objectList objects;
+ foreach ( Plot2d_Curve* curve, curves )
+ objects << curve;
+ displayObjects( objects, update );
+}
+
+/*!
+ Erases curve
+*/
+void Plot2d_ViewFrame::eraseCurve( Plot2d_Curve* curve, bool update )
+{
+ eraseObject( curve, update );
+}
+
+/*!
+ Erases curves
+*/
+void Plot2d_ViewFrame::eraseCurves( const curveList& curves, bool update )
+{
+ objectList objects;
+ foreach ( Plot2d_Curve* curve, curves )
+ objects << curve;
+ eraseObjects( objects, update );
+}
+
+/*!
+ Updates curves attributes
+*/
+void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
+{
+ updateObject( curve, update );
+}
+
+void Plot2d_ViewFrame::processFiltering(bool update)
+{
+ CurveDict aCurves = getCurves();
+ AlgoPlot2dInputData aLData, aRData;
+ CurveDict::iterator it;
+ for ( it = aCurves.begin(); it != aCurves.end(); it++ ) {
+ Plot2d_Object* objItem = it.value();
+ if (objItem->getYAxis() == QwtPlot::yRight)
+ aRData.append(objItem);
+ else
+ aLData.append(objItem);
+ }
+
+// Normalization by left Y axis
+ if (!myNormLMin && !myNormLMax)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeNone);
+ if(myNormLMin && myNormLMax)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMinMax);
+ else if(myNormLMin)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMin);
+ else if(myNormLMax)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMax);
+
+ myLNormAlgo->setInput(aLData);
+ myLNormAlgo->execute();
+
+// Normalization by right Y axis
+ if (!myNormRMin && !myNormRMax)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeNone);
+ if(myNormRMin && myNormRMax)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMinMax);
+ else if(myNormRMin)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMin);
+ else if(myNormRMax)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMax);
+
+ myRNormAlgo->setInput(aRData);
+ myRNormAlgo->execute();
+
+ for ( it = aCurves.begin(); it != aCurves.end(); it++) {
+ QwtPlotCurve* item = it.key();
+ Plot2d_Object* objItem = it.value();
+ updatePlotItem(objItem, item);
+ }
+ if(update)
+ myPlot->replot();
+}
+
+/*!
+ Gets lsit of displayed curves
+*/
+int Plot2d_ViewFrame::getCurves( curveList& curves ) const
+{
+ curves.clear();
+
+ CurveDict aCurves = getCurves();
+ CurveDict::iterator it;
+ for ( it = aCurves.begin(); it != aCurves.end(); it++ )
+ curves << it.value();
+ return curves.count();
+}
+
+CurveDict Plot2d_ViewFrame::getCurves() const
+{
+ CurveDict curves;
+ ObjectDict::const_iterator it = myObjects.begin(), aLast = myObjects.end();
+ for ( ; it != aLast; it++ ) {
+ QwtPlotItem* anItem = it.key();
+ if ( anItem && anItem->rtti() == QwtPlotItem::Rtti_PlotCurve ) {
+ QwtPlotCurve* aPCurve = dynamic_cast<QwtPlotCurve*>( anItem );
+ Plot2d_Curve* aCurve = dynamic_cast<Plot2d_Curve*>( it.value() );
+ if ( aPCurve && aCurve )
+ curves.insert( aPCurve, aCurve );
+ }
+ }
+ return curves;
+}
+
+/*!
+ Adds object into view
+*/
+QwtPlotItem* Plot2d_ViewFrame::displayObject( Plot2d_Object* object, bool update )
+{
+ QwtPlotItem* anItem = 0;
+ if ( !object )
+ return anItem;
+
+ if ( object->getYAxis() == QwtPlot::yRight )
+ mySecondY = true;
// san -- Protection against QwtCurve bug in Qwt 0.4.x:
// it crashes if switched to X/Y logarithmic mode, when one or more points have
// non-positive X/Y coordinate
- if ( myXMode && curve->getMinX() <= 0. )
+ if ( myXMode && object->getMinX() <= 0. )
setHorScaleMode( 0, false );
- if ( myYMode && curve->getMinY() <= 0. )
+ if ( myYMode && object->getMinY() <= 0. )
setVerScaleMode( 0, false );
- if ( hasPlotCurve( curve ) ) {
- updateCurve( curve, update );
+ if ( object->isAutoAssign() )
+ object->autoFill( myPlot );
+
+ if ( hasPlotObject( object ) ) {
+ processFiltering(update);
+ updateObject( object, update );
}
else {
- QwtPlotCurve* aPCurve = new QwtPlotCurve( curve->getVerTitle() );
- aPCurve->attach( myPlot );
+ anItem = object->createPlotItem();
+ anItem->attach( myPlot );
+ myObjects.insert( anItem, object );
//myPlot->setCurveYAxis(curveKey, curve->getYAxis());
- myPlot->getCurves().insert( aPCurve, curve );
- if ( curve->isAutoAssign() ) {
- QwtSymbol::Style typeMarker;
- QColor color;
- Qt::PenStyle typeLine;
-
- myPlot->getNextMarker( typeMarker, color, typeLine );
- aPCurve->setPen( QPen( color, DEFAULT_LINE_WIDTH, typeLine ) );
- aPCurve->setSymbol( QwtSymbol( typeMarker,
- QBrush( color ),
- QPen( color ),
- QSize( myMarkerSize, myMarkerSize ) ) );
- curve->setColor( color );
- curve->setLine( Plot2d::qwt2plotLine( typeLine ) );
- curve->setMarker( Plot2d::qwt2plotMarker( typeMarker ) );
- }
- else {
- Qt::PenStyle ps = Plot2d::plot2qwtLine( curve->getLine() );
- QwtSymbol::Style ms = Plot2d::plot2qwtMarker( curve->getMarker() );
- aPCurve->setPen( QPen( curve->getColor(), curve->getLineWidth(), ps ) );
- aPCurve->setSymbol( QwtSymbol( ms,
- QBrush( curve->getColor() ),
- QPen( curve->getColor() ),
- QSize( myMarkerSize, myMarkerSize ) ) );
+ if ( object->rtti() == QwtPlotItem::Rtti_PlotCurve )
+ {
+ Plot2d_Curve* aCurve = dynamic_cast<Plot2d_Curve*>( object );
+ if ( aCurve )
+ {
+ //myMarkerSize = 1;
+ //aCurve->setMarkerSize( myMarkerSize );
+
+ if (aCurve->getMarkerSize() == 0)
+ {
+ aCurve->setMarkerSize( myMarkerSize );
+ }
+
+ processFiltering(update);
+ updatePlotItem( aCurve, anItem );
+ setCurveType( getPlotCurve( aCurve ), myCurveType );
+ }
}
- setCurveType( aPCurve, myCurveType );
- aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() );
}
updateTitles();
+ myPlot->updateYAxisIdentifiers();
if ( update )
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
+ return anItem;
}
/*!
- Adds curves into view
+ Adds objects into view
*/
-void Plot2d_ViewFrame::displayCurves( const curveList& curves, bool update )
+void Plot2d_ViewFrame::displayObjects( const objectList& objects, bool update )
{
//myPlot->setUpdatesEnabled( false ); // call this function deprecate update of legend
- curveList::const_iterator it = curves.begin();
- Plot2d_Curve* aCurve;
- for (; it != curves.end(); ++it ) {
- aCurve = *it;
- displayCurve( aCurve, false );
- }
+ foreach ( Plot2d_Object* object, objects )
+ displayObject( object, false );
fitAll();
//myPlot->setUpdatesEnabled( true );
-// update legend
+ // update legend
if ( update )
myPlot->replot();
}
/*!
- Erases curve
+ Erases object
*/
-void Plot2d_ViewFrame::eraseCurve( Plot2d_Curve* curve, bool update )
+void Plot2d_ViewFrame::eraseObject( Plot2d_Object* object, bool update )
{
- if ( !curve )
+ if ( !object )
return;
- if ( hasPlotCurve( curve ) ) {
- QwtPlotCurve* aPCurve = getPlotCurve( curve );
- aPCurve->hide();
- aPCurve->detach();
- myPlot->getCurves().remove( aPCurve );
+
+ if ( hasPlotObject( object ) ) {
+ QwtPlotItem* anObject = getPlotObject( object );
+ anObject->hide();
+ anObject->detach();
+ myObjects.remove( anObject );
updateTitles();
+ myPlot->updateYAxisIdentifiers();
if ( update )
myPlot->replot();
}
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
- Erases curves
+ Erases objects
*/
-void Plot2d_ViewFrame::eraseCurves( const curveList& curves, bool update )
+void Plot2d_ViewFrame::eraseObjects( const objectList& objects, bool update )
{
- curveList::const_iterator it = curves.begin();
- Plot2d_Curve* aCurve;
- for (; it != curves.end(); ++it ) {
- aCurve = *it;
- eraseCurve( aCurve, false );
- }
-// fitAll();
+ foreach ( Plot2d_Object* object, objects )
+ eraseObject( object, false );
+
+ // fitAll();
if ( update )
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
- Updates curves attributes
+ Updates objects attributes
*/
-void Plot2d_ViewFrame::updateCurve( Plot2d_Curve* curve, bool update )
+void Plot2d_ViewFrame::updateObject( Plot2d_Object* object, bool update )
{
- if ( !curve )
+ if ( !object )
return;
- if ( hasPlotCurve( curve ) ) {
- QwtPlotCurve* aPCurve = getPlotCurve( curve );
- if ( !curve->isAutoAssign() ) {
- Qt::PenStyle ps = Plot2d::plot2qwtLine( curve->getLine() );
- QwtSymbol::Style ms = Plot2d::plot2qwtMarker( curve->getMarker() );
- aPCurve->setPen ( QPen( curve->getColor(), curve->getLineWidth(), ps ) );
- aPCurve->setSymbol( QwtSymbol( ms,
- QBrush( curve->getColor() ),
- QPen( curve->getColor() ),
- QSize( myMarkerSize, myMarkerSize ) ) );
- aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() );
- }
- aPCurve->setTitle( curve->getVerTitle() );
- aPCurve->setVisible( true );
+ if ( hasPlotObject( object ) ) {
+ QwtPlotItem* anItem = getPlotObject( object );
+ if ( !anItem )
+ return;
+ updatePlotItem(object, anItem );
+ anItem->setVisible( true );
if ( update )
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
}
/*!
Gets lsit of displayed curves
*/
-int Plot2d_ViewFrame::getCurves( curveList& clist )
+int Plot2d_ViewFrame::getObjects( objectList& objects ) const
{
- clist.clear();
-
- CurveDict::iterator it = myPlot->getCurves().begin();
- for ( ; it != myPlot->getCurves().end(); it++ )
- clist.append( it.value() );
- return clist.count();
-}
+ objects.clear();
-const CurveDict& Plot2d_ViewFrame::getCurves()
-{
- return myPlot->getCurves();
+ ObjectDict::const_iterator it;
+ for ( it = myObjects.begin(); it != myObjects.end(); it++ )
+ objects << it.value();
+ return objects.count();
}
/*!
Returns true if the curve is visible
*/
-bool Plot2d_ViewFrame::isVisible( Plot2d_Curve* curve )
+bool Plot2d_ViewFrame::isVisible( Plot2d_Object* object ) const
{
- if(curve) {
- if ( hasPlotCurve( curve ) ) {
- return getPlotCurve( curve )->isVisible();
- }
- }
- return false;
+ return object && hasPlotObject( object ) && getPlotObject( object )->isVisible();
}
/*!
{
if ( !prs || prs->IsNull() )
return;
- curveList aCurves = prs->getCurves();
- curveList::iterator it = aCurves.begin();
- Plot2d_Curve* aCurve;
- for (; it != aCurves.end(); ++it ) {
- aCurve = *it;
- if ( hasPlotCurve( aCurve ) )
- getPlotCurve( aCurve )->setTitle( aCurve->getVerTitle() );
+ ObjectDict::iterator it = myObjects.begin();
+ Plot2d_Object* anObj;
+ for (; it != myObjects.end(); ++it ) {
+ anObj = *it;
+ if ( hasPlotObject( anObj ) )
+ getPlotObject( anObj )->setTitle( !anObj->getName().isEmpty() ?
+ anObj->getName() : anObj->getVerTitle() );
+ }
+}
+
+/*!
+ update legend
+*/
+void Plot2d_ViewFrame::updateLegend() {
+ if ( myPlot->getLegend() ) {
+ ObjectDict::iterator it = myObjects.begin();
+ for( ; it != myObjects.end(); ++it )
+ it.key()->updateLegend(myPlot->getLegend());
}
}
+
/*!
Fits the view to see all data
*/
myPlot->setAxisAutoScale( QwtPlot::xBottom );
myPlot->replot();
- // for existing grid
- QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
- QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
+ double xmin, xmax, y1min, y1max, y2min, y2max;
+ getFitRangeByCurves(xmin, xmax, y1min, y1max, y2min, y2max);
- myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s2() );
- myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s2() );
+ myPlot->setAxisScale( QwtPlot::xBottom, xmin, xmax );
+ myPlot->setAxisScale( QwtPlot::yLeft, y1min, y1max );
if (mySecondY) {
myPlot->setAxisAutoScale( QwtPlot::yRight );
myPlot->replot();
- QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
- myPlot->setAxisScale( QwtPlot::yRight, yMap2.s1(), yMap2.s2() );
+ myPlot->setAxisScale( QwtPlot::yRight, y2min, y2max );
}
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
myPlot->invTransform( QwtPlot::xBottom, rect.left() ),
myPlot->invTransform( QwtPlot::xBottom, rect.right() ) );
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
"Fit Data" command for TUI interface
*/
void Plot2d_ViewFrame::fitData(const int mode,
- const double xMin, const double xMax,
- const double yMin, const double yMax,
- double y2Min, double y2Max)
+ const double xMin, const double xMax,
+ const double yMin, const double yMax,
+ double y2Min, double y2Max)
{
if ( mode == 0 || mode == 2 ) {
myPlot->setAxisScale( QwtPlot::yLeft, yMin, yMax );
if ( mode == 0 || mode == 1 )
myPlot->setAxisScale( QwtPlot::xBottom, xMin, xMax );
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
/*!
Gets current fit ranges for view frame
*/
void Plot2d_ViewFrame::getFitRanges(double& xMin,double& xMax,
- double& yMin, double& yMax,
- double& y2Min, double& y2Max)
+ double& yMin, double& yMax,
+ double& y2Min, double& y2Max)
{
int ixMin = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s1() );
int ixMax = myPlot->canvasMap( QwtPlot::xBottom ).transform( myPlot->canvasMap( QwtPlot::xBottom ).s2() );
}
}
+/*!
+ Gets current fit ranges by Curves
+*/
+void Plot2d_ViewFrame::getFitRangeByCurves(double& xMin, double& xMax,
+ double& yMin, double& yMax,
+ double& y2Min, double& y2Max)
+{
+ bool emptyV1 = true, emptyV2 = true;
+ if ( !myObjects.isEmpty() ) {
+ ObjectDict::const_iterator it = myObjects.begin();
+ for ( ; it != myObjects.end(); it++ ) {
+ bool isV2 = it.value()->getYAxis() == QwtPlot::yRight;
+ if ( !it.value()->isEmpty() ) {
+ if ( emptyV1 && emptyV2 ) {
+ xMin = 1e150;
+ xMax = -1e150;
+ }
+ if ( emptyV1 ) {
+ yMin = 1e150;
+ yMax = -1e150;
+ }
+ if ( emptyV2 ) {
+ y2Min = 1e150;
+ y2Max = -1e150;
+ }
+ isV2 ? emptyV2 = false : emptyV1 = false;
+ xMin = qMin( xMin, it.value()->getMinX() );
+ xMax = qMax( xMax, it.value()->getMaxX() );
+ if ( isV2 ) {
+ y2Min = qMin( y2Min, it.value()->getMinY() );
+ y2Max = qMax( y2Max, it.value()->getMaxY() );
+ }
+ else {
+ yMin = qMin( yMin, it.value()->getMinY() );
+ yMax = qMax( yMax, it.value()->getMaxY() );
+ }
+ }
+ }
+ if ( xMin == xMax ) {
+ xMin = xMin == 0. ? -1. : xMin - xMin/10.;
+ xMax = xMax == 0. ? 1. : xMax + xMax/10.;
+ }
+ if ( yMin == yMax ) {
+ yMin = yMin == 0. ? -1. : yMin - yMin/10.;
+ yMax = yMax == 0. ? 1 : yMax + yMax/10.;
+ }
+ if ( y2Min == y2Max ) {
+ y2Min = y2Min == 0. ? -1. : y2Min - y2Min/10.;
+ y2Max = y2Max == 0. ? 1 : y2Max + y2Max/10.;
+ }
+ }
+ // default values
+ if ( emptyV1 && emptyV2 ) {
+ xMin = isModeHorLinear() ? 0. : 1.;
+ xMax = isModeHorLinear() ? 1000. : 1e5;
+ }
+ if ( emptyV1 ) {
+ yMin = isModeVerLinear() ? 0. : 1.;
+ yMax = isModeVerLinear() ? 1000. : 1e5;
+ }
+ if ( emptyV2 ) {
+ y2Min = isModeVerLinear() ? 0. : 1.;
+ y2Max = isModeVerLinear() ? 1000. : 1e5;
+ }
+}
+
/*!
Tests if it is necessary to start operation on mouse action
*/
const int panBtn = Qt::ControlModifier | Qt::MidButton;
const int fitBtn = Qt::ControlModifier | Qt::RightButton;
- switch (btn)
- {
- case zoomBtn:
- {
- QPixmap zoomPixmap (imageZoomCursor);
- QCursor zoomCursor (zoomPixmap);
- myPlot->canvas()->setCursor( zoomCursor );
- return ZoomId;
- }
- case panBtn:
+ int op = NoOpId;
+ if ( btn == zoomBtn ) {
+ QPixmap zoomPixmap (imageZoomCursor);
+ QCursor zoomCursor (zoomPixmap);
+ myPlot->canvas()->setCursor( zoomCursor );
+ op = ZoomId;
+ }
+ else if ( btn == panBtn ) {
myPlot->canvas()->setCursor( QCursor( Qt::SizeAllCursor ) );
- return PanId;
- case fitBtn:
+ op = PanId;
+ }
+ else if ( btn == fitBtn ) {
myPlot->canvas()->setCursor( QCursor( Qt::PointingHandCursor ) );
- return FitAreaId;
- default :
- return NoOpId;
+ op = FitAreaId;
}
+ return op;
}
/*!
if (mySecondY)
dlg->setY2Title( myY2TitleEnabled, myY2Title );
dlg->setCurveType( myCurveType );
- dlg->setLegend( myShowLegend, myLegendPos );
+ dlg->setLegend( myShowLegend, myLegendPos, myLegendFont, myLegendColor );
dlg->setMarkerSize( myMarkerSize );
dlg->setBackgroundColor( myBackground );
dlg->setScaleMode(myXMode, myYMode);
+ dlg->setLMinNormMode(myNormLMin);
+ dlg->setLMaxNormMode(myNormLMax);
+ dlg->setRMinNormMode(myNormRMin);
+ dlg->setRMaxNormMode(myNormRMax);
+
+ QVariant v = myPlot->property(PLOT2D_DEVIATION_LW);
+ int lw = v.isValid() ? v.toInt() : 1;
+
+ v = myPlot->property(PLOT2D_DEVIATION_TS);
+ int ts = v.isValid() ? v.toInt() : 2;
+
+ v = myPlot->property(PLOT2D_DEVIATION_COLOR);
+ QColor cl = v.isValid() ? v.value<QColor>() : QColor(255,0,0);
+
+ dlg->setDeviationMarkerLw(lw);
+ dlg->setDeviationMarkerTs(ts);
+ dlg->setDeviationMarkerCl(cl);
+
//
dlg->setMajorGrid( myXGridMajorEnabled, myPlot->axisMaxMajor( QwtPlot::xBottom ),
myYGridMajorEnabled, myPlot->axisMaxMajor( QwtPlot::yLeft ),
setTitle( dlg->isY2TitleEnabled(), dlg->getY2Title(), Y2Title, false );
// main title
+ if( dlg->isMainTitleEnabled() && myTitle != dlg->getMainTitle() )
+ myIsDefTitle = false;
setTitle( dlg->isMainTitleEnabled(), dlg->getMainTitle(), MainTitle, true );
// curve type
if ( myCurveType != dlg->getCurveType() ) {
if ( myLegendPos != dlg->getLegendPos() ) {
setLegendPos( dlg->getLegendPos() );
}
+ if ( myLegendFont != dlg->getLegendFont() ) {
+ setLegendFont( dlg->getLegendFont() );
+ }
+ if ( myLegendColor != dlg->getLegendColor() ) {
+ setLegendFontColor( dlg->getLegendColor() );
+ }
+
// marker size
if ( myMarkerSize != dlg->getMarkerSize() ) {
setMarkerSize( dlg->getMarkerSize(), false );
if ( myYMode != dlg->getYScaleMode() ) {
setVerScaleMode( dlg->getYScaleMode() );
}
+ if ( myNormLMin != dlg->getLMinNormMode() ) {
+ setNormLMinMode( dlg->getLMinNormMode() );
+ }
+ if ( myNormLMax != dlg->getLMaxNormMode() ) {
+ setNormLMaxMode( dlg->getLMaxNormMode() );
+ }
+ if ( myNormRMin != dlg->getRMinNormMode() ) {
+ setNormRMinMode( dlg->getRMinNormMode() );
+ }
+ if ( myNormRMax != dlg->getRMaxNormMode() ) {
+ setNormRMaxMode( dlg->getRMaxNormMode() );
+ }
+
+ myPlot->setProperty(PLOT2D_DEVIATION_COLOR,
+ dlg->getDeviationMarkerCl());
+ myPlot->setProperty(PLOT2D_DEVIATION_LW,
+ dlg->getDeviationMarkerLw());
+ myPlot->setProperty(PLOT2D_DEVIATION_TS,
+ dlg->getDeviationMarkerTs());
+
+
// update view
myPlot->replot();
// update preferences
delete dlg;
}
+/*!
+ "Analytical Curves" toolbar action slot
+*/
+void Plot2d_ViewFrame::onAnalyticalCurve()
+{
+#ifndef DISABLE_PYCONSOLE
+ Plot2d_AnalyticalCurveDlg dlg( this, this );
+ dlg.exec();
+ updateAnalyticalCurves();
+#endif
+}
+
+void Plot2d_ViewFrame::addAnalyticalCurve( Plot2d_AnalyticalCurve* theCurve)
+{
+#ifndef DISABLE_PYCONSOLE
+ myAnalyticalCurves.append(theCurve);
+#endif
+}
+
+void Plot2d_ViewFrame::removeAnalyticalCurve( Plot2d_AnalyticalCurve* theCurve)
+{
+#ifndef DISABLE_PYCONSOLE
+ theCurve->setAction(Plot2d_AnalyticalCurve::ActRemoveFromView);
+#endif
+}
+
+/*
+ Update Analytical curve
+*/
+void Plot2d_ViewFrame::updateAnalyticalCurve(Plot2d_AnalyticalCurve* c, bool updateView)
+{
+#ifndef DISABLE_PYCONSOLE
+ if(!c) return;
+ QwtScaleDiv* div = myPlot->axisScaleDiv(QwtPlot::xBottom);
+ c->setRangeBegin(div->lowerBound());
+ c->setRangeEnd(div->upperBound());
+ c->calculate();
+ c->setMarkerSize(myMarkerSize);
+ QwtPlotItem* item = c->plotItem();
+
+ switch( c->getAction() ) {
+ case Plot2d_AnalyticalCurve::ActAddInView:
+ if( c->isActive() ) {
+ c->updatePlotItem();
+ item->attach( myPlot );
+ item->show();
+ }
+ c->setAction(Plot2d_AnalyticalCurve::ActNothing);
+ break;
+
+ case Plot2d_AnalyticalCurve::ActUpdateInView:
+ if(c->isActive()) {
+ c->updatePlotItem();
+ item->show();
+ } else {
+ item->hide();
+ item->detach();
+ }
+
+ c->setAction(Plot2d_AnalyticalCurve::ActNothing);
+ break;
+ case Plot2d_AnalyticalCurve::ActRemoveFromView:
+ item->hide();
+ item->detach();
+ myAnalyticalCurves.removeAll(c);
+ delete c;
+ break;
+ }
+
+ if(updateView)
+ myPlot->replot();
+#endif
+}
+
+/*
+ Update Analytical curves
+*/
+void Plot2d_ViewFrame::updateAnalyticalCurves()
+{
+#ifndef DISABLE_PYCONSOLE
+ AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+ for( ; it != myAnalyticalCurves.end(); it++) {
+ updateAnalyticalCurve(*it);
+ }
+ myPlot->replot();
+#endif
+}
+
+/*!
+ Return list of the alalytical curves.
+*/
+AnalyticalCurveList Plot2d_ViewFrame::getAnalyticalCurves() const
+{
+ return myAnalyticalCurves;
+}
+
+/*!
+ Get analytical curve by plot item.
+*/
+Plot2d_AnalyticalCurve* Plot2d_ViewFrame::getAnalyticalCurve(QwtPlotItem * theItem) {
+#ifndef DISABLE_PYCONSOLE
+ AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+ for( ; it != myAnalyticalCurves.end(); it++) {
+ if((*it)->plotItem() == theItem);
+ return (*it);
+ }
+ return 0;
+#endif
+}
+
/*!
"Fit Data" command slot
*/
fitData(mode,xMin,xMax,yMin,yMax,y2Min,y2Max);
}
delete dlg;
+ updateAnalyticalCurves();
}
/*!
*/
void Plot2d_ViewFrame::onChangeBackground()
{
- QColor selColor = QColorDialog::getColor ( backgroundColor(), this );
+ QColor selColor = QColorDialog::getColor ( backgroundColor(), this );
if ( selColor.isValid() ) {
setBackgroundColor( selColor );
}
void Plot2d_ViewFrame::setCurveType( int curveType, bool update )
{
myCurveType = curveType;
- CurveDict::iterator it = myPlot->getCurves().begin();
- for ( ; it != myPlot->getCurves().end(); it++ ) {
+ CurveDict aCurves = getCurves();
+ CurveDict::iterator it = aCurves.begin();
+ for ( ; it != aCurves.end(); it++ ) {
QwtPlotCurve* crv = it.key();
if ( crv )
setCurveType( crv, myCurveType );
emit vpCurveChanged();
}
+/*!
+ Gets curve type
+*/
+int Plot2d_ViewFrame::getCurveType() const
+{
+ return myCurveType;
+}
+
/*!
Sets curve title
\param curveKey - curve id
\param title - new title
*/
void Plot2d_ViewFrame::setCurveTitle( Plot2d_Curve* curve, const QString& title )
+{
+ setObjectTitle( curve, title );
+}
+
+/*!
+ Sets object title
+ \param object - object id
+ \param title - new title
+*/
+void Plot2d_ViewFrame::setObjectTitle( Plot2d_Object* object, const QString& title )
{
- if ( curve && hasPlotCurve( curve ) )
- getPlotCurve( curve )->setTitle( title );
+ if ( object && hasPlotObject( object ) )
+ getPlotObject( object )->setTitle( title );
}
/*!
QwtLegend* legend = myPlot->legend();
if ( !legend ) {
legend = new QwtLegend( myPlot );
- legend->setFrameStyle( QFrame::Box | QFrame::Sunken );
+ legend->setFrameStyle( QFrame::Box | QFrame::Sunken );
}
legend->setItemMode( QwtLegend::ClickableItem );
myPlot->insertLegend( legend );
setLegendPos( myLegendPos );
+ setLegendFont( myLegendFont );
+ setLegendFontColor( myLegendColor );
}
else
myPlot->insertLegend( 0 );
{
myLegendPos = pos;
QwtLegend* legend = myPlot->legend();
- switch( pos ) {
- case 0:
- myPlot->insertLegend( legend, QwtPlot::LeftLegend );
- break;
- case 1:
- myPlot->insertLegend( legend, QwtPlot::RightLegend );
- break;
- case 2:
- myPlot->insertLegend( legend, QwtPlot::TopLegend );
- break;
- case 3:
- myPlot->insertLegend( legend, QwtPlot::BottomLegend );
- break;
+ if ( legend ) {
+ switch( pos ) {
+ case 0:
+ myPlot->insertLegend( legend, QwtPlot::LeftLegend );
+ break;
+ case 1:
+ myPlot->insertLegend( legend, QwtPlot::RightLegend );
+ break;
+ case 2:
+ myPlot->insertLegend( legend, QwtPlot::TopLegend );
+ break;
+ case 3:
+ myPlot->insertLegend( legend, QwtPlot::BottomLegend );
+ break;
+ }
+ }
+}
+
+/*!
+ Gets legend position : 0 - left, 1 - right, 2 - top, 3 - bottom
+*/
+int Plot2d_ViewFrame::getLegendPos() const
+{
+ return myLegendPos;
+}
+
+/*!
+ Sets legend font
+*/
+void Plot2d_ViewFrame::setLegendFont( const QFont& fnt )
+{
+ myLegendFont = fnt;
+ QwtLegend* legend = myPlot->legend();
+ if ( legend ) {
+ legend->setFont(fnt);
+ }
+}
+
+/*!
+ Gets legend font
+*/
+QFont Plot2d_ViewFrame::getLegendFont() const
+{
+ return myLegendFont;
+}
+
+/*!
+ Gets legend font color
+*/
+QColor Plot2d_ViewFrame::getLegendFontColor() const
+{
+ return myLegendColor;
+}
+
+/*!
+ Sets legend font color
+*/
+void Plot2d_ViewFrame::setLegendFontColor( const QColor& col )
+{
+ myLegendColor = col;
+ QwtLegend* legend = myPlot->legend();
+ if ( legend ) {
+ QPalette pal = legend->palette();
+ pal.setColor( QPalette::Text, col );
+ legend->setPalette( pal );
}
}
if ( myMarkerSize != size )
{
myMarkerSize = size;
- CurveDict::iterator it = myPlot->getCurves().begin();
- for ( ; it != myPlot->getCurves().end(); it++ ) {
+ CurveDict aCurves = getCurves();
+ CurveDict::iterator it = aCurves.begin();
+ for ( ; it != aCurves.end(); it++ ) {
QwtPlotCurve* crv = it.key();
if ( crv )
{
QwtSymbol aSymbol = crv->symbol();
aSymbol.setSize( myMarkerSize, myMarkerSize );
crv->setSymbol( aSymbol );
+ if(it.value())
+ it.value()->setMarkerSize( myMarkerSize );
}
}
if ( update )
}
}
+/*!
+ Gets new marker size
+*/
+int Plot2d_ViewFrame::getMarkerSize() const
+{
+ return myMarkerSize;
+}
+
/*!
Sets background color
*/
aPal.setColor( QPalette::Background, myBackground );
}
myPlot->getLegend()->setPalette( aPal );
+ updateLegend();
}
Repaint();
}
myY2Title = title;
myPlot->setAxisTitle( QwtPlot::yRight, myY2TitleEnabled ? myY2Title : QString() );
break;
+ default:
+ break;
}
if ( update )
myPlot->replot();
title = myYTitle; break;
case Y2Title:
title = myY2Title; break;
+ default:
+ break;
}
return title;
}
if ( update )
myPlot->replot();
}
+
/*!
Sets scale mode for horizontal axis: 0 - linear, 1 - logarithmic
*/
fitAll();
emit vpModeHorChanged();
}
+
+/*!
+ Gets scale mode for horizontal axis: 0 - linear, 1 - logarithmic
+*/
+int Plot2d_ViewFrame::getHorScaleMode() const
+{
+ return myXMode;
+}
+
/*!
Sets scale mode for vertical axis: 0 - linear, 1 - logarithmic
*/
emit vpModeVerChanged();
}
+/*!
+ Gets scale mode for vertical axis: 0 - linear, 1 - logarithmic
+*/
+int Plot2d_ViewFrame::getVerScaleMode() const
+{
+ return myYMode;
+}
+
+/*!
+ Sets normalization mode to the global maximum by left Y axis
+*/
+void Plot2d_ViewFrame::setNormLMaxMode( bool mode, bool update )
+{
+ if ( myNormLMax == mode )
+ return;
+
+ myNormLMax = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormLModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global maximum by left Y axis
+*/
+bool Plot2d_ViewFrame::getNormLMaxMode() const
+{
+ return myNormLMax;
+}
+
+/*!
+ Sets normalization mode to the global minimum by left Y axis
+*/
+void Plot2d_ViewFrame::setNormLMinMode( bool mode, bool update )
+{
+ if ( myNormLMin == mode )
+ return;
+
+ myNormLMin = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormLModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global minimum by left Y axis
+*/
+bool Plot2d_ViewFrame::getNormLMinMode() const
+{
+ return myNormLMax;
+}
+
+/*!
+ Sets normalization mode to the global maximum by right Y axis
+*/
+void Plot2d_ViewFrame::setNormRMaxMode( bool mode, bool update )
+{
+ if ( myNormRMax == mode )
+ return;
+
+ myNormRMax = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormRModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global maximum by right Y axis
+*/
+bool Plot2d_ViewFrame::getNormRMaxMode() const
+{
+ return myNormRMax;
+}
+
+/*!
+ Sets normalization mode to the global minimum by right Y axis
+*/
+void Plot2d_ViewFrame::setNormRMinMode( bool mode, bool update )
+{
+ if ( myNormRMin == mode )
+ return;
+
+ myNormRMin = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormRModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global minimum by right Y axis
+*/
+bool Plot2d_ViewFrame::getNormRMinMode() const
+{
+ return myNormRMax;
+}
+
/*!
Return, scale mode for horizontal axis
*/
{
return (myYMode == 0 ? true : false);
}
+
+/*!
+ Return \c True if curves are normalize to the global maximum by left Y axis
+*/
+bool Plot2d_ViewFrame::isNormLMaxMode()
+{
+ return (myNormLMax ? true : false);
+}
+
+/*!
+ Return \c True if curves are normalize to the global minimum by left Y axis
+*/
+bool Plot2d_ViewFrame::isNormLMinMode()
+{
+ return (myNormLMin ? true : false);
+}
+
+/*!
+ Return \c True if curves are normalize to the global maximum by right Y axis
+*/
+bool Plot2d_ViewFrame::isNormRMaxMode()
+{
+ return (myNormRMax ? true : false);
+}
+
+/*!
+ Return \c True if curves are normalize to the global minimum by right Y axis
+*/
+bool Plot2d_ViewFrame::isNormRMinMode()
+{
+ return (myNormRMin ? true : false);
+}
+
+/*!
+ Return \c True if legend is shown
+*/
+bool Plot2d_ViewFrame::isLegendShow() const
+{
+ return myShowLegend;
+}
+
/*!
Slot, called when user presses mouse button
*/
QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
me.pos(), me.globalPos() );
emit contextMenuRequested( &aEvent );
+ }
+ else {
+ updateAnalyticalCurves();
}
myPlot->canvas()->setCursor( QCursor( Qt::CrossCursor ) );
myPlot->defaultPicker();
QwtScaleMap xMap = myPlot->canvasMap( QwtPlot::xBottom );
QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
- myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(), yMap.s2()*aScale );
- myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(), xMap.s2()*aScale );
+ if ( ((yMap.s2() - yMap.s1()) < 10e-13 || (xMap.s2() - xMap.s1()) < 10e-13 ) && aScale < 1 )
+ return;
+
+ 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 );
- myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s2()*aScale );
+ if ( ((y2Map.s2() - y2Map.s1()) < 10e-13 ) && aScale < 1 ) return;
+ myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(), y2Map.s1() + aScale*(y2Map.s2() - y2Map.s1()) );
}
myPlot->replot();
+ if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
myPnt = event->pos();
+ updateAnalyticalCurves();
}
/*!
Returns qwt plot curve if it is existed in map of curves and 0 otherwise
*/
-QwtPlotCurve* Plot2d_ViewFrame::getPlotCurve( Plot2d_Curve* curve )
+QwtPlotCurve* Plot2d_ViewFrame::getPlotCurve( Plot2d_Curve* curve ) const
{
- CurveDict::iterator it = myPlot->getCurves().begin();
- for ( ; it != myPlot->getCurves().end(); it++ ) {
- if ( it.value() == curve )
- return it.key();
+ return dynamic_cast<QwtPlotCurve*>( getPlotObject( curve ) );
+}
+/*!
+ Returns true if qwt plot curve is existed in map of curves and false otherwise
+*/
+bool Plot2d_ViewFrame::hasPlotCurve( Plot2d_Curve* curve ) const
+{
+ return hasPlotObject( curve );
+}
+
+/*!
+ Returns qwt plot curve if it is existed in map of curves and 0 otherwise
+*/
+QwtPlotItem* Plot2d_ViewFrame::getPlotObject( Plot2d_Object* object ) const
+{
+ ObjectDict::const_iterator it = myObjects.begin();
+ for ( ; it != myObjects.end(); it++ ) {
+ if ( it.value() == object )
+ return it.key();
}
return 0;
}
/*!
Returns true if qwt plot curve is existed in map of curves and false otherwise
*/
-bool Plot2d_ViewFrame::hasPlotCurve( Plot2d_Curve* curve )
+bool Plot2d_ViewFrame::hasPlotObject( Plot2d_Object* object ) const
{
- CurveDict::iterator it = myPlot->getCurves().begin();
- for ( ; it != myPlot->getCurves().end(); it++ ) {
- if ( it.value() == curve )
+ ObjectDict::const_iterator it = myObjects.begin();
+ for ( ; it != myObjects.end(); it++ ) {
+ if ( it.value() == object )
return true;
}
return false;
bool Plot2d_ViewFrame::isXLogEnabled() const
{
bool allPositive = true;
- CurveDict::const_iterator it = myPlot->getCurves().begin();
- for ( ; allPositive && it != myPlot->getCurves().end(); it++ )
+ ObjectDict::const_iterator it = myObjects.begin();
+ for ( ; allPositive && it != myObjects.end(); it++ )
allPositive = ( it.value()->getMinX() > 0. );
return allPositive;
}
bool Plot2d_ViewFrame::isYLogEnabled() const
{
bool allPositive = true;
- CurveDict::const_iterator it = myPlot->getCurves().begin();
- for ( ; allPositive && it != myPlot->getCurves().end(); it++ )
+ ObjectDict::const_iterator it = myObjects.begin();
+ for ( ; allPositive && it != myObjects.end(); it++ )
allPositive = ( it.value()->getMinY() > 0. );
return allPositive;
}
+/**
+ *
+ */
+void Plot2d_ViewFrame::setEnableAxis( QwtPlot::Axis theAxis, bool isEnable )
+{
+ if ( myPlot->axisEnabled( theAxis ) == isEnable )
+ return;
+ myPlot->enableAxis( theAxis, isEnable );
+ if ( theAxis == QwtPlot::yRight )
+ mySecondY = isEnable;
+}
+
class Plot2d_QwtPlotZoomer : public QwtPlotZoomer
{
public:
: QwtPlot( parent ),
myIsPolished( false )
{
+ // Create alternative scales
+ setAxisScaleDraw( QwtPlot::yLeft, new Plot2d_ScaleDraw() );
+ setAxisScaleDraw( QwtPlot::xBottom, new Plot2d_ScaleDraw() );
+ setAxisScaleDraw( QwtPlot::yRight, new Plot2d_ScaleDraw() );
+
myPlotZoomer = new Plot2d_QwtPlotZoomer( QwtPlot::xBottom, QwtPlot::yLeft, canvas() );
myPlotZoomer->setSelectionFlags( QwtPicker::DragSelection | QwtPicker::CornerToCorner );
myPlotZoomer->setTrackerMode( QwtPicker::AlwaysOff );
setAxisAutoScale( QwtPlot::yLeft );
setAxisAutoScale( QwtPlot::yRight );
setAxisAutoScale( QwtPlot::xBottom );
-
+
+ myScaleDraw = NULL;
// grid
myGrid = new QwtPlotGrid();
QPen aMajPen = myGrid->majPen();
canvas()->setMouseTracking( true );
myPlotZoomer->setEnabled( true );
+ myPlotZoomer->setZoomBase();
+
+ setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
+}
+
+Plot2d_Plot2d::~Plot2d_Plot2d()
+{
}
/*!
*/
void Plot2d_Plot2d::replot()
{
- updateLayout(); // to fix bug(?) of Qwt - view is not updated when title is changed
- QwtPlot::replot();
-}
-
-/*!
- Checks if two colors are close to each other [ static ]
- uses COLOR_DISTANCE variable as max tolerance for comparing of colors
-*/
-const long COLOR_DISTANCE = 100;
-const int MAX_ATTEMPTS = 10;
-static bool closeColors( const QColor& color1, const QColor& color2 )
-{
- long tol = abs( color2.red() - color1.red() ) +
- abs( color2.green() - color1.green() ) +
- abs( color2.blue() - color1.blue() );
-
- return ( tol <= COLOR_DISTANCE );
-}
-/*!
- Gets new unique marker for item if possible
-*/
-void Plot2d_Plot2d::getNextMarker( QwtSymbol::Style& typeMarker, QColor& color, Qt::PenStyle& typeLine )
-{
- bool bOk = false;
- int cnt = 1;
- while ( !bOk ) {
- int aRed = (int)( 256.0 * rand() / RAND_MAX); // generate random color
- int aGreen = (int)( 256.0 * rand() / RAND_MAX); // ...
- int aBlue = (int)( 256.0 * rand() / RAND_MAX); // ...
- int aMarker = (int)( 9.0 * rand() / RAND_MAX) + 1; // 9 markers types ( not including empty )
- int aLine = (int)( 5.0 * rand() / RAND_MAX) + 1; // 5 line types ( not including empty )
-
- typeMarker = ( QwtSymbol::Style )aMarker;
- color = QColor( aRed, aGreen, aBlue );
- typeLine = ( Qt::PenStyle )aLine;
-
- cnt++;
- if ( cnt == MAX_ATTEMPTS )
- bOk = true;
- else
- bOk = !existMarker( typeMarker, color, typeLine );
- }
-/*
- static int aMarker = -1;
- static int aColor = -1;
- static int aLine = -1;
-
- if ( myColors.isEmpty() ) {
- // creating colors list
- myColors.append( Qt::white );
- myColors.append( Qt::blue );
- myColors.append( Qt::gray );
- myColors.append( Qt::darkGreen );
- myColors.append( Qt::magenta );
- myColors.append( Qt::darkGray );
- myColors.append( Qt::red );
- myColors.append( Qt::darkBlue );
- myColors.append( Qt::darkYellow );
- myColors.append( Qt::cyan );
- myColors.append( Qt::darkRed );
- myColors.append( Qt::darkCyan );
- myColors.append( Qt::yellow );
- myColors.append( Qt::darkMagenta );
- myColors.append( Qt::green );
- myColors.append( Qt::black );
- }
-
- int nbMarkers = 11; // QwtSymbol supports 11 marker types
- int nbLines = 6; // Qt supports 6 line types
- int nbColors = myColors.count(); // number of default colors supported
-
- aMarker = ( aMarker + 1 ) % nbMarkers;
- if ( aMarker == QwtSymbol::None || aMarker == QwtSymbol::Triangle ) aMarker++;
- aColor = ( aColor + 1 ) % nbColors;
- aLine = ( aLine + 1 ) % nbLines;
- if ( aLine == Qt::NoPen ) aLine++;
-
- typeMarker = ( QwtSymbol::Style )aMarker;
- color = myColors[ aColor ];
- typeLine = ( Qt::PenStyle )aLine;
- if ( !existMarker( typeMarker, color, typeLine ) )
- return;
-
- int i, j, k;
- for ( i = 0; i < nbMarkers; i++ ) {
- aMarker = ( aMarker + 1 ) % nbMarkers;
- if ( aMarker == QwtSymbol::None || aMarker == QwtSymbol::Triangle ) aMarker++;
- for ( j = 0; j < nbColors; j++ ) {
- aColor = ( aColor + 1 ) % nbColors;
- for ( k = 0; k < nbLines; k++ ) {
- aLine = ( aLine + 1 ) % nbLines;
- if ( aLine == Qt::NoPen ) aLine++;
- if ( !existMarker( ( QwtSymbol::Style )aMarker, aColor, ( Qt::PenStyle )aLine ) ) {
- typeMarker = ( QwtSymbol::Style )aMarker;
- color = myColors[ aColor ];
- typeLine = ( Qt::PenStyle )aLine;
- return;
- }
- }
+ // the following code is intended to enable only axes
+ // that are really used by displayed objects
+ bool enableXBottom = false, enableXTop = false;
+ bool enableYLeft = false, enableYRight = false;
+ const QwtPlotItemList& items = itemList();
+ QwtPlotItemIterator it;
+ for ( it = items.begin(); it != items.end(); it++ ) {
+ QwtPlotItem* item = *it;
+ if ( item ) {
+ enableXBottom |= item->xAxis() == QwtPlot::xBottom;
+ enableXTop |= item->xAxis() == QwtPlot::xTop;
+ enableYLeft |= item->yAxis() == QwtPlot::yLeft;
+ enableYRight |= item->yAxis() == QwtPlot::yRight;
}
}
-*/
+ enableAxis( QwtPlot::xBottom, enableXBottom );
+ enableAxis( QwtPlot::xTop, enableXTop );
+ enableAxis( QwtPlot::yLeft, enableYLeft );
+ enableAxis( QwtPlot::yRight, enableYRight );
+
+ updateLayout(); // to fix bug(?) of Qwt - view is not updated when title is changed
+ QwtPlot::replot();
}
/*!
- \return the default layout behavior of the widget
+ Get legend
*/
-QSizePolicy Plot2d_Plot2d::sizePolicy() const
+QwtLegend* Plot2d_Plot2d::getLegend()
{
- return QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
+#if QWT_VERSION < 0x040200
+ return d_legend;
+#else
+ return legend(); /* mpv: porting to the Qwt 4.2.0 */
+#endif
}
/*!
}
/*!
- return closest curve if it exist, else 0
-*/
-Plot2d_Curve* Plot2d_Plot2d::getClosestCurve( QPoint p, double& distance, int& index )
+ * Set the point picker associated with a graphic view
+ */
+void Plot2d_Plot2d::setPicker( Plot2d_QwtPlotPicker *picker)
{
- CurveDict::iterator it = getCurves().begin();
- QwtPlotCurve* aCurve;
- for ( ; it != getCurves().end(); it++ ) {
- aCurve = it.key();
- if ( !aCurve )
- continue;
- index = aCurve->closestPoint( p, &distance );
- if ( index > -1 )
- return it.value();
- }
- return 0;
+ myPicker = picker;
}
/*!
- Checks if marker belongs to any enitity
-*/
-bool Plot2d_Plot2d::existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine )
+ * Create marker and tooltip associed with a point
+ */
+QwtPlotMarker* Plot2d_Plot2d::createMarkerAndTooltip( QwtSymbol symbol,
+ double X,
+ double Y,
+ QString & tooltip,
+ Plot2d_QwtPlotPicker *picker)
{
- QColor aColor = palette().color( QPalette::Background );
- if ( closeColors( color, aColor ) )
- return true;
+ QwtPlotMarker* aPlotMarker = new QwtPlotMarker();
- CurveDict::iterator it = myCurves.begin();
- for ( ; it != myCurves.end(); it++ ) {
- QwtPlotCurve* crv = it.key();
- if ( crv ) {
- QwtSymbol::Style aStyle = crv->symbol().style();
- QColor aColor = crv->pen().color();
- Qt::PenStyle aLine = crv->pen().style();
-// if ( aStyle == typeMarker && aColor == color && aLine == typeLine )
- if ( aStyle == typeMarker && closeColors( aColor,color ) && aLine == typeLine )
- return true;
- }
- }
- return false;
+ aPlotMarker->setSymbol( symbol ); // symbol must have a color
+ aPlotMarker->setLabelAlignment( Qt::AlignTop);
+ aPlotMarker->setXValue(X);
+ aPlotMarker->setYValue(Y);
+ //
+ aPlotMarker->attach(this);
+
+ // Associate a tooltip with the point's marker
+ // PB: how to obtain a tooltip with a rectangular frame ?
+ //QwtText tooltip ("X=" + QString::number(X) + " Y=" + QString::number(Y) );
+
+ QwtText text (tooltip);
+ //QColor tooltipColor( 245, 222, 179); // Wheat -RGB (0 a 255)
+ QColor tooltipColor( 253, 245, 230); // OldLace
+ text.setBackgroundBrush( QBrush(tooltipColor)); //, Qt::SolidPattern));
+ //
+ picker->pMarkers.append( aPlotMarker);
+ picker->pMarkersToolTip[ aPlotMarker] = text;
+ return aPlotMarker;
+}
+
+bool Plot2d_Plot2d::polished() const
+{
+ return myIsPolished;
+}
+
+QwtPlotGrid* Plot2d_Plot2d::grid() const
+{
+ return myGrid;
+};
+
+QwtPlotZoomer* Plot2d_Plot2d::zoomer() const
+{
+ return myPlotZoomer;
}
/*!
default:
break;
}
-
+
if ( axisId >= 0 ) {
QwtScaleMap map = canvasMap(axisId);
double aDist = fabs(map.s2()-map.s1()) / (axisMaxMajor(axisId)*axisMaxMinor(axisId));
QwtScaleDraw* aQwtSD = axisScaleDraw(axisId);
Plot2d_ScaleDraw* aPlot2dSD = dynamic_cast<Plot2d_ScaleDraw*>(aQwtSD);
- if ( !aPlot2dSD && aPrecision > 6 || aPlot2dSD && aPlot2dSD->precision() != aPrecision )
- setAxisScaleDraw( axisId, new Plot2d_ScaleDraw(*aQwtSD, 'f', aPrecision) );
+ if ( ( !aPlot2dSD && aPrecision > 6 ) || ( aPlot2dSD && aPlot2dSD->precision() != aPrecision ) )
+ setAxisScaleDraw( axisId, new Plot2d_ScaleDraw(*aQwtSD, 'f', aPrecision) );
}
}
}
+/*!
+ Updates identifiers of Y axis type in the legend.
+*/
+void Plot2d_Plot2d::updateYAxisIdentifiers()
+{
+ bool enableYLeft = false, enableYRight = false;
+ const QwtPlotItemList& items = itemList();
+ QwtPlotItemIterator it;
+ for ( it = items.begin(); it != items.end(); it++ ) {
+ QwtPlotItem* item = *it;
+ if ( item ) {
+ enableYLeft |= item->yAxis() == QwtPlot::yLeft;
+ enableYRight |= item->yAxis() == QwtPlot::yRight;
+ }
+ }
+
+ // if several curves are attached to different axes
+ // display corresponding identifiers in the legend,
+ // otherwise hide them
+ for ( it = items.begin(); it != items.end(); it++ ) {
+ QwtPlotItem* item = *it;
+ if ( Plot2d_QwtPlotCurve* aPCurve = dynamic_cast<Plot2d_QwtPlotCurve*>( item ) )
+ aPCurve->setYAxisIdentifierEnabled( enableYLeft && enableYRight );
+ if ( item && item->isVisible() && legend() )
+ item->updateLegend( legend() );
+ }
+}
+
/*!
Sets the flag saying that QwtPlot geometry has been fully defined.
*/
myIsPolished = true;
}
+// Methods to manage axis graduations
+
+/* Create definition and graduations of axes
+ */
+void Plot2d_Plot2d::createAxisScaleDraw()
+{
+ myScaleDraw = new Plot2d_AxisScaleDraw( this);
+}
+
+
+/* Stock X axis's ticks in the drawing zone
+*/
+void Plot2d_Plot2d::applyTicks()
+{
+ myScaleDraw->applyTicks();
+}
+
+
+/* Unactivate automatic ticks drawing (call to method Plot2d_AxisScaleDraw::draw() )
+ * Parameters :
+ * - number call to ticks drawing (for information) : numcall
+ */
+void Plot2d_Plot2d::unactivAxisScaleDraw( int numcall)
+{
+ // Memorize X axis (myScaleDraw already exists) in the drawing zone
+ //setAxisScaleDraw( QwtPlot::xBottom, myScaleDraw); // heritage of QwtPlot
+
+ myScaleDraw->unactivTicksDrawing( numcall);
+}
+
+
+/* Draw ticks and labels on X axis of the drawing zone
+ * Draw systems' names under the X axis of the drawing zone
+ * Draw vertical segments between X axis's intervals of the systems
+ * Parameters :
+ * - left and right margins for ticks : XLeftMargin, XRightMargin
+ * - for each named system :
+ * positions and labels for ticks on X axis : devicesPosLabelTicks
+ *
+ * The true drawings will be realized by the method Plot2d_AxisScaleDraw::draw()
+ * PB: who call il ?
+ */
+void Plot2d_Plot2d::displayXTicksAndLabels(
+ double XLeftMargin, double XRightMargin,
+ const QList< QPair< QString, QMap<double, QString> > > & devicesPosLabelTicks)
+ // name position label
+ // system tick tick
+{
+ //std::cout << "Plot2d_Plot2d::displayXTicksAndLabels() 1" << std::endl;
+
+ int nbDevices = devicesPosLabelTicks.size();
+ //
+ //std::cout << " Nombre de systemes = " << nbDevices << std::endl;
+ if (nbDevices == 0) return;
+
+ // For drawing systems' names, their positions must be in the allTicks list
+ // (cf class Plot2d_AxisScaleDraw)
+
+ // Liste of ticks' positions and systems' names
+ QList<double> allTicks;
+
+ double devXmin, devXmax; // X interval of a system
+ double gapXmin, gapXmax; // X interval between two systems
+ double devLabPos; // Label's position of a system
+ double segmentPos; // Position of the vertical segment between current system and the next
+
+ // 1)- Search for the system whose X interval is the most to the left
+
+ int ileftDev = 0;
+ double XminMin = 1.e+12;
+
+ if (nbDevices > 1)
+ {
+ for (int idev=0; idev < nbDevices; idev++)
+ {
+ QPair< QString, QMap<double,QString> > paire = devicesPosLabelTicks.at(idev);
+
+ QString deviceLabel = paire.first;
+
+ // Ticks' map of the system
+ QMap<double,QString> devPosLabelTicks = paire.second;
+
+ QList<double> posTicks = devPosLabelTicks.keys();
+
+ // List's items increasing sorting
+ qSort( posTicks.begin(), posTicks.end() ); // iterators
+
+ // X interval for the system
+ devXmin = posTicks.first();
+ devXmax = posTicks.last();
+
+ if (devXmin < XminMin)
+ {
+ XminMin = devXmin;
+ ileftDev = idev;
+ }
+ }
+ }
+
+ // 2)- Ticks, systems' names, verticals segments
+
+ for (int idev=0; idev < nbDevices; idev++)
+ {
+ QPair< QString, QMap<double,QString> > paire = devicesPosLabelTicks.at(idev);
+
+ QString deviceLabel = paire.first;
+
+ std::string std_label = deviceLabel.toStdString();
+ //const char *c_label = std_label.c_str();
+ //std::cout << " deviceLabel: |" << c_label << "|" << std::endl;
+
+ // Ticks' map of the system
+ QMap<double,QString> devPosLabelTicks = paire.second;
+
+ int nbTicks = devPosLabelTicks.size();
+
+ QList<double> posTicks = devPosLabelTicks.keys();
+
+ // List's items increasing sorting
+ qSort( posTicks.begin(), posTicks.end() ); // iterators
+
+ // X interval for the system
+ devXmin = posTicks.first();
+ devXmax = posTicks.last();
+
+ // Stock ticks' positions and labels on X axis
+ double pos;
+ QString label;
+ //
+ for (int itic=0; itic < nbTicks; itic++)
+ {
+ pos = posTicks.at(itic);
+ label = devPosLabelTicks[pos];
+
+ myScaleDraw->setLabelTick( pos, label, false);
+
+ std::string std_label = label.toStdString();
+ //const char *c_label = std_label.c_str();
+ //std::cout << " tick " << itic << " : pos= " << pos << ", label= |" << c_label << "|" << std::endl;
+ }
+ allTicks.append( posTicks);
+
+ // Compute the position of the system's label
+ if (idev == ileftDev)
+ {
+ devLabPos = devXmin + 0.25*(devXmax - devXmin);
+ }
+ else
+ {
+ devLabPos = devXmin + 0.50*(devXmax - devXmin);
+ }
+ allTicks.append( devLabPos);
+
+ // Stock position and name of the system under X axis
+ myScaleDraw->setLabelTick( devLabPos, deviceLabel, true);
+
+ if (idev > 0)
+ {
+ // Create the vertical segment between the current system and the next
+ gapXmax = devXmin;
+ segmentPos = gapXmin + 0.5*(gapXmax - gapXmin);
+
+ createSeparationLine( segmentPos);
+ }
+ gapXmin = devXmax;
+ }
+
+ // List's items increasing sorting
+ qSort( allTicks.begin(), allTicks.end() ); // iterators
+
+ // Stock the interval of X's values
+ double lowerBound = allTicks.first() - XLeftMargin;
+ double upperBound = allTicks.last() + XRightMargin;
+ myScaleDraw->setInterval( lowerBound, upperBound);
+
+ // For each system, stock the position of the X's ticks and those of the name
+ myScaleDraw->setTicks( allTicks); // do not draw the ticks
+
+ // Memorize the X axis in the drawing zone
+ setAxisScaleDraw( QwtPlot::xBottom, myScaleDraw); // heritage of QwtPlot
+
+ //std::cout << "Plot2d_Plot2d::displayXTicksAndLabels() 1" << std::endl;
+}
+
+
+/* Create vertical segment between two curves
+ */
+void Plot2d_Plot2d::createSeparationLine( double Xpos)
+{
+ QwtPlotMarker* aPlotMarker = new QwtPlotMarker();
+
+ aPlotMarker->setLineStyle( QwtPlotMarker::VLine);
+ aPlotMarker->setXValue( Xpos);
+ aPlotMarker->setLinePen( QPen(Qt::black));
+ aPlotMarker->attach(this); // Add to drawing zone
+ // To deallocate in EraseAll()
+ mySeparationLineList.append( aPlotMarker);
+}
+
+void Plot2d_Plot2d::clearSeparationLineList()
+{
+ mySeparationLineList.clear();
+}
/*!
Creates presentation of object
#define BRACKETIZE(x) QString( "[ " ) + x + QString( " ]" )
void Plot2d_ViewFrame::updateTitles()
{
- CurveDict::iterator it = myPlot->getCurves().begin();
- //QIntDictIterator<Plot2d_Curve> it( myCurves );
+ ObjectDict::iterator it = myObjects.begin();
QStringList aXTitles;
QStringList aYTitles;
+ QStringList aY2Titles;
QStringList aXUnits;
QStringList aYUnits;
+ QStringList aY2Units;
QStringList aTables;
int i = 0;
- Plot2d_Curve* aCurve;
- for ( ; it != myPlot->getCurves().end(); it++ ) {
+ Plot2d_Object* anObject;
+ for ( ; it != myObjects.end(); it++ ) {
// collect titles and units from all curves...
- aCurve = it.value();
- QString xTitle = aCurve->getHorTitle().trimmed();
- QString yTitle = aCurve->getVerTitle().trimmed();
- QString xUnits = aCurve->getHorUnits().trimmed();
- QString yUnits = aCurve->getVerUnits().trimmed();
+ anObject = it.value();
+ QString xTitle = anObject->getHorTitle().trimmed();
+ QString yTitle = anObject->getVerTitle().trimmed();
+ QString xUnits = anObject->getHorUnits().trimmed();
+ QString yUnits = anObject->getVerUnits().trimmed();
- aYTitles.append( yTitle );
+ if ( anObject->getYAxis() == QwtPlot::yLeft ) {
+ if ( !aYTitles.contains( yTitle ) )
+ aYTitles.append( yTitle );
+ if ( !aYUnits.contains( yUnits ) )
+ aYUnits.append( yUnits );
+ }
+ else {
+ if ( !aY2Titles.contains( yTitle ) )
+ aY2Titles.append( yTitle );
+ if ( !aY2Units.contains( yUnits ) )
+ aY2Units.append( yUnits );
+ }
if ( !aXTitles.contains( xTitle ) )
aXTitles.append( xTitle );
if ( !aXUnits.contains( xUnits ) )
aXUnits.append( xUnits );
- if ( !aYUnits.contains( yUnits ) )
- aYUnits.append( yUnits );
- QString aName = aCurve->getTableTitle();
+ QString aName = anObject->getTableTitle();
if( !aName.isEmpty() && !aTables.contains( aName ) )
aTables.append( aName );
++i;
}
// ... and update plot 2d view
- QString xUnits, yUnits;
+ QString xUnits, yUnits, y2Units;
if ( aXUnits.count() == 1 && !aXUnits[0].isEmpty() )
xUnits = BRACKETIZE( aXUnits[0] );
if ( aYUnits.count() == 1 && !aYUnits[0].isEmpty())
yUnits = BRACKETIZE( aYUnits[0] );
- QString xTitle, yTitle;
+ if ( aY2Units.count() == 1 && !aY2Units[0].isEmpty())
+ y2Units = BRACKETIZE( aY2Units[0] );
+ QString xTitle, yTitle, y2Title;
if ( aXTitles.count() == 1 && aXUnits.count() == 1 )
xTitle = aXTitles[0];
if ( aYTitles.count() == 1 )
yTitle = aYTitles[0];
+ if ( mySecondY && aY2Titles.count() == 1 )
+ y2Title = aY2Titles[0];
if ( !xTitle.isEmpty() && !xUnits.isEmpty() )
xTitle += " ";
if ( !yTitle.isEmpty() && !yUnits.isEmpty() )
yTitle += " ";
+ if ( !y2Title.isEmpty() && !y2Units.isEmpty() )
+ y2Title += " ";
setTitle( myXTitleEnabled, xTitle + xUnits, XTitle, true );
setTitle( myYTitleEnabled, yTitle + yUnits, YTitle, true );
- setTitle( true, aTables.join("; "), MainTitle, true );
+ if ( mySecondY )
+ setTitle( myY2TitleEnabled, y2Title + y2Units, Y2Title, true );
+ if( myIsDefTitle )
+ setTitle( true, aTables.join("; "), MainTitle, true );
}
/*!
#endif
}
+/**
+ * Print Plot2d window
+ */
+void Plot2d_ViewFrame::printPlot( QPainter* p, const QRect& rect,
+ const QwtPlotPrintFilter& filter ) const
+{
+ myPlot->print( p, rect, filter );
+}
+
/*!
\return string with all visual parameters
*/
QString Plot2d_ViewFrame::getVisualParameters()
{
+
+ return getXmlVisualParameters();
+
+ /*
+ RNV: Old case, now visual parameters stored in the XML format.
+ //
double xmin, xmax, ymin, ymax, y2min, y2max;
getFitRanges( xmin, xmax, ymin, ymax, y2min, y2max );
QString retStr;
- retStr.sprintf( "%d*%d*%d*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e", myXMode,
- myYMode, mySecondY, xmin, xmax, ymin, ymax, y2min, y2max );
+ //Store font in the visual parameters string as:
+ //
+ // ...*FontFamily|FontSize|B|I|U|r:g:b*...
+
+ retStr.sprintf( "%d*%d*%d*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%s|%i|%i|%i|%i|%i:%i:%i",
+ myXMode, myYMode, mySecondY, xmin, xmax, ymin, ymax, y2min, y2max,
+ qPrintable(myLegendFont.family()), myLegendFont.pointSize(),myLegendFont.bold(),
+ myLegendFont.italic(), myLegendFont.underline(),myLegendColor.red(),
+ myLegendColor.green(), myLegendColor.blue());
+
+ //store all Analytical curves
+ //store each curve in the following format
+ // ...*Name|isActive|Expresion|NbInervals|isAutoAssign[|MarkerType|LineType|LineWidth|r:g:b]
+ // parameters in the [ ] is optional in case if isAutoAssign == true
+ AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+ Plot2d_AnalyticalCurve* c = 0;
+ bool isAuto;
+ for( ; it != myAnalyticalCurves.end(); it++) {
+ c = (*it);
+ if(!c) continue;
+ QString curveString("");
+ isAuto = c->isAutoAssign();
+ curveString.sprintf("*%s|%i|%s|%i|%i",
+ qPrintable(c->getName()),
+ c->isActive(),
+ qPrintable(c->getExpression()),
+ c->getNbIntervals(),
+ isAuto);
+
+ retStr+=curveString;
+ if(!isAuto) {
+ QString optCurveString("");
+ optCurveString.sprintf("|%i|%i|%i|%i:%i:%i",
+ (int)c->getMarker(),
+ (int)c->getLine(),
+ c->getLineWidth(),
+ c->getColor().red(),
+ c->getColor().green(),
+ c->getColor().blue());
+ retStr+=optCurveString;
+ }
+ }
+ retStr += QString( "*%1" ).arg( Qtx::colorToString( backgroundColor() ) );
return retStr;
+ */
}
/*!
*/
void Plot2d_ViewFrame::setVisualParameters( const QString& parameters )
{
+ if(setXmlVisualParameters(parameters))
+ return;
+
+ double xmin, xmax;
QStringList paramsLst = parameters.split( '*' );
- if ( paramsLst.size() == 9 ) {
- double xmin, xmax, ymin, ymax, y2min, y2max;
+ if ( paramsLst.size() >= 9 ) {
+ double ymin, ymax, y2min, y2max;
myXMode = paramsLst[0].toInt();
myYMode = paramsLst[1].toInt();
mySecondY = (bool)paramsLst[2].toInt();
QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
myYDistance2 = yMap2.s2() - yMap2.s1();
}
-
+
fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );
fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );
- }
+ }
+
+ //Restore legend font
+ if(paramsLst.size() >= 10) {
+ QStringList fontList = paramsLst[9].split( '|' );
+ if(fontList.size() == 6) {
+ myLegendFont = QFont(fontList[0]);
+ myLegendFont.setPointSize(fontList[1].toInt());
+ myLegendFont.setBold(fontList[2].toInt());
+ myLegendFont.setItalic(fontList[3].toInt());
+ myLegendFont.setUnderline(fontList[4].toInt());
+ QStringList colorList = fontList[5].split(":");
+ setLegendFont( myLegendFont );
+
+ if(colorList.size() == 3) {
+ myLegendColor = QColor(colorList[0].toInt(),
+ colorList[1].toInt(),
+ colorList[2].toInt());
+ setLegendFontColor( myLegendColor );
+ }
+ }
+ }
+
+ //Restore all Analytical curves
+ int startCurveIndex = 10;
+ if( paramsLst.size() >= startCurveIndex+1 ) {
+ for( int i=startCurveIndex; i<paramsLst.size() ; i++ ) {
+ QStringList curveLst = paramsLst[i].split("|");
+ if( curveLst.size() == 5 || curveLst.size() == 9 ) {
+ Plot2d_AnalyticalCurve* c = new Plot2d_AnalyticalCurve();
+ c->setName(curveLst[0]);
+ c->setActive(curveLst[1].toInt());
+ c->setExpression(curveLst[2]);
+ c->setNbIntervals(curveLst[3].toLong());
+ c->setAutoAssign(curveLst[4].toInt());
+ if( !c->isAutoAssign() ) {
+ c->setMarker((Plot2d::MarkerType)curveLst[5].toInt());
+ c->setLine((Plot2d::LineType)curveLst[6].toInt());
+ c->setLineWidth(curveLst[7].toInt());
+ QStringList colorList = curveLst[8].split(":");
+ if( colorList.size() == 3 ) {
+ c->setColor(QColor(colorList[0].toInt(),
+ colorList[1].toInt(),
+ colorList[2].toInt()));
+ }
+ } else {
+ c->autoFill( myPlot );
+ }
+ addAnalyticalCurve(c);
+ updateAnalyticalCurve(c);
+ }
+ else if( curveLst.size() == 1 ) {
+ // background color can be set here
+ QColor c;
+ if ( Qtx::stringToColor( paramsLst[i], c ) )
+ setBackgroundColor( c );
+ }
+ }
+ myPlot->replot();
+ }
+}
+
+/*!
+ Store visual parameters in xml format.
+*/
+QString Plot2d_ViewFrame::getXmlVisualParameters() {
+ QString retStr;
+ QXmlStreamWriter aWriter(&retStr);
+ aWriter.setAutoFormatting(true);
+
+ //Ranges
+ aWriter.writeStartDocument();
+ aWriter.writeStartElement("ViewState");
+ aWriter.writeStartElement("Range");
+ double xmin, xmax, ymin, ymax, y2min, y2max;
+ getFitRanges( xmin, xmax, ymin, ymax, y2min, y2max );
+ aWriter.writeAttribute("Xmin", QString("").sprintf("%.12e",xmin));
+ aWriter.writeAttribute("Xmax", QString("").sprintf("%.12e",xmax));
+ aWriter.writeAttribute("Ymin", QString("").sprintf("%.12e",ymin));
+ aWriter.writeAttribute("Ymax", QString("").sprintf("%.12e",ymax));
+ aWriter.writeAttribute("Y2min", QString("").sprintf("%.12e",y2min));
+ aWriter.writeAttribute("Y2max", QString("").sprintf("%.12e",y2max));
+ aWriter.writeEndElement();
+
+ //Display mode
+ aWriter.writeStartElement("DisplayMode");
+ aWriter.writeAttribute("SecondAxis", QString("").sprintf("%d",mySecondY));
+ aWriter.writeStartElement("ScaleMode");
+ aWriter.writeAttribute("Xscale", QString("").sprintf("%d",myXMode));
+ aWriter.writeAttribute("Yscale", QString("").sprintf("%d",myYMode));
+ aWriter.writeEndElement();
+ aWriter.writeStartElement("NormalizationMode");
+ aWriter.writeAttribute("LeftMin", QString("").sprintf("%d",myNormLMin));
+ aWriter.writeAttribute("LeftMax", QString("").sprintf("%d",myNormLMax));
+ aWriter.writeAttribute("RightMin", QString("").sprintf("%d",myNormRMin));
+ aWriter.writeAttribute("RightMax", QString("").sprintf("%d",myNormRMax));
+ aWriter.writeEndElement();
+ aWriter.writeEndElement();
+
+ //Legend
+ aWriter.writeStartElement("Legend");
+ aWriter.writeAttribute("Visibility", QString("").sprintf("%d", myShowLegend));
+ aWriter.writeStartElement("LegendFont");
+ aWriter.writeAttribute("Family", myLegendFont.family());
+ aWriter.writeAttribute("Size", QString("").sprintf("%d",myLegendFont.pointSize()));
+ aWriter.writeAttribute("Bold", QString("").sprintf("%d",myLegendFont.bold()));
+ aWriter.writeAttribute("Italic", QString("").sprintf("%d",myLegendFont.italic()));
+ aWriter.writeAttribute("Underline", QString("").sprintf("%d",myLegendFont.underline()));
+ aWriter.writeAttribute("R", QString("").sprintf("%d",myLegendColor.red()));
+ aWriter.writeAttribute("G", QString("").sprintf("%d",myLegendColor.green()));
+ aWriter.writeAttribute("B", QString("").sprintf("%d",myLegendColor.blue()));
+ aWriter.writeEndElement();
+ aWriter.writeEndElement();
+
+ //AnalyticalCurve
+ aWriter.writeStartElement("AnalyticalCurves");
+ AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+ Plot2d_AnalyticalCurve* c = 0;
+ bool isAuto;
+ int id = 1;
+ for( ; it != myAnalyticalCurves.end(); it++) {
+ c = (*it);
+ if(!c) continue;
+ aWriter.writeStartElement(QString("AnalyticalCurve_%1").arg(id));
+ isAuto = c->isAutoAssign();
+ aWriter.writeAttribute("Name",c->getName());
+ aWriter.writeAttribute("IsActive", QString("").sprintf("%d", c->isActive()));
+ aWriter.writeAttribute("Expression", c->getExpression());
+ aWriter.writeAttribute("NbIntervals", QString("").sprintf("%d", c->getNbIntervals()));
+ aWriter.writeAttribute("isAuto", QString("").sprintf("%d",isAuto));
+ if(!isAuto) {
+ aWriter.writeAttribute("Marker", QString("").sprintf("%d",(int)c->getMarker()));
+ aWriter.writeAttribute("Line", QString("").sprintf("%d",(int)c->getLine()));
+ aWriter.writeAttribute("LineWidth", QString("").sprintf("%d",c->getLineWidth()));
+ aWriter.writeAttribute("R", QString("").sprintf("%d",c->getColor().red()));
+ aWriter.writeAttribute("G", QString("").sprintf("%d",c->getColor().green()));
+ aWriter.writeAttribute("B", QString("").sprintf("%d",c->getColor().blue()));
+ }
+ aWriter.writeEndElement();
+ id++;
+ }
+ aWriter.writeEndElement(); //AnalyticalCurve
+
+ //Background
+ aWriter.writeStartElement(QString("Background").arg(id));
+ aWriter.writeStartElement(QString("BackgroundColor").arg(id));
+ aWriter.writeAttribute("R", QString("").sprintf("%d",backgroundColor().red()));
+ aWriter.writeAttribute("G", QString("").sprintf("%d",backgroundColor().green()));
+ aWriter.writeAttribute("B", QString("").sprintf("%d",backgroundColor().blue()));
+ aWriter.writeEndElement();
+ aWriter.writeEndElement();
+
+
+ aWriter.writeEndDocument();
+ return retStr;
+}
+/*!
+ Restore visual parameters from xml format.
+*/
+bool Plot2d_ViewFrame::setXmlVisualParameters(const QString& parameters) {
+ QXmlStreamReader aReader(parameters);
+ double xmin, xmax, ymin, ymax, y2min, y2max;
+ bool leftMin,leftMax,rightMin,rightMax;
+ leftMin = leftMax = rightMin = rightMax = false;
+ while(!aReader.atEnd()) {
+ aReader.readNext();
+ if (aReader.isStartElement()) {
+ QXmlStreamAttributes aAttr = aReader.attributes();
+ if(aReader.name() == "Range") {
+ xmin = aAttr.value("Xmin").toString().toDouble();
+ xmax = aAttr.value("Xmax").toString().toDouble();
+ ymin = aAttr.value("Ymin").toString().toDouble();
+ ymax = aAttr.value("Ymax").toString().toDouble();
+ y2min = aAttr.value("Y2min").toString().toDouble();
+ y2max = aAttr.value("Y2max").toString().toDouble();
+ } else if(aReader.name() == "DisplayMode") {
+ mySecondY = aAttr.value("Y2max").toString().toDouble();
+ } else if(aReader.name() == "ScaleMode") {
+ myXMode = aAttr.value("Xscale").toString().toInt();
+ myYMode = aAttr.value("Yscale").toString().toInt();
+ } else if(aReader.name() == "NormalizationMode") {
+ leftMin = (bool)aAttr.value("LeftMin").toString().toInt();
+ leftMax = (bool)aAttr.value("LeftMax").toString().toInt();
+ rightMin = (bool)aAttr.value("RightMin").toString().toInt();
+ rightMax = (bool)aAttr.value("RightMax").toString().toInt();
+ } else if(aReader.name() == "Legend") {
+ myShowLegend = (bool)aAttr.value("Visibility").toString().toInt();
+ } else if (aReader.name() == "LegendFont") {
+ myLegendFont = QFont(aAttr.value("Family").toString());
+ myLegendFont.setPointSize(aAttr.value("Size").toString().toInt());
+ myLegendFont.setBold((bool)aAttr.value("Bold").toString().toInt());
+ myLegendFont.setItalic((bool)aAttr.value("Italic").toString().toInt());
+ myLegendFont.setUnderline((bool)aAttr.value("Underline").toString().toInt());
+ myLegendColor = QColor(aAttr.value("R").toString().toInt(),
+ aAttr.value("G").toString().toInt(),
+ aAttr.value("B").toString().toInt());
+ setLegendFontColor( myLegendColor );
+ setLegendFont(myLegendFont);
+ } else if(aReader.name().toString().indexOf("AnalyticalCurve_") >= 0) {
+ Plot2d_AnalyticalCurve* c = new Plot2d_AnalyticalCurve();
+ c->setName(aAttr.value("Name").toString());
+ c->setActive((bool)aAttr.value("IsActive").toString().toInt());
+ c->setExpression(aAttr.value("Expression").toString());
+ c->setNbIntervals(aAttr.value("NbIntervals").toString().toLong());
+ c->setAutoAssign((bool)aAttr.value("isAuto").toString().toInt());
+ if( !c->isAutoAssign() ) {
+ c->setMarker((Plot2d::MarkerType)aAttr.value("Marker").toString().toInt());
+ c->setLine((Plot2d::LineType)aAttr.value("Line").toString().toInt());
+ c->setLineWidth(aAttr.value("LineWidth").toString().toInt());
+ c->setColor(QColor(aAttr.value("R").toString().toInt(),
+ aAttr.value("G").toString().toInt(),
+ aAttr.value("B").toString().toInt()));
+ } else {
+ c->autoFill( myPlot );
+ }
+ addAnalyticalCurve(c);
+ updateAnalyticalCurve(c);
+ } else if(aReader.name().toString() == "BackgroundColor") {
+ setBackgroundColor(QColor(aAttr.value("R").toString().toInt(),
+ aAttr.value("G").toString().toInt(),
+ aAttr.value("B").toString().toInt()));
+ }
+ }
+ }
+
+ if(aReader.hasError())
+ return false;
+
+ if (mySecondY)
+ setTitle( myY2TitleEnabled, myY2Title, Y2Title, false );
+ setHorScaleMode( myXMode, /*update=*/false );
+ setVerScaleMode( myYMode, /*update=*/false );
+ if (mySecondY) {
+ QwtScaleMap yMap2 = myPlot->canvasMap( QwtPlot::yRight );
+ myYDistance2 = yMap2.s2() - yMap2.s1();
+ }
+ setNormLMinMode(leftMin);
+ setNormLMaxMode(leftMax);
+ setNormRMinMode(rightMin);
+ setNormRMaxMode(rightMax);
+
+ showLegend( myShowLegend, false );
+
+ fitData( 0, xmin, xmax, ymin, ymax, y2min, y2max );
+ return true;
}
/*!
QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
myPlot->setAxisScale( QwtPlot::yLeft,
- myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s1() )-incrY ),
- myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() )-incrY ) );
+ myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s1() )-incrY ),
+ myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() )-incrY ) );
myPlot->setAxisScale( QwtPlot::xBottom,
- myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s1() )-incrX ),
- myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() )-incrX ) );
+ myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s1() )-incrX ),
+ myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() )-incrX ) );
if (mySecondY) {
QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
myPlot->setAxisScale( QwtPlot::yRight,
- myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s1() )-incrY ),
- myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) );
+ myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s1() )-incrY ),
+ myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) );
}
myPlot->replot();
}
QwtScaleMap yMap = myPlot->canvasMap( QwtPlot::yLeft );
myPlot->setAxisScale( QwtPlot::yLeft, yMap.s1(),
- myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() ) + incrY ) );
+ myPlot->invTransform( QwtPlot::yLeft, yMap.transform( yMap.s2() ) + incrY ) );
myPlot->setAxisScale( QwtPlot::xBottom, xMap.s1(),
- myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() ) - incrX ) );
+ myPlot->invTransform( QwtPlot::xBottom, xMap.transform( xMap.s2() ) - incrX ) );
if (mySecondY) {
QwtScaleMap y2Map = myPlot->canvasMap( QwtPlot::yRight );
myPlot->setAxisScale( QwtPlot::yRight, y2Map.s1(),
- myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) );
+ myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) );
}
myPlot->replot();
}
+/*
+ Update plot item
+*/
+void Plot2d_ViewFrame::updatePlotItem(Plot2d_Object* theObject, QwtPlotItem* theItem) {
+ theObject->updatePlotItem( theItem );
+ Plot2d_Curve* c = dynamic_cast<Plot2d_Curve*>(theObject);
+ QwtPlotCurve* cu = dynamic_cast<QwtPlotCurve*>(theItem);
+ Plot2d_NormalizeAlgorithm* aNormAlgo;
+ if(c && cu) {
+ if(c->getYAxis() == QwtPlot::yRight)
+ aNormAlgo = myRNormAlgo;
+ else
+ aNormAlgo = myLNormAlgo;
+ if(aNormAlgo->getNormalizationMode() != Plot2d_NormalizeAlgorithm::NormalizeNone) {
+ AlgoPlot2dOutputData aResultData = aNormAlgo->getOutput();
+ AlgoPlot2dOutputData::iterator itTmp = aResultData.find(theObject);
+ double *xNew,*yNew;
+ int size = itTmp.value().size();
+ xNew = new double[size];
+ yNew = new double[size];
+ int j = 0;
+ for (; j < size; ++j) {
+ xNew[j] = itTmp.value().at(j).first;
+ yNew[j] = itTmp.value().at(j).second;
+ }
+ cu->setData(xNew, yNew,j);
+ delete [] xNew;
+ delete [] yNew;
+ if(aNormAlgo->getNormalizationMode() != Plot2d_NormalizeAlgorithm::NormalizeNone) {
+ QString name = c->getName().isEmpty() ? c->getVerTitle() : c->getName();
+ name = name + QString("(B=%1, K=%2)");
+ name = name.arg(aNormAlgo->getBkoef(c)).arg(aNormAlgo->getKkoef(c));
+ cu->setTitle(name);
+ }
+ }
+ }
+}
+
+/**
+ *
+ */
+QwtPlotCanvas* Plot2d_ViewFrame::getPlotCanvas() const
+{
+ return myPlot ? myPlot->canvas() : 0;
+}
+
+/*!
+ return closest curve if it exist, else 0
+*/
+Plot2d_Curve* Plot2d_ViewFrame::getClosestCurve( QPoint p, double& distance, int& index ) const
+{
+ CurveDict aCurves = getCurves();
+ CurveDict::iterator it = aCurves.begin();
+ QwtPlotCurve* aCurve;
+ for ( ; it != aCurves.end(); it++ ) {
+ aCurve = it.key();
+ if ( !aCurve )
+ continue;
+ index = aCurve->closestPoint( p, &distance );
+ if ( index > -1 )
+ return it.value();
+ }
+ return 0;
+}
+
+/*!
+ \brief Deselect all analytical curves.
+*/
+void Plot2d_ViewFrame::deselectAnalyticalCurves() {
+ foreach(Plot2d_AnalyticalCurve* c, myAnalyticalCurves) {
+ c->setSelected(false);
+ }
+}
+
+/*!
+ \brief Deselect all objects, except analytical curves.
+*/
+void Plot2d_ViewFrame::deselectObjects() {
+ ObjectDict::const_iterator it = myObjects.begin(), aLast = myObjects.end();
+ for ( ; it != aLast; it++ ) {
+ it.value()->setSelected(false);
+ }
+}
+
#define INCREMENT_FOR_OP 10
/*!
void Plot2d_ViewFrame::onPanLeft()
{
this->incrementalPan( -INCREMENT_FOR_OP, 0 );
+ updateAnalyticalCurves();
}
/*!
void Plot2d_ViewFrame::onPanRight()
{
this->incrementalPan( INCREMENT_FOR_OP, 0 );
+ updateAnalyticalCurves();
}
/*!
void Plot2d_ViewFrame::onPanUp()
{
this->incrementalPan( 0, -INCREMENT_FOR_OP );
+ updateAnalyticalCurves();
}
/*!
void Plot2d_ViewFrame::onPanDown()
{
this->incrementalPan( 0, INCREMENT_FOR_OP );
+ updateAnalyticalCurves();
}
/*!
void Plot2d_ViewFrame::onZoomIn()
{
this->incrementalZoom( INCREMENT_FOR_OP, INCREMENT_FOR_OP );
+ updateAnalyticalCurves();
}
/*!
void Plot2d_ViewFrame::onZoomOut()
{
this->incrementalZoom( -INCREMENT_FOR_OP, -INCREMENT_FOR_OP );
+ updateAnalyticalCurves();
}
/*!
fitAll();
}
+
+/*!
+ * Return Plot2d_Object by the QwtPlotItem
+ *
+*/
+Plot2d_Object* Plot2d_ViewFrame::getPlotObject( QwtPlotItem* plotItem ) const {
+
+ ObjectDict::const_iterator it = myObjects.begin();
+ for( ; it != myObjects.end(); ++it ) {
+ if ( it.key() == plotItem ) {
+ return it.value();
+ }
+ }
+ return 0;
+}
+
Plot2d_ScaleDraw::Plot2d_ScaleDraw( char f, int prec )
: QwtScaleDraw(),
myFormat(f),
QwtText Plot2d_ScaleDraw::label( double value ) const
{
- return QLocale::system().toString(value,myFormat,myPrecision);
+ QwtScaleMap m = map();
+ QString str1 = QwtScaleDraw::label( m.s1() ).text();
+ QString str2 = QwtScaleDraw::label( m.s2() ).text();
+ if ( str1 == str2 ) {
+ double aDist = fabs(map().s2()-map().s1())/5;
+ int precision = 0;
+ while (aDist < 1 ) {
+ precision++;
+ aDist *= 10.;
+ }
+ if ( precision > 0 && value > 0 )
+ return QLocale::system().toString( value,'f', precision );
+ }
+
+ return QwtScaleDraw::label( value );
+}
+
+Plot2d_YScaleDraw::Plot2d_YScaleDraw()
+ : QwtScaleDraw()
+{
+}
+
+QwtText Plot2d_YScaleDraw::label( double value ) const
+{
+ // Axis labels format
+ QString strD = QString( "%1").arg( value, 10, 'e', 3); // format 10.3e
+
+ return QwtText( strD);
+}
+
+/* Definition of X axis graduations
+ */
+const QString Plot2d_AxisScaleDraw::DEVICE_FONT = QString("Times");
+const int Plot2d_AxisScaleDraw::DEVICE_FONT_SIZE = 12;
+const int Plot2d_AxisScaleDraw::DEVICE_BY = 40;
+
+Plot2d_AxisScaleDraw::Plot2d_AxisScaleDraw( Plot2d_Plot2d* plot)
+: myPlot(plot)
+{
+ myLowerBound = -1;
+ myUpperBound = -1;
+ setLabelAlignment(Qt::AlignRight);
+ setLabelRotation(45.);
+
+ applyTicks();
+
+ myActivTicksDrawing = true;
+ myNumTicksDrawingCall = 1;
+}
+
+
+Plot2d_AxisScaleDraw::~Plot2d_AxisScaleDraw()
+{
+}
+
+
+/* Unactivate automatic ticks drawing
+ */
+void Plot2d_AxisScaleDraw::unactivTicksDrawing( int numcall)
+{
+ myActivTicksDrawing = false;
+ myNumTicksDrawingCall = numcall;
+}
+
+
+/* Draw X ticks and labels.
+ * Draw systems names under X axis.
+ * Overload the same name QwtScaleDraw method.
+ * (PB: who call automaticaly this method)
+ */
+void Plot2d_AxisScaleDraw::draw( QPainter* painter, const QPalette & palette) const
+{
+ //std::cout << "Plot2d_AxisScaleDraw::draw() : activ= " << myActivTicksDrawing
+ // << " numcall= " << myNumTicksDrawingCall << std::endl;
+
+ if (!myActivTicksDrawing) return;
+
+ //std::cout << "Plot2d_AxisScaleDraw::draw()" << std::endl;
+
+ QList<double> major_ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+ QList<double> medium_ticks = scaleDiv().ticks(QwtScaleDiv::MediumTick);
+ QList<double> minor_ticks = scaleDiv().ticks(QwtScaleDiv::MinorTick);
+
+ medium_ticks.clear();
+ minor_ticks.clear();
+ major_ticks.clear();
+
+ major_ticks.append( myTicks);
+ myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MajorTick, major_ticks);
+ myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MediumTick, medium_ticks);
+ myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MinorTick, minor_ticks);
+ QwtScaleDraw *scale = myPlot->axisScaleDraw(QwtPlot::xBottom);
+ ((Plot2d_AxisScaleDraw*)(scale))->applyTicks();
+
+ QwtScaleDraw::draw( painter, palette);
+
+ for (int i = 0; i < myTicks.size(); i++)
+ {
+ drawLabel( painter, myTicks[i]);
+ }
+
+ //std::cout << "Ok for Plot2d_AxisScaleDraw::draw()" << std::endl;
+}
+
+
+QwtText Plot2d_AxisScaleDraw::label( double value) const
+{
+ if (myLabelX.contains(value))
+ return myLabelX[value];
+
+ return QwtText(QString::number(value, 'f', 1));
+}
+
+
+/* Stock position and label of a X tick
+ */
+void Plot2d_AxisScaleDraw::setLabelTick( double value, QString label, bool isDevice)
+{
+ //qDebug()<< "setLabelTick ( " << value << ","<< label <<" )";
+ if ( isDevice )
+ {
+ // For systems names under X axis
+ myLabelDevice[value] = label;
+ }
+ else
+ {
+ // For X axis graduations
+ myLabelX[value] = label;
+ }
+}
+
+
+/* Stock ticks positions of a system, and draw them
+ */
+void Plot2d_AxisScaleDraw::setTicks(const QList<double> aTicks)
+{
+ //std::cout << " Plot2d_AxisScaleDraw::setTicks()" << std::endl;
+ myTicks = aTicks;
+
+ applyTicks();
+}
+
+
+void Plot2d_AxisScaleDraw::setInterval(double lowerBound, double upperBound)
+{
+ myLowerBound = lowerBound;
+ myUpperBound = upperBound;
+ myPlot->setAxisScale( QwtPlot::xBottom, myLowerBound, myUpperBound );
+}
+
+
+/* Stock X ticks in drawing zone
+ */
+void Plot2d_AxisScaleDraw::applyTicks()
+{
+ //std::cout << " Plot2d_AxisScaleDraw::applyTicks()" << std::endl;
+
+ QList<double> major_ticks = scaleDiv().ticks(QwtScaleDiv::MajorTick);
+ QList<double> medium_ticks = scaleDiv().ticks(QwtScaleDiv::MediumTick);
+ QList<double> minor_ticks = scaleDiv().ticks(QwtScaleDiv::MinorTick);
+
+ medium_ticks.clear();
+ minor_ticks.clear();
+
+ myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MajorTick, myTicks);
+ myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MediumTick, medium_ticks);
+ myPlot->axisScaleDiv(QwtPlot::xBottom)->setTicks(QwtScaleDiv::MinorTick, minor_ticks);
+
+ QwtScaleDiv* aScaleDiv = (QwtScaleDiv*) &scaleDiv();
+
+ aScaleDiv->setTicks(QwtScaleDiv::MajorTick, myTicks);
+ aScaleDiv->setTicks(QwtScaleDiv::MediumTick, medium_ticks);
+ aScaleDiv->setTicks(QwtScaleDiv::MinorTick, minor_ticks);
+
+ if (myLowerBound != -1 && myUpperBound != -1)
+ aScaleDiv->setInterval(myLowerBound, myUpperBound);
+
+ //for (int i = 0; i < myTicks.size(); i++){
+ // QPoint p = labelPosition( i );
+ // qDebug() << i<< ") applyTicks -> LABEL" <<p;
+ //}
+}
+
+
+void Plot2d_AxisScaleDraw::drawLabel( QPainter* painter, double value) const
+{
+ //std::cout << " Plot2d_AxisScaleDraw::drawLabel( " << value << " ) : "; //<< std::endl;
+
+ //qDebug() << "drawLabel ( " <<value<<" )";
+ if ( myLabelDevice.contains(value) )
+ {
+ QString deviceLabel = myLabelDevice[value];
+ //
+ std::string std_label = deviceLabel.toStdString();
+ //const char *c_label = std_label.c_str();
+ //std::cout << " deviceLabel= |" << c_label << "|" << std::endl;
+
+ QPoint p = labelPosition( value );
+ p += QPoint(0, DEVICE_BY);
+ QFont prevf = painter->font();
+ //QColor prevc = (painter->pen()).color();
+
+ QFont devicef( DEVICE_FONT, DEVICE_FONT_SIZE, QFont::Bold);
+ //
+ //painter->setPen( QColor("blue") );
+ painter->setFont( devicef );
+ painter->drawText( p, myLabelDevice[value] );
+ //painter->setPen( prevc );
+ painter->setFont( prevf );
+ }
+ if ( myLabelX.contains(value) )
+ {
+ QString xLabel = myLabelX[value];
+ //
+ std::string std_label = xLabel.toStdString();
+ //const char *c_label = std_label.c_str();
+ //std::cout << " xLabel= |" << c_label << "|" << std::endl;
+
+ QwtScaleDraw::drawLabel( painter, value );
+ }
+}
+
+
+void Plot2d_AxisScaleDraw::drawTick( QPainter* painter, double value, int len) const
+{
+ //qDebug() << "drawTick ( " <<value<<" , "<<len<<" ) " ;
+ //qDebug() << "myLabelX" << myLabelX;
+ //
+ if ( myLabelX.contains(value) )
+ {
+ QwtScaleDraw::drawTick( painter, value, len);
+ }
+}
+
+
+/* Management of tooltips associated with markers for curves points or others points
+ */
+const double Plot2d_QwtPlotPicker::BOUND_HV_SIZE = 0.2;
+
+Plot2d_QwtPlotPicker::Plot2d_QwtPlotPicker( int xAxis,
+ int yAxis,
+ int selectionFlags,
+ RubberBand rubberBand,
+ DisplayMode trackerMode,
+ QwtPlotCanvas *canvas)
+: QwtPlotPicker( xAxis,
+ yAxis,
+ selectionFlags,
+ rubberBand,
+ trackerMode,
+ canvas) // of drawing zone QwtPlot
+{
+}
+
+Plot2d_QwtPlotPicker::Plot2d_QwtPlotPicker( int xAxis,
+ int yAxis,
+ QwtPlotCanvas *canvas)
+: QwtPlotPicker( xAxis,
+ yAxis,
+ canvas)
+{
+}
+
+Plot2d_QwtPlotPicker::~Plot2d_QwtPlotPicker()
+{
+}
+// http://www.qtcentre.org/threads/22751-How-do-i-select-a-QwtPlotMarker-using-a-QPlotPicker
+
+/* Return the tooltip associated with a point when the mouse cursor pass near
+ */
+QwtText Plot2d_QwtPlotPicker::trackerText( const QwtDoublePoint & pos ) const
+{
+ for (QList<QwtPlotMarker* >::const_iterator pMarkerIt = pMarkers.begin();
+ pMarkerIt != pMarkers.end();
+ ++pMarkerIt )
+ {
+ QwtPlotMarker* pMarker = *pMarkerIt;
+ if ( pMarker != NULL )
+ {
+ QwtDoubleRect bound0 = pMarker->boundingRect();
+ QwtDoublePoint center_bound0 = bound0.center();
+ double left = center_bound0.x()-(BOUND_HV_SIZE/2.);
+ double top = center_bound0.y()-(BOUND_HV_SIZE/2.);
+
+ QwtDoubleRect bound( left, top , BOUND_HV_SIZE, BOUND_HV_SIZE);
+
+ if( bound.contains(pos) )
+ {
+ //QString toolTip = "X=" + QString::number( pMarker->xValue() )
+ // + " Y=" + QString::number( pMarker->yValue() );
+ return pMarkersToolTip[pMarker];
+ }
+ }
+ }
+
+ return QwtText();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef PLOT2D_VIEWFRAME_H
#define PLOT2D_VIEWFRAME_H
+#include "Plot2d.h"
#include "Plot2d_Curve.h"
+#include "Plot2d_AnalyticalCurve.h"
+#include "Plot2d_NormalizeAlgorithm.h"
+
#include <QWidget>
#include <QMultiHash>
+#include <QMap>
#include <QList>
+#include <QPainter>
#include <qwt_symbol.h>
#include <qwt_scale_draw.h>
+#include <qwt_plot_marker.h>
+#include <qwt_plot_picker.h>
+
+#include <iostream>
+#include <ostream>
class Plot2d_Plot2d;
class Plot2d_Prs;
+class Plot2d_Curve;
+class Plot2d_Object;
class QCustomEvent;
+class QwtPlotItem;
class QwtPlotCurve;
class QwtPlotGrid;
class QwtPlotZoomer;
+class Plot2d_AxisScaleDraw;
+class Plot2d_QwtPlotPicker;
-typedef QMultiHash<QwtPlotCurve*, Plot2d_Curve*> CurveDict;
+typedef QMultiHash<QwtPlotCurve*, Plot2d_Curve*> CurveDict;
+typedef QMultiHash<QwtPlotItem*, Plot2d_Object*> ObjectDict;
-class PLOT2D_EXPORT Plot2d_ViewFrame : public QWidget
+class PLOT2D_EXPORT Plot2d_ViewFrame : public QWidget, public Plot2d_CurveContainer
{
Q_OBJECT
-
+
enum { NoOpId, FitAreaId, ZoomId, PanId, GlPanId, DumpId,
- ModeXLinearId, ModeXLogarithmicId, ModeYLinearId, ModeYLogarithmicId,
- LegendId, CurvePointsId, CurveLinesId, CurveSplinesId };
+ ModeXLinearId, ModeXLogarithmicId, ModeYLinearId, ModeYLogarithmicId,
+ LegendId, CurvePointsId, CurveLinesId, CurveSplinesId };
public:
/* Construction/destruction */
- Plot2d_ViewFrame( QWidget* parent, const QString& title = "" );
+ Plot2d_ViewFrame( QWidget*, const QString& = "" );
virtual ~Plot2d_ViewFrame();
enum ObjectType { MainTitle, XTitle, YTitle, Y2Title, XAxis, YAxis, Y2Axis };
-public:
- QWidget* getViewWidget();
+ QWidget* getViewWidget();
/* display */
- void DisplayAll();
- void EraseAll();
- void Repaint();
+ virtual void DisplayAll();
+ virtual void EraseAll();
+ void Repaint();
- void Display( const Plot2d_Prs* );
- void Erase( const Plot2d_Prs*, const bool = false );
- Plot2d_Prs* CreatePrs( const char* entry = 0 );
+ void Display( const Plot2d_Prs* );
+ void Erase( const Plot2d_Prs*, const bool = false );
+ Plot2d_Prs* CreatePrs( const char* = 0 );
- virtual bool eventFilter(QObject* watched, QEvent* e);
+ virtual bool eventFilter( QObject*, QEvent* );
/* operations */
- void updateTitles();
- void setTitle( const QString& title );
- QString getTitle() const { return myTitle; }
- void displayCurve( Plot2d_Curve* curve, bool update = false );
- void displayCurves( const curveList& curves, bool update = false );
- void eraseCurve( Plot2d_Curve* curve, bool update = false );
- void eraseCurves( const curveList& curves, bool update = false );
- int getCurves( curveList& clist );
- const CurveDict& getCurves();
- bool isVisible( Plot2d_Curve* curve );
- void updateCurve( Plot2d_Curve* curve, bool update = false );
- void updateLegend( const Plot2d_Prs* prs );
- void fitAll();
- void fitArea( const QRect& area );
- void fitData(const int mode,
- const double xMin, const double xMax,
- const double yMin, const double yMax,
- const double y2Min = 0, const double y2Max = 0);
-
- void getFitRanges(double& xMin, double& xMax,
- double& yMin, double& yMax,
- double& y2Min, double& y2Max);
+ void updateTitles();
+ 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);
+
+ void displayPlot2dCurveList( QList<Plot2d_Curve*> curveList,
+ int groupsize,
+ Plot2d_QwtPlotPicker* picker,
+ bool displayLegend);
+
+ Plot2d_Curve* createPlot2dCurve( QString & title,
+ QString & unit,
+ QList<double> & xList,
+ QList<double> & yList,
+ QList<QString> & tooltipList,
+ Plot2d::LineType lineKind,
+ int lineWidth,
+ QColor & lineColor,
+ QwtSymbol::Style markerKind,
+ Plot2d_QwtPlotPicker* picker,
+ bool toDraw,
+ bool displayLegend=true);
+
+ QColor getPlot2dCurveColor( Plot2d_Curve* plot2dCurve);
+
+ void createSegment( double *X, double *Y, int nbPoint,
+ Qt::PenStyle lineKind,
+ int lineWidth,
+ QColor & lineColor,
+ QwtSymbol::Style markerKind);
+
+ /* curves operations [ obsolete ] */
+ void displayCurve( Plot2d_Curve*, bool = false );
+ void displayCurves( const curveList&, bool = false );
+ void eraseCurve( Plot2d_Curve*, bool = false );
+ void eraseCurves( const curveList&, bool = false );
+ int getCurves( curveList& ) const;
+ CurveDict getCurves() const;
+ void updateCurve( Plot2d_Curve*, bool = false );
+ void processFiltering(bool = false);
+
+ /* objects operations */
+ QwtPlotItem* displayObject( Plot2d_Object*, bool = false );
+ void displayObjects( const objectList&, bool = false );
+ void eraseObject( Plot2d_Object*, bool = false );
+ void eraseObjects( const objectList&, bool = false );
+ int getObjects( objectList& ) const;
+ bool isVisible( Plot2d_Object* ) const;
+ void updateObject( Plot2d_Object*, bool = false );
+
+ void updateLegend( const Plot2d_Prs* );
+ void updateLegend();
+ void fitAll();
+ void fitArea( const QRect& );
+ void fitData( const int, const double, const double,
+ const double, const double,
+ const double = 0, const double = 0 );
+
+ void getFitRanges( double&, double&, double&, double&,
+ double&, double&);
+
+ void getFitRangeByCurves( double&, double&, double&, double&,
+ double&, double& );
+
+ void addAnalyticalCurve( Plot2d_AnalyticalCurve* );
+ void removeAnalyticalCurve( Plot2d_AnalyticalCurve* );
+ void updateAnalyticalCurve( Plot2d_AnalyticalCurve*, bool = false );
+ void updateAnalyticalCurves();
+ void deselectAnalyticalCurves();
+ void deselectObjects();
+
+ AnalyticalCurveList getAnalyticalCurves() const;
+ Plot2d_AnalyticalCurve* getAnalyticalCurve(QwtPlotItem *);
/* view parameters */
- void copyPreferences( Plot2d_ViewFrame* );
- void setCurveType( int curveType, bool update = true );
- int getCurveType() const { return myCurveType; }
- void setCurveTitle( Plot2d_Curve* curve, const QString& title );
- void showLegend( bool show, bool update = true );
- void setLegendPos( int pos );
- int getLegendPos() const { return myLegendPos; }
- void setMarkerSize( const int size, bool update = true );
- int getMarkerSize() const { return myMarkerSize; }
- void setBackgroundColor( const QColor& color );
- QColor backgroundColor() const;
- void setXGrid( bool xMajorEnabled, const int xMajorMax,
- bool xMinorEnabled, const int xMinorMax, bool update = true );
- void setYGrid( bool yMajorEnabled, const int yMajorMax,
- bool yMinorEnabled, const int yMinorMax,
- bool y2MajorEnabled, const int y2MajorMax,
- bool y2MinorEnabled, const int y2MinorMax, bool update = true );
- void setTitle( bool enabled, const QString& title, ObjectType type, bool update = true );
- QString getTitle( ObjectType type ) const;
-
- void setFont( const QFont& font, ObjectType type, bool update = true );
- void setHorScaleMode( const int mode, bool update = true );
- int getHorScaleMode() const { return myXMode; }
- void setVerScaleMode( const int mode, bool update = true );
- int getVerScaleMode() const { return myYMode; }
-
- bool isModeHorLinear();
- bool isModeVerLinear();
- bool isLegendShow() { return myShowLegend; };
+ void copyPreferences( Plot2d_ViewFrame* );
+ void setCurveType( int, bool = true );
+ int getCurveType() const;
+ void setCurveTitle( Plot2d_Curve*, const QString& );
+ void setObjectTitle( Plot2d_Object*, const QString& );
+ void showLegend( bool, bool = true );
+ void setLegendPos( int );
+ int getLegendPos() const;
+ void setLegendFont( const QFont& );
+ QFont getLegendFont() const;
+ void setLegendFontColor( const QColor& );
+ QColor getLegendFontColor() const;
+ void setMarkerSize( const int, bool = true );
+ int getMarkerSize() const;
+ void setBackgroundColor( const QColor& );
+ QColor backgroundColor() const;
+ void setXGrid( bool, const int, bool, const int, bool = true );
+ void setYGrid( bool, const int, bool, const int,
+ bool, const int, bool, const int, bool = true );
+ void setTitle( bool, const QString&, ObjectType, bool = true );
+ QString getTitle( ObjectType ) const;
+
+ void setFont( const QFont&, ObjectType, bool = true );
+ void setHorScaleMode( const int, bool = true );
+ int getHorScaleMode() const;
+ void setVerScaleMode( const int, bool = true );
+ int getVerScaleMode() const;
+ void setNormLMaxMode( bool, bool = true);
+ bool getNormLMaxMode()const;
+ void setNormLMinMode( bool, bool = true);
+ bool getNormLMinMode()const;
+ void setNormRMaxMode( bool, bool = true);
+ bool getNormRMaxMode()const;
+ void setNormRMinMode( bool, bool = true);
+ bool getNormRMinMode()const;
+
+
+ bool isModeHorLinear();
+ bool isModeVerLinear();
+ bool isNormLMaxMode();
+ bool isNormLMinMode();
+ bool isNormRMaxMode();
+ bool isNormRMinMode();
+
+ bool isLegendShow() const;
// Protection against QwtCurve::drawLines() bug in Qwt 0.4.x:
// it crashes if switched to X/Y logarithmic mode, when one or more points have
// non-positive X/Y coordinate
- bool isXLogEnabled() const;
- bool isYLogEnabled() const;
+ bool isXLogEnabled() const;
+ bool isYLogEnabled() const;
+ void setEnableAxis( QwtPlot::Axis, bool );
+
+ virtual bool print( const QString&, const QString& ) const;
+ void printPlot( QPainter*, const QRect&,
+ const QwtPlotPrintFilter& = QwtPlotPrintFilter() ) const;
- virtual bool print( const QString& file, const QString& format ) const;
+ QString getVisualParameters();
+ void setVisualParameters( const QString& );
- QString getVisualParameters();
- void setVisualParameters( const QString& parameters );
+ void incrementalPan ( const int, const int );
+ void incrementalZoom( const int, const int );
- void incrementalPan ( const int incrX, const int incrY );
- void incrementalZoom( const int incrX, const int incrY );
+ QwtPlotCanvas* getPlotCanvas() const;
+ Plot2d_Curve* getClosestCurve( QPoint, double&, int& ) const;
+
+ Plot2d_Object* getPlotObject( QwtPlotItem* ) const;
+ QwtPlotItem* getPlotObject( Plot2d_Object* ) const;
+ QwtPlotCurve* getPlotCurve( Plot2d_Curve* ) const;
+ Plot2d_Plot2d* getPlot() const { return myPlot; }
+ void updatePlotItem(Plot2d_Object*, QwtPlotItem*);
protected:
- int testOperation( const QMouseEvent& );
- void readPreferences();
- void writePreferences();
- QString getInfo( const QPoint& pnt );
- virtual void wheelEvent( QWheelEvent* );
- QwtPlotCurve* getPlotCurve( Plot2d_Curve* curve );
- bool hasPlotCurve( Plot2d_Curve* curve );
- void setCurveType( QwtPlotCurve* curve, int curveType );
+ int testOperation( const QMouseEvent& );
+ void readPreferences();
+ void writePreferences();
+ QString getInfo( const QPoint& );
+ virtual void wheelEvent( QWheelEvent* );
+ bool hasPlotCurve( Plot2d_Curve* ) const;
+ void setCurveType( QwtPlotCurve*, int );
+ bool hasPlotObject( Plot2d_Object* ) const;
+ QString getXmlVisualParameters();
+ bool setXmlVisualParameters(const QString&);
+
+
+
+
public slots:
- void onViewPan();
- void onViewZoom();
- void onViewFitAll();
- void onViewFitArea();
- void onViewGlobalPan();
- void onSettings();
- void onFitData();
- void onChangeBackground();
- void onPanLeft();
- void onPanRight();
- void onPanUp();
- void onPanDown();
- void onZoomIn();
- void onZoomOut();
+ void onViewPan();
+ void onViewZoom();
+ void onViewFitAll();
+ void onViewFitArea();
+ void onViewGlobalPan();
+ void onSettings();
+ void onAnalyticalCurve();
+ void onFitData();
+ void onChangeBackground();
+ void onPanLeft();
+ void onPanRight();
+ void onPanUp();
+ void onPanDown();
+ void onZoomIn();
+ void onZoomOut();
protected:
- virtual void customEvent( QEvent* );
- void plotMousePressed( const QMouseEvent& );
- bool plotMouseMoved( const QMouseEvent& );
- void plotMouseReleased( const QMouseEvent& );
+ virtual void customEvent( QEvent* );
+ void plotMousePressed( const QMouseEvent& );
+ bool plotMouseMoved( const QMouseEvent& );
+ void plotMouseReleased( const QMouseEvent& );
signals:
- void vpModeHorChanged();
- void vpModeVerChanged();
- void vpCurveChanged();
- void contextMenuRequested( QContextMenuEvent *e );
- void legendClicked( QwtPlotItem* );
+ void vpModeHorChanged();
+ void vpModeVerChanged();
+ void vpNormLModeChanged();
+ void vpNormRModeChanged();
+ void vpCurveChanged();
+ void contextMenuRequested( QContextMenuEvent* );
+ void legendClicked( QwtPlotItem* );
protected:
- Plot2d_Plot2d* myPlot;
- int myOperation;
- QPoint myPnt;
-
- int myCurveType;
- bool myShowLegend;
- int myLegendPos;
- int myMarkerSize;
- QColor myBackground;
- QString myTitle, myXTitle, myYTitle, myY2Title;
- bool myTitleEnabled, myXTitleEnabled, myYTitleEnabled, myY2TitleEnabled;
- bool myXGridMajorEnabled, myYGridMajorEnabled, myY2GridMajorEnabled;
- bool myXGridMinorEnabled, myYGridMinorEnabled, myY2GridMinorEnabled;
- int myXGridMaxMajor, myYGridMaxMajor, myY2GridMaxMajor;
- int myXGridMaxMinor, myYGridMaxMinor, myY2GridMaxMinor;
- int myXMode, myYMode;
- double myXDistance, myYDistance, myYDistance2;
- bool mySecondY;
+ Plot2d_Plot2d* myPlot;
+ int myOperation;
+ QPoint myPnt;
+
+ int myCurveType;
+ bool myShowLegend;
+ int myLegendPos;
+ QFont myLegendFont;
+ QColor myLegendColor;
+ int myMarkerSize;
+ QColor myBackground;
+ QString myTitle, myXTitle, myYTitle, myY2Title;
+ bool myTitleEnabled, myXTitleEnabled, myYTitleEnabled, myY2TitleEnabled;
+ bool myXGridMajorEnabled, myYGridMajorEnabled, myY2GridMajorEnabled;
+ bool myXGridMinorEnabled, myYGridMinorEnabled, myY2GridMinorEnabled;
+ int myXGridMaxMajor, myYGridMaxMajor, myY2GridMaxMajor;
+ int myXGridMaxMinor, myYGridMaxMinor, myY2GridMaxMinor;
+ int myXMode, myYMode;
+ bool myNormLMin, myNormLMax, myNormRMin, myNormRMax;
+ double myXDistance, myYDistance, myYDistance2;
+ bool mySecondY;
+ ObjectDict myObjects;
+ AnalyticalCurveList myAnalyticalCurves;
+ Plot2d_NormalizeAlgorithm* myLNormAlgo;
+ Plot2d_NormalizeAlgorithm* myRNormAlgo;
+ bool myIsDefTitle;
+ private:
+ // List of QwtPlotCurve curves to draw (created by Plot2d_Curve::createPlotItem() )
+ QList<QwtPlotItem*> myQwtPlotCurveList;
+
+ // List of intermittent segments to connect curves
+ QList<QwtPlotCurve*> myIntermittentSegmentList;
+
+ // List of markers associated with curves points
+ QList<QwtPlotMarker*> myMarkerList;
+
+ // List of curves Plot2d_Curve
+ QList<Plot2d_Curve*> myPlot2dCurveList;
};
class Plot2d_Plot2d : public QwtPlot
{
Q_OBJECT
public:
- Plot2d_Plot2d( QWidget* parent );
-
- void setLogScale( int axisId, bool log10 );
-
- void replot();
- void getNextMarker( QwtSymbol::Style& typeMarker, QColor& color, Qt::PenStyle& typeLine );
- QwtLegend* getLegend() {
-#if QWT_VERSION < 0x040200
- return d_legend;
-#else
- return legend(); /* mpv: porting to the Qwt 4.2.0 */
-#endif
- }
- virtual QSize sizeHint() const;
- virtual QSizePolicy sizePolicy() const;
- virtual QSize minimumSizeHint() const;
- void defaultPicker();
- void setPickerMousePattern( int button, int state = Qt::NoButton );
-
- bool polished() const { return myIsPolished; }
- QwtPlotGrid* grid() { return myGrid; };
- CurveDict& getCurves() { return myCurves; }
- Plot2d_Curve* getClosestCurve( QPoint p, double& distance, int& index );
+ Plot2d_Plot2d( QWidget* );
+ virtual ~Plot2d_Plot2d();
+
+ void setLogScale( int, bool );
+
+ void replot();
+ QwtLegend* getLegend();
+ QSize sizeHint() const;
+ QSize minimumSizeHint() const;
+ void defaultPicker();
+ void setPickerMousePattern( int, int = Qt::NoButton );
+ void setPicker( Plot2d_QwtPlotPicker *picker);
+ Plot2d_QwtPlotPicker* getPicker() { return myPicker; }
+ Plot2d_AxisScaleDraw* getScaleDraw() { return myScaleDraw; }
+ QList<QwtPlotMarker*> getSeparationLineList() { return mySeparationLineList; }
+ void clearSeparationLineList();
+ QwtPlotMarker *createMarkerAndTooltip( QwtSymbol symbol,
+ double X,
+ double Y,
+ QString & tooltip,
+ Plot2d_QwtPlotPicker *picker);
+
+ bool polished() const;
+ QwtPlotGrid* grid() const;
+ QwtPlotZoomer* zoomer() const;
+
+ virtual void updateYAxisIdentifiers();
+
+ // Methods to deal with axes ticks
+
+ void createAxisScaleDraw();
+ void applyTicks();
+ void unactivAxisScaleDraw( int numcall);
+
+ void displayXTicksAndLabels(
+ double XLeftmargin, double XRightMargin,
+ const QList< QPair< QString, QMap<double,QString> > > & devicesPosLabelTicks);
+
+ void createSeparationLine( double Xpos);
+
public slots:
- virtual void polish();
-
-protected:
- bool existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine );
+ virtual void polish();
protected slots:
- void onScaleDivChanged();
+ void onScaleDivChanged();
protected:
- CurveDict myCurves;
- QwtPlotGrid* myGrid;
- QList<QColor> myColors;
- bool myIsPolished;
- QwtPlotZoomer* myPlotZoomer;
+ QwtPlotGrid* myGrid;
+ QList<QColor> myColors;
+ bool myIsPolished;
+ QwtPlotZoomer* myPlotZoomer;
+ Plot2d_AxisScaleDraw* myScaleDraw;
+ // The point picker associated with the graphic view
+ Plot2d_QwtPlotPicker *myPicker;
+private:
+ // List of verticals segments between two curves
+ QList<QwtPlotMarker*> mySeparationLineList;
};
class Plot2d_ScaleDraw: public QwtScaleDraw
int myPrecision;
};
+class Plot2d_YScaleDraw: public QwtScaleDraw
+{
+public:
+ Plot2d_YScaleDraw();
+
+ virtual QwtText label( double value ) const;
+};
+
+/* Definition of X axis graduations
+ */
+class Plot2d_AxisScaleDraw: public QwtScaleDraw
+{
+public:
+ static const QString DEVICE_FONT;
+ static const int DEVICE_FONT_SIZE;
+ static const int DEVICE_BY;
+
+ Plot2d_AxisScaleDraw(Plot2d_Plot2d* plot);
+
+ virtual ~Plot2d_AxisScaleDraw();
+
+ void unactivTicksDrawing( int numcall);
+
+ virtual void draw( QPainter * painter, const QPalette & palette) const;
+
+ virtual QwtText label(double value) const;
+
+ void setLabelTick(double value, QString label, bool isDevice = false);
+
+ void setTicks(const QList<double> aTicks);
+
+ void setInterval(double lowerBound, double upperBound);
+
+ void applyTicks();
+
+protected:
+
+ void drawLabel( QPainter* painter, double value) const;
+
+ void drawTick( QPainter* painter, double value, int len) const;
+
+private:
+ bool myActivTicksDrawing; // true => activate drawing ticks (with draw() )
+ int myNumTicksDrawingCall; // call number to ticks drawing
+
+ // Ticks list to display on X axis
+ QMap<double, QString> myLabelX; // position, label
+ //
+ QList<double> myTicks; // positions
+
+ // Systems names to display under X axis
+ QMap<double, QString> myLabelDevice;
+
+ Plot2d_Plot2d* myPlot; // Drawing zone QwtPlot
+
+ double myLowerBound;
+ double myUpperBound;
+};
+
+
+
+
+/* Management of tooltips associated with markers for curves points or others points
+ */
+class Plot2d_QwtPlotPicker : public QwtPlotPicker
+{
+public:
+ static const double BOUND_HV_SIZE;
+
+ Plot2d_QwtPlotPicker( int xAxis,
+ int yAxis,
+ int selectionFlags,
+ RubberBand rubberBand,
+ DisplayMode trackerMode,
+ QwtPlotCanvas *canvas);
+
+ Plot2d_QwtPlotPicker( int xAxis,
+ int yAxis,
+ QwtPlotCanvas *canvas);
+
+ virtual ~Plot2d_QwtPlotPicker();
+
+ QList<QwtPlotMarker*> pMarkers; // points markers
+ QMap<QwtPlotMarker*, QwtText> pMarkersToolTip; // associations (marker,tooltip)
+
+protected:
+
+ virtual QwtText trackerText( const QwtDoublePoint & pos ) const;
+
+};
+
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "Plot2d_ViewManager.h"
#include "Plot2d_ViewModel.h"
#include "Plot2d_ViewWindow.h"
#include "Plot2d_ViewFrame.h"
+#include "SUIT_PreferenceMgr.h"
+#include "SUIT_ResourceMgr.h"
+
/*!
Constructor
*/
Plot2d_ViewFrame* aViewFrame = view->getViewFrame();
Plot2d_Viewer* aViewer = getPlot2dModel();
connect( aViewFrame, SIGNAL( legendClicked( QwtPlotItem* ) ),
- aViewer, SLOT( onLegendClicked( QwtPlotItem* ) ) );
+ aViewer, SLOT( onLegendClicked( QwtPlotItem* ) ) );
}
return res;
}
return newWnd;
}
+
+/*!
+ Fills preference manager for viewer
+*/
+int Plot2d_ViewManager::fillPreferences( SUIT_PreferenceMgr* thePrefMgr, const int theId )
+{
+ int aGrpId = thePrefMgr->addItem( tr( "PREF_GROUP_PLOT2DVIEWER" ), theId,
+ SUIT_PreferenceMgr::GroupBox );
+
+ thePrefMgr->addItem( tr( "PREF_SHOW_LEGEND" ), aGrpId,
+ SUIT_PreferenceMgr::Bool, "Plot2d", "ShowLegend" );
+
+ int legendPosition = thePrefMgr->addItem( tr( "PREF_LEGEND_POSITION" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "LegendPos" );
+ QStringList aLegendPosList;
+ aLegendPosList.append( tr("PREF_LEFT") );
+ aLegendPosList.append( tr("PREF_RIGHT") );
+ aLegendPosList.append( tr("PREF_TOP") );
+ aLegendPosList.append( tr("PREF_BOTTOM") );
+
+ QList<QVariant> anIndexesList;
+ anIndexesList.append(0);
+ anIndexesList.append(1);
+ anIndexesList.append(2);
+ anIndexesList.append(3);
+
+ thePrefMgr->setItemProperty( "strings", aLegendPosList, legendPosition );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, legendPosition );
+
+ int curveType = thePrefMgr->addItem( tr( "PREF_CURVE_TYPE" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "CurveType" );
+ QStringList aCurveTypesList;
+ aCurveTypesList.append( tr("PREF_POINTS") );
+ aCurveTypesList.append( tr("PREF_LINES") );
+ aCurveTypesList.append( tr("PREF_SPLINE") );
+
+ anIndexesList.clear();
+ anIndexesList.append(0);
+ anIndexesList.append(1);
+ anIndexesList.append(2);
+
+ thePrefMgr->setItemProperty( "strings", aCurveTypesList, curveType );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, curveType );
+
+ int markerSize = thePrefMgr->addItem( tr( "PREF_MARKER_SIZE" ), aGrpId,
+ SUIT_PreferenceMgr::IntSpin, "Plot2d", "MarkerSize" );
+
+ thePrefMgr->setItemProperty( "min", 0, markerSize );
+ thePrefMgr->setItemProperty( "max", 100, markerSize );
+
+ QStringList aScaleModesList;
+ aScaleModesList.append( tr("PREF_LINEAR") );
+ aScaleModesList.append( tr("PREF_LOGARITHMIC") );
+
+ anIndexesList.clear();
+ anIndexesList.append(0);
+ anIndexesList.append(1);
+
+ int horScale = thePrefMgr->addItem( tr( "PREF_HOR_AXIS_SCALE" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "HorScaleMode" );
+
+ thePrefMgr->setItemProperty( "strings", aScaleModesList, horScale );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, horScale );
+
+ int verScale = thePrefMgr->addItem( tr( "PREF_VERT_AXIS_SCALE" ), aGrpId,
+ SUIT_PreferenceMgr::Selector, "Plot2d", "VerScaleMode" );
+
+ thePrefMgr->setItemProperty( "strings", aScaleModesList, verScale );
+ thePrefMgr->setItemProperty( "indexes", anIndexesList, verScale );
+
+ thePrefMgr->addItem( tr( "PREF_VIEWER_BACKGROUND" ), aGrpId,
+ SUIT_PreferenceMgr::Color, "Plot2d", "Background" );
+
+ return aGrpId;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef PLOT2D_VIEWMANAGER_H
#define PLOT2D_VIEWMANAGER_H
#include "SUIT_ViewManager.h"
class SUIT_Desktop;
+class SUIT_PreferenceMgr;
class Plot2d_ViewWindow;
class Plot2d_Viewer;
class Plot2d_ViewFrame;
Plot2d_Viewer* getPlot2dModel() const;
Plot2d_ViewWindow* cloneView( Plot2d_ViewWindow* srcWnd );
+ static int fillPreferences( SUIT_PreferenceMgr*, const int );
+
protected:
bool insertView(SUIT_ViewWindow* theView);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// Plot2d_ViewModel.cxx: implementation of the Plot2d_ViewModel class.
//
#include "Plot2d_ViewModel.h"
{
myPrs = 0;
myAutoDel = theAutoDel;
+ Plot2d_Object::initColors();
}
/*!
*/
SUIT_ViewWindow* Plot2d_Viewer::createView(SUIT_Desktop* theDesktop)
{
- Plot2d_ViewWindow* aPlot2dView = new Plot2d_ViewWindow(theDesktop, this);
+ Plot2d_ViewWindow* aView = new Plot2d_ViewWindow(theDesktop, this);
+ aView->initLayout();
if (myPrs)
- aPlot2dView->getViewFrame()->Display(myPrs);
- return aPlot2dView;
+ aView->getViewFrame()->Display(myPrs);
+ return aView;
}
/*!
void Plot2d_Viewer::clearPrs()
{
SUIT_ViewManager* aMgr = getViewManager();
- QVector<SUIT_ViewWindow*> aViews = aMgr->getViews();
+ QVector<SUIT_ViewWindow*> aViews;
+ if ( aMgr )
+ aViews = aMgr->getViews();
unsigned int aSize = aViews.size();
for (uint i = 0; i < aSize; i++) {
Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i];
{
Plot2d_ViewManager* pmgr = ( Plot2d_ViewManager* )mgr;
connect( pmgr, SIGNAL( cloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ),
- this, SLOT( onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ) );
+ this, SLOT( onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ) ) );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#if !defined(_PLOT2D_VIEWMODEL_H)
#define _PLOT2D_VIEWMODEL_H
#include "Plot2d.h"
#include "SUIT_ViewModel.h"
-#include "qwt_plot.h"
+#include <qwt_plot_item.h>
class SUIT_ViewWindow;
class SUIT_Desktop;
public:
static QString Type() { return "Plot2d"; }
-
+
Plot2d_Viewer(bool theAutoDel = false);
~Plot2d_Viewer();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d_ViewWindow.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <Qtx.h>
#include <QtxAction.h>
#include <QtxMultiAction.h>
#include <QtxActionToolMgr.h>
#include <QToolBar>
#include <QPaintEvent>
#include <QActionGroup>
+#include <QPainter>
+#include <QPrinter>
+#include <QPrintDialog>
+
+#include <qwt_plot_curve.h>
/*!
\class Plot2d_ViewWindow
: SUIT_ViewWindow( theDesktop )
{
myModel = theModel;
- myDumpImage = QImage();
+}
+
+/*!
+ \brief Destructor.
+*/
+Plot2d_ViewWindow::~Plot2d_ViewWindow()
+{
+}
+/*!
+ \brief Internal initialization.
+*/
+void Plot2d_ViewWindow::initLayout()
+{
+ myDumpImage = QImage();
myViewFrame = new Plot2d_ViewFrame( this, "plotView" );
setCentralWidget( myViewFrame );
connect( myViewFrame, SIGNAL( vpModeHorChanged() ), this, SLOT( onChangeHorMode() ) );
connect( myViewFrame, SIGNAL( vpModeVerChanged() ), this, SLOT( onChangeVerMode() ) );
+ connect( myViewFrame, SIGNAL( vpNormLModeChanged() ), this, SLOT( onChangeNormLMode() ) );
+ connect( myViewFrame, SIGNAL( vpNormRModeChanged() ), this, SLOT( onChangeNormRMode() ) );
connect( myViewFrame, SIGNAL( vpCurveChanged() ), this, SLOT( onChangeCurveMode() ) );
connect( myViewFrame, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ),
- this, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) );
+ this, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) );
myViewFrame->installEventFilter( this );
}
-/*!
- \brief Destructor.
-*/
-Plot2d_ViewWindow::~Plot2d_ViewWindow()
-{
-}
-
/*!
\brief Get view model.
\return Plot2d view model
curTypePopup->addAction( mgr->action( CurvLinesId ) );
curTypePopup->addAction( mgr->action( CurvSplinesId ) );
+ //Normalization type
+ QMenu* normTypePopup = thePopup->addMenu( tr( "NORMALIZATION_TYPE_POPUP" ) );
+ normTypePopup->addAction( mgr->action( PModeNormLMinId ) );
+ normTypePopup->addAction( mgr->action( PModeNormLMaxId ) );
+ normTypePopup->addSeparator();
+ normTypePopup->addAction( mgr->action( PModeNormRMinId ) );
+ normTypePopup->addAction( mgr->action( PModeNormRMaxId ) );
+
+
// legend
thePopup->addAction( mgr->action( LegendId ) );
// 1. Dump View
aAction = new QtxAction( tr( "MNU_DUMP_VIEW" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_DUMP" ) ),
tr( "MNU_DUMP_VIEW" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_DUMP_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onDumpView() ) );
mgr->registerAction( aAction, DumpId );
// 2.1. Fit All
aAction = new QtxAction( tr( "MNU_FITALL" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_ALL" ) ),
tr( "MNU_FITALL" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_FITALL" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitAll() ) );
mgr->registerAction( aAction, FitAllId );
// 2.2. Fit Rect
aAction = new QtxAction( tr( "MNU_FITRECT" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_FIT_AREA" ) ),
tr( "MNU_FITRECT" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_FITRECT" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onFitRect() ) );
mgr->registerAction( aAction, FitRectId );
// 2.3. Zoom
aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ZOOM" ) ),
tr( "MNU_ZOOM_VIEW" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onZoom() ) );
mgr->registerAction( aAction, ZoomId );
// 3.1. Panning
aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ),
- tr( "MNU_PAN_VIEW" ),
- 0, this);
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_PAN" ) ),
+ tr( "MNU_PAN_VIEW" ),
+ 0, this);
aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onPanning() ) );
mgr->registerAction( aAction, PanId );
// 3.2. Global Panning
aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_GLOBALPAN" ) ),
tr( "MNU_GLOBALPAN_VIEW" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onGlobalPanning() ) );
mgr->registerAction( aAction, GlobalPanId );
// 4.1. Points
aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_POINTS" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_POINTS" ) ),
- tr( "MEN_PLOT2D_CURVES_POINTS" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_POINTS" ) ),
+ tr( "MEN_PLOT2D_CURVES_POINTS" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_POINTS" ) );
aAction->setCheckable( true );
mgr->registerAction( aAction, CurvPointsId );
// 4.2. Lines
aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_LINES" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_LINES" ) ),
- tr( "MEN_PLOT2D_CURVES_LINES" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_LINES" ) ),
+ tr( "MEN_PLOT2D_CURVES_LINES" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_LINES" ) );
aAction->setCheckable( true );
mgr->registerAction( aAction, CurvLinesId );
// 4.3. Splines
aAction = new QtxAction( tr( "TOT_PLOT2D_CURVES_SPLINES" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_SPLINES" ) ),
- tr( "MEN_PLOT2D_CURVES_SPLINES" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CURVES_SPLINES" ) ),
+ tr( "MEN_PLOT2D_CURVES_SPLINES" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_CURVES_SPLINES" ) );
aAction->setCheckable( true );
mgr->registerAction( aAction, CurvSplinesId );
// 5.1. Linear
aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_HOR" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_HOR" ) ),
- tr( "MEN_PLOT2D_MODE_LINEAR_HOR" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_HOR" ) ),
+ tr( "MEN_PLOT2D_MODE_LINEAR_HOR" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_HOR" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) );
aAction->setCheckable( true );
// 5.2. Logarithmic
aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_HOR" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" ) ),
- tr( "MEN_PLOT2D_MODE_LOGARITHMIC_HOR" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_HOR" ) ),
+ tr( "MEN_PLOT2D_MODE_LOGARITHMIC_HOR" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewHorMode() ) );
aAction->setCheckable( true );
// 6.1. Linear
aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LINEAR_VER" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_VER" ) ),
- tr( "MEN_PLOT2D_MODE_LINEAR_VER" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LINEAR_VER" ) ),
+ tr( "MEN_PLOT2D_MODE_LINEAR_VER" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LINEAR_VER" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) );
aAction->setCheckable( true );
// 6.2. Logarithmic
aAction = new QtxAction( tr( "TOT_PLOT2D_MODE_LOGARITHMIC_VER" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_VER" ) ),
- tr( "MEN_PLOT2D_MODE_LOGARITHMIC_VER" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_MODE_LOGARITHMIC_VER" ) ),
+ tr( "MEN_PLOT2D_MODE_LOGARITHMIC_VER" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_VER" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewVerMode() ) );
aAction->setCheckable( true );
aVerGroup->addAction( mgr->action( PModeYLinearId ) );
aVerGroup->addAction( mgr->action( PModeYLogarithmicId ) );
- // 7. Legend
+ // 7. Normalization mode operations
+
+ // 7.1. Normalize to the global minimum by left Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_LMIN" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_LMIN" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_LMIN" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_LMIN" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormLMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormLMinId );
+
+ // 7.2. Normalize to the global maximum by right Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_LMAX" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_LMAX" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_LMAX" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_LMAX" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormLMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormLMaxId );
+
+ // 7.3. Normalize to the global minimum by right Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_RMIN" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_RMIN" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_RMIN" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_RMIN" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormRMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormRMinId );
+
+ // 7.4. Normalize to the global maximum by left Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_RMAX" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_RMAX" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_RMAX" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_RMAX" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormRMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormRMaxId );
+
+ // 8. Legend
aAction = new QtxAction( tr( "TOT_PLOT2D_SHOW_LEGEND" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ),
- tr( "MEN_PLOT2D_SHOW_LEGEND" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ),
+ tr( "MEN_PLOT2D_SHOW_LEGEND" ),
+ 0, this );
aAction->setStatusTip( tr( "PRP_PLOT2D_SHOW_LEGEND" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onLegend() ) );
aAction->setCheckable( true );
mgr->registerAction( aAction, LegendId );
- // 8. Settings
+ // 9. Settings
aAction = new QtxAction( tr( "TOT_PLOT2D_SETTINGS" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ),
- tr( "MEN_PLOT2D_SETTINGS" ),
- 0, this );
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ),
+ tr( "MEN_PLOT2D_SETTINGS" ),
+ 0, this );
+
aAction->setStatusTip( tr( "PRP_PLOT2D_SETTINGS" ) );
connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onSettings() ) );
mgr->registerAction( aAction, CurvSettingsId );
- // 9. Clone
+ // 9. Analytical curves
+#ifndef DISABLE_PYCONSOLE
+ aAction = new QtxAction( tr( "TOT_PLOT2D_ANALYTICAL_CURVES" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_ANALYTICAL_CURVES" ) ),
+ tr( "MEN_PLOT2D_ANALYTICAL_CURVES" ),
+ 0, this );
+
+ aAction->setStatusTip( tr( "PRP_PLOT2D_ANALYTICAL_CURVES" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), myViewFrame, SLOT( onAnalyticalCurve() ) );
+ mgr->registerAction( aAction, AnalyticalCurveId );
+#endif
+
+ // 10. Clone
aAction = new QtxAction( tr( "MNU_CLONE_VIEW" ),
- aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_CLONE_VIEW" ) ),
tr( "MNU_CLONE_VIEW" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_CLONE_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SIGNAL( cloneView() ) );
mgr->registerAction( aAction, CloneId );
+ // 11. Print
+ aAction = new QtxAction( tr( "MNU_PRINT_VIEW" ),
+ aResMgr->loadPixmap( "STD", tr( "ICON_PLOT2D_PRINT" ) ),
+ tr( "MNU_PRINT_VIEW" ),
+ 0, this);
+ aAction->setStatusTip( tr( "DSC_PRINT_VIEW" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onPrintView() ) );
+ mgr->registerAction( aAction, PrintId );
+
// Set initial values
onChangeCurveMode();
onChangeHorMode();
onChangeVerMode();
+ onChangeNormLMode();
+ onChangeNormRMode();
onChangeLegendMode();
}
void Plot2d_ViewWindow::createToolBar()
{
QtxActionToolMgr* mgr = toolMgr();
- myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+ myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
mgr->append( DumpId, myToolBar );
mgr->append( ScaleOpId, myToolBar );
mgr->append( MoveOpId, myToolBar );
mgr->append( CurvLinesId, myToolBar );
mgr->append( CurvSplinesId, myToolBar );
mgr->append( toolMgr()->separator(), myToolBar );
+ mgr->append( PModeNormLMaxId, myToolBar );
+ mgr->append( PModeNormLMinId, myToolBar );
+ mgr->append( toolMgr()->separator(), myToolBar );
+ mgr->append( PModeNormRMaxId, myToolBar );
+ mgr->append( PModeNormRMinId, myToolBar );
+ mgr->append( toolMgr()->separator(), myToolBar );
mgr->append( PModeXLinearId, myToolBar );
mgr->append( PModeXLogarithmicId, myToolBar );
mgr->append( toolMgr()->separator(), myToolBar );
mgr->append( toolMgr()->separator(), myToolBar );
mgr->append( LegendId, myToolBar );
mgr->append( CurvSettingsId, myToolBar );
+ mgr->append( AnalyticalCurveId, myToolBar );
mgr->append( CloneId, myToolBar );
+ mgr->append( PrintId, myToolBar );
}
/*!
toolMgr()->action( GlobalPanId )->setEnabled( aHorLinear && aVerLinear );
}
+/*!
+ \brief Called when the normalization mode (by left Y axis) for curves is changed.
+*/
+void Plot2d_ViewWindow::onChangeNormLMode()
+{
+ bool aNormMax = myViewFrame->isNormLMaxMode();
+ bool aNormMin = myViewFrame->isNormLMinMode();
+
+ if ( aNormMax )
+ toolMgr()->action( PModeNormLMaxId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormLMaxId )->setChecked( false );
+ if ( aNormMin )
+ toolMgr()->action( PModeNormLMinId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormLMinId )->setChecked( false );
+}
+
+/*!
+ \brief Called when the normalization mode (by left Y axis) for curves is changed.
+*/
+void Plot2d_ViewWindow::onChangeNormRMode()
+{
+ bool aNormMax = myViewFrame->isNormRMaxMode();
+ bool aNormMin = myViewFrame->isNormRMinMode();
+
+ if ( aNormMax )
+ toolMgr()->action( PModeNormRMaxId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormRMaxId )->setChecked( false );
+ if ( aNormMin )
+ toolMgr()->action( PModeNormRMinId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormRMinId )->setChecked( false );
+}
+
/*!
\brief Called when the curve type is changed.
*/
myViewFrame->setVerScaleMode( toolMgr()->action( PModeYLinearId )->isChecked() ? 0 : 1 );
}
+/*!
+ \brief Called when normalization mode action (by left Y axis) is activated.
+*/
+
+void Plot2d_ViewWindow::onViewNormLMode()
+{
+ myViewFrame->setNormLMaxMode( toolMgr()->action( PModeNormLMaxId )->isChecked() ? true : false );
+ myViewFrame->setNormLMinMode( toolMgr()->action( PModeNormLMinId )->isChecked() ? true : false );
+}
+
+/*!
+ \brief Called when normalization mode action (by right Y axis) is activated.
+*/
+
+void Plot2d_ViewWindow::onViewNormRMode()
+{
+ myViewFrame->setNormRMaxMode( toolMgr()->action( PModeNormRMaxId )->isChecked() ? true : false );
+ myViewFrame->setNormRMinMode( toolMgr()->action( PModeNormRMinId )->isChecked() ? true : false );
+}
+
/*!
\brief Called when the "Show legend" action is activated.
*/
\param format image format ("BMP" [default], "JPEG", "JPG", "PNG")
*/
bool Plot2d_ViewWindow::dumpViewToFormat( const QImage& img,
- const QString& fileName,
- const QString& format )
+ const QString& fileName,
+ const QString& format )
{
bool res = myViewFrame ? myViewFrame->print( fileName, format ) : false;
if( !res )
return filters.join( ";;" );
}
+/*!
+ \brief Called when the "Print view" action is activated.
+*/
+void Plot2d_ViewWindow::onPrintView()
+{
+ if ( !myViewFrame )
+ return;
+
+#if !defined(WIN32) && !defined(QT_NO_CUPS)
+#if QT_VERSION < 0x040303
+ if ( !Qtx::hasAnyPrinters() ) {
+ SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
+ tr( "WRN_NO_PRINTERS" ) );
+ return;
+ }
+#endif
+#endif
+
+ // stored settings for further starts
+ static QString aPrinterName;
+ static int aColorMode = -1;
+ static int anOrientation = -1;
+
+ QPrinter aPrinter;
+
+ // restore settinds from previous launching
+
+ // printer name
+ if ( !aPrinterName.isEmpty() )
+ aPrinter.setPrinterName( aPrinterName );
+ else
+ {
+ // Nothing to do for the first printing. aPrinter contains default printer name by default
+ }
+
+ // color mode
+ if ( aColorMode >= 0 )
+ aPrinter.setColorMode( (QPrinter::ColorMode)aColorMode );
+ else
+ {
+ // Black-and-wight printers are often used
+ aPrinter.setColorMode( QPrinter::GrayScale );
+ }
+
+ if ( anOrientation >= 0 )
+ aPrinter.setOrientation( (QPrinter::Orientation)anOrientation );
+ else
+ aPrinter.setOrientation( QPrinter::Landscape );
+
+ QPrintDialog printDlg( &aPrinter, this );
+ printDlg.setPrintRange( QAbstractPrintDialog::AllPages );
+ if ( printDlg.exec() != QDialog::Accepted )
+ return;
+
+ // store printer settings for further starts
+ aPrinterName = aPrinter.printerName();
+ aColorMode = aPrinter.colorMode();
+ anOrientation = aPrinter.orientation();
+
+ int W, H;
+ QPainter aPainter;
+
+ bool needColorCorrection = aPrinter.colorMode() == QPrinter::GrayScale;
+
+ // work arround for printing on real printer
+ if ( aPrinter.outputFileName().isEmpty() && aPrinter.orientation() == QPrinter::Landscape )
+ {
+ aPrinter.setFullPage( false );
+ // set paper orientation and rotate painter
+ aPrinter.setOrientation( QPrinter::Portrait );
+
+ W = aPrinter.height();
+ H = aPrinter.width();
+
+ aPainter.begin( &aPrinter );
+ aPainter.translate( QPoint( H, 0 ) );
+ aPainter.rotate( 90 );
+ }
+ else
+ {
+ aPrinter.setFullPage( false );
+ aPainter.begin( &aPrinter );
+ W = aPrinter.width();
+ H = aPrinter.height();
+ }
+
+ QMap< QwtPlotCurve*, QPen > aCurvToPen;
+ QMap< QwtPlotCurve*, QwtSymbol > aCurvToSymbol;
+
+ if ( needColorCorrection )
+ {
+ // Iterate through, store temporary their parameters and assign
+ // parameters proper for printing
+
+ CurveDict aCurveDict = myViewFrame->getCurves();
+ CurveDict::iterator it;
+ for ( it = aCurveDict.begin(); it != aCurveDict.end(); it++ )
+ {
+ QwtPlotCurve* aCurve = it.key();
+ if ( !aCurve )
+ continue;
+
+ // pen
+ QPen aPen = aCurve->pen();
+ aCurvToPen[ aCurve ] = aPen;
+
+ aPen.setColor( QColor( 0, 0, 0 ) );
+ aPen.setWidthF( 1.5 );
+
+ aCurve->setPen( aPen );
+
+ // symbol
+ QwtSymbol aSymbol = aCurve->symbol();
+ aCurvToSymbol[ aCurve ] = aSymbol;
+ aPen = aSymbol.pen();
+ aPen.setColor( QColor( 0, 0, 0 ) );
+ aPen.setWidthF( 1.5 );
+ aSymbol.setPen( aPen );
+
+ aCurve->setSymbol( aSymbol );
+ }
+ }
+
+ myViewFrame->printPlot( &aPainter, QRect( 0, 0, W, H ) );
+ aPainter.end();
+
+ // restore old pens and symbols
+ if ( needColorCorrection && !aCurvToPen.isEmpty() )
+ {
+ CurveDict aCurveDict = myViewFrame->getCurves();
+ CurveDict::iterator it;
+ for ( it = aCurveDict.begin(); it != aCurveDict.end(); it++ )
+ {
+ QwtPlotCurve* aCurve = it.key();
+ if ( !aCurve ||
+ !aCurvToPen.contains( aCurve ) ||
+ !aCurvToSymbol.contains( aCurve ) )
+ continue;
+
+ aCurve->setPen( aCurvToPen[ aCurve ] );
+ aCurve->setSymbol( aCurvToSymbol[ aCurve ] );
+ }
+ }
+}
+
/*!
\fn void Plot2d_ViewWindow::cloneView();
\brief Emitted when the "Clone View" action is activated.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Plot2d_ViewWindow.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
public:
enum { DumpId,
- ScaleOpId, FitAllId, FitRectId, ZoomId,
- MoveOpId, PanId, GlobalPanId,
- PModeXLinearId, PModeXLogarithmicId,
+ ScaleOpId, FitAllId, FitRectId, ZoomId,
+ MoveOpId, PanId, GlobalPanId,
+ PModeXLinearId, PModeXLogarithmicId,
PModeYLinearId, PModeYLogarithmicId,
+ PModeNormLMaxId, PModeNormLMinId,
+ PModeNormRMaxId, PModeNormRMinId,
CurvPointsId, CurvLinesId, CurvSplinesId,
LegendId,
CurvSettingsId,
- CloneId };
+ CloneId, PrintId,
+ AnalyticalCurveId };
public:
Plot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* );
void putInfo( const QString&);
Plot2d_ViewFrame* getViewFrame();
QToolBar* getToolBar();
+ virtual void initLayout();
void contextMenuPopup( QMenu* );
virtual bool eventFilter( QObject*, QEvent* );
void onChangeVerMode();
void onChangeCurveMode();
void onChangeLegendMode();
+ void onChangeNormLMode();
+ void onChangeNormRMode();
+
void onFitAll();
void onFitRect();
void onGlobalPanning();
void onViewHorMode();
void onViewVerMode();
+ void onViewNormLMode();
+ void onViewNormRMode();
void onLegend();
void onCurves();
void onDumpView();
+ void onPrintView();
protected:
virtual QImage dumpView();
virtual bool dumpViewToFormat( const QImage&,
- const QString&,
- const QString& );
+ const QString&,
+ const QString& );
virtual QString filter() const;
signals:
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_PLOT2D_DUMP"
-msgstr "plot2d_camera_dump.png"
-
-msgid "ICON_PLOT2D_FIT_ALL"
-msgstr "plot2d_fitall.png"
-
-msgid "ICON_PLOT2D_FIT_AREA"
-msgstr "plot2d_fitarea.png"
-
-msgid "ICON_PLOT2D_ZOOM"
-msgstr "plot2d_zoom.png"
-
-msgid "ICON_PLOT2D_PAN"
-msgstr "plot2d_pan.png"
-
-msgid "ICON_PLOT2D_GLOBALPAN"
-msgstr "plot2d_glpan.png"
-
-msgid "ICON_PLOT2D_CLONE_VIEW"
-msgstr "plot2d_clone.png"
-
-msgid "ICON_PLOT2D_MODE_LINEAR_HOR"
-msgstr "plot2d_linear.png"
-
-msgid "ICON_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "plot2d_log.png"
-
-msgid "ICON_PLOT2D_MODE_LINEAR_VER"
-msgstr "plot2d_linear_y.png"
-
-msgid "ICON_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "plot2d_log_y.png"
-
-msgid "ICON_PLOT2D_SHOW_LEGEND"
-msgstr "plot2d_legend.png"
-
-msgid "ICON_PLOT2D_CURVES_POINTS"
-msgstr "plot2d_points.png"
-
-msgid "ICON_PLOT2D_CURVES_LINES"
-msgstr "plot2d_lines.png"
-
-msgid "ICON_PLOT2D_CURVES_SPLINES"
-msgstr "plot2d_splines.png"
-
-msgid "ICON_PLOT2D_SETTINGS"
-msgstr "plot2d_settings.png"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>ICON_PLOT2D_MODE_LOGARITHMIC_VER</source>
<translation>plot2d_log_y.png</translation>
</message>
+ <message>
+ <source>ICON_PLOT2D_NORMALIZE_MODE_LMIN</source>
+ <translation>plot2d_lmin_normalization.png</translation>
+ </message>
+ <message>
+ <source>ICON_PLOT2D_NORMALIZE_MODE_LMAX</source>
+ <translation>plot2d_lmax_normalization.png</translation>
+ </message>
+ <message>
+ <source>ICON_PLOT2D_NORMALIZE_MODE_RMIN</source>
+ <translation>plot2d_rmin_normalization.png</translation>
+ </message>
+ <message>
+ <source>ICON_PLOT2D_NORMALIZE_MODE_RMAX</source>
+ <translation>plot2d_rmax_normalization.png</translation>
+ </message>
<message>
<source>ICON_PLOT2D_SETTINGS</source>
<translation>plot2d_settings.png</translation>
</message>
+ <message>
+ <source>ICON_PLOT2D_ANALYTICAL_CURVES</source>
+ <translation>plot2d_analytical_curve.png</translation>
+ </message>
<message>
<source>ICON_PLOT2D_CURVES_LINES</source>
<translation>plot2d_lines.png</translation>
<source>ICON_PLOT2D_SHOW_LEGEND</source>
<translation>plot2d_legend.png</translation>
</message>
+ <message>
+ <source>ICON_PLOT2D_PRINT</source>
+ <translation>plot2d_print.png</translation>
+ </message>
</context>
</TS>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-# ------------------------------------
-# Plot2d_ViewFrame
-# ------------------------------------
-msgid "TOT_PLOT2D_MODE_LINEAR_HOR"
-msgstr "Horizontal axis: linear"
-
-msgid "MEN_PLOT2D_MODE_LINEAR_HOR"
-msgstr "Horizontal axis: linear"
-
-msgid "PRP_PLOT2D_MODE_LINEAR_HOR"
-msgstr "Switches view to linear scaling mode along horizontal axis"
-
-msgid "TOT_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "Horizontal axis: logarithmic"
-
-msgid "MEN_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "Horizontal axis: logarithmic"
-
-msgid "PRP_PLOT2D_MODE_LOGARITHMIC_HOR"
-msgstr "Switches view to logarithmic scaling mode along horizontal axis"
-
-msgid "TOT_PLOT2D_MODE_LINEAR_VER"
-msgstr "Vertical axis: linear"
-
-msgid "MEN_PLOT2D_MODE_LINEAR_VER"
-msgstr "Vertical axis: linear"
-
-msgid "PRP_PLOT2D_MODE_LINEAR_VER"
-msgstr "Switches view to linear scaling mode along vertical axis"
-
-msgid "TOT_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "Vertical axis: logarithmic"
-
-msgid "MEN_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "Vertical axis: logarithmic"
-
-msgid "PRP_PLOT2D_MODE_LOGARITHMIC_VER"
-msgstr "Switches view to logarithmic scaling mode along vertical axis"
-
-msgid "TOT_PLOT2D_SHOW_LEGEND"
-msgstr "Show Legend"
-
-msgid "MEN_PLOT2D_SHOW_LEGEND"
-msgstr "Show &Legend"
-
-msgid "PRP_PLOT2D_SHOW_LEGEND"
-msgstr "Enables/disables legend"
-
-msgid "TOT_PLOT2D_CURVES_POINTS"
-msgstr "Draw points"
-
-msgid "MEN_PLOT2D_CURVES_POINTS"
-msgstr "Draw points"
-
-msgid "PRP_PLOT2D_CURVES_POINTS"
-msgstr "Switches view to points mode"
-
-msgid "TOT_PLOT2D_CURVES_LINES"
-msgstr "Draw lines"
-
-msgid "MEN_PLOT2D_CURVES_LINES"
-msgstr "Draw lines"
-
-msgid "PRP_PLOT2D_CURVES_LINES"
-msgstr "Switches view to lines mode"
-
-msgid "TOT_PLOT2D_CURVES_SPLINES"
-msgstr "Draw splines"
-
-msgid "MEN_PLOT2D_CURVES_SPLINES"
-msgstr "Draw splines"
-
-msgid "PRP_PLOT2D_CURVES_SPLINES"
-msgstr "Switches view to splines mode"
-
-msgid "TOT_PLOT2D_SETTINGS"
-msgstr "Settings"
-
-msgid "MEN_PLOT2D_SETTINGS"
-msgstr "&Settings"
-
-msgid "PRP_PLOT2D_SETTINGS"
-msgstr "Setups view properties"
-
-msgid "TOT_PLOT2D_FITDATA"
-msgstr "Fit range"
-
-msgid "MEN_PLOT2D_FITDATA"
-msgstr "Fit &Range"
-
-msgid "PRP_PLOT2D_FITDATA"
-msgstr "Fits view to the given data range"
-
-msgid "TOT_PLOT2D_CHANGE_BACKGROUND"
-msgstr "Change background"
-
-msgid "MEN_PLOT2D_CHANGE_BACKGROUND"
-msgstr "Change background..."
-
-msgid "PRP_PLOT2D_CHANGE_BACKGROUND"
-msgstr "Change background color"
-
-msgid "SCALING_POPUP"
-msgstr "Scaling"
-
-msgid "CURVE_TYPE_POPUP"
-msgstr "Curve type"
-
-msgid "INF_COORDINATES"
-msgstr "Coordinates: X : %1, Y : %2"
-
-msgid "WARNING"
-msgstr "Warning"
-
-msgid "WRN_XLOG_NOT_ALLOWED"
-msgstr "Some points with non-positive abscissa values have been detected.\nLogarithmic scale for abscissa axis is not allowed."
-
-msgid "WRN_YLOG_NOT_ALLOWED"
-msgstr "Some points with non-positive ordinate values have been detected.\nLogarithmic scale for ordinate axis is not allowed."
-
-msgid "INF_COORDINATES_SOME_Y"
-msgstr "Coordinates: X : %1, Y : %2 ( %3 )"
-
-#msgid "INF_READY"
-#msgstr "Ready"
-
-msgid "PLOT2D_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-#-------------------------------------
-# Plot2d_SetupViewDlg
-# ------------------------------------
-msgid "TLT_SETUP_PLOT2D_VIEW"
-msgstr "Plot 2d View Settings"
-
-msgid "PLOT2D_ENABLE_MAIN_TITLE"
-msgstr "Main title"
-
-msgid "PLOT2D_ENABLE_HOR_TITLE"
-msgstr "Horizontal axis title"
-
-msgid "INF_AXES_X"
-msgstr "Axis X"
-
-msgid "INF_AXES_Y_LEFT"
-msgstr "Axis Y Left"
-
-msgid "INF_AXES_Y_RIGHT"
-msgstr "Axis Y Right"
-
-msgid "PLOT2D_ENABLE_VER_TITLE"
-msgstr "Vertical axis title"
-
-msgid "PLOT2D_CURVE_TYPE_LBL"
-msgstr "Curve type:"
-
-msgid "PLOT2D_CURVE_TYPE_POINTS"
-msgstr "Points"
-
-msgid "PLOT2D_CURVE_TYPE_LINES"
-msgstr "Lines"
-
-msgid "PLOT2D_CURVE_TYPE_SPLINE"
-msgstr "Spline"
-
-msgid "PLOT2D_ENABLE_LEGEND"
-msgstr "Show legend"
-
-msgid "PLOT2D_LEGEND_POSITION_LEFT"
-msgstr "Left"
-
-msgid "PLOT2D_LEGEND_POSITION_RIGHT"
-msgstr "Right"
-
-msgid "PLOT2D_LEGEND_POSITION_TOP"
-msgstr "Top"
-
-msgid "PLOT2D_LEGEND_POSITION_BOTTOM"
-msgstr "Bottom"
-
-msgid "PLOT2D_MARKER_SIZE_LBL"
-msgstr "Marker size:"
-
-msgid "PLOT2D_BACKGROUND_COLOR_LBL"
-msgstr "Background color:"
-
-msgid "PLOT2D_SCALE_TLT"
-msgstr "Scale mode"
-
-msgid "PLOT2D_SCALE_MODE_HOR"
-msgstr "Horizontal axis:"
-
-msgid "PLOT2D_SCALE_MODE_VER"
-msgstr "Vertical axis:"
-
-msgid "PLOT2D_SCALE_MODE_LINEAR"
-msgstr "Linear"
-
-msgid "PLOT2D_SCALE_MODE_LOGARITHMIC"
-msgstr "Logarithmic"
-
-msgid "PLOT2D_GRID_TLT"
-msgstr "Grid / Axes marks"
-
-msgid "PLOT2D_GRID_ENABLE_HOR_MAJOR"
-msgstr "Horizontal major"
-
-msgid "PLOT2D_GRID_ENABLE_VER_MAJOR"
-msgstr "Vertical major"
-
-msgid "PLOT2D_GRID_ENABLE_HOR_MINOR"
-msgstr "Horizontal minor"
-
-msgid "PLOT2D_GRID_ENABLE_VER_MINOR"
-msgstr "Vertical minor"
-
-msgid "PLOT2D_MAX_INTERVALS"
-msgstr "Max intervals"
-
-msgid "PLOT2D_SET_AS_DEFAULT_CHECK"
-msgstr "Save settings as default"
-
-# ------------------------------------
-# Plot2d_FitDataDlg
-# ------------------------------------
-msgid "FIT_DATA_TLT"
-msgstr "Fit Data Range"
-
-msgid "Plot2d_FitDataDlg::FIT_ALL"
-msgstr "Fit both"
-
-msgid "Plot2d_FitDataDlg::FIT_HORIZONTAL"
-msgstr "Fit horizontally"
-
-msgid "Plot2d_FitDataDlg::FIT_VERTICAL"
-msgstr "Fit vertically"
-
-msgid "Plot2d_FitDataDlg::HORIZONTAL_AXIS"
-msgstr "Horizontal axis"
-
-msgid "Plot2d_FitDataDlg::VERTICAL_AXIS"
-msgstr "Vertical axis"
-
-msgid "Plot2d_FitDataDlg::VERTICAL_LEFT_AXIS"
-msgstr "Vertical left axis"
-
-msgid "Plot2d_FitDataDlg::VERTICAL_RIGHT_AXIS"
-msgstr "Vertical right axis"
-
-msgid "Plot2d_FitDataDlg::MIN_VALUE_LAB"
-msgstr "Min:"
-
-msgid "Plot2d_FitDataDlg::MAX_VALUE_LAB"
-msgstr "Max:"
-
-# ------------------------------------
-# Plot2d_ViewWindow
-# ------------------------------------
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_CLONE_VIEW"
-msgstr "Create new OCC viewer for the active scene"
-
-msgid "MNU_CLONE_VIEW"
-msgstr "Clone View"
-
-
-msgid "TLT_SETUP_CURVE"
-msgstr "Setup Curve"
-
-msgid "CURVE_LINE_TYPE_LAB"
-msgstr "Line type:"
-
-msgid "CURVE_LINE_WIDTH_LAB"
-msgstr "Line width:"
-
-msgid "CURVE_MARKER_TYPE_LAB"
-msgstr "Marker type:"
-
-msgid "CURVE_COLOR_LAB"
-msgstr "Color:"
-
-msgid "NONE_LINE_LBL"
-msgstr "None"
-
-msgid "SOLID_LINE_LBL"
-msgstr "Solid"
-
-msgid "DASH_LINE_LBL"
-msgstr "Dash"
-
-msgid "DOT_LINE_LBL"
-msgstr "Dot"
-
-msgid "DASHDOT_LINE_LBL"
-msgstr "DashDot"
-
-msgid "DAHSDOTDOT_LINE_LBL"
-msgstr "DashDotDot"
-
-msgid "NONE_MARKER_LBL"
-msgstr "None"
-
-msgid "CIRCLE_MARKER_LBL"
-msgstr "Circle"
-
-msgid "RECTANGLE_MARKER_LBL"
-msgstr "Rectangle"
-
-msgid "DIAMOND_MARKER_LBL"
-msgstr "Diamond"
-
-msgid "DTRIANGLE_MARKER_LBL"
-msgstr "Downward triangle"
-
-msgid "UTRIANGLE_MARKER_LBL"
-msgstr "Upward triangle"
-
-msgid "LTRIANGLE_MARKER_LBL"
-msgstr "Leftward triangle"
-
-msgid "RTRIANGLE_MARKER_LBL"
-msgstr "Rightward triangle"
-
-msgid "CROSS_MARKER_LBL"
-msgstr "Cross"
-
-msgid "XCROSS_MARKER_LBL"
-msgstr "Diagonal cross"
-
-msgid "POSTSCRIPT_FILES"
-msgstr "PostScript files (*.ps)"
-
-msgid "Plot2d_ViewManager::PLOT2D_VIEW_TITLE"
-msgstr "Plot2d scene:%M - viewer:%V"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>PLOT2D_SCALE_MODE_HOR</source>
<translation>Horizontal axis:</translation>
</message>
+ <message>
+ <source>PLOT2D_NORMALIZE_TLT</source>
+ <translation>Normalization</translation>
+ </message>
+ <message>
+ <source>PLOT2D_NORMALIZE_MODE_MIN</source>
+ <translation>Normalize to minimum</translation>
+ </message>
+ <message>
+ <source>PLOT2D_NORMALIZE_MODE_MAX</source>
+ <translation>Normalize to maximum</translation>
+ </message>
+ <message>
+ <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
+ <translation>Left Y Axis: </translation>
+ </message>
+ <message>
+ <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
+ <translation>Right Y Axis: </translation>
+ </message>
<message>
<source>PLOT2D_SCALE_MODE_VER</source>
<translation>Vertical axis:</translation>
<source>MNU_CLONE_VIEW</source>
<translation>Clone View</translation>
</message>
+ <message>
+ <source>MNU_PRINT_VIEW</source>
+ <translation>Print View</translation>
+ </message>
<message>
<source>POSTSCRIPT_FILES</source>
<translation>PostScript files (*.ps)</translation>
<source>CURVE_TYPE_POPUP</source>
<translation>Curve type</translation>
</message>
+ <message>
+ <source>NORMALIZATION_TYPE_POPUP</source>
+ <translation>Normalization</translation>
+ </message>
<message>
<source>TOT_PLOT2D_MODE_LINEAR_VER</source>
<translation>Vertical axis: linear</translation>
<source>DSC_CLONE_VIEW</source>
<translation>Create new OCC viewer for the active scene</translation>
</message>
+ <message>
+ <source>DSC_PRINT_VIEW</source>
+ <translation>Print active view</translation>
+ </message>
<message>
<source>DASH_LINE_LBL</source>
<translation>Dash</translation>
<source>TOT_PLOT2D_SETTINGS</source>
<translation>Settings</translation>
</message>
+ <message>
+ <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
+ <translation>Analytical curves</translation>
+ </message>
+ <message>
+ <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
+ <translation>Left Y Axis: Normalize to global maximum</translation>
+ </message>
+ <message>
+ <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
+ <translation>Left Y Axis: Normalize to global minimum</translation>
+ </message>
+ <message>
+ <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
+ <translation>Right Y Axis: Normalize to global maximum</translation>
+ </message>
+ <message>
+ <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
+ <translation>Right Y Axis: Normalize to global minimum</translation>
+ </message>
<message>
<source>PLOT2D_CURVE_TYPE_LINES</source>
<translation>Lines</translation>
<source>PLOT2D_BACKGROUND_COLOR_LBL</source>
<translation>Background color:</translation>
</message>
+ <message>
+ <source>PLOT2D_DEVIATION_MARKER_TLT</source>
+ <translation>Deviation marker</translation>
+ </message>
+ <message>
+ <source>PLOT2D_DEVIATION_LW_LBL</source>
+ <translation>Line width</translation>
+ </message>
+ <message>
+ <source>PLOT2D_DEVIATION_TS_LBL</source>
+ <translation>Tick size</translation>
+ </message>
+ <message>
+ <source>PLOT2D_DEVIATION_CL_LBL</source>
+ <translation>Color</translation>
+ </message>
<message>
<source>WRN_XLOG_NOT_ALLOWED</source>
<translation>Some points with non-positive abscissa values have been detected.
<source>PLOT2D_ENABLE_LEGEND</source>
<translation>Show legend</translation>
</message>
+ <message>
+ <source>PLOT2D_LEGEND_FONT</source>
+ <translation>Legend font</translation>
+ </message>
<message>
<source>DSC_ZOOM_VIEW</source>
<translation>Zoom the view</translation>
</message>
+ <message>
+ <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
+ <translation>Setups analytical curves properties</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
+ <translation>Switches view to maximum normalization mode by left Y axis</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
+ <translation>Switches view to minimum normalization mode by left Y axis</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
+ <translation>Switches view to maximum normalization mode by right Y axis</translation>
+ </message>
+ <message>
+ <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
+ <translation>Switches view to minimum normalization mode by right Y axis</translation>
+ </message>
<message>
<source>PRP_PLOT2D_SETTINGS</source>
<translation>Setups view properties</translation>
- </message>
+ </message>
<message>
<source>INF_COORDINATES_SOME_Y</source>
<translation>Coordinates: X : %1, Y : %2 ( %3 )</translation>
<source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
<translation>Vertical Axis: Logarithmic</translation>
</message>
+ <message>
+ <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
+ <translation>Left Y Axis: Minimum</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
+ <translation>Left Y Axis: Maximum</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
+ <translation>Right Y Axis: Minimum</translation>
+ </message>
+ <message>
+ <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
+ <translation>Right Y Axis: Maximum</translation>
+ </message>
<message>
<source>PRP_PLOT2D_FITDATA</source>
<translation>Fits view to the given data range</translation>
<source>MEN_PLOT2D_SETTINGS</source>
<translation>&Settings</translation>
</message>
+ <message>
+ <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
+ <translation>Analytical curves</translation>
+ </message>
<message>
<source>CIRCLE_MARKER_LBL</source>
<translation>Circle</translation>
<source>PLOT2D_VIEW_TITLE</source>
<translation>Plot2d scene:%M - viewer:%V</translation>
</message>
+ <message>
+ <source>PREF_GROUP_PLOT2DVIEWER</source>
+ <translation>Plot2d Viewer</translation>
+ </message>
+ <message>
+ <source>PREF_SHOW_LEGEND</source>
+ <translation>Show legend</translation>
+ </message>
+ <message>
+ <source>PREF_LEGEND_POSITION</source>
+ <translation>Legend position:</translation>
+ </message>
+ <message>
+ <source>PREF_LEFT</source>
+ <translation>Left</translation>
+ </message>
+ <message>
+ <source>PREF_RIGHT</source>
+ <translation>Right</translation>
+ </message>
+ <message>
+ <source>PREF_TOP</source>
+ <translation>Top</translation>
+ </message>
+ <message>
+ <source>PREF_BOTTOM</source>
+ <translation>Bottom</translation>
+ </message>
+ <message>
+ <source>PREF_CURVE_TYPE</source>
+ <translation>Curve type:</translation>
+ </message>
+ <message>
+ <source>PREF_POINTS</source>
+ <translation>Points</translation>
+ </message>
+ <message>
+ <source>PREF_LINES</source>
+ <translation>Lines</translation>
+ </message>
+ <message>
+ <source>PREF_SPLINE</source>
+ <translation>Spline</translation>
+ </message>
+ <message>
+ <source>PREF_MARKER_SIZE</source>
+ <translation>Marker size:</translation>
+ </message>
+ <message>
+ <source>PREF_LINEAR</source>
+ <translation>Linear</translation>
+ </message>
+ <message>
+ <source>PREF_LOGARITHMIC</source>
+ <translation>Logarithmic</translation>
+ </message>
+ <message>
+ <source>PREF_HOR_AXIS_SCALE</source>
+ <translation>Horizontal axis scale:</translation>
+ </message>
+ <message>
+ <source>PREF_VERT_AXIS_SCALE</source>
+ <translation>Vertical axis scale:</translation>
+ </message>
+ <message>
+ <source>PREF_VIEWER_BACKGROUND</source>
+ <translation>Background color</translation>
+ </message>
+</context>
+<context>
+ <name>Plot2d_AnalyticalCurveDlg</name>
+ <message>
+ <source>ANALYTICAL_CURVE_TLT</source>
+ <translation>Analytical curves properties</translation>
+ </message>
+ <message>
+ <source>AC_CURVE_PARAMS</source>
+ <translation>Curve parameters</translation>
+ </message>
+ <message>
+ <source>AC_CURVE_PROPS</source>
+ <translation>Curve properties</translation>
+ </message>
+ <message>
+ <source>AC_FORMULA</source>
+ <translation>y(x) = </translation>
+ </message>
+ <message>
+ <source>AC_NB_INTERVALS</source>
+ <translation>Nb. intervals</translation>
+ </message>
+ <message>
+ <source>AC_AUTO_ASSIGN</source>
+ <translation>Auto assign</translation>
+ </message>
+ <message>
+ <source>AC_MARKER_TYPE</source>
+ <translation>Marker type</translation>
+ </message>
+ <message>
+ <source>AC_LINE_TYPE</source>
+ <translation>Line type</translation>
+ </message>
+ <message>
+ <source>AC_LINE_WIDTH</source>
+ <translation>Line Width</translation>
+ </message>
+ <message>
+ <source>AC_CURVE_COLOR</source>
+ <translation>Curve color</translation>
+ </message>
+ <message>
+ <source>AC_ADD_BTN</source>
+ <translation>Add curve</translation>
+ </message>
+ <message>
+ <source>AC_REM_BTN</source>
+ <translation>Remove curve</translation>
+ </message>
+ <message>
+ <source>AC_OK_BTN</source>
+ <translation>Ok</translation>
+ </message>
+ <message>
+ <source>AC_APPLY_BTN</source>
+ <translation>Apply</translation>
+ </message>
+ <message>
+ <source>AC_CANT_CALCULATE</source>
+ <translation>Can't calculate curve.
+Please, check input parameters!!!</translation>
+ </message>
+ <message>
+ <source>AC_CLOSE_BTN</source>
+ <translation>&Close</translation>
+ </message>
+ <message>
+ <source>AC_HELP_BTN</source>
+ <translation>Help</translation>
+ </message>
+</context>
+<context>
+ <name>Plot2d_SetupCurveScaleDlg</name>
+ <message>
+ <source>TLT_SETUP_CURVE_SCALE</source>
+ <translation>Curve(s) scale</translation>
+ </message>
+ <message>
+ <source>CURVE_SCALE_FACTOR</source>
+ <translation>Scale factor</translation>
+ </message>
</context>
-</TS>
+</TS>
\ No newline at end of file
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libSalomePrs.la
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = SalomePrs
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PRS_EXPORTS
-
-HEADERS = SALOME_Prs.h
-
-SOURCES = SALOME_Prs.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: SALOME_Prs.cxx
-// Created: Wed Apr 28 15:03:43 2004
-// Author: Sergey ANIKIN
-// <san@startrex.nnov.opencascade.com>
-//
-#include "SALOME_Prs.h"
-//#include "utilities.h"
+// File: SALOME_Prs.cxx
+// Author: Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
-//using namespace std;
+#include "SALOME_Prs.h"
/*!
Dispatches display operation to proper Display() method of SALOME_View
if ( v ) v->Erase( this, forced );
}
+/*!
+ Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->BeforeDisplay( v, this );
+}
+
+/*!
+ Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->AfterDisplay( v, this );
+}
+
+/*!
+ Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->BeforeErase( v, this );
+}
+
+/*!
+ Dispatches display operation to proper AfterErase() method of SALOME_Displayer
+*/
+void SALOME_OCCPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->AfterErase( v, this );
+}
+
/*!
Dispatches operation to proper LocalSelectionIn() method of SALOME_View
*/
if ( v ) v->Erase( this, forced );
}
+/*!
+ Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->BeforeDisplay( v, this );
+}
+
+/*!
+ Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->AfterDisplay( v, this );
+}
+
+/*!
+ Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->BeforeErase( v, this );
+}
+
+/*!
+ Dispatches display operation to proper AfterErase() method of SALOME_Displayer
+*/
+void SALOME_VTKPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->AfterErase( v, this );
+}
+
/*!
Dispatches operation to proper LocalSelectionIn() method of SALOME_View
*/
if ( v ) v->Erase( this, forced );
}
+/*!
+ Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->BeforeDisplay( v, this );
+}
+
+/*!
+ Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->AfterDisplay( v, this );
+}
+
+/*!
+ Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->BeforeErase( v, this );
+}
+
+/*!
+ Dispatches display operation to proper AfterErase() method of SALOME_Displayer
+*/
+void SALOME_Prs2d::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
+{
+ d->AfterErase( v, this );
+}
+
/*!
Dispatches operation to proper LocalSelectionIn() method of SALOME_View
*/
// Probably, selection is being activated in uncompatible viewframe." );
}
+void SALOME_View::BeforeDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+ p->BeforeDisplayIn( d, this );
+}
+
+void SALOME_View::AfterDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+ p->AfterDisplayIn( d, this );
+}
+
+void SALOME_View::BeforeErase( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+ p->BeforeEraseIn( d, this );
+}
+
+void SALOME_View::AfterErase ( SALOME_Displayer* d, const SALOME_Prs* p )
+{
+ p->AfterEraseIn( d, this );
+}
+
/*!
Gives control to SALOME_Prs object, so that it could perform double dispatch
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOME_PRS_H
#define SALOME_PRS_H
#ifdef WIN32
-#ifdef PRS_EXPORTS
+#if defined PRS_EXPORTS || defined SalomePrs_EXPORTS
#define PRS_EXPORT __declspec(dllexport)
#else
#define PRS_EXPORT __declspec(dllimport)
class SALOME_View;
class SALOME_Displayer;
+class SALOME_ListIO;
class Handle_SALOME_InteractiveObject;
/*!
//! Key method for double dispatch of erase operation
virtual void EraseIn( SALOME_View*, const bool = false ) const = 0;
+ //! Key method for double dispatch of pre-display operation
+ virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
+ //! Key method for double dispatch of post-display operation
+ virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
+ //! Key method for double dispatch of pre-erase operation
+ virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
+ //! Key method for double dispatch of post-erase operation
+ virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const = 0;
+
//! Key method for double dispatch of update operation
virtual void Update( SALOME_Displayer* ) = 0;
//! Should return true, if this presentation contains a graphic object
virtual bool IsNull() const = 0;
- //! Key method for double dispatch of activation of subshapes selection
+ //! Key method for double dispatch of activation of sub-shapes selection
virtual void LocalSelectionIn( SALOME_View*, const int ) const = 0;
};
class PRS_EXPORT SALOME_OCCPrs : public SALOME_Prs
{
public:
- //! It uses double dispatch in order to \n
+ //! It uses double dispatch in order to
//! invoke Display() method corresponding to the actual type of presentation.
virtual void DisplayIn( SALOME_View* ) const;
- //! It uses double dispatch in order to \n
+ //! It uses double dispatch in order to
//! invoke Erase() method corresponding to the actual type of presentation.
virtual void EraseIn( SALOME_View*, const bool = false ) const;
- //! It uses double dispatch in order to \n
+ //! It uses double dispatch in order to
+ //! invoke BeforeDisplayIn() method corresponding to the actual type of presentation.
+ virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke AfterDisplayIn() method corresponding to the actual type of presentation.
+ virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke BeforeEraseIn() method corresponding to the actual type of presentation.
+ virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke AfterEraseIn() method corresponding to the actual type of presentation.
+ virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
//! invoke Update() method corresponding to the actual type of presentation.
virtual void Update( SALOME_Displayer* );
- //! Key method for double dispatch of activation of subshapes selection
+ //! Key method for double dispatch of activation of sub-shapes selection
virtual void LocalSelectionIn( SALOME_View*, const int ) const;
};
class PRS_EXPORT SALOME_VTKPrs : public SALOME_Prs
{
public:
- //! It uses double dispatch in order to \n
+ //! It uses double dispatch in order to
//! invoke Display() method corresponding to the actual type of presentation.
virtual void DisplayIn( SALOME_View* ) const;
- //! It uses double dispatch in order to \n
+ //! It uses double dispatch in order to
//! invoke Erase() method corresponding to the actual type of presentation.
virtual void EraseIn( SALOME_View*, const bool = false ) const;
- //! It uses double dispatch in order to \n
+ //! It uses double dispatch in order to
+ //! invoke BeforeDisplayIn() method corresponding to the actual type of presentation.
+ virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke AfterDisplayIn() method corresponding to the actual type of presentation.
+ virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke BeforeEraseIn() method corresponding to the actual type of presentation.
+ virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke AfterEraseIn() method corresponding to the actual type of presentation.
+ virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
//! invoke Update() method corresponding to the actual type of presentation.
virtual void Update( SALOME_Displayer* );
- //! Key method for double dispatch of activation of subshapes selection
+ //! Key method for double dispatch of activation of sub-shapes selection
virtual void LocalSelectionIn( SALOME_View*, const int ) const;
};
//! invoke Erase() method corresponding to the actual type of presentation.
virtual void EraseIn( SALOME_View*, const bool = false ) const;
+ //! It uses double dispatch in order to
+ //! invoke BeforeDisplayIn() method corresponding to the actual type of presentation.
+ virtual void BeforeDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke AfterDisplayIn() method corresponding to the actual type of presentation.
+ virtual void AfterDisplayIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke BeforeEraseIn() method corresponding to the actual type of presentation.
+ virtual void BeforeEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
+ //! It uses double dispatch in order to
+ //! invoke AfterEraseIn() method corresponding to the actual type of presentation.
+ virtual void AfterEraseIn( SALOME_Displayer*, SALOME_View* ) const;
+
//! It uses double dispatch in order to
//! invoke Update() method corresponding to the actual type of presentation.
virtual void Update( SALOME_Displayer* );
- //! Key method for double dispatch of activation of subshapes selection
+ //! Key method for double dispatch of activation of sub-shapes selection
virtual void LocalSelectionIn( SALOME_View*, const int ) const;
};
//! Destructor
virtual ~SALOME_View() {}
- //! This Display() method should be called to display given presentation \n
- //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+ //! This Display() method should be called to display given presentation
+ //! created anywhere by anybody. It simply passes control to SALOME_Prs object
//! so that it could perform double dispatch.
void Display( const SALOME_Prs* );
- //! This Erase() method should be called to erase given presentation \n
- //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+ //! This Erase() method should be called to erase given presentation
+ //! created anywhere by anybody. It simply passes control to SALOME_Prs object
//! so that it could perform double dispatch.
void Erase( const SALOME_Prs*, const bool = false );
- //! This LocalSelection() method should be called to activate sub-shapes selection \n
- //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+ //! This LocalSelection() method should be called to activate sub-shapes selection
+ //! created anywhere by anybody. It simply passes control to SALOME_Prs object
//! so that it could perform double dispatch.
void LocalSelection( const SALOME_Prs*, const int );
// Display() methods for ALL kinds of presentation should appear here
virtual void Display( const SALOME_OCCPrs* );//!< Display SALOME_OCCPrs presentation.
virtual void Display( const SALOME_VTKPrs* );//!< Display SALOME_VTKPrs presentation.
- virtual void Display( const SALOME_Prs2d* );//!< Display SALOME_Prs2d presentation.
+ virtual void Display( const SALOME_Prs2d* );//!< Display SALOME_Prs2d presentation.
// Add new Display() methods here...
// Erase() methods for ALL kinds of presentation should appear here
virtual void Erase( const SALOME_OCCPrs*, const bool = false );//!< Erase SALOME_OCCPrs
virtual void Erase( const SALOME_VTKPrs*, const bool = false );//!< Erase SALOME_VTKPrs
- virtual void Erase( const SALOME_Prs2d*, const bool = false );//!< Erase SALOME_Prs2d
+ virtual void Erase( const SALOME_Prs2d*, const bool = false );//!< Erase SALOME_Prs2d
virtual void EraseAll( const bool = false );
// Add new Erase() methods here...
virtual SALOME_Prs* CreatePrs( const char* /*entry*/ = 0 ) { return 0; }
// Axiluary methods called before and after displaying of objects
- virtual void BeforeDisplay( SALOME_Displayer* ) {} //!< Null body here
- virtual void AfterDisplay ( SALOME_Displayer* ) {} //!< Null body here
+ virtual void BeforeDisplay( SALOME_Displayer*, const SALOME_Prs* );
+ virtual void AfterDisplay ( SALOME_Displayer*, const SALOME_Prs* );
+
+ // Axiluary methods called before and after erasing of objects
+ virtual void BeforeErase( SALOME_Displayer*, const SALOME_Prs* );
+ virtual void AfterErase ( SALOME_Displayer*, const SALOME_Prs* );
// New methods (asv)
//! \retval Return false.
virtual bool isVisible( const Handle_SALOME_InteractiveObject& ){ return false; }
virtual void Repaint() {} //!< Null body here.
+ virtual void GetVisible( SALOME_ListIO& theList ) {}
};
-/*!
- \class SALOME_Displayer
- These classes are used to specify type of view VTK, OCC or Plot2d
-*/
-class PRS_EXPORT SALOME_OCCViewType {};
-class PRS_EXPORT SALOME_VTKViewType {};
-class PRS_EXPORT SALOME_Plot2dViewType {};
-
/*!
\class SALOME_Displayer
Base class for SALOME displayers
//! Destructor
virtual ~SALOME_Displayer() {/*! Null body here*/}
- //! This Update() method should be called to update given presentation \n
- //! created anywhere by anybody. It simply passes control to SALOME_Prs object \n
+ //! This Update() method should be called to update given presentation
+ //! created anywhere by anybody. It simply passes control to SALOME_Prs object
//! so that it could perform double dispatch.
void UpdatePrs( SALOME_Prs* );
// Add new Update() methods here...
// Axiluary methods called before and after displaying of objects
- virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCViewType& ){/*! Null body here*/};
- virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCViewType& ){/*! Null body here*/};
- virtual void BeforeDisplay( SALOME_View*, const SALOME_VTKViewType& ){/*! Null body here*/};
- virtual void AfterDisplay ( SALOME_View*, const SALOME_VTKViewType& ){/*! Null body here*/};
- virtual void BeforeDisplay( SALOME_View*, const SALOME_Plot2dViewType& ){/*! Null body here*/};
- virtual void AfterDisplay ( SALOME_View*, const SALOME_Plot2dViewType& ){/*! Null body here*/};
+ virtual void BeforeDisplay( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+ virtual void AfterDisplay ( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+ virtual void BeforeDisplay( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+ virtual void AfterDisplay ( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+ virtual void BeforeDisplay( SALOME_View*, const SALOME_Prs2d* ) {} //! Null body here
+ virtual void AfterDisplay ( SALOME_View*, const SALOME_Prs2d* ) {} //! Null body here
+
+ // Axiluary methods called before and after erasing of objects
+ virtual void BeforeErase( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+ virtual void AfterErase ( SALOME_View*, const SALOME_OCCPrs* ) {} //! Null body here
+ virtual void BeforeErase( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+ virtual void AfterErase ( SALOME_View*, const SALOME_VTKPrs* ) {} //! Null body here
+ virtual void BeforeErase( SALOME_View*, const SALOME_Prs2d* ) {} //! Null body here
+ virtual void AfterErase ( SALOME_View*, const SALOME_Prs2d* ) {} //! Null body here
+
};
#endif
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : PyConsole
nodist_libPyConsole_la_SOURCES = $(MOC_FILES)
nodist_salomeres_DATA = \
- PyConsole_msg_en.qm
+ PyConsole_msg_en.qm \
+ PyConsole_msg_fr.qm
libPyConsole_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) \
-I$(srcdir)/../PyInterp -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
-libPyConsole_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS)
+libPyConsole_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSALOMELocalTrace
libPyConsole_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../PyInterp/libPyInterp.la
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyConsole.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
// ========================================================
// set dllexport type for Win platform
#ifdef WIN32
-# ifdef PYCONSOLE_EXPORTS
+# if defined PYCONSOLE_EXPORTS || defined PyConsole_EXPORTS
# define PYCONSOLE_EXPORT __declspec(dllexport)
# else
# define PYCONSOLE_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = PyConsole
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHONVER=2.4
-PYTHONHOME=$$(PYTHONHOME)
-PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
-PYTHONLIB=$${PYTHONHOME}/lib
-
-INCLUDEPATH += ../../include $${PYTHONINC}
-INCLUDEPATH += ../Qtx ../SUIT ../PyInterp
-unix:LIBS += -L$${PYTHONLIB} -lpython$${PYTHONVER}
-win32:LIBS += /LIBPATH:$$(PYTHONLIB)
-LIBS += -L../../lib -lqtx -lsuit -lPyInterp
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PYCONSOLE_EXPORTS
-
-HEADERS = PyConsole.h
-HEADERS += PyConsole_Console.h
-HEADERS += PyConsole_Editor.h
-HEADERS += PyConsole_Interp.h
-
-SOURCES = PyConsole_Console.cxx
-SOURCES += PyConsole_Editor.cxx
-SOURCES += PyConsole_Interp.cxx
-
-TRANSLATIONS = resources/PyConsole_msg_en.ts
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyConsole_Console.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include <QMenu>
#include <QVBoxLayout>
+#include <utilities.h>
+
/*!
\brief Constructor.
QVBoxLayout* lay = new QVBoxLayout( this );
lay->setMargin( 0 );
myEditor = new PyConsole_Editor( myInterp, this );
+ char* synchronous = getenv("PYTHON_CONSOLE_SYNC");
+ if (synchronous && atoi(synchronous))
+ {
+ MESSAGE("Python console is synchronous");
+ myEditor->setIsSync(true);
+ }
myEditor->viewport()->installEventFilter( this );
lay->addWidget( myEditor );
myEditor->setIsSync( on );
}
+/*!
+ \brief Get suppress output flag value.
+
+ \sa setIsSuppressOutput()
+ \return True if python console output is suppressed.
+*/
+bool PyConsole_Console::isSuppressOutput() const
+{
+ return myEditor->isSuppressOutput();
+}
+
+/*!
+ \brief Set suppress output flag value.
+
+ In case if suppress output flag is true, the python
+ console output suppressed.
+
+ \param on suppress output flag
+*/
+void PyConsole_Console::setIsSuppressOutput( const bool on )
+{
+ myEditor->setIsSuppressOutput(on);
+}
+
+/*!
+ \brief Get 'show banner' flag value.
+
+ \sa setIsShowBanner()
+ \return \c true if python console shows banner
+*/
+bool PyConsole_Console::isShowBanner() const
+{
+ return myEditor->isShowBanner();
+}
+
+/*!
+ \brief Set 'show banner' flag value.
+
+ The banner is shown in the top of the python console window.
+
+ \sa isShowBanner()
+ \param on 'show banner' flag
+*/
+void PyConsole_Console::setIsShowBanner( const bool on )
+{
+ myEditor->setIsShowBanner( on );
+}
+
/*!
\brief Change the python console's font.
\param f new font
menu->addAction( myActions[ClearId] );
menu->addSeparator();
menu->addAction( myActions[SelectAllId] );
+ menu->addSeparator();
+ menu->addAction( myActions[DumpCommandsId] );
Qtx::simplifySeparators( menu );
myActions[PasteId]->setVisible( flags & PasteId );
myActions[ClearId]->setVisible( flags & ClearId );
myActions[SelectAllId]->setVisible( flags & SelectAllId );
+ myActions[DumpCommandsId]->setVisible( flags & DumpCommandsId );
}
/*!
ret = ret | ( myActions[PasteId]->isVisible() ? PasteId : 0 );
ret = ret | ( myActions[ClearId]->isVisible() ? ClearId : 0 );
ret = ret | ( myActions[SelectAllId]->isVisible() ? SelectAllId : 0 );
+ ret = ret | ( myActions[DumpCommandsId]->isVisible() ? DumpCommandsId : 0 );
return ret;
}
a->setStatusTip( tr( "EDIT_SELECTALL_CMD" ) );
connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( selectAll() ) );
myActions.insert( SelectAllId, a );
+
+ a = new QAction( tr( "EDIT_DUMPCOMMANDS_CMD" ), this );
+ a->setStatusTip( tr( "EDIT_DUMPCOMMANDS_CMD" ) );
+ connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( dump() ) );
+ myActions.insert( DumpCommandsId, a );
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyConsole_Console.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
//! Context popup menu actions flags
enum
{
- CopyId = 0x01, //!< "Copy" menu action
- PasteId = 0x02, //!< "Paste" menu action
- ClearId = 0x04, //!< "Clear" menu action
- SelectAllId = 0x08, //!< "Select All" menu action
- All = CopyId | PasteId | ClearId | SelectAllId //!< all menu actions
+ CopyId = 0x01, //!< "Copy" menu action
+ PasteId = 0x02, //!< "Paste" menu action
+ ClearId = 0x04, //!< "Clear" menu action
+ SelectAllId = 0x08, //!< "Select All" menu action
+ DumpCommandsId = 0x16, //!< "DumpCommands" menu action
+ All = CopyId | PasteId | ClearId | SelectAllId | DumpCommandsId //!< all menu actions
};
public:
bool isSync() const;
void setIsSync( const bool );
+ bool isSuppressOutput() const;
+ void setIsSuppressOutput( const bool );
+
+ bool isShowBanner() const;
+ void setIsShowBanner( const bool );
+
void exec( const QString& );
void execAndWait( const QString& );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : PyConsole_Editor.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#include <PyInterp_Dispatcher.h>
#include <SUIT_Tools.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_FileValidator.h>
#include <QApplication>
#include <QClipboard>
#include <QTextBlock>
#include <QTextCursor>
#include <QTextDocument>
+#include <QTextStream>
static QString READY_PROMPT = ">>> ";
static QString DOTS_PROMPT = "... ";
#define PRINT_EVENT 65432
+
+class DumpCommandsFileValidator : public SUIT_FileValidator
+{
+ public:
+ DumpCommandsFileValidator( QWidget* parent = 0 ) : SUIT_FileValidator ( parent ) {};
+ virtual ~DumpCommandsFileValidator() {};
+ virtual bool canSave( const QString& file, bool permissions );
+};
+
+bool DumpCommandsFileValidator::canSave(const QString& file, bool permissions)
+{
+ QFileInfo fi( file );
+ if ( !QRegExp( "[A-Za-z_][A-Za-z0-9_]*" ).exactMatch( fi.completeBaseName() ) ) {
+ SUIT_MessageBox::critical( parent(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_FILE_NAME_BAD") );
+ return false;
+ }
+ return SUIT_FileValidator::canSave( file, permissions);
+}
+
/*!
\class ExecCommand
\brief Python command execution request.
\param sync if True the request is processed synchronously
*/
ExecCommand( PyInterp_Interp* theInterp,
- const QString& theCommand,
- PyConsole_Editor* theListener,
- bool sync = false )
+ const QString& theCommand,
+ PyConsole_Editor* theListener,
+ bool sync = false )
: PyInterp_LockRequest( theInterp, theListener, sync ),
myCommand( theCommand ), myState( PyInterp_Event::ES_OK )
{}
{
if ( myCommand != "" )
{
- int ret = getInterp()->run( myCommand.toLatin1() );
+ int ret = getInterp()->run( myCommand.toUtf8().data() );
if ( ret < 0 )
- myState = PyInterp_Event::ES_ERROR;
+ myState = PyInterp_Event::ES_ERROR;
else if ( ret > 0 )
- myState = PyInterp_Event::ES_INCOMPLETE;
+ myState = PyInterp_Event::ES_INCOMPLETE;
}
}
void staticCallback( void* data, char* c )
{
- QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c ) );
+ if(!((PyConsole_Editor*)data)->isSuppressOutput())
+ QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c ) );
}
/*!
\param theParent parent widget
*/
PyConsole_Editor::PyConsole_Editor( PyConsole_Interp* theInterp,
- QWidget* theParent )
+ QWidget* theParent )
: QTextEdit( theParent ),
myInterp( 0 ),
myCmdInHistory( -1 ),
myEventLoop( 0 ),
- myIsSync( false )
+ myShowBanner( true ),
+ myIsSync( false ),
+ myIsSuppressOutput( false )
{
QString fntSet( "" );
QFont aFont = SUIT_Tools::stringToFont( fntSet );
myIsSync = on;
}
+/*!
+ \brief Get suppress output flag value.
+
+ \sa setIsSuppressOutput()
+ \return \c true if python console output is suppressed.
+*/
+bool PyConsole_Editor::isSuppressOutput() const
+{
+ return myIsSuppressOutput;
+}
+
+/*!
+ \brief Set suppress output flag value.
+
+ In case if suppress output flag is true, the python
+ console output suppressed.
+
+ \param on suppress output flag
+*/
+void PyConsole_Editor::setIsSuppressOutput( const bool on )
+{
+ myIsSuppressOutput = on;
+}
+
+/*!
+ \brief Get 'show banner' flag value.
+
+ \sa setIsShowBanner()
+ \return \c true if python console shows banner
+*/
+bool PyConsole_Editor::isShowBanner() const
+{
+ return myShowBanner;
+}
+
+/*!
+ \brief Set 'show banner' flag value.
+
+ The banner is shown in the top of the python console window.
+
+ \sa isShowBanner()
+ \param on 'show banner' flag
+*/
+void PyConsole_Editor::setIsShowBanner( const bool on )
+{
+ if ( myShowBanner != on ) {
+ myShowBanner = on;
+ clear();
+ }
+}
+
+/*!
+ \brief Get size hint for the Python console window
+ \return size hint value
+*/
+QSize PyConsole_Editor::sizeHint() const
+{
+ QFontMetrics fm( font() );
+ int nbLines = ( isShowBanner() ? myBanner.split("\n").count() : 0 ) + 1;
+ QSize s(100, fm.lineSpacing()*nbLines);
+ return s;
+}
+
/*!
\brief Put the string \a str to the python editor.
\param str string to be put in the command line of the editor
\param newBlock if True, then the string is printed on a new line
*/
void PyConsole_Editor::addText( const QString& str,
- const bool newBlock )
+ const bool newBlock )
{
moveCursor( QTextCursor::End );
if ( newBlock )
}
// create new drop event and use it instead of the original
QDropEvent de( pos,
- event->possibleActions(),
- event->mimeData(),
- event->mouseButtons(),
- event->keyboardModifiers(),
- event->type() );
+ event->possibleActions(),
+ event->mimeData(),
+ event->mouseButtons(),
+ event->keyboardModifiers(),
+ event->type() );
QTextEdit::dropEvent( &de );
// accept the original event
event->acceptProposedAction();
{
if ( event->button() == Qt::LeftButton ) {
QTextEdit::mouseReleaseEvent( event );
- copy();
+ //copy();
}
else if ( event->button() == Qt::MidButton ) {
QString text;
// check if <Shift> is pressed
bool shftPressed = event->modifiers() & Qt::ShiftModifier;
- if ( aKey == Qt::Key_Escape || ctrlPressed && aKey == -1 ) {
+ if ( aKey == Qt::Key_Escape || ( ctrlPressed && aKey == -1 ) ) {
// process <Ctrl>+<Break> key-binding and <Escape> key: clear current command
myCommandBuffer.truncate( 0 );
myPrompt = READY_PROMPT;
// any printed key: just print it
{
if ( curLine < endLine || curCol < PROMPT_SIZE ) {
- moveCursor( QTextCursor::End );
+ moveCursor( QTextCursor::End );
}
QTextEdit::keyPressEvent( event );
break;
// - with <Ctrl>+<Shift> modifier keys pressed: scroll one row up
{
if ( ctrlPressed && shftPressed ) {
- int value = verticalScrollBar()->value();
- int spacing = fontMetrics().lineSpacing();
- verticalScrollBar()->setValue( value > spacing ? value-spacing : 0 );
+ int value = verticalScrollBar()->value();
+ int spacing = fontMetrics().lineSpacing();
+ verticalScrollBar()->setValue( value > spacing ? value-spacing : 0 );
}
else if ( shftPressed || ctrlPressed ) {
- if ( curLine > 0 )
- moveCursor( QTextCursor::Up,
- shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+ if ( curLine > 0 )
+ moveCursor( QTextCursor::Up,
+ shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
}
else {
- if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
- // set history browsing mode
- myCmdInHistory = myHistory.count();
- // remember current command
- QTextBlock par = document()->end().previous();
- myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
- }
- if ( myCmdInHistory > 0 ) {
- myCmdInHistory--;
- // get previous command in the history
- QString previousCommand = myHistory.at( myCmdInHistory );
- // print previous command
- moveCursor( QTextCursor::End );
- moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
- textCursor().removeSelectedText();
- addText( myPrompt + previousCommand );
- // move cursor to the end
- moveCursor( QTextCursor::End );
- }
+ if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
+ // set history browsing mode
+ myCmdInHistory = myHistory.count();
+ // remember current command
+ QTextBlock par = document()->end().previous();
+ myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
+ }
+ if ( myCmdInHistory > 0 ) {
+ myCmdInHistory--;
+ // get previous command in the history
+ QString previousCommand = myHistory.at( myCmdInHistory );
+ // print previous command
+ moveCursor( QTextCursor::End );
+ moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+ textCursor().removeSelectedText();
+ addText( myPrompt + previousCommand );
+ // move cursor to the end
+ moveCursor( QTextCursor::End );
+ }
}
break;
}
// - with <Ctrl>+<Shift> modifier keys pressed: scroll one row down
{
if ( ctrlPressed && shftPressed ) {
- int value = verticalScrollBar()->value();
- int maxval = verticalScrollBar()->maximum();
- int spacing = fontMetrics().lineSpacing();
- verticalScrollBar()->setValue( value+spacing < maxval ? value+spacing : maxval );
+ int value = verticalScrollBar()->value();
+ int maxval = verticalScrollBar()->maximum();
+ int spacing = fontMetrics().lineSpacing();
+ verticalScrollBar()->setValue( value+spacing < maxval ? value+spacing : maxval );
}
else if ( shftPressed || ctrlPressed) {
- if ( curLine < endLine )
- moveCursor( QTextCursor::Down,
- shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+ if ( curLine < endLine )
+ moveCursor( QTextCursor::Down,
+ shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
}
else {
- if ( myCmdInHistory >= 0 ) {
- // get next command in the history
- myCmdInHistory++;
- QString nextCommand;
- if ( myCmdInHistory < myHistory.count() ) {
- // next command in history
- nextCommand = myHistory.at( myCmdInHistory );
- }
- else {
- // end of history is reached
- // last printed command
- nextCommand = myCurrentCommand;
- // unset history browsing mode
- myCmdInHistory = -1;
- }
- // print next or current command
- moveCursor( QTextCursor::End );
- moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
- textCursor().removeSelectedText();
- addText( myPrompt + nextCommand );
- // move cursor to the end
- moveCursor( QTextCursor::End );
- }
+ if ( myCmdInHistory >= 0 ) {
+ // get next command in the history
+ myCmdInHistory++;
+ QString nextCommand;
+ if ( myCmdInHistory < myHistory.count() ) {
+ // next command in history
+ nextCommand = myHistory.at( myCmdInHistory );
+ }
+ else {
+ // end of history is reached
+ // last printed command
+ nextCommand = myCurrentCommand;
+ // unset history browsing mode
+ myCmdInHistory = -1;
+ }
+ // print next or current command
+ moveCursor( QTextCursor::End );
+ moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+ textCursor().removeSelectedText();
+ addText( myPrompt + nextCommand );
+ // move cursor to the end
+ moveCursor( QTextCursor::End );
+ }
}
break;
}
{
QString txt = textCursor().block().text();
if ( !shftPressed && isCommand( txt ) && curCol <= PROMPT_SIZE ) {
- moveCursor( QTextCursor::Up );
- moveCursor( QTextCursor::EndOfBlock );
+ moveCursor( QTextCursor::Up );
+ moveCursor( QTextCursor::EndOfBlock );
}
else {
- QTextEdit::keyPressEvent( event );
+ QTextEdit::keyPressEvent( event );
}
break;
}
{
QString txt = textCursor().block().text();
if ( !shftPressed ) {
- if ( curCol < txt.length() ) {
- if ( isCommand( txt ) && curCol < PROMPT_SIZE ) {
- cur.setPosition( cur.block().position() + PROMPT_SIZE );
- setTextCursor( cur );
- break;
- }
- }
- else {
- if ( curLine < endLine && isCommand( textCursor().block().next().text() ) ) {
- cur.setPosition( cur.position() + PROMPT_SIZE+1 );
- setTextCursor( cur );
- horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
- break;
- }
- }
+ if ( curCol < txt.length() ) {
+ if ( isCommand( txt ) && curCol < PROMPT_SIZE ) {
+ cur.setPosition( cur.block().position() + PROMPT_SIZE );
+ setTextCursor( cur );
+ break;
+ }
+ }
+ else {
+ if ( curLine < endLine && isCommand( textCursor().block().next().text() ) ) {
+ cur.setPosition( cur.position() + PROMPT_SIZE+1 );
+ setTextCursor( cur );
+ horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+ break;
+ }
+ }
}
QTextEdit::keyPressEvent( event );
break;
// - with <Ctrl>+<Shift> modifier keys pressed: scroll one page up
{
if ( ctrlPressed && shftPressed ) {
- verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub);
+ verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepSub);
}
else if ( shftPressed || ctrlPressed ) {
- bool moved = false;
- qreal lastY = cursorRect( cur ).top();
- qreal distance = 0;
- // move using movePosition to keep the cursor's x
- do {
- qreal y = cursorRect( cur ).top();
- distance += qAbs( y - lastY );
- lastY = y;
- moved = cur.movePosition( QTextCursor::Up,
- shftPressed ? QTextCursor::KeepAnchor :
- QTextCursor::MoveAnchor );
- } while ( moved && distance < viewport()->height() );
- if ( moved ) {
- cur.movePosition( QTextCursor::Down,
- shftPressed ? QTextCursor::KeepAnchor :
- QTextCursor::MoveAnchor );
- verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
- }
- setTextCursor( cur );
+ bool moved = false;
+ qreal lastY = cursorRect( cur ).top();
+ qreal distance = 0;
+ // move using movePosition to keep the cursor's x
+ do {
+ qreal y = cursorRect( cur ).top();
+ distance += qAbs( y - lastY );
+ lastY = y;
+ moved = cur.movePosition( QTextCursor::Up,
+ shftPressed ? QTextCursor::KeepAnchor :
+ QTextCursor::MoveAnchor );
+ } while ( moved && distance < viewport()->height() );
+ if ( moved ) {
+ cur.movePosition( QTextCursor::Down,
+ shftPressed ? QTextCursor::KeepAnchor :
+ QTextCursor::MoveAnchor );
+ verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
+ }
+ setTextCursor( cur );
}
else {
- if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
- // set history browsing mode
- myCmdInHistory = myHistory.count();
- // remember current command
- QTextBlock par = document()->end().previous();
- myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
- }
- if ( myCmdInHistory > 0 ) {
- myCmdInHistory = 0;
- // get very first command in the history
- QString firstCommand = myHistory.at( myCmdInHistory );
- // print first command
- moveCursor( QTextCursor::End );
- moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
- textCursor().removeSelectedText();
- addText( myPrompt + firstCommand );
- // move cursor to the end
- moveCursor( QTextCursor::End );
- }
+ if ( myCmdInHistory < 0 && myHistory.count() > 0 ) {
+ // set history browsing mode
+ myCmdInHistory = myHistory.count();
+ // remember current command
+ QTextBlock par = document()->end().previous();
+ myCurrentCommand = par.text().remove( 0, PROMPT_SIZE );
+ }
+ if ( myCmdInHistory > 0 ) {
+ myCmdInHistory = 0;
+ // get very first command in the history
+ QString firstCommand = myHistory.at( myCmdInHistory );
+ // print first command
+ moveCursor( QTextCursor::End );
+ moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+ textCursor().removeSelectedText();
+ addText( myPrompt + firstCommand );
+ // move cursor to the end
+ moveCursor( QTextCursor::End );
+ }
}
break;
}
// - with <Ctrl>+<Shift> modifier keys pressed: scroll one page down
{
if ( ctrlPressed && shftPressed ) {
- verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd);
+ verticalScrollBar()->triggerAction(QAbstractSlider::SliderPageStepAdd);
}
else if ( shftPressed || ctrlPressed ) {
- bool moved = false;
- qreal lastY = cursorRect( cur ).top();
- qreal distance = 0;
- // move using movePosition to keep the cursor's x
- do {
- qreal y = cursorRect( cur ).top();
- distance += qAbs( y - lastY );
- lastY = y;
- moved = cur.movePosition( QTextCursor::Down,
- shftPressed ? QTextCursor::KeepAnchor :
- QTextCursor::MoveAnchor );
- } while ( moved && distance < viewport()->height() );
- if ( moved ) {
- cur.movePosition( QTextCursor::Up,
- shftPressed ? QTextCursor::KeepAnchor :
- QTextCursor::MoveAnchor );
- verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
- }
- setTextCursor( cur );
+ bool moved = false;
+ qreal lastY = cursorRect( cur ).top();
+ qreal distance = 0;
+ // move using movePosition to keep the cursor's x
+ do {
+ qreal y = cursorRect( cur ).top();
+ distance += qAbs( y - lastY );
+ lastY = y;
+ moved = cur.movePosition( QTextCursor::Down,
+ shftPressed ? QTextCursor::KeepAnchor :
+ QTextCursor::MoveAnchor );
+ } while ( moved && distance < viewport()->height() );
+ if ( moved ) {
+ cur.movePosition( QTextCursor::Up,
+ shftPressed ? QTextCursor::KeepAnchor :
+ QTextCursor::MoveAnchor );
+ verticalScrollBar()->triggerAction( QAbstractSlider::SliderPageStepSub );
+ }
+ setTextCursor( cur );
}
else {
- if ( myCmdInHistory >= 0 ) {
- // unset history browsing mode
- myCmdInHistory = -1;
- // print current command
- moveCursor( QTextCursor::End );
- moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
- textCursor().removeSelectedText();
- addText( myPrompt + myCurrentCommand );
- // move cursor to the end
- moveCursor( QTextCursor::End );
- }
+ if ( myCmdInHistory >= 0 ) {
+ // unset history browsing mode
+ myCmdInHistory = -1;
+ // print current command
+ moveCursor( QTextCursor::End );
+ moveCursor( QTextCursor::StartOfBlock, QTextCursor::KeepAnchor );
+ textCursor().removeSelectedText();
+ addText( myPrompt + myCurrentCommand );
+ // move cursor to the end
+ moveCursor( QTextCursor::End );
+ }
}
break;
}
// - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very first symbol with selection
{
if ( ctrlPressed ) {
- moveCursor( QTextCursor::Start,
- shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+ moveCursor( QTextCursor::Start,
+ shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
}
else {
- QString txt = textCursor().block().text();
- if ( isCommand( txt ) ) {
- if ( shftPressed ) {
- if ( curCol > PROMPT_SIZE ) {
- cur.movePosition( QTextCursor::StartOfLine, QTextCursor::KeepAnchor );
- cur.movePosition( QTextCursor::Right, QTextCursor::KeepAnchor, PROMPT_SIZE );
- }
- }
- else {
- cur.movePosition( QTextCursor::StartOfLine );
- cur.movePosition( QTextCursor::Right, QTextCursor::MoveAnchor, PROMPT_SIZE );
- }
- setTextCursor( cur );
- }
- else {
- moveCursor( QTextCursor::StartOfBlock,
- shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
- }
- horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+ QString txt = textCursor().block().text();
+ if ( isCommand( txt ) ) {
+ if ( shftPressed ) {
+ if ( curCol > PROMPT_SIZE ) {
+ cur.movePosition( QTextCursor::StartOfLine, QTextCursor::KeepAnchor );
+ cur.movePosition( QTextCursor::Right, QTextCursor::KeepAnchor, PROMPT_SIZE );
+ }
+ }
+ else {
+ cur.movePosition( QTextCursor::StartOfLine );
+ cur.movePosition( QTextCursor::Right, QTextCursor::MoveAnchor, PROMPT_SIZE );
+ }
+ setTextCursor( cur );
+ }
+ else {
+ moveCursor( QTextCursor::StartOfBlock,
+ shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+ }
+ horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
}
break;
}
// - with <Ctrl>+<Shift> modifier keys pressed: move cursor to the very last symbol with selection
{
moveCursor( ctrlPressed ? QTextCursor::End : QTextCursor::EndOfBlock,
- shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
+ shftPressed ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor );
break;
}
case Qt::Key_Backspace :
// works only for last (command) line
{
if ( cur.hasSelection() ) {
- cut();
+ cut();
}
else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE ) {
- if ( shftPressed ) {
- moveCursor( QTextCursor::PreviousWord, QTextCursor::KeepAnchor );
- textCursor().removeSelectedText();
- }
- else if ( ctrlPressed ) {
- cur.setPosition( document()->end().previous().position() + PROMPT_SIZE,
- QTextCursor::KeepAnchor );
- setTextCursor( cur );
- textCursor().removeSelectedText();
- }
- else {
- QTextEdit::keyPressEvent( event );
- }
+ if ( shftPressed ) {
+ moveCursor( QTextCursor::PreviousWord, QTextCursor::KeepAnchor );
+ textCursor().removeSelectedText();
+ }
+ else if ( ctrlPressed ) {
+ cur.setPosition( document()->end().previous().position() + PROMPT_SIZE,
+ QTextCursor::KeepAnchor );
+ setTextCursor( cur );
+ textCursor().removeSelectedText();
+ }
+ else {
+ QTextEdit::keyPressEvent( event );
+ }
}
else {
- cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
- setTextCursor( cur );
- horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+ cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
+ setTextCursor( cur );
+ horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
}
break;
}
// works only for last (command) line
{
if ( cur.hasSelection() ) {
- cut();
+ cut();
}
else if ( cur.position() > document()->end().previous().position() + PROMPT_SIZE-1 ) {
- if ( shftPressed ) {
- moveCursor( QTextCursor::NextWord, QTextCursor::KeepAnchor );
- textCursor().removeSelectedText();
- }
- else if ( ctrlPressed ) {
- moveCursor( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor );
- textCursor().removeSelectedText();
- }
- else {
- QTextEdit::keyPressEvent( event );
- }
+ if ( shftPressed ) {
+ moveCursor( QTextCursor::NextWord, QTextCursor::KeepAnchor );
+ textCursor().removeSelectedText();
+ }
+ else if ( ctrlPressed ) {
+ moveCursor( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor );
+ textCursor().removeSelectedText();
+ }
+ else {
+ QTextEdit::keyPressEvent( event );
+ }
}
else {
- cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
- setTextCursor( cur );
- horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
+ cur.setPosition( document()->end().previous().position() + PROMPT_SIZE );
+ setTextCursor( cur );
+ horizontalScrollBar()->setValue( horizontalScrollBar()->minimum() );
}
break;
}
// - with <Shift> modifier key pressed: paste() to the command line
{
if ( ctrlPressed ) {
- copy();
+ copy();
}
else if ( shftPressed ) {
- paste();
+ paste();
}
else
- QTextEdit::keyPressEvent( event );
+ QTextEdit::keyPressEvent( event );
break;
}
}
if ( myInterp ) {
// print banner
myBanner = myInterp->getbanner().c_str();
- addText( myBanner );
+ if ( isShowBanner() )
+ addText( myBanner );
// clear command buffer
myCommandBuffer.truncate(0);
// unset read-only state
viewport()->unsetCursor();
// stop event loop (if running)
if( myEventLoop)
- myEventLoop->exit();
+ myEventLoop->exit();
}
else {
// clear contents
void PyConsole_Editor::clear()
{
QTextEdit::clear();
- addText( myBanner );
+ if ( isShowBanner() )
+ addText( myBanner );
myPrompt = READY_PROMPT;
addText( myPrompt );
}
+
+/*!
+ \brief "Dump commands" operation.
+ */
+void PyConsole_Editor::dump()
+{
+ QStringList aFilters;
+ aFilters.append( tr( "PYTHON_FILES_FILTER" ) );
+
+ QString fileName = SUIT_FileDlg::getFileName( this, QString(),
+ aFilters, tr( "TOT_DUMP_PYCOMMANDS" ),
+ false, true, new DumpCommandsFileValidator( this ) );
+ if ( fileName != "" ) {
+ QFile file( fileName );
+ if ( !file.open( QFile::WriteOnly ) )
+ return;
+
+ QTextStream out (&file);
+
+ for( int i=0; i<myHistory.count(); i++ ) {
+ out<<myHistory[i]<<endl;
+ }
+ file.close();
+ }
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : PyConsole_Editor.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
bool isSync() const;
void setIsSync( const bool );
+ bool isSuppressOutput() const;
+ void setIsSuppressOutput(const bool);
+
+ bool isShowBanner() const;
+ void setIsShowBanner( const bool );
+
+ virtual QSize sizeHint() const;
+
protected:
virtual void dropEvent( QDropEvent* event );
virtual void mouseReleaseEvent( QMouseEvent* event );
void clear();
void handleReturn();
void onPyInterpChanged( PyConsole_Interp* );
+ void dump();
private:
PyConsole_Interp* myInterp; //!< python interpreter
- QString myCommandBuffer; //!< python comman buffer
+ QString myCommandBuffer; //!< python command buffer
QString myCurrentCommand; //!< currently being printed command
QString myPrompt; //!< current command line prompt
int myCmdInHistory; //!< current history command index
QStringList myHistory; //!< commands history buffer
QEventLoop* myEventLoop; //!< internal event loop
QString myBanner; //!< current banner
+ bool myShowBanner; //!< 'show banner' flag
QStringList myQueue; //!< python commands queue
bool myIsSync; //!< synchronous mode flag
+ bool myIsSuppressOutput; //!< suppress output flag
};
#endif // PYCONSOLE_EDITOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : PyConsole_Interp.cxx
// Author : Nicolas REJNERI
/*!
\brief Initialize internal Python interpreter state.
+
+ When calling initState the GIL is not held
+ It must not be held on exit
+
\return \c true on success
*/
bool PyConsole_Interp::initState()
{
- // The GIL is acquired and will be held on initState output
- // It is the caller responsability to release the lock if needed
PyEval_AcquireLock();
_tstate = Py_NewInterpreter(); // create an interpreter and save current state
PySys_SetArgv(PyInterp_Interp::_argc,PyInterp_Interp::_argv); // initialize sys.argv
\brief Initialize python interpeter context.
The GIL is assumed to be held.
- It is the caller responsability caller to acquire the GIL.
- It will still be held on initContext() exit.
+ It is the caller responsability to acquire the GIL.
+ It must still be held on initContext() exit.
\return \c true on success
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : PyConsole_Interp.h
// Author : Nicolas REJNERI
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1">
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>PyConsole_Console</name>
<message>
<source>EDIT_SELECTALL_CMD</source>
<translation>Select &All</translation>
</message>
+ <message>
+ <source>EDIT_DUMPCOMMANDS_CMD</source>
+ <translation>D&ump commands</translation>
+ </message>
+</context>
+<context>
+ <name>PyConsole_Editor</name>
+ <message>
+ <source>TOT_DUMP_PYCOMMANDS</source>
+ <translation>Dump commands</translation>
+ </message>
+ <message>
+ <source>PYTHON_FILES_FILTER</source>
+ <translation>PYTHON Files (*.py)</translation>
+ </message>
</context>
</TS>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME PyInterp : implementation of base thread-safe Python services
# File : Makefile.in
# Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyInterp.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
// ========================================================
// set dllexport type for Win platform
#ifdef WIN32
-# ifdef PYINTERP_EXPORTS
+# if defined PYINTERP_EXPORTS || defined PyInterp_EXPORTS
# define PYINTERP_EXPORT __declspec(dllexport)
# else
# define PYINTERP_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = PyInterp
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHONVER=2.4
-PYTHONHOME=$$(PYTHONHOME)
-PYTHONINC=$${PYTHONHOME}/include/python$${PYTHONVER}
-PYTHONLIB=$${PYTHONHOME}/lib
-
-INCLUDEPATH += ../../include $${PYTHONINC}
-unix:LIBS += -L$${PYTHONLIB} -lpython$${PYTHONVER}
-win32:LIBS += /LIBPATH:$${PYTHONLIB}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += PYINTERP_EXPORTS
-
-HEADERS = PyInterp.h
-HEADERS += PyInterp_Dispatcher.h
-HEADERS += PyInterp_Watcher.h
-HEADERS += PyInterp_Interp.h
-
-SOURCES = PyInterp_Dispatcher.cxx
-SOURCES += PyInterp_Interp.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyInterp_Dispatcher.cxx
// Author : Sergey ANIKIN, OCC
// Module : GUI
}
};
-using namespace std;
-
PyInterp_Dispatcher* PyInterp_Dispatcher::myInstance = 0;
void PyInterp_Request::process()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyInterp_Dispatcher.h
// Author : Sergey Anikin, OCC
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyInterp_Interp.cxx
// Author : Christian CAREMOLI, Paul RASCLE, EDF
// Module : SALOME
//
#include "PyInterp_Interp.h" // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+#include <pythread.h>
#include <cStringIO.h>
#include <structmember.h>
#include <string>
#include <vector>
+#include <map>
#include <iostream>
#define TOP_HISTORY_PY "--- top of history ---"
#define BEGIN_HISTORY_PY "--- begin of history ---"
+// a map to store python thread states that have been created for a given system thread (key=thread id,value=thread state)
+std::map<long,PyThreadState*> currentThreadMap;
+
/*!
\class PyLockWrapper
\brief Python GIL wrapper.
}
/*!
- \brief Desstructor. Automatically releases GIL.
+ \brief Destructor. Automatically releases GIL.
*/
PyLockWrapper::~PyLockWrapper()
{
*/
PyLockWrapper PyInterp_Interp::GetLockWrapper()
{
- return _tstate;
+ if (_tstate->interp == PyInterp_Interp::_interp)
+ return _tstate;
+
+ // If we are here, we have a secondary python interpreter. Try to get a thread state synchronized with the system thread
+ long currentThreadid=PyThread_get_thread_ident(); // the system thread id
+ PyThreadState* theThreadState;
+ if(currentThreadMap.count(currentThreadid) != 0)
+ {
+ //a thread state exists for this thread id
+ PyThreadState* oldThreadState=currentThreadMap[currentThreadid];
+ if(_tstate->interp ==oldThreadState->interp)
+ {
+ //The old thread state has the same python interpreter as this one : reuse the threadstate
+ theThreadState=oldThreadState;
+ }
+ else
+ {
+ //The old thread state has not the same python interpreter as this one : delete the old threadstate and create a new one
+ PyEval_AcquireLock();
+ PyThreadState_Clear(oldThreadState);
+ PyThreadState_Delete(oldThreadState);
+ PyEval_ReleaseLock();
+ theThreadState=PyThreadState_New(_tstate->interp);
+ currentThreadMap[currentThreadid]=theThreadState;
+ }
+ }
+ else
+ {
+ // no old thread state for this thread id : create a new one
+ theThreadState=PyThreadState_New(_tstate->interp);
+ currentThreadMap[currentThreadid]=theThreadState;
+ }
+ return theThreadState;
}
/*
return Py_None;
}
+static PyObject*
+PyStdOut_flush(PyStdOut *self)
+{
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static PyMethodDef PyStdOut_methods[] = {
- {"write", (PyCFunction)PyStdOut_write, METH_VARARGS,
- PyDoc_STR("write(string) -> None")},
+ {"write", (PyCFunction)PyStdOut_write, METH_VARARGS, PyDoc_STR("write(string) -> None")},
+ {"flush", (PyCFunction)PyStdOut_flush, METH_NOARGS, PyDoc_STR("flush() -> None")},
{NULL, NULL} /* sentinel */
};
static PyMemberDef PyStdOut_memberlist[] = {
- {"softspace", T_INT, offsetof(PyStdOut, softspace), 0,
- "flag indicating that a space needs to be printed; used by print"},
+ {(char*)"softspace", T_INT, offsetof(PyStdOut, softspace), 0,
+ (char*)"flag indicating that a space needs to be printed; used by print"},
{NULL} /* Sentinel */
};
*/
int PyInterp_Interp::_argc = 1;
-char* PyInterp_Interp::_argv[] = {""};
+char* PyInterp_Interp::_argv[] = {(char*)""};
PyObject* PyInterp_Interp::builtinmodule = NULL;
PyThreadState* PyInterp_Interp::_gtstate = NULL;
PyInterpreterState* PyInterp_Interp::_interp = NULL;
initState();
- PyLockWrapper aLock = GetLockWrapper();
+ PyEval_AcquireThread(_tstate);
initContext();
PyObjWrapper m(PyImport_ImportModule("codeop"));
if(!m) {
PyErr_Print();
+ PyEval_ReleaseThread(_tstate);
return;
}
// All the initRun outputs are redirected to the standard output (console)
initRun();
+ PyEval_ReleaseThread(_tstate);
}
/*!
PyErr_Print();
return -1;
}
- PyObjWrapper v(PyObject_CallMethod(m,"compile_command","s",command));
+ PyObjWrapper v(PyObject_CallMethod(m,(char*)"compile_command",(char*)"s",command));
if(!v) {
// Error encountered. It should be SyntaxError,
//so we don't write out traceback
//PyLockWrapper aLock(_tstate); // san - lock is centralized now
// Reset redirected outputs before treatment
- PySys_SetObject("stderr",_verr);
- PySys_SetObject("stdout",_vout);
+ PySys_SetObject((char*)"stderr",_verr);
+ PySys_SetObject((char*)"stdout",_vout);
int ier = compile_command(command,_g);
// Outputs are redirected on standards outputs (console)
- PySys_SetObject("stdout",PySys_GetObject("__stdout__"));
- PySys_SetObject("stderr",PySys_GetObject("__stderr__"));
+ PySys_SetObject((char*)"stdout",PySys_GetObject((char*)"__stdout__"));
+ PySys_SetObject((char*)"stderr",PySys_GetObject((char*)"__stderr__"));
return ier;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyInterp_Interp.h
// Author : Christian CAREMOLI, Paul RASCLE, EDF
// Module : SALOME
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : PyInterp_Watcher.h
// Author : Sergey Anikin, OCC
// Module : SALOME
// Private class that keeps track of destructions of request listeners
class PYINTERP_EXPORT PyInterp_Watcher : public QObject
-{
+{
Q_OBJECT
public:
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Alexander SOLOVYOV (OCN)
# Module : QDS
-# $Header: /home/server/cvs/GUI/GUI_SRC/src/QDS/Makefile.in
+# $Header$
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
nodist_libQDS_la_SOURCES = $(MOC_FILES)
-nodist_salomeres_DATA = QDS_msg_en.qm
+nodist_salomeres_DATA = QDS_msg_en.qm QDS_msg_fr.qm
libQDS_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) \
-I$(srcdir)/../Qtx -I$(srcdir)/../DDS
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS.h"
#include "QDS_Datum.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_H
#define QDS_H
#ifdef WIN32
-#ifdef QDS_EXPORTS
+#if defined QDS_EXPORTS
#define QDS_EXPORT __declspec(dllexport)
#else
#define QDS_EXPORT __declspec(dllimport)
//! Enum describes bit flags of the Qt datum view and behaviour
typedef enum
{
- None = 0x00, //!< Non specified any flags (Default behaviour)
- Label = 0x01, //!< Create subwidget for datum label
- Control = 0x02, //!< Create subwidget for datum input control
- Units = 0x04, //!< Create subwidget for datum units of measure
- NotFormat = 0x08, //!< Don't format initial value
- NotAccel = 0x10, //!< Not support accelerators in datum label
- UnitsWithLabel = 0x20, //!< Display units of measure in label like "<label_text> (<units_text>) instead separate text"
+ None = 0x00, //!< Non specified any flags (Default behaviour)
+ Label = 0x01, //!< Create subwidget for datum label
+ Control = 0x02, //!< Create subwidget for datum input control
+ Units = 0x04, //!< Create subwidget for datum units of measure
+ NotFormat = 0x08, //!< Don't format initial value
+ NotAccel = 0x10, //!< Not support accelerators in datum label
+ NotConvert = 0x20, //!< Don't convert numeric value
+ UnitsWithLabel = 0x40, //!< Display units of measure in label like "<label_text> (<units_text>) instead separate text"
All = Label | Control | Units //!< Create all subwidgets
} DatumFlags;
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = QDS
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} ../Qtx ../DDS
-LIBS += -L../../lib -lqtx -lDDS $${CAS_KERNEL}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += QDS_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = QDS.h
-HEADERS += QDS_CheckBox.h
-HEADERS += QDS_ComboBox.h
-HEADERS += QDS_Datum.h
-HEADERS += QDS_LineEdit.h
-HEADERS += QDS_SpinBox.h
-HEADERS += QDS_SpinBoxDbl.h
-HEADERS += QDS_TextEdit.h
-HEADERS += QDS_Validator.h
-HEADERS += QDS_RadioBox.h
-#HEADERS += QDS_Table.h
-
-SOURCES = QDS.cxx
-SOURCES += QDS_CheckBox.cxx
-SOURCES += QDS_ComboBox.cxx
-SOURCES += QDS_Datum.cxx
-SOURCES += QDS_LineEdit.cxx
-SOURCES += QDS_SpinBox.cxx
-SOURCES += QDS_SpinBoxDbl.cxx
-SOURCES += QDS_TextEdit.cxx
-SOURCES += QDS_Validator.cxx
-SOURCES += QDS_RadioBox.cxx
-#SOURCES += QDS_Table.cxx
-
-TRANSLATIONS = resources/QDS_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_CheckBox.h"
#include <QCheckBox>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_CHECKBOX_H
#define QDS_CHECKBOX_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_ComboBox.h"
#include <QtxComboBox.h>
myUserIds = ids;
myUserNames = names;
- unitSystemChanged( "" );
+ //unitSystemChanged( "" );
}
/*!
*/
void QDS_ComboBox::reset()
{
- int id = -1;
QString aDefValue = defaultValue();
if ( !aDefValue.isEmpty() )
setString( aDefValue );
else if ( txt.isEmpty() )
{
if ( !cb->isEditable() )
- cb->setItemText( cb->currentIndex(), txt );
+ cb->setCleared( true );
else
cb->lineEdit()->setText( txt );
}
- if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentIndex() ) )
+ if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentIndex() ) || isClear != cb->isCleared() )
{
onParamChanged();
QString str = getString();
void QDS_ComboBox::onActivated( int idx )
{
if ( comboBox() )
- comboBox()->setCurrentIndex( comboBox()->currentIndex() );
+ {
+ int ind = comboBox()->currentIndex();
+ comboBox()->setCurrentIndex( -1 );
+ comboBox()->setCurrentIndex( ind );
+ }
int id = getId( idx );
if ( id != -1 )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_COMBOBOX_H
#define QDS_COMBOBOX_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_Datum.h"
#include <QLayout>
if( labStr.isNull() )
labStr = toQString( myDicItem->GetId() );
}
- if( myTr )
+ if( myTr && labStr.length()>0 )
{
QString dest = QApplication::translate( "QDS", labStr.toLatin1().constData() );
if( labStr != dest )
else
{
res = getString().toDouble();
- if ( !myDicItem.IsNull() )
+ if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
res = myDicItem->ToSI( res );
}
else
{
double val = getString().toDouble();
- if ( !myDicItem.IsNull() )
+ if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
res = (int)myDicItem->ToSI( val );
}
mySourceValue = QString().setNum( num, 'g', 16 );
double val = num;
- if ( !myDicItem.IsNull() )
+ if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
val = myDicItem->FromSI( val );
QString aStr = format( ( flags() & NotFormat ) ? (QString) "" : format(), type(), val );
mySourceValue = QString().setNum( num );
double val = num;
- if ( !myDicItem.IsNull() )
+ if ( !myDicItem.IsNull() && !( flags() & NotConvert ) )
val = myDicItem->FromSI( val );
QString aStr = format( ( flags() & NotFormat ) ? (QString) "" : format(), type(), val );
bool QDS_Datum::validate( const QString& txt ) const
{
if ( type() == DDS_DicItem::Unknown ||
- type() == DDS_DicItem::String && isDoubleFormat( format() ) )
+ ( type() == DDS_DicItem::String && isDoubleFormat( format() ) ) )
return true;
QValidator* aValidator = validator( true );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_DATUM_H
#define QDS_DATUM_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_LineEdit.h"
#include <QLineEdit>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_LINEEDIT_H
#define QDS_LINEEDIT_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_RadioBox.h"
#include <TColStd_HArray1OfInteger.hxx>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_RADIOBOX_H
#define QDS_RADIOBOX_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_SpinBox.h"
#include <QtxIntSpinBox.h>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_SPINBOX_H
#define QDS_SPINBOX_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_SpinBoxDbl.h"
#include <QtxDoubleSpinBox.h>
QtxDoubleSpinBox* sb = spinBox();
if ( sb && !sb->isCleared() )
{
- bool hasFocus = sb->hasFocus();
+ /*bool hasFocus = sb->hasFocus();
if ( hasFocus )
- sb->clearFocus();
+ sb->clearFocus();*/
res = sb->text();
if ( !sb->suffix().isEmpty() )
if ( !sb->prefix().isEmpty() )
res.remove( res.indexOf( sb->prefix() ), sb->prefix().length() );
- if ( hasFocus )
- sb->setFocus();
+ /*if ( hasFocus )
+ sb->setFocus();*/
}
return res;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_PINBOXDBL_H
#define QDS_PINBOXDBL_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_Table.h"
class QDS_Table::DeleteFilter : public QObject
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_TABLE_H
#define QDS_TABLE_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_TextEdit.h"
#include <QTextEdit>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_TEXTEEDIT_H
#define QDS_TEXTEEDIT_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QDS_Validator.h"
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QDS_VALIDATOR_H
#define QDS_VALIDATOR_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-# -------------------------------------------------------------
-
-msgid "QDS_Datum::DATA_ERR_TITLE"
-msgstr "Incorrect parameter value"
-
-msgid "QDS_Datum::DATA_INCORRECT_VALUE"
-msgstr "Value of parameter \"%1\" is incorrect."
-
-msgid "QDS_Datum::DATA_INPUT_VALUE"
-msgstr "Please, input correct value."
-
-msgid "QDS_Datum::DATA_SHOULD_BE_VALUE"
-msgstr "Should be%1 value"
-
-msgid "QDS_Datum::DATA_FLOAT"
-msgstr " real"
-
-msgid "QDS_Datum::DATA_INTEGER"
-msgstr " integer"
-
-msgid "QDS_Datum::DATA_STRING"
-msgstr " non-empty string"
-
-msgid "QDS_Datum::DATA_NON_EMPTY"
-msgstr " non-empty"
-
-msgid "QDS_Datum::DATA_MIN_LIMIT"
-msgstr " is greater than %1"
-
-msgid "QDS_Datum::DATA_MAX_LIMIT"
-msgstr " is less than %1"
-
-msgid "QDS_Datum::DATA_RANGE"
-msgstr " in range [%1, %2]"
-
-# -------------------------------------------------------------
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>QDS_Datum</name>
<message>
</message>
<message>
<source>DATA_MIN_LIMIT</source>
- <translation> is greater than %1</translation>
+ <translation> greater than %1</translation>
</message>
<message>
<source>DATA_FLOAT</source>
</message>
<message>
<source>DATA_SHOULD_BE_VALUE</source>
- <translation>Should be%1 value</translation>
+ <translation>Should be %1 value</translation>
</message>
<message>
<source>DATA_INTEGER</source>
</message>
<message>
<source>DATA_MAX_LIMIT</source>
- <translation> is less than %1</translation>
+ <translation> less than %1</translation>
</message>
<message>
<source>DATA_INPUT_VALUE</source>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : suit
QtxActionMgr.h \
QtxActionSet.h \
QtxActionToolMgr.h \
+ QtxBackgroundTool.h \
+ QtxBiColorTool.h \
QtxColorButton.h \
QtxColorScale.h \
QtxComboBox.h \
QtxResourceMgr.h \
QtxRubberBand.h \
QtxSearchTool.h \
+ QtxShortcutEdit.h \
QtxSplash.h \
QtxToolBar.h \
QtxToolTip.h \
QtxWorkspace.h \
QtxWorkspaceAction.h \
QtxWorkstack.h \
- QtxWorkstackAction.h
+ QtxWorkstackAction.h \
+ QtxWebBrowser.h
#VSR: not yet migrated to Qt4 files
# \
QtxActionMgr.cxx \
QtxActionSet.cxx \
QtxActionToolMgr.cxx \
+ QtxBackgroundTool.cxx \
+ QtxBiColorTool.cxx \
QtxColorButton.cxx \
QtxColorScale.cxx \
QtxComboBox.cxx \
QtxResourceMgr.cxx \
QtxRubberBand.cxx \
QtxSearchTool.cxx \
+ QtxShortcutEdit.cxx \
QtxSplash.cxx \
QtxToolBar.cxx \
QtxToolTip.cxx \
QtxWorkspace.cxx \
QtxWorkspaceAction.cxx \
QtxWorkstack.cxx \
- QtxWorkstackAction.cxx
+ QtxWorkstackAction.cxx \
+ QtxWebBrowser.cxx
#VSR: not yet migrated to Qt4 files
# \
QtxActionMgr_moc.cxx \
QtxActionSet_moc.cxx \
QtxActionToolMgr_moc.cxx \
+ QtxBackgroundTool_moc.cxx \
+ QtxBiColorTool_moc.cxx \
QtxColorButton_moc.cxx \
QtxColorScale_moc.cxx \
QtxComboBox_moc.cxx \
QtxPopupMgr_moc.cxx \
QtxRubberBand_moc.cxx \
QtxSearchTool_moc.cxx \
+ QtxShortcutEdit_moc.cxx \
QtxSplash_moc.cxx \
QtxToolBar_moc.cxx \
QtxToolTip_moc.cxx \
QtxWorkspace_moc.cxx \
QtxWorkspaceAction_moc.cxx \
QtxWorkstack_moc.cxx \
- QtxWorkstackAction_moc.cxx
+ QtxWorkstackAction_moc.cxx \
+ QtxWebBrowser_moc.cxx
#VSR: not yet migrated to Qt4 files
# \
nodist_libqtx_la_SOURCES = $(MOC_FILES)
libqtx_la_CPPFLAGS = $(QT_INCLUDES)
-libqtx_la_LDFLAGS = $(QT_MT_LIBS)
+libqtx_la_LDFLAGS = $(QT_MT_LIBS) $(OGL_LIBS)
+
+nodist_salomeres_DATA = \
+ Qtx_msg_fr.qm
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: Qtx.cxx
// Author: Sergey TELKOV
//
#include <QCompleter>
#include <QApplication>
#include <QDesktopWidget>
-#include <QLinearGradient>
-#include <QRadialGradient>
-#include <QConicalGradient>
+#include <QtDebug>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <clocale>
+
+#define BICOLOR_CHANGE_HUE
+
+/*!
+ \brief Auxiliary function converting string \a str to the integer value.
+ Parameter \a defVal specifies default value that is returned if conversion can't be done.
+ Parameters \a minVal and \a maxVal limit the resulting value.
+ \param str string being converted
+ \param defVal default value
+ \param minVal minimum allowed value
+ \param maxVal maximum allowed value
+ \return integer value obtained from the string
+ \internal
+*/
+static int stringToInt( const QString& str, int defVal, int minVal, int maxVal )
+{
+ bool ok;
+ int v = str.toInt( &ok );
+ if ( !ok ) v = defVal;
+ return qMin( qMax( v, minVal ), maxVal );
+}
/*!
\class Qtx
*/
QString Qtx::tmpDir()
{
- char* tmpdir = ::getenv( "TEMP" );
+ const char* tmpdir = ::getenv( "TEMP" );
if ( !tmpdir )
tmpdir = ::getenv ( "TMP" );
if ( !tmpdir )
{
QFileInfo inf = *it;
if ( inf.fileName() == "." || inf.fileName() == ".." )
- continue;
+ continue;
stat = stat && rmDir( inf.absoluteFilePath() );
}
stat = stat && aDir.rmdir( thePath );
if ( nbwri != outcnt )
{
::fclose( src );
- ::fclose( tgt );
+ ::fclose( tgt );
QFile::remove( QString( temp ) );
return false;
}
return cmp;
}
+/*!
+ \brief Parse given string to retrieve environment variable.
+
+ Looks through the string for the patterns: ${name} or $(name) or %name%.
+ If string contains variable satisfying any pattern, the variable name
+ is returned, start index of the variable is returned in the \a start parameter,
+ and length of the variable is returned in the \a len parameter.
+
+ \param str string being processed
+ \param start if variable is found, this parameter contains its starting
+ position in the \a str
+ \param len if variable is found, this parameter contains its length
+ \return first found variable or null QString if there is no ones
+*/
+QString Qtx::findEnvVar( const QString& str, int& start, int& len )
+{
+ QString varName;
+ len = 0;
+
+ QRegExp rx( "(^\\$\\{|[^\\$]\\$\\{)([a-zA-Z]+[a-zA-Z0-9_]*)(\\})|(^\\$\\(|[^\\$]\\$\\()([a-zA-Z]+[a-zA-Z0-9_]*)(\\))|(^\\$|[^\\$]\\$)([a-zA-Z]+[a-zA-Z0-9_]*)|(^%|[^%]%)([a-zA-Z]+[a-zA-Z0-9_]*)(%[^%]|%$)" );
+
+ int pos = rx.indexIn( str, start );
+ if ( pos != -1 )
+ {
+ int i = 1;
+ while ( i <= rx.numCaptures() && varName.isEmpty() )
+ {
+ QString capStr = rx.cap( i );
+ if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) )
+ varName = capStr;
+ i++;
+ }
+
+ if ( !varName.isEmpty() )
+ {
+ int capIdx = i - 1;
+ start = rx.pos( capIdx );
+ int end = start + varName.length();
+ if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) )
+ start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) );
+ if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() )
+ end++;
+ len = end - start;
+ }
+ }
+ return varName;
+}
+
+/*!
+ \brief Substitute environment variables by their values.
+
+ Environment variable is substituted by its value.
+
+ \param str string to be processed
+ \return processed string (with all substitutions made)
+*/
+QString Qtx::makeEnvVarSubst( const QString& str, const SubstMode mode )
+{
+ QString res = str;
+ if ( mode != Never )
+ {
+ QMap<QString, int> ignoreMap;
+
+ int start( 0 ), len( 0 );
+ while ( true )
+ {
+ QString envName = findEnvVar( res, start, len );
+ if ( envName.isNull() )
+ break;
+
+ QString newStr;
+ if ( ::getenv( envName.toLatin1() ) || mode == Always )
+ newStr = QString( ::getenv( envName.toLatin1() ) );
+
+ if ( newStr.isNull() )
+ {
+ if ( ignoreMap.contains( envName ) )
+ {
+ start += len;
+ continue;
+ }
+ ignoreMap.insert( envName, 0 );
+ }
+ res.replace( start, len, newStr );
+ }
+
+ res.replace( "$$", "$" );
+ res.replace( "%%", "%" );
+ }
+
+ return res;
+}
+
/*!
\brief Pack the specified color into integer RGB set.
\param c unpacked color
/*!
\brief Scale the pixmap to the required size.
- If \h is 0 (default) the value of \a w is used instead (to create
+ If \a h is 0 (default) the value of \a w is used instead (to create
square pixmap).
\param icon pixmap to be resized
{
QPixmap p;
int aw = w, ah = h <= 0 ? w : h;
- if ( icon.isNull() || aw <= 0 || ah <= 0 || aw == icon.width() && ah == icon.height() )
+ if ( icon.isNull() || aw <= 0 || ah <= 0 || ( aw == icon.width() && ah == icon.height() ) )
p = icon;
else
p = icon.fromImage( icon.toImage().scaled( aw, ah, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
- "RR,GG,BB[,AA]" or "RR GG BB[ AA]" (\c RR, \c GG, \c BB
and optional \c AA values represent red, green, blue and alpha
components of the color in decimal form)
- - #RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
+ - "#RRGGBB" - (\c RR, \c GG and \c BB values represent red, green and blue
components of the color in hexadecimal form)
- an integer value representing packed color components (see rgbSet())
- a name from the list of colors defined in the list of SVG color keyword names
return res;
}
+/*!
+ \brief Convert bi-color value to the string representation.
+
+ Bi-color value is specified as main color and integer delta
+ value that is used to calculate secondary color by changing
+ paremeters of the main color ("saturation" and "value"
+ components in HSV notation).
+
+ The resulting string consists of two sub-strings separated by
+ '|' symbol. The first part represents main color
+ (see colorToString() for more details), the second part is a
+ delta value.
+
+ Backward conversion can be done with stringToBiColor() method.
+
+ \param color color to be converted
+ \param delta delta value
+ \return string representation of the bi-color value
+
+ \sa stringToBiColor(), stringToColor()
+*/
+QString Qtx::biColorToString( const QColor& color, const int delta )
+{
+ return QString("%1|%2").arg( Qtx::colorToString( color ) ).arg( delta );
+}
+
+/*!
+ \brief Restore bi-color value from the string representation.
+
+ Bi-color value is specified as main color and integer delta
+ value that is used to calculate secondary color by changing
+ paremeters of the main color ("saturation" and "value"
+ components in HSV notation).
+
+ The parameter \a str should consist of two sub-strings separated
+ by '|' symbol. The first part represents main color
+ (see stringToColor() for more details), the second part is a
+ delta value.
+
+ Backward conversion can be done with biColorToString() method.
+
+ \param str string representation of the bi-color value
+ \param color resulting color value
+ \param delta resulting delta value
+ \return \c true if the conversion is successful and \c false otherwise
+
+ \sa biColorToString(), stringToColor(), rgbSet()
+*/
+bool Qtx::stringToBiColor( const QString& str, QColor& color, int& delta )
+{
+ QStringList data = str.split( "|", QString::KeepEmptyParts );
+ QColor c;
+ int d = 0;
+ bool ok = data.count() > 0 && Qtx::stringToColor( data[0], c );
+ bool dok = false;
+ if ( data.count() > 1 ) d = data[1].toInt( &dok );
+ ok = ok && dok;
+ color = ok ? c : QColor();
+ delta = ok ? d : 0;
+ return ok;
+}
+
+/*!
+ \brief Compute secondary color value from specified main color
+ and delta.
+
+ Secondary color is calculated by changing paremeters of the main
+ color ("saturation" and "value" components in HSV notation) using
+ specified delta.
+
+ If main color is invalid, result of the function is also invalid color.
+
+ \param color source main color
+ \param delta delta value
+ \return resulting secondary color
+
+ \sa biColorToString(), stringToBiColor()
+*/
+QColor Qtx::mainColorToSecondary( const QColor& color, int delta )
+{
+ QColor cs = color;
+ if ( cs.isValid() ) {
+ int val = qMin( 255, qMax( cs.value() + delta, 0 ) );
+ int sat = qMin( 255, qMax( cs.saturation() + delta-(val-cs.value()), 0 ) );
+#ifdef BICOLOR_CHANGE_HUE
+ const int BICOLOR_HUE_MAXDELTA = 40;
+ int dh = delta-(val-cs.value())-(sat-cs.saturation());
+ dh = qMin( BICOLOR_HUE_MAXDELTA, qAbs( dh ) ) * ( dh > 0 ? 1 : -1 );
+ //int hue = qMin( 359, qMax( cs.hue() + delta-(val-cs.value())-(sat-cs.saturation()), 0 ) );
+ //int hue = qMin( 359, qMax( cs.hue() + delta-(val-cs.value())-ds, 0 ) );
+ int hue = cs.hue() + dh;
+ if ( hue < 0 ) hue = 360 - hue;
+#else
+ int hue = cs.hue();
+#endif
+ cs.setHsv( hue, sat, val );
+ }
+ return cs;
+}
+
/*!
\brief Dump linear gradient to the string description.
\param gradient linear gradient to be converted
// spread type
if ( vals.count() > 5 )
{
- QString spread = vals[ 5 ].trimmed().toLower();
- if ( spread == "pad" || spread == "0" )
- gradient.setSpread( QGradient::PadSpread );
- else if ( spread == "repeat" || spread == "2" )
- gradient.setSpread( QGradient::RepeatSpread );
- else if ( spread == "reflect" || spread == "1" )
- gradient.setSpread( QGradient::ReflectSpread );
+ QString spread = vals[ 5 ].trimmed().toLower();
+ if ( spread == "pad" || spread == "0" )
+ gradient.setSpread( QGradient::PadSpread );
+ else if ( spread == "repeat" || spread == "2" )
+ gradient.setSpread( QGradient::RepeatSpread );
+ else if ( spread == "reflect" || spread == "1" )
+ gradient.setSpread( QGradient::ReflectSpread );
}
// stop points
QGradientStops stops;
for ( int i = 6; i < vals.count(); i+=2 )
{
- bool bOk5, bOk6 = false;
- QColor c;
- double stop = vals[i].toDouble( &bOk5 );
- if ( i+1 < vals.count() )
- bOk6 = stringToColor( vals[ i+1 ], c );
- if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() )
- stops.append( QGradientStop( stop, c ) );
+ bool bOk5, bOk6 = false;
+ QColor c;
+ double stop = vals[i].toDouble( &bOk5 );
+ if ( i+1 < vals.count() )
+ bOk6 = stringToColor( vals[ i+1 ], c );
+ if ( bOk5 && stop >= 0.0 && stop <= 1.0 && bOk6 && c.isValid() )
+ stops.append( QGradientStop( stop, c ) );
}
gradient.setStops( stops );
success = true;
{
bool success = false;
QStringList vals = str.split( "|", QString::SkipEmptyParts );
- if ( vals.count() > 5 && vals[0] == "radial" || vals[0] == "rg" )
+ if ( vals.count() > 5 && ( vals[0] == "radial" || vals[0] == "rg" ) )
{
// center, radius and focal point
double cx, cy, r, fx, fy;
// spread type
if ( vals.count() > 6 )
{
- QString spread = vals[ 6 ].trimmed().toLower();
- if ( spread == "pad" || spread == "0" )
- gradient.setSpread( QGradient::PadSpread );
- else if ( spread == "repeat" || spread == "2" )
- gradient.setSpread( QGradient::RepeatSpread );
- else if ( spread == "reflect" || spread == "1" )
- gradient.setSpread( QGradient::ReflectSpread );
+ QString spread = vals[ 6 ].trimmed().toLower();
+ if ( spread == "pad" || spread == "0" )
+ gradient.setSpread( QGradient::PadSpread );
+ else if ( spread == "repeat" || spread == "2" )
+ gradient.setSpread( QGradient::RepeatSpread );
+ else if ( spread == "reflect" || spread == "1" )
+ gradient.setSpread( QGradient::ReflectSpread );
}
// stop points
QGradientStops stops;
for ( int i = 7; i < vals.count(); i+=2 )
{
- bool bOk7, bOk8 = false;
- QColor c;
- double stop = vals[i].toDouble( &bOk7 );
- if ( i+1 < vals.count() )
- bOk8 = stringToColor( vals[ i+1 ], c );
- if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() )
- stops.append( QGradientStop( stop, c ) );
+ bool bOk7, bOk8 = false;
+ QColor c;
+ double stop = vals[i].toDouble( &bOk7 );
+ if ( i+1 < vals.count() )
+ bOk8 = stringToColor( vals[ i+1 ], c );
+ if ( bOk7 && stop >= 0.0 && stop <= 1.0 && bOk8 && c.isValid() )
+ stops.append( QGradientStop( stop, c ) );
}
gradient.setStops( stops );
success = true;
{
bool success = false;
QStringList vals = str.split( "|", QString::SkipEmptyParts );
- if ( vals.count() > 3 && vals[0] == "conical" || vals[0] == "cg" )
+ if ( vals.count() > 3 && ( vals[0] == "conical" || vals[0] == "cg" ) )
{
// center and angle
double cx, cy, a;
// spread type
if ( vals.count() > 4 )
{
- QString spread = vals[ 4 ].trimmed().toLower();
- if ( spread == "pad" || spread == "0" )
- gradient.setSpread( QGradient::PadSpread );
- else if ( spread == "repeat" || spread == "2" )
- gradient.setSpread( QGradient::RepeatSpread );
- else if ( spread == "reflect" || spread == "1" )
- gradient.setSpread( QGradient::ReflectSpread );
+ QString spread = vals[ 4 ].trimmed().toLower();
+ if ( spread == "pad" || spread == "0" )
+ gradient.setSpread( QGradient::PadSpread );
+ else if ( spread == "repeat" || spread == "2" )
+ gradient.setSpread( QGradient::RepeatSpread );
+ else if ( spread == "reflect" || spread == "1" )
+ gradient.setSpread( QGradient::ReflectSpread );
}
// stop points
QGradientStops stops;
for ( int i = 5; i < vals.count(); i+=2 )
{
- bool bOk4, bOk5 = false;
- QColor c;
- double stop = vals[i].toDouble( &bOk4 );
- if ( i+1 < vals.count() )
- bOk5 = stringToColor( vals[ i+1 ], c );
- if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() )
- stops.append( QGradientStop( stop, c ) );
+ bool bOk4, bOk5 = false;
+ QColor c;
+ double stop = vals[i].toDouble( &bOk4 );
+ if ( i+1 < vals.count() )
+ bOk5 = stringToColor( vals[ i+1 ], c );
+ if ( bOk4 && stop >= 0.0 && stop <= 1.0 && bOk5 && c.isValid() )
+ stops.append( QGradientStop( stop, c ) );
}
gradient.setStops( stops );
success = true;
}
return success;
}
+
+/*!
+ \brief Convert background data to the string representation.
+ The resulting string consists of several sub-strings separated by ';' symbol.
+ These sub-strings represent:
+ 1. background type (enumerator, see Qtx::BackgroundMode)
+ 2. texture image file name (string)
+ 3. texture mode (enumerator, see Qtx::TextureMode)
+ 4. "show texture" flag (boolean)
+ 5. first color (for simple gradient data) or solid color (for single-colored mode)
+ 6. second color (for simple gradient data)
+ 7. type of simple gradient (some integer identifier)
+ 8. complex gradient data (for custom gradient mode)
+ Each sub-string consists of keyword/value couple, in form of "<keyword>=<value>".
+
+ Backward conversion can be done with stringToBackground() method.
+
+ \param bgData background data
+ \return string representation of the background data
+
+ \sa stringToBackground()
+*/
+QString Qtx::backgroundToString( const Qtx::BackgroundData& bgData )
+{
+ const QString dtSep = ";";
+ const QString kwSep = "=";
+ const QString kwBgType = "bt";
+ const QString kwFileName = "fn";
+ const QString kwTextureMode = "tm";
+ const QString kwShowTexture = "ts";
+ const QString kwFirstColor = "c1";
+ const QString kwSecondColor = "c2";
+ const QString kwGrType = "gt";
+ const QString kwGrData = "gr";
+
+ Qtx::BackgroundMode bgMode = bgData.mode();
+ QString fileName;
+ Qtx::TextureMode textureMode = bgData.texture( fileName );
+ bool showTexture = bgData.isTextureShown();
+ QColor c1, c2;
+ int gradientType = bgData.gradient( c1, c2 );
+ const QGradient* gradient = bgData.gradient();
+ QString grString;
+ if ( gradient ) {
+ switch ( gradient->type() ) {
+ case QGradient::LinearGradient:
+ grString = gradientToString( *(static_cast<const QLinearGradient*>( gradient )) );
+ break;
+ case QGradient::RadialGradient:
+ grString = gradientToString( *(static_cast<const QRadialGradient*>( gradient )) );
+ break;
+ case QGradient::ConicalGradient:
+ grString = gradientToString( *(static_cast<const QConicalGradient*>( gradient )) );
+ break;
+ default:
+ break;
+ }
+ }
+ QStringList data;
+ data << QString( "%1%2%3" ).arg( kwBgType ).arg( kwSep ).arg( (int)bgMode );
+ data << QString( "%1%2%3" ).arg( kwFileName ).arg( kwSep ).arg( fileName );
+ data << QString( "%1%2%3" ).arg( kwTextureMode ).arg( kwSep ).arg( (int)textureMode );
+ data << QString( "%1%2%3" ).arg( kwShowTexture ).arg( kwSep ).arg( showTexture ? "true" : "false" );
+ data << QString( "%1%2%3" ).arg( kwFirstColor ).arg( kwSep ).arg( Qtx::colorToString( c1 ) );
+ data << QString( "%1%2%3" ).arg( kwSecondColor ).arg( kwSep ).arg( Qtx::colorToString( c2 ) );
+ data << QString( "%1%2%3" ).arg( kwGrType ).arg( kwSep ).arg( gradientType );
+ data << QString( "%1%2%3" ).arg( kwGrData ).arg( kwSep ).arg( grString );
+
+ return data.join( dtSep );
+}
+
+/*!
+ \brief Restore background data from the string representation.
+
+ The string should consist of several sub-strings separated by ';' symbol.
+ Each sub-string consists of keyword/value couple, in form of "<keyword>=<value>".
+ The sub-strings can follow in arbitrary order, some keywords can be missing.
+ The background data is described by the following values:
+ - background type (enumerator, see Qtx::BackgroundMode), keyword "bt"
+ - texture image file name (string), keyword "fn"
+ - texture mode (enumerator, see Qtx::TextureMode), keyword "tm"
+ - "show texture" flag (boolean), keyword "ts"
+ - first color (for simple gradient data) or solid color (for single-colored mode), keyword "c1"
+ - second color (for simple gradient data), keyword "c2"
+ - name of gradient type (string), keyword "gt"
+ - complex gradient data (for custom gradient mode), keyword "gr"
+
+ Also, for backward compatibility, background data can be represented by
+ single color value, see stringToColor().
+
+ Backward conversion can be done with backgroundToString() method.
+ Returns invalid background if conversion could not be done.
+
+ \code
+ Qtx::BackgroundData bgData = Qtx::stringToBackground( str );
+ if ( bgData.isValid() ) ) doSomething( bgData );
+ \endcode
+
+ \param theString string representation of the background data
+ \return resulting background data (invalid if conversion has failed)
+
+ \sa backgroundToString()
+*/
+
+Qtx::BackgroundData Qtx::stringToBackground( const QString& str )
+{
+ const QString dtSep = ";";
+ const QString kwSep = "=";
+ const QString kwBgType = "bt";
+ const QString kwFileName = "fn";
+ const QString kwTextureMode = "tm";
+ const QString kwShowTexture = "ts";
+ const QString kwFirstColor = "c1";
+ const QString kwSecondColor = "c2";
+ const QString kwGrType = "gt";
+ const QString kwGrData = "gr";
+
+ Qtx::BackgroundData bgData = BackgroundData();
+
+ QStringList data = str.split( dtSep, QString::KeepEmptyParts );
+
+ QColor c;
+ if ( data.count() == 1 && !data.contains( kwSep ) && stringToColor( data[0], c ) ) {
+ // solid color mode, for backward compatibility
+ bgData.setColor( c );
+ }
+ else {
+ QMap<QString, QString> dmap;
+ // background data
+ foreach( QString d, data ) {
+ QStringList items = d.split( kwSep, QString::KeepEmptyParts );
+ if ( items.count() > 0 ) {
+ QString kw = items.takeFirst().trimmed().toLower(); // keyword
+ QString val = items.join( kwSep ).trimmed(); // if value contains "=" symbol, we have to restore it
+ dmap[ kw ] = val;
+ }
+ }
+ QString bgMode = dmap.value( kwBgType, QString() );
+ QString fileName = dmap.value( kwFileName, QString() );
+ QString textureMode = dmap.value( kwTextureMode, QString() );
+ QString showTexture = dmap.value( kwShowTexture, QString() );
+ QString color1 = dmap.value( kwFirstColor, QString() );
+ QString color2 = dmap.value( kwSecondColor, QString() );
+ QString gradientType = dmap.value( kwGrType, QString() );
+ QString gradient = dmap.value( kwGrData, QString() );
+
+ // texture data
+ if ( !fileName.isEmpty() || !textureMode.isEmpty() || !showTexture.isEmpty() ) {
+ Qtx::TextureMode m = (Qtx::TextureMode)( stringToInt( textureMode, Qtx::CenterTexture,
+ Qtx::CenterTexture, Qtx::StretchTexture ) );
+ bgData.setTexture( fileName, m );
+ QStringList boolvars; boolvars << "true" << "yes" << "ok" << "1";
+ if ( boolvars.contains( showTexture.trimmed().toLower() ) )
+ bgData.setTextureShown( true );
+ }
+ QColor c1, c2;
+ // try color mode
+ bool ok = Qtx::stringToColor( color1, c1 );
+ if ( ok ) {
+ bgData.setColor( c1 );
+ }
+ // try simple gradient mode
+ ok = Qtx::stringToColor( color2, c2 );
+ if ( ok || !gradientType.isEmpty() ) {
+ int gt = gradientType.toInt( &ok );
+ bgData.setGradient( ok ? gt : -1, c1, c2 );
+ }
+ // try custom gradient mode
+ QLinearGradient lg;
+ QConicalGradient cg;
+ QRadialGradient rg;
+ ok = Qtx::stringToLinearGradient( gradient, lg );
+ if ( ok ) {
+ bgData.setGradient( lg );
+ }
+ ok = Qtx::stringToRadialGradient( gradient, rg );
+ if ( ok ) {
+ bgData.setGradient( rg );
+ }
+ ok = Qtx::stringToConicalGradient( gradient, cg );
+ if ( ok ) {
+ bgData.setGradient( cg );
+ }
+
+ // finally set background mode
+ Qtx::BackgroundMode m = (Qtx::BackgroundMode)( stringToInt( bgMode, Qtx::ColorBackground,
+ Qtx::NoBackground, Qtx::CustomGradientBackground ) );
+ bgData.setMode( m );
+ }
+
+ return bgData;
+}
+
+/*!
+ \class Qtx::Localizer
+ \brief Localization helper
+
+ This helper class can be used to solve the localization problems,
+ usually related to the textual files reading/writing, namely when
+ floating point values are read / written with API functions.
+ The problem relates to such locale specific settings as decimal point
+ separator, thousands separator, etc.
+
+ To use the Localizer class, just create a local variable in the beginning
+ of the code where you need to read / write data from textual file(s).
+ The constructor of the class forces setting "C" locale temporariy.
+ The destructor switches back to the initial locale.
+
+ \code
+ Qtx::Localizer loc;
+ readSomething();
+ writeSomething();
+ \endcode
+*/
+
+/*!
+ \brief Constructor. Forces "C" locale to be set.
+*/
+Qtx::Localizer::Localizer()
+{
+ myCurLocale = setlocale( LC_NUMERIC, 0 );
+ setlocale( LC_NUMERIC, "C" );
+}
+
+/*!
+ \brief Destructor. Reverts back to the initial locale.
+*/
+Qtx::Localizer::~Localizer()
+{
+ setlocale( LC_NUMERIC, myCurLocale.toLatin1().constData() );
+}
+
+/*!
+ \class Qtx::BackgroundData
+ \brief Stores background data
+
+ This class is used to store background data. Depending on the mode,
+ the background can be specified by:
+ - image (by assigning the file name to be used as background texture), see setTexture(), setTextureShown()
+ - single color (by assigning any color), see setColor()
+ - simple two-color gradient (with the gradient type id and two colors), see setGradient( int, const QColor&, const QColor& )
+ - complex gradient (by assigning arbitrary gradient data), see setGradient( const QGradient& )
+
+ The class stores all the data passed to it, so switching between different modes can be done
+ just by calling setMode() function.
+
+ \note Texture is used with combination of the background mode.
+
+ \note Two-color gradient is specified by two colors and integer identifier. The interpretation of
+ this identifier should be done in the calling code.
+
+ \code
+ Qtx::BackgroundData bg;
+ bg.setColor( QColor(100, 100, 100) ); // bg is switched to Qtx::ColorBackground mode
+ bg.setGradient( Qt::Horizontal, Qt::gray, Qt::white ); // bg is switched to Qtx::ColorBackground mode
+ QLinearGradient grad( 0,0,1,1 );
+ grad.setColorAt( 0.0, Qt::gray );
+ grad.setColorAt( 0.5, Qt::white );
+ grad.setColorAt( 1.0, Qt::green );
+ grad.setSpread( QGradient::PadSpread );
+ bg.setGradient( grad ); // bg is switched to Qtx::CustomGradientBackground mode
+ bg.setMode( Qtx::ColorBackground ); // bg is switched back to Qtx::ColorBackground mode
+ bg.setTexture( "/data/images/background.png" ); // specify texture (in the centered mode by default)
+ bg.setTextureShown( true ); // draw texture on the solid color background
+ \endcode
+*/
+
+/*!
+ \brief Default constructor.
+ Creates invalid background data.
+*/
+Qtx::BackgroundData::BackgroundData()
+ : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+ setMode( Qtx::NoBackground );
+}
+
+/*!
+ \brief Constructor.
+ Creates background data initialized with the specified color
+ \param c color
+*/
+Qtx::BackgroundData::BackgroundData( const QColor& c )
+ : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+ setColor( c );
+}
+
+/*!
+ \brief Constructor.
+ Creates background data initialized with the specified two-color gradient
+ \param type gradient type identifier
+ \param c1 first gradient color
+ \param c2 second gradient color
+ \note the interpretation of the gradient identifier should be done in the calling code
+*/
+Qtx::BackgroundData::BackgroundData( int type, const QColor& c1, const QColor& c2 )
+ : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+ setGradient( type, c1, c2 );
+}
+
+/*!
+ \brief Constructor.
+ Creates background data initialized with the arbirtary gradient data
+ \param grad gradient data
+*/
+Qtx::BackgroundData::BackgroundData( const QGradient& grad )
+ : myTextureMode( Qtx::CenterTexture ), myGradientType( -1 ), myTextureShown( false )
+{
+ setGradient( grad );
+}
+
+/*!
+ \brief Destructor.
+*/
+Qtx::BackgroundData::~BackgroundData()
+{
+}
+
+/*!
+ \brief Compares two background data objects
+*/
+bool Qtx::BackgroundData::operator==( const Qtx::BackgroundData& other ) const
+{
+ return
+ ( myMode == other.myMode ) &&
+ ( myTextureMode == other.myTextureMode ) &&
+ ( myFileName == other.myFileName ) &&
+ ( myColors == other.myColors ) &&
+ ( myGradientType == other.myGradientType ) &&
+ ( myGradient == other.myGradient ) &&
+ ( myTextureShown == other.myTextureShown );
+}
+
+/*!
+ \brief Returns \c false if background data is not set (invalid)
+ \return \c true if background data is valid or \c false otherwise
+ \sa mode()
+*/
+bool Qtx::BackgroundData::isValid() const
+{
+ return myMode != Qtx::NoBackground;
+}
+
+/*!
+ \brief Get background mode
+ \return current background mode
+ \sa setMode()
+*/
+Qtx::BackgroundMode Qtx::BackgroundData::mode() const
+{
+ return myMode;
+}
+
+/*!
+ \brief Set background mode
+ \param m background mode being set
+ \sa mode()
+*/
+void Qtx::BackgroundData::setMode( const Qtx::BackgroundMode m )
+{
+ myMode = m;
+}
+
+/*!
+ \brief Get file name used as a texture image
+ \return path to the texture image file
+ \sa setTexture(), setTextureShown()
+*/
+Qtx::TextureMode Qtx::BackgroundData::texture( QString& fileName ) const
+{
+ fileName = myFileName;
+ return myTextureMode;
+}
+
+/*!
+ \brief Set file name to be used as a texture image.
+
+ \note To show texture image on the background it is necessary to call additionally
+ setTextureShown() method.
+
+ \param fileName path to the texture image file name
+ \param m texture mode (Qtx::CenterTexture by default)
+ \sa texture(), setTextureShown()
+*/
+void Qtx::BackgroundData::setTexture( const QString& fileName, const Qtx::TextureMode m )
+{
+ myFileName = fileName;
+ myTextureMode = m;
+}
+
+/*!
+ \brief Check if "show texture" flag is switched on
+ \return \c true if "show texture" flag is set or \c false otherwise
+ \sa setTextureShown(), texture()
+*/
+bool Qtx::BackgroundData::isTextureShown() const
+{
+ return myTextureShown;
+}
+
+/*!
+ \brief Specify if texture should be shown on the background or no.
+ \param on \c true if texture should be shown or \c false otherwise
+ \sa isTextureShown(), texture()
+*/
+void Qtx::BackgroundData::setTextureShown( bool on )
+{
+ myTextureShown = on;
+}
+
+/*!
+ \brief Get background color. Returns null QColor if color is not set
+ \return solid background color
+ \sa setColor(), mode()
+*/
+QColor Qtx::BackgroundData::color() const
+{
+ return myColors.count() > 0 ? myColors[0] : QColor();
+}
+
+/*!
+ \brief Set background color and switch to the Qtx::ColorBackground mode
+ \param c color
+ \sa color(), mode()
+*/
+void Qtx::BackgroundData::setColor( const QColor& c )
+{
+ myColors.clear();
+ myColors << c;
+ setMode( Qtx::ColorBackground );
+}
+
+/*!
+ \brief Get simple gradient data.
+ Returns -1 and null QColor for \a c1 and \a c2 if gradient data is not set
+ \param c1 first gradient color is returned via this parameter
+ \param c2 second gradient color is returned via this parameter
+ \return current two-colored gradient mode type identifier
+ \note the interpretation of the gradient identifier should be done in the calling code
+ \sa setGradient(int, const QColor&, const QColor&), mode()
+*/
+int Qtx::BackgroundData::gradient( QColor& c1, QColor& c2 ) const
+{
+ c1 = myColors.count() > 0 ? myColors[0] : QColor();
+ c2 = myColors.count() > 1 ? myColors[1] : ( myColors.count() > 0 ? myColors[0] : QColor() );
+ return myGradientType;
+}
+
+/*!
+ \brief Set simple background gradient data and switch to the Qtx::SimpleGradientBackground mode
+ \param type two-colored gradient mode type identifier
+ \param c1 first gradient color is returned via this parameter
+ \param c2 second gradient color is returned via this parameter
+ \note the interpretation of the gradient identifier should be done in the calling code
+ \sa gradient(QColor&, QColor&), mode()
+*/
+void Qtx::BackgroundData::setGradient( int type, const QColor& c1, const QColor& c2 )
+{
+ myColors.clear();
+ myColors << c1 << c2;
+ myGradientType = type;
+ setMode( Qtx::SimpleGradientBackground );
+}
+
+/*!
+ \brief Get complex gradient data.
+ Returns QGradient of QGradient::NoGradient if gradient data is not set
+ \note This function does not transform simple gradient data set with
+ setGradient( const QString&, const QColor&, const QColor& ) to QGradient class
+ \return gradient data
+ \sa setGradient(const QGradient&), mode()
+*/
+const QGradient* Qtx::BackgroundData::gradient() const
+{
+ return &myGradient;
+}
+
+/*!
+ \brief Set complex background gradient data and switch to the Qtx::CustomGradientBackground mode
+ \param grad gradient data (QLinearGradient, QRadialGradient or QConicalGradient)
+ \sa gradient(), mode()
+*/
+void Qtx::BackgroundData::setGradient( const QGradient& grad )
+{
+ myGradient = grad;
+ setMode( Qtx::CustomGradientBackground );
+}
+
+
+#ifndef WIN32
+
+#include <X11/Xlib.h>
+#include <GL/glx.h>
+
+/*!
+ \brief Open the default X display and returns pointer to it.
+ This method is available on Linux only.
+ \return Pointer to X display.
+ \sa getVisual()
+*/
+void* Qtx::getDisplay()
+{
+ static Display* pDisplay = NULL;
+ if ( !pDisplay )
+ pDisplay = XOpenDisplay( NULL );
+ return pDisplay;
+}
+
+/*!
+ \brief Returns pointer to X visual suitable for 3D rendering.
+ This method is available on Linux only.
+ \return Pointer to X visual.
+ \sa getDisplay()
+*/
+Qt::HANDLE Qtx::getVisual()
+{
+ Qt::HANDLE res = (Qt::HANDLE)NULL;
+
+ Display* pDisplay = (Display*)getDisplay();
+ if ( !pDisplay )
+ return res;
+
+ int errorBase;
+ int eventBase;
+
+ // Make sure OpenGL's GLX extension supported
+ if( !glXQueryExtension( pDisplay, &errorBase, &eventBase ) ){
+ qCritical( "Could not find glx extension" );
+ return res;
+ }
+
+ // Find an appropriate visual
+
+ int doubleBufferVisual[] = {
+ GLX_RGBA, // Needs to support OpenGL
+ GLX_DEPTH_SIZE, 16, // Needs to support a 16 bit depth buffer
+ GLX_DOUBLEBUFFER, // Needs to support double-buffering
+ None // end of list
+ };
+
+ // Try for the double-bufferd visual first
+ XVisualInfo *visualInfo = NULL;
+ visualInfo = glXChooseVisual( pDisplay, DefaultScreen(pDisplay), doubleBufferVisual );
+
+ if( visualInfo == NULL ){
+ qCritical( "Could not find matching glx visual" );
+ return res;
+ }
+
+ qDebug() << "Picked visual 0x" << hex << XVisualIDFromVisual( visualInfo->visual );
+ res = (Qt::HANDLE)( visualInfo->visual );
+
+ return res;
+}
+#endif // WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: Qtx.h
// Author: Sergey TELKOV
//
#define QTX_H
#if defined WIN32
-# if defined QTX_EXPORTS
+# if defined QTX_EXPORTS || defined qtx_EXPORTS
# define QTX_EXPORT _declspec( dllexport )
# else
# define QTX_EXPORT _declspec( dllimport )
#include <QColor>
#include <QImage>
#include <QPixmap>
+#include <QGradient>
class QObject;
class QWidget;
class QCompleter;
-class QLinearGradient;
-class QRadialGradient;
-class QConicalGradient;
typedef QList<int> QIntList; //!< list of int values
typedef QList<short> QShortList; //!< list of short int values
};
typedef enum {
- Shown, //!< column should be always visible
- Hidden, //!< column should be always hidden
- Toggled //!< it should be possible to show/hide the column with help of popup menu
+ Shown, //!< column should be always visible
+ Hidden, //!< column should be always hidden
+ Toggled //!< it should be possible to show/hide the column with help of popup menu
} Appropriate; //!< appropriate status
+ //! Environment variables substitution mode
+ typedef enum {
+ Always, //!< substitute environment variable by it's value if variable exists, and "" otherwise
+ Never, //!< keep environment variable as is without any substitution
+ Auto //!< substitute environment variable by it's value if variable exists, and keep it as is otherwise
+ } SubstMode;
+
+ //! object visibility state
+ typedef enum {
+ ShownState, //!< Object is shown in viewer
+ HiddenState, //!< Object is hidden in viewer
+ UnpresentableState, //!< Unpresentable object
+ } VisibilityState;
+
+ //! Header view flags
+ typedef enum {
+ ShowText = 0x001, //!< Show only text in the header
+ ShowIcon = 0x010, //!< Show only icon in the header
+ ShowAll = ShowText | ShowIcon //!< Show icon and text in the header
+ } HeaderViewFlags;
+
+ //! Type of the custom data (for custom tree model)
+ typedef enum {
+ IdType
+ } CustomDataType;
+
+ //! Background mode
+ typedef enum {
+ NoBackground, // no (invalid) background data
+ ColorBackground, // single color
+ SimpleGradientBackground, // simple two-color gradient
+ CustomGradientBackground // custom (complex) gradient
+ } BackgroundMode;
+
+ //! Texture mode
+ typedef enum {
+ CenterTexture, // center texture
+ TileTexture, // tile texture
+ StretchTexture, // stretch texture
+ } TextureMode;
+
+ class QTX_EXPORT Localizer
+ {
+ public:
+ Localizer();
+ ~Localizer();
+ private:
+ QString myCurLocale;
+ };
+
+ class QTX_EXPORT BackgroundData
+ {
+ public:
+ BackgroundData();
+ BackgroundData( const QColor& );
+ BackgroundData( int, const QColor&, const QColor& );
+ BackgroundData( const QGradient& );
+ virtual ~BackgroundData();
+
+ bool operator==( const BackgroundData&) const;
+ inline bool operator!=( const BackgroundData& other ) const
+ { return !operator==( other ); }
+
+ bool isValid() const;
+
+ BackgroundMode mode() const;
+ void setMode( const BackgroundMode );
+
+ TextureMode texture( QString& ) const;
+ void setTexture( const QString&, TextureMode = Qtx::CenterTexture );
+ bool isTextureShown() const;
+ void setTextureShown( bool );
+
+ QColor color() const;
+ void setColor( const QColor& );
+
+ int gradient( QColor&, QColor& ) const;
+ void setGradient( int, const QColor&, const QColor& );
+
+ const QGradient* gradient() const;
+ void setGradient( const QGradient& );
+
+ private:
+ BackgroundMode myMode;
+ TextureMode myTextureMode;
+ QString myFileName;
+ QColorList myColors;
+ int myGradientType;
+ QGradient myGradient;
+ bool myTextureShown;
+ };
+
static QString toQString( const char*, const int = -1 );
static QString toQString( const short*, const int = -1 );
static QString toQString( const unsigned char*, const int = -1 );
static QString addSlash( const QString& );
static QCompleter* pathCompleter( const PathType, const QString& = QString() );
+ static QString findEnvVar( const QString&, int&, int& );
+ static QString makeEnvVarSubst( const QString&, const SubstMode = Auto );
static int rgbSet( const QColor& );
static int rgbSet( const int, const int, const int );
static QString colorToString( const QColor& );
static bool stringToColor( const QString&, QColor& );
+ static QString biColorToString( const QColor&, const int );
+ static bool stringToBiColor( const QString&, QColor&, int& );
+ static QColor mainColorToSecondary( const QColor&, int );
static QString gradientToString( const QLinearGradient& );
static QString gradientToString( const QRadialGradient& );
static bool stringToLinearGradient( const QString&, QLinearGradient& );
static bool stringToRadialGradient( const QString&, QRadialGradient& );
static bool stringToConicalGradient( const QString&, QConicalGradient& );
+
+ static QString backgroundToString( const BackgroundData& );
+ static BackgroundData stringToBackground( const QString& );
+
+#ifndef WIN32
+ static void* getDisplay();
+ static Qt::HANDLE getVisual();
+#endif
};
#endif
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = qtx
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-QT += xml
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += QTX_EXPORTS
-
-HEADERS = Qtx.h
-HEADERS += QtxAction.h
-HEADERS += QtxActionMenuMgr.h
-HEADERS += QtxActionMgr.h
-HEADERS += QtxActionSet.h
-HEADERS += QtxActionToolMgr.h
-HEADERS += QtxColorScale.h
-HEADERS += QtxComboBox.h
-HEADERS += QtxDialog.h
-HEADERS += QtxDockAction.h
-HEADERS += QtxDockWidget.h
-HEADERS += QtxDoubleSpinBox.h
-HEADERS += QtxEvalExpr.h
-HEADERS += QtxGridBox.h
-HEADERS += QtxGroupBox.h
-HEADERS += QtxIntSpinBox.h
-HEADERS += QtxListAction.h
-HEADERS += QtxLogoMgr.h
-HEADERS += QtxMainWindow.h
-HEADERS += QtxMap.h
-HEADERS += QtxMRUAction.h
-HEADERS += QtxPathDialog.h
-HEADERS += QtxPopupMgr.h
-HEADERS += QtxResourceMgr.h
-HEADERS += QtxSplash.h
-HEADERS += QtxToolBar.h
-HEADERS += QtxToolTip.h
-HEADERS += QtxValidator.h
-HEADERS += QtxWorkspace.h
-HEADERS += QtxWorkspaceAction.h
-HEADERS += QtxWorkstack.h
-HEADERS += QtxWorkstackAction.h
-#HEADERS += QtxDirListEditor.h
-#HEADERS += QtxListBox.h
-#HEADERS += QtxListResourceEdit.h
-#HEADERS += QtxListView.h
-#HEADERS += QtxPopupMenu.h
-#HEADERS += QtxResourceEdit.h
-#HEADERS += QtxTable.h
-
-SOURCES = Qtx.cxx
-SOURCES += QtxAction.cxx
-SOURCES += QtxActionMenuMgr.cxx
-SOURCES += QtxActionMgr.cxx
-SOURCES += QtxActionSet.cxx
-SOURCES += QtxActionToolMgr.cxx
-SOURCES += QtxColorScale.cxx
-SOURCES += QtxComboBox.cxx
-SOURCES += QtxDialog.cxx
-SOURCES += QtxDockAction.cxx
-SOURCES += QtxDockWidget.cxx
-SOURCES += QtxDoubleSpinBox.cxx
-SOURCES += QtxEvalExpr.cxx
-SOURCES += QtxGridBox.cxx
-SOURCES += QtxGroupBox.cxx
-SOURCES += QtxIntSpinBox.cxx
-SOURCES += QtxListAction.cxx
-SOURCES += QtxLogoMgr.cxx
-SOURCES += QtxMainWindow.cxx
-SOURCES += QtxMRUAction.cxx
-SOURCES += QtxPathDialog.cxx
-SOURCES += QtxPopupMgr.cxx
-SOURCES += QtxResourceMgr.cxx
-SOURCES += QtxSplash.cxx
-SOURCES += QtxToolBar.cxx
-SOURCES += QtxToolTip.cxx
-SOURCES += QtxValidator.cxx
-SOURCES += QtxWorkspace.cxx
-SOURCES += QtxWorkspaceAction.cxx
-SOURCES += QtxWorkstack.cxx
-SOURCES += QtxWorkstackAction.cxx
-#SOURCES += QtxDirListEditor.cxx
-#SOURCES += QtxListBox.cxx
-#SOURCES += QtxListResourceEdit.cxx
-#SOURCES += QtxListView.cxx
-#SOURCES += QtxPopupMenu.cxx
-#SOURCES += QtxResourceEdit.cxx
-#SOURCES += QtxTable.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxAction.cxx
// Author: Sergey TELKOV
//
Creates an action owned by \a parent.
Parameter \a toggle can be used to make the action checkable.
+ Parameter \a shortcutAction can be used to assign the shortcut from
+ preferences. This parameter value corresponds to shortcut action identifier
+ in shortcut preferences.
\param parent parent object
\param toggle if \c true the action will be a toggle action
+ \param shortcutAction shortcut action identifier
*/
-QtxAction::QtxAction( QObject* parent, bool toggle )
+QtxAction::QtxAction( QObject* parent, bool toggle, const QString& shortcutAction )
: QWidgetAction( parent )
{
setCheckable( toggle );
+ setShortcutActionName(shortcutAction);
QApplication::instance()->installEventFilter( this );
}
Creates an action owned by \a parent. Parameters \a text,
\a icon, \a menuText and \a accel specify the action's attributes.
Parameter \a toggle can be used to make the action checkable.
+ Parameter \a shortcutAction can be used to assign the shortcut from
+ preferences. This parameter value corresponds to shortcut action identifier
+ in shortcut preferences.
\param text tooltip text
\param icon iconset
\param accel shortcut key sequence
\param parent parent object
\param toggle if \c true the action will be a toggle action
+ \param shortcutAction shortcut action identifier
*/
-QtxAction::QtxAction( const QString& text, const QIcon& icon,
- const QString& menuText, int accel, QObject* parent, bool toggle )
+QtxAction::QtxAction( const QString& text, const QIcon& icon, const QString& menuText,
+ int accel, QObject* parent, bool toggle, const QString& shortcutAction )
: QWidgetAction( parent )
{
setIcon( icon );
setToolTip( text );
setShortcut( accel );
setCheckable( toggle );
+ setShortcutActionName(shortcutAction);
QApplication::instance()->installEventFilter( this );
}
Creates an action owned by \a parent. Parameters \a text,
\a menuText and \a accel specify the action's attributes.
Parameter \a toggle can be used to make the action checkable.
+ Parameter \a shortcutAction can be used to assign the shortcut from
+ preferences. This parameter value corresponds to shortcut action identifier
+ in shortcut preferences.
\param text tooltip text
\param menuText menu text
\param accel shortcut key sequence
\param parent parent object
\param toggle if \c true the action is a toggle action
+ \param shortcutAction shortcut action identifier
*/
QtxAction::QtxAction( const QString& text, const QString& menuText,
- int accel, QObject* parent, bool toggle )
+ int accel, QObject* parent, bool toggle, const QString& shortcutAction )
: QWidgetAction( parent )
{
setText( menuText );
setToolTip( text );
setShortcut( accel );
setCheckable( toggle );
-
+ setShortcutActionName(shortcutAction);
+
QApplication::instance()->installEventFilter( this );
}
else
removedFrom( ae->widget() );
}
+
+/*!
+ \brief Return shortcut action name for the action.
+
+ \return shortcut action name
+ \sa setShortcutActionName()
+*/
+QString QtxAction::shortcutActionName() const
+{
+ return myShortcutActionName;
+}
+
+/*!
+ \brief Set shortcut action name to the action.
+
+ Shortcut action name is used for shortcuts customization.
+
+ \param shortcutAction shortcut action name
+ \sa shortcutActionName()
+*/
+void QtxAction::setShortcutActionName( const QString& shortcutAction )
+{
+ myShortcutActionName = shortcutAction;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxAction.h
// Author: Sergey TELKOV
//
class ActionNotify;
public:
- QtxAction( QObject* = 0, bool = false );
- QtxAction( const QString&, const QString&, int, QObject*, bool = false );
- QtxAction( const QString&, const QIcon&, const QString&, int, QObject*, bool = false );
+ QtxAction( QObject* = 0, bool = false, const QString& = QString() );
+ QtxAction( const QString&, const QString&, int, QObject*, bool = false, const QString& = QString() );
+ QtxAction( const QString&, const QIcon&, const QString&, int, QObject*, bool = false, const QString& = QString() );
virtual ~QtxAction();
virtual bool eventFilter( QObject*, QEvent* );
+ QString shortcutActionName() const;
+ void setShortcutActionName( const QString& );
+
protected:
virtual void addedTo( QWidget* );
virtual void removedFrom( QWidget* );
virtual void customEvent( QEvent* );
+
+private:
+ QString myShortcutActionName;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionGroup.cxx
// Author: Sergey TELKOV
//
{
QtxComboBox* cb = ::qobject_cast<QtxComboBox*>( *it );
if ( cb )
- cb->setCurrentId( id );
+ cb->setCurrentId( id );
}
}
QList<QAction*> lst = actions();
for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
- w->removeAction( *it );
+ w->removeAction( *it );
}
}
else
else {
QList<QAction*> lst = actions();
for ( QList<QAction*>::iterator it = lst.begin(); it != lst.end(); ++it )
- w->removeAction( *it );
+ w->removeAction( *it );
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionGroup.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionMenuMgr.cxx
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
\param _group menu node group ID
*/
QtxActionMenuMgr::MenuNode::MenuNode( MenuNode* p,
- const int _id,
- const int _idx,
- const int _group )
+ const int _id,
+ const int _idx,
+ const int _group )
: parent( p ), id( _id ), idx( _idx ), group( _group ), visible( true ), emptyEnabled( 0 )
{
if ( p )
delNodes.append( *it );
}
+ QWidget* mW = menuWidget( pNode );
for ( NodeList::iterator itr = delNodes.begin(); itr != delNodes.end(); ++itr )
+ {
+ int id = (*itr)->id;
+ if( mW && menuAction( id ) )
+ {
+ mW->removeAction( menuAction( id ) );
+ myMenus.remove( id );
+ }
+ else if( mW && itemAction( id ) )
+ mW->removeAction( itemAction( id ) );
pNode->children.removeAll( *itr );
+ }
triggerUpdate( pNode->id, false );
}
{
a = foralit.next();
if ( !mw->actions().contains( a ) )
- foralit.remove();
+ foralit.remove();
}
}
QList<QAction*> alist = mw->actions();
for ( NodeList::const_iterator iter = node->children.begin(); iter != node->children.end(); ++iter )
{
QAction* mya = itemAction( (*iter)->id );
- if ( !mya ) mya = menuAction( (*iter)->id );
- if ( mya && mya == a ) return true;
+ if ( !mya )
+ mya = menuAction( (*iter)->id );
+ if ( mya && mya == a )
+ return true;
}
return false;
}
if ( node && menuAction( id ) ) {
int old = node->emptyEnabled;
node->emptyEnabled += enable ? 1 : -1;
- if ( old <= 0 && enable || old > 0 && !enable ) // update menu only if enabled state has been changed
+ if ( ( old <= 0 && enable ) || ( old > 0 && !enable ) ) // update menu only if enabled state has been changed
updateMenu( node, true, true );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionMenuMgr.h
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionMgr.cxx
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionMgr.h
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
Reader* reader() const;
virtual int append( const QString&, const bool,
- const ItemAttributes&, const int ) = 0;
+ const ItemAttributes&, const int ) = 0;
virtual void connect( QAction* ) const;
virtual bool loadPixmap( const QString&, QPixmap& ) const;
protected:
static int intValue( const ItemAttributes&, const QString&, const int );
static QString strValue( const ItemAttributes&, const QString&,
- const QString& = QString() );
+ const QString& = QString() );
private:
QtxActionMgr::Reader* myReader; //!< actions reader
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionSet.cxx
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionSet.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionToolMgr.cxx
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
#include "QtxAction.h"
#include "QtxToolBar.h"
+#include <QApplication>
+#include <QHideEvent>
#include <QMainWindow>
/*!
\param title toolbar title
\param tid requested toolbar ID
\param mw parent main window; if it is null, the tool manager's main window is used
+ \param vis show toolbar visible immediately after creation (true by default)
\return id of created/found toolbar
*/
-int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw )
+int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainWindow* mw, bool vis )
+{
+ return createToolBar( title, true, Qt::AllToolBarAreas, tid, mw, vis );
+}
+
+/*!
+ \brief Create toolbar and assign \a id to it.
+
+ If \a tid is less than 0, the identifier is generated automatically.
+ If toolbar with given \a tid is already registered, the toolbar will not be created.
+
+ \param title toolbar title
+ \param floatable if \c true, new toolbar is made floatable
+ \param dockAreas dock areas of the main window where the new toolbar can be situated
+ \param tid requested toolbar ID
+ \param mw parent main window; if it is null, the tool manager's main window is used
+ \param vis show toolbar visible immediately after creation (true by default)
+ \return id of created/found toolbar
+*/
+int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas,
+ int tid, QMainWindow* mw, bool vis )
{
static int _toolBarId = -1;
if ( !tb )
{
tb = new QtxToolBar( true, tbw );
+ //tb->setVisible( false ); // VSR: create toolbar visible initially
+ tb->setFloatable( floatable );
+ tb->setAllowedAreas( dockAreas );
+ tb->setMovable( dockAreas & Qt::AllToolBarAreas );
//mainWindow()->addToolBar( tb );
tb->setWindowTitle( title );
tb->setObjectName( title );
tb->setToolTip( title );
+ if ( !vis )
+ QApplication::postEvent( tb, new QHideEvent());
}
tInfo.toolBar = tb;
return toolBar( find( title ) );
}
+/*!
+ \bried Get all registered toolbars identifiers
+ \return list of toolbars ids
+*/
+QIntList QtxActionToolMgr::toolBarsIds() const
+{
+ return myToolBars.keys();
+}
+
/*!
\brief Check if toolbar with given \a id already registered.
\param tid toolbar ID
{
const NodeList& list = it.value().nodes;
for ( NodeList::const_iterator nit = list.begin(); nit != list.end(); ++nit )
- if ( (*nit).id == id )
- return true;
+ if ( (*nit).id == id )
+ return true;
}
}
return false;
}
+/*!
+ \brief Get index of the action \a id within the toolbar \a tid
+ \param id action ID
+ \param tid toolbar ID
+ \return index of the action in the toolbar or -1 if action is not contained in the toolbar
+*/
+int QtxActionToolMgr::index( const int id, const int tid ) const
+{
+ for ( ToolBarMap::ConstIterator it = myToolBars.begin(); it != myToolBars.end(); ++it )
+ {
+ if ( it.key() == tid )
+ {
+ const NodeList& list = it.value().nodes;
+ int idx = 0;
+ for ( NodeList::const_iterator nit = list.begin(); nit != list.end(); ++nit, ++idx )
+ if ( (*nit).id == id ) return idx;
+ }
+ }
+ return -1;
+}
+
/*!
\brief Called when toolbar is destroyed.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxActionToolMgr.h
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
QMainWindow* mainWindow() const;
- int createToolBar( const QString&, int = -1, QMainWindow* = 0 );
+ int createToolBar( const QString&, int = -1, QMainWindow* = 0, bool = true );
+ int createToolBar( const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas,
+ int = -1, QMainWindow* = 0, bool = true );
void removeToolBar( const QString& );
void removeToolBar( const int );
QToolBar* toolBar( const int ) const;
QToolBar* toolBar( const QString& ) const;
+ QIntList toolBarsIds() const;
bool hasToolBar( const int ) const;
bool hasToolBar( const QString& ) const;
bool containsAction( const int, const int = -1 ) const;
+ int index( const int, const int ) const;
virtual bool load( const QString&, QtxActionMgr::Reader& );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxColorButton.cxx
// Author: Sergey TELKOV
//
: QToolButton( parent )
{
setCheckable( false );
- setPopupMode( MenuButtonPopup );
+ setPopupMode( MenuButtonPopup ); // VSR 11/10/2010 temporarily roolback from InstantPopup (regressions)
QMenu* pm = new QMenu( this );
QGridLayout* grid = new QGridLayout( pm );
pix.fill( palette().color( backgroundRole() ) );
if ( color().isValid() )
- drawColor( &pix, color() );
+ drawColor( &pix, isEnabled() ? color() : palette().mid().color(), isEnabled() ? Qt::black : palette().mid().color() );
else {
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( Qt::BDiagPattern ) );
+ pixp.fillRect( 3, 3, pix.width() - 6, pix.height() - 6,
+ QBrush( palette().color( isEnabled() ? QPalette::WindowText : QPalette::Mid ), Qt::BDiagPattern ) );
pixp.end();
}
\param c color
\param m margin
*/
-void QtxColorButton::drawColor( QPaintDevice* pd, const QColor& c, const int m ) const
+void QtxColorButton::drawColor( QPaintDevice* pd, const QColor& c, const QColor& bc, const int m ) const
{
if ( !pd )
return;
QPainter p( pd );
- p.setPen( Qt::black );
+ p.setPen( bc );
p.fillRect( m, m, pd->width() - 2 * m - 1, pd->height() - 2 * m - 1, QBrush( c ) );
p.drawRect( m, m, pd->width() - 2 * m - 1, pd->height() - 2 * m - 1 );
p.end();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxColorButton.h
// Author: Sergey TELKOV
//
void updateState();
void updateButton( QToolButton* );
QPixmap buttonIcon( const QColor& ) const;
- void drawColor( QPaintDevice*, const QColor&, const int = 1 ) const;
+ void drawColor( QPaintDevice*, const QColor&, const QColor& = Qt::black, const int = 1 ) const;
private:
typedef QMap<const QToolButton*, QColor> ColorMap;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxColorScale.cxx
// Author: Sergey TELKOV
//
\return color scale size
*/
QSize QtxColorScale::calculateSize( const bool min, const int flags, const bool title,
- const bool labels, const bool colors ) const
+ const bool labels, const bool colors ) const
{
int num = intervalsNumber();
{
QPainter p( (QtxColorScale*)this );
if ( scaleWidth )
- srt->setTextWidth( scaleWidth );
+ srt->setTextWidth( scaleWidth );
titleHeight = (int)srt->size().height() + spacer;
titleWidth = (int)srt->size().width() + 10;
{
bool scale = ( myDumpMode == ScaleDump || myDumpMode == FullDump );
bool label = ( myDumpMode == ScaleDump || myDumpMode == FullDump ) &&
- labelPosition() != None;
+ labelPosition() != None;
bool title = ( myDumpMode == TitleDump || myDumpMode == FullDump ) &&
- titlePosition() != None;
+ titlePosition() != None;
QColor bgc = palette().color( backgroundRole() );
QPainter p;
p.begin( &aPix );
QSize sz = calculateSize( false, myFlags & ~WrapTitle, title, label, scale );
if ( W < 0 )
- W = sz.width();
+ W = sz.width();
if ( H < 0 )
- H = sz.height();
+ H = sz.height();
}
aPix = QPixmap( W, H );
QRect aDrawRect = contentsRect();
drawScale( p, false/*testFlags( Transparent )*/, aDrawRect.x(),
- aDrawRect.y(), aDrawRect.width(), aDrawRect.height(),
- titlePosition() != None, labelPosition() != None, true );
+ aDrawRect.y(), aDrawRect.width(), aDrawRect.height(),
+ titlePosition() != None, labelPosition() != None, true );
}
/*!
int pos2 = lab - 1 - i2;
if ( filter && !( pos1 % filter ) )
{
- p->drawText( x, (int)( Y + i1 * step + ascent + offset ), labels[i1] );
- last1 = i1;
+ p->drawText( x, (int)( Y + i1 * step + ascent + offset ), labels[i1] );
+ last1 = i1;
}
if ( filter && !( pos2 % filter ) )
{
- p->drawText( x, (int)( Y + i2 * step + ascent + offset ), labels[i2] );
- last2 = i2;
+ p->drawText( x, (int)( Y + i2 * step + ascent + offset ), labels[i2] );
+ last2 = i2;
}
i1++;
i2--;
while ( pos <= i2 && i0 == -1 )
{
if ( filter && !( pos % filter ) &&
- qAbs( pos - last1 ) >= filter && qAbs( pos - last2 ) >= filter )
- i0 = pos;
+ qAbs( pos - last1 ) >= filter && qAbs( pos - last2 ) >= filter )
+ i0 = pos;
pos++;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxColorScale.h
// Author: Sergey TELKOV
//
double getNumber( const int ) const;
QTextDocument* textDocument( const int ) const;
void drawScale( QPainter*, const bool, const int, const int,
- const int, const int, const bool, const bool, const bool ) const;
+ const int, const int, const bool, const bool, const bool ) const;
void drawScale( QPainter*, const QColor&, const bool,
- const int, const int, const int, const int,
- const bool, const bool, const bool ) const;
+ const int, const int, const int, const int,
+ const bool, const bool, const bool ) const;
QSize calculateSize( const bool, const int,
- const bool, const bool, const bool ) const;
+ const bool, const bool, const bool ) const;
private:
double myMin; //!< lower limit
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxComboBox.cxx
// Author: Sergey TELKOV
//
: QComboBox( parent ),
myCleared( false )
{
- connect( this, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) );
connect( this, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onCurrentChanged( int ) ) );
setModel( new Model( this ) );
}
lineEdit()->setText( "" );
}
-/*!
- \brief Called when any item is activated by the user.
- \param idx activated item index
-*/
-void QtxComboBox::onActivated( int idx )
-{
- resetClear();
- emit activatedId( id( idx ) );
-}
-
/*!
\brief Called when current item is chaned (by the user or programmatically).
\param idx item being set current
void QtxComboBox::onCurrentChanged( int idx )
{
if ( idx != -1 )
+ {
resetClear();
+ emit activatedId( id( idx ) );
+ }
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxComboBox.h
// Author: Sergey TELKOV
//
void activatedId( int );
private slots:
- void onActivated( int );
void onCurrentChanged( int );
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDialog.cxx
// Author: Sergey TELKOV
//
{
buttonId[mit.value()] = mit.key();
if ( mit.key() >= 0 )
- src.append( mit.value() );
+ src.append( mit.value() );
}
}
{
buttonLayout->addWidget( other[i] );
if ( aPolicy == QtxDialog::Uniform && i < (int)other.count() - 1 )
- buttonLayout->addStretch( 1 );
+ buttonLayout->addStretch( 1 );
}
}
\param wf dialog box flags (Qt::WindowFlags)
*/
QtxDialog::QtxDialog( QWidget* parent, bool modal, bool allowResize, const int f, Qt::WindowFlags wf )
-: QDialog( parent, (Qt::WindowFlags)( wf | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::Dialog |
+: QDialog( parent, (Qt::WindowFlags)( wf | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::Dialog |
#ifdef WIN32
( allowResize ? 0 : Qt::FramelessWindowHint ) |
#endif
( ( allowResize
#ifdef WIN32
- // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON
- && !( wf & Qt::WindowContextHelpButtonHint )
+ // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON
+ && !( wf & Qt::WindowContextHelpButtonHint )
#endif
- ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ),
+ ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ),
myInited( false ),
mySender( 0 ),
myAlignment( 0 ),
for ( ButtonMap::Iterator it = myButton.begin(); it != myButton.end(); ++it )
{
if ( it.key() < 0 )
- map.insert( it.key(), it.value() );
+ map.insert( it.key(), it.value() );
}
}
else if ( myButton.contains( id ) )
{
for ( ButtonMap::ConstIterator it = myButton.begin(); it != myButton.end(); ++it )
if ( f == -1 || ( it.key() >= 0 && f & it.key() ) )
- retmap.insert( it.key(), it.value() );
+ retmap.insert( it.key(), it.value() );
}
return retmap;
}
if ( e->key() == Qt::Key_Tab && e->modifiers() & Qt::ControlModifier )
{
QObject* tab = qFindChild<QTabWidget*>( this );
- if ( tab )
+ if ( tab && !property( "in_tab_event" ).toBool() ) {
+ setProperty( "in_tab_event", true );
QApplication::sendEvent( tab, e );
+ setProperty( "in_tab_event", false );
+ }
}
}
const QList<QAbstractButton*>& lst = aIt.value()->buttons();
for ( QList<QAbstractButton*>::const_iterator bIt = lst.begin(); bIt != lst.end(); ++bIt )
if ( (*bIt)->isVisibleTo( this ) )
- minWidth = qMax( minWidth, (*bIt)->sizeHint().width() );
+ minWidth = qMax( minWidth, (*bIt)->sizeHint().width() );
}
for ( AreaMap::Iterator aItr = myArea.begin(); aItr != myArea.end(); ++aItr )
const QList<QAbstractButton*>& lst = aItr.value()->buttons();
for ( QList<QAbstractButton*>::const_iterator bItr = lst.begin(); bItr != lst.end(); ++bItr )
if ( (*bItr)->isVisibleTo( this ) )
- (*bItr)->setMinimumWidth( minWidth );
+ (*bItr)->setMinimumWidth( minWidth );
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDialog.h
// Author: Sergey TELKOV
//
public:
//! Buttons alignment type
typedef enum { Position, //!< buttons are placed according their position
- Expand, //!< buttons occupy all available space
- Uniform //!< buttons are uniformly placed in the area
+ Expand, //!< buttons occupy all available space
+ Uniform //!< buttons are uniformly placed in the area
} PlacePolicy;
//! Buttons area
typedef enum { TopArea, //!< horizontal area at the top side of the dialog box
- BottomArea, //!< horizontal area at the bottom side of the dialog box
- LeftArea, //!< vertical area at the left side of the dialog box
- RightArea //!< vertical area at the right side of the dialog box
+ BottomArea, //!< horizontal area at the bottom side of the dialog box
+ LeftArea, //!< vertical area at the left side of the dialog box
+ RightArea //!< vertical area at the right side of the dialog box
} ButtonArea;
//! Button position
typedef enum { Left, //!< set button left-most
- Right, //!< set button right-most
- Center, //!< place button in the center
- Top = Left, //!< set button top-most
- Bottom = Right //!< set button bottom-most
+ Right, //!< set button right-most
+ Center, //!< place button in the center
+ Top = Left, //!< set button top-most
+ Bottom = Right //!< set button bottom-most
} ButtonPosition;
//! Button ID flags
typedef enum { None = 0x00000000, //!< no button used
- OK = 0x00000001, //!< OK button
- Apply = 0x00000002, //!< Apply button
- Cancel = 0x00000004, //!< Cancel button
- Yes = 0x00000008, //!< Yes button
- No = 0x00000010, //!< No button
- Close = 0x00000020, //!< Close button
- Help = 0x00000040, //!< Help button
- OKCancel = OK | Cancel, //!< OK & Cancel button
- YesNo = Yes | No, //!< Yes & No buttons
- Standard = OK | Cancel | Help, //!< OK, Cancel & Help buttons
- All = Standard | YesNo | Apply | Close //!< all buttons
+ OK = 0x00000001, //!< OK button
+ Apply = 0x00000002, //!< Apply button
+ Cancel = 0x00000004, //!< Cancel button
+ Yes = 0x00000008, //!< Yes button
+ No = 0x00000010, //!< No button
+ Close = 0x00000020, //!< Close button
+ Help = 0x00000040, //!< Help button
+ OKCancel = OK | Cancel, //!< OK & Cancel button
+ YesNo = Yes | No, //!< Yes & No buttons
+ Standard = OK | Cancel | Help, //!< OK, Cancel & Help buttons
+ All = Standard | YesNo | Apply | Close //!< all buttons
} ButtonFlags;
//! Dialog box flags
typedef enum { Accept = 0x000001, //!< allow dialog box accepting control
- Reject = 0x000002, //!< allow dialog box rejecting control
- AlignOnce = 0x000004, //!< align dialog box only when it is first time shown
- SetFocus = 0x000008 //!< allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget)
+ Reject = 0x000002, //!< allow dialog box rejecting control
+ AlignOnce = 0x000004, //!< align dialog box only when it is first time shown
+ SetFocus = 0x000008 //!< allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget)
} DialogFlags;
public:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDockAction.cxx
// Author: Sergey TELKOV
//
*/
QtxDockAction::~QtxDockAction()
{
+ // to avoid memory leak
+ if( QMenu* aMenu = menu() )
+ {
+ delete aMenu;
+ aMenu = 0;
+ }
+}
+
+/*!
+ \brief Update associated menu
+*/
+void QtxDockAction::update()
+{
+ updateMenu();
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDockAction.h
// Author: Sergey TELKOV
//
public:
//! Dock windows type.
enum { ToolBar, //!< list toolbars only
- DockWidget, //!< list dockable windows only
- Both //!< list toolbars and dockable windows
+ DockWidget, //!< list dockable windows only
+ Both //!< list toolbars and dockable windows
} DockType;
public:
QtxDockAction( const QString&, const QIcon&, const QString&, QMainWindow* );
virtual ~QtxDockAction();
+ void update();
+
int dockType() const;
void setDockType( const int );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDockWidget.cxx
// Author: Sergey TELKOV
//
*/
void QtxDockWidget::Watcher::customEvent( QEvent* e )
{
- if ( e->type() == Update )
+ if ( e->type() == (QEvent::Type)Update )
{
updateIcon();
updateCaption();
updateVisibility();
}
- else if ( myCont && e->type() == Remove && !myCont->widget() )
+ else if ( myCont && e->type() == (QEvent::Type)Remove && !myCont->widget() )
{
myCont->deleteLater();
myCont = 0;
if ( l )
{
for ( int i = 0; i < (int)l->count() && !vis; i++ )
- vis = l->itemAt( i ) && l->itemAt( i )->widget() && l->itemAt( i )->widget()->isVisibleTo( myCont );
+ vis = l->itemAt( i ) && l->itemAt( i )->widget() && l->itemAt( i )->widget()->isVisibleTo( myCont );
}
}
{
QSize sz = QDockWidget::sizeHint();
- printf( "----------------> QtxDockWidget::sizeHint()\n" );
+ // printf( "----------------> QtxDockWidget::sizeHint()\n" );
return QSize( 500, 100 );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDockWidget.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDoubleSpinBox.cxx
// Author: Sergey TELKOV
//
#include <QLineEdit>
#include <QDoubleValidator>
+#include <QVariant>
+
+#include <limits>
+
+const double PSEUDO_ZERO = 1.e-20;
/*!
\class QtxDoubleSpinBox
... // process entered value
}
\endcode
+
+ Another useful feature is possibility to use scientific notation (e.g. 1.234e+18)
+ for the widegt text. To enable this, negative precision should be specified either
+ through a constructor or using setPrecision() method.
+
+ Note that "decimals" property of QDoubleSpinBox is almost completely substituted
+ by "myPrecision" field of QtxDoubleSpinBox class. "decimals" is still used
+ for proper size hint calculation and for rounding minimum and maximum bounds of
+ the spin box range.
*/
/*!
*/
QtxDoubleSpinBox::QtxDoubleSpinBox( QWidget* parent )
: QDoubleSpinBox( parent ),
- myCleared( false ),
- myPrecision(0)
+ myCleared( false )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
+ // Use precision equal to default Qt decimals
+ myPrecision = decimals();
+
connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
}
/*!
*/
QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, QWidget* parent )
: QDoubleSpinBox( parent ),
- myCleared( false ),
- myPrecision( 0 )
+ myCleared( false )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
+ // Use precision equal to default Qt decimals
+ myPrecision = decimals();
+
setMinimum( min );
setMaximum( max );
setSingleStep( step );
connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
}
/*!
\brief Constructor.
Constructs a spin box with specified minimum, maximum and step value.
- The precision is set to 2 decimal places.
+ The precision is set to <prec> decimal places.
The value is initially set to the minimum value.
\param min spin box minimum possible value
\param max spin box maximum possible value
\param step spin box increment/decrement value
+ \param prec non-negative values means the number of digits after the decimal point,
+ negative value means the maximum number of significant digits for the scientific notation
+ \param dec number of digits after the decimal point passed to base Qt class (used for correct control sizing only!)
\param parent parent object
*/
QtxDoubleSpinBox::QtxDoubleSpinBox( double min, double max, double step, int prec, int dec, QWidget* parent )
myCleared( false ),
myPrecision( prec )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
setDecimals( dec );
setMinimum( min );
setMaximum( max );
setSingleStep( step );
connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
}
/*!
*/
QString QtxDoubleSpinBox::textFromValue( double val ) const
{
- QString s = QLocale().toString( val, myPrecision >= 0 ? 'f' : 'g', myPrecision == 0 ? 6 : qAbs( myPrecision ) );
+ QString s = locale().toString( val, myPrecision >= 0 ? 'f' : 'g', qAbs( myPrecision ) );
return removeTrailingZeroes( s );
}
*/
QString QtxDoubleSpinBox::removeTrailingZeroes( const QString& src ) const
{
- QString delim( QLocale().decimalPoint() );
+ QString delim( locale().decimalPoint() );
int idx = src.lastIndexOf( delim );
if ( idx == -1 )
QString iPart = src.left( idx );
QString fPart = src.mid( idx + 1 );
+ QString ePart = "";
+ int idx1 = fPart.lastIndexOf( QRegExp( "e[+|-]?[0-9]+" ) );
+ if ( idx1 >= 0 ) {
+ ePart = fPart.mid( idx1 );
+ fPart = fPart.left( idx1 );
+ }
- while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' )
- fPart.remove( fPart.length() - 1, 1 );
+ fPart.remove( QRegExp( "0+$" ) );
QString res = iPart;
if ( !fPart.isEmpty() )
res += delim + fPart;
+ res += ePart;
return res;
}
myCleared = false;
QDoubleSpinBox::stepBy( steps );
+ double tmpval = value();
+ if ( qAbs( tmpval ) < PSEUDO_ZERO ) tmpval = 0.;
+ if ( tmpval < minimum() ) tmpval = minimum();
+ else if ( tmpval > maximum() ) tmpval = maximum();
+ setValue( tmpval );
}
/*!
*/
QValidator::State QtxDoubleSpinBox::validate( QString& str, int& pos ) const
{
- if (myPrecision >= 0)
- return QDoubleSpinBox::validate(str, pos);
-
QString pref = this->prefix();
QString suff = this->suffix();
uint overhead = pref.length() + suff.length();
QValidator::State state = QValidator::Invalid;
-
+
QDoubleValidator v (NULL);
- v.setDecimals( decimals() );
+
+ // If 'g' format is used (myPrecision < 0), then
+ // myPrecision - 1 digits are allowed after the decimal point.
+ // Otherwise, expect myPrecision digits after the decimal point.
+ int decs = myPrecision < 0 ? qAbs( myPrecision ) - 1 : myPrecision;
+
+ v.setDecimals( decs );
v.setBottom( minimum() );
v.setTop( maximum() );
- v.setNotation( QDoubleValidator::ScientificNotation );
+ v.setNotation( myPrecision >= 0 ? QDoubleValidator::StandardNotation :
+ QDoubleValidator::ScientificNotation );
if ( overhead == 0 )
state = v.validate( str, pos );
else
{
if ( str.length() >= overhead && str.startsWith( pref ) &&
- str.right( suff.length() ) == suff )
- {
- QString core = str.mid( pref.length(), str.length() - overhead );
- int corePos = pos - pref.length();
- state = v.validate( core, corePos );
- pos = corePos + pref.length();
- str.replace( pref.length(), str.length() - overhead, core );
- }
+ str.right( suff.length() ) == suff )
+ {
+ QString core = str.mid( pref.length(), str.length() - overhead );
+ int corePos = pos - pref.length();
+ state = v.validate( core, corePos );
+ pos = corePos + pref.length();
+ str.replace( pref.length(), str.length() - overhead, core );
+ }
else
- {
- state = v.validate( str, pos );
- if ( state == QValidator::Invalid )
- {
- QString special = this->specialValueText().trimmed();
- QString candidate = str.trimmed();
- if ( special.startsWith( candidate ) )
- {
- if ( candidate.length() == special.length() )
- state = QValidator::Acceptable;
- else
- state = QValidator::Intermediate;
- }
- }
- }
+ {
+ state = v.validate( str, pos );
+ if ( state == QValidator::Invalid )
+ {
+ QString special = this->specialValueText().trimmed();
+ QString candidate = str.trimmed();
+ if ( special.startsWith( candidate ) )
+ {
+ if ( candidate.length() == special.length() )
+ state = QValidator::Acceptable;
+ else
+ state = QValidator::Intermediate;
+ }
+ }
+ }
}
+
+ // Treat values ouside (min; max) range as Invalid
+ // This check is enabled by assigning "strict_validity_check" dynamic property
+ // with value "true" to the spin box instance.
+ if ( state == QValidator::Intermediate ){
+ bool isOk;
+ double val = str.toDouble( &isOk );
+ if ( isOk ){
+ QVariant propVal = property( "strict_validity_check" );
+ if ( propVal.isValid() && propVal.canConvert( QVariant::Bool ) && propVal.toBool() ){
+ if ( val < minimum() || val > maximum() )
+ state = QValidator::Invalid;
+ }
+ }
+ else if ( myPrecision < 0 ){
+ // Consider too large negative exponent as Invalid
+ QChar e( locale().exponential() );
+ int epos = str.indexOf( e, 0, Qt::CaseInsensitive );
+ if ( epos != -1 ){
+ epos++; // Skip exponential symbol itself
+ QString exponent = str.right( str.length() - epos );
+ int expValue = exponent.toInt( &isOk );
+ if ( isOk && expValue < std::numeric_limits<double>::min_exponent10 )
+ state = QValidator::Invalid;
+ }
+ }
+ }
+
return state;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxDoubleSpinBox.h
// Author: Sergey TELKOV
//
virtual QValidator::State validate( QString&, int& ) const;
-private slots:
+protected slots:
virtual void onTextChanged( const QString& );
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxEvalExpr.cxx
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
mLen = 0;
if ( oPos != pos && cPos != pos )
{
- int i;
+ int i;
for ( i = pos + 1; i < (int)expr.length(); i++ )
{
if ( expr[i].isSpace() )
v1 = res;
}
else
- v1 = QVariant( v2.toList().contains( v1 ) );
+ v1 = QVariant( v2.toList().contains( v1 ) );
}
}
return err;
\return error code (QtxEvalExpr::Error)
*/
QtxEvalExpr::Error QtxEvalSetConst::isValid( const QString& /*op*/,
- const QVariant::Type /*t1*/,
- const QVariant::Type /*t2*/ ) const
+ const QVariant::Type /*t1*/,
+ const QVariant::Type /*t2*/ ) const
{
return QtxEvalExpr::InvalidOperation;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxEvalExpr.h
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxFontEdit.cxx
// Author: Sergey TELKOV
//
*/
QtxFontEdit::QtxFontEdit( QWidget* parent )
: QFrame( parent ),
- myFeatures( All )
+ myFeatures( All ),
+ myMode( Native )
{
initialize();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxFontEdit.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxGridBox.cxx
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxGridBox.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxGroupBox.cxx
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxGroupBox.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxIntSpinBox.cxx
// Author: Sergey TELKOV
//
: QSpinBox( parent ),
myCleared( false )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
setCorrectionMode( QSpinBox::CorrectToNearestValue );
connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
}
/*!
: QSpinBox( parent ),
myCleared( false )
{
+ // VSR 01/07/2010: Disable thousands separator for spin box
+ // (to avoid incosistency of double-2-string and string-2-double conversion)
+ QLocale loc;
+ loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
+ setLocale(loc);
+
setMinimum( min );
setMaximum( max );
setSingleStep( step );
setCorrectionMode( QSpinBox::CorrectToNearestValue );
connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxIntSpinBox.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxListAction.cxx
// Author: Sergey TELKOV
//
\param parent parent object
*/
QtxListAction::QtxListAction( const QIcon& icon, const QString& menuText,
- int accel, QObject* parent )
+ int accel, QObject* parent )
: QtxAction( menuText, icon, menuText, accel, parent ),
myFrame( 0 )
{
\param parent parent object
*/
QtxListAction::QtxListAction( const QString& text, const QString& menuText,
- int accel, QObject* parent )
+ int accel, QObject* parent )
: QtxAction( text, menuText, accel, parent ),
myFrame( 0 )
{
\param parent parent object
*/
QtxListAction::QtxListAction( const QString& text, const QIcon& icon,
- const QString& menuText, int accel, QObject* parent )
+ const QString& menuText, int accel, QObject* parent )
: QtxAction( text, icon, menuText, accel, parent ),
myFrame( 0 )
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxListAction.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxListBox.cxx
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxListBox.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxLogoMgr.cxx
// Author: Sergey TELKOV
//
{
logoLab->setPixmap( (*it).pix );
// if ( !pix.mask().isNull() )
-// logoLab->setMask( pix.mask() );
+// logoLab->setMask( pix.mask() );
}
logoLab->setScaledContents( false );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxLogoMgr.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxMRUAction.cxx
// Author: Sergey TELKOV
//
for ( QStringList::const_iterator it = items.begin(); it != items.end(); ++it )
{
if ( (*it).startsWith( itemPrefix ) )
- resMgr->remove( section, *it );
+ resMgr->remove( section, *it );
}
}
int counter = 0;
for ( QStringList::const_iterator iter = lst.begin();
- iter != lst.end() && ( myHistoryCount < 0 || counter < myHistoryCount );
- ++iter, counter++ )
+ iter != lst.end() && ( myHistoryCount < 0 || counter < myHistoryCount );
+ ++iter, counter++ )
resMgr->setValue( section, itemPrefix + QString().sprintf( "%03d", counter ), *iter );
}
{
QString shortName = Qtx::file( myLinks[i] );
if ( map.contains( shortName ) )
- map[shortName]++;
+ map[shortName]++;
else
- map.insert( shortName, 0 );
+ map.insert( shortName, 0 );
}
}
case LinkAuto:
linkName = Qtx::file( *it );
if ( map.contains( linkName ) && map[linkName] )
- linkName = *it;
+ linkName = *it;
break;
case LinkShort:
linkName = Qtx::file( *it );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxMRUAction.h
// Author: Sergey TELKOV
//
public:
//! Items insertion policy
typedef enum { MoveFirst, //!< put the specified item to the beginning
- MoveLast, //!< put the specified item to the end
- AddFirst, //!< if specified item doesn't exist, add it to the beginning
- AddLast //!< if specified item doesn't exist, add it to the end
+ MoveLast, //!< put the specified item to the end
+ AddFirst, //!< if specified item doesn't exist, add it to the beginning
+ AddLast //!< if specified item doesn't exist, add it to the end
} InsertionMode;
typedef enum { LinkAuto, //!< put the full path of link into the menu if link file names of severals link are same
- LinkShort, //!< put the only file name of link into the menu
- LinkFull //!< put the full path of link into the menu
+ LinkShort, //!< put the only file name of link into the menu
+ LinkFull //!< put the full path of link into the menu
} LinkType;
public:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// File: QtxMainWindow.cxx
-// Author: Sergey TELKOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File: QtxMainWindow.cxx
+// Author: Sergey TELKOV
+
#include "QtxMainWindow.h"
#include "QtxToolBar.h"
-#include "QtxResourceMgr.h"
#include <QEvent>
+#include <QPoint>
+#include <QTimer>
+#include <QLayout>
#include <QMenuBar>
#include <QStatusBar>
+#include <QRubberBand>
+#include <QMouseEvent>
#include <QApplication>
#include <QDesktopWidget>
-
+#include <cstdio>
/*!
\class QtxMainWindow::Filter
\internal
return QObject::eventFilter( o, e );
}
+/*!
+ \class QtxMainWindow::Resizer
+ \internal
+ \brief Internal object used to resize dock widgets.
+*/
+
+class QtxMainWindow::Resizer : public QObject
+{
+public:
+ Resizer( const QPoint&, const Qt::Orientation, QtxMainWindow* );
+ virtual ~Resizer();
+
+ QMouseEvent* finalEvent() const;
+ void setFinalEvent( QMouseEvent* );
+
+ void setPosition( const QPoint& );
+ virtual bool eventFilter( QObject*, QEvent* );
+
+private:
+ void setFilters( bool );
+
+private:
+ QPoint myPos;
+ QMainWindow* myMain;
+ QRubberBand* myRubber;
+ Qt::Orientation myOrient;
+ QMouseEvent* myFinEvent;
+};
+
+/*!
+ \brief Constructor.
+ \param mw parent main window
+*/
+QtxMainWindow::Resizer::Resizer( const QPoint& p, const Qt::Orientation o, QtxMainWindow* mw )
+: QObject( mw ),
+ myMain( mw ),
+ myOrient( o ),
+ myFinEvent( 0 )
+{
+ setFilters( true );
+
+ myRubber = new QRubberBand( QRubberBand::Line, 0 );
+
+ setPosition( p );
+
+ myRubber->hide();
+};
+
+/*!
+ \brief Destructor.
+*/
+QtxMainWindow::Resizer::~Resizer()
+{
+ delete myRubber;
+
+ setFilters( false );
+}
+
+void QtxMainWindow::Resizer::setPosition( const QPoint& pos )
+{
+ myPos = pos;
+ if ( myRubber ) {
+ QRect r;
+ QPoint min = myMain->mapToGlobal( myMain->rect().topLeft() );
+ QPoint max = myMain->mapToGlobal( myMain->rect().bottomRight() );
+ if ( myOrient == Qt::Horizontal ) {
+ int p = qMax( qMin( myPos.y(), max.y() ), min.y() );
+ r = QRect( myMain->mapToGlobal( QPoint( 0, 0 ) ).x(), p - 1, myMain->width(), 3 );
+ }
+ else {
+ int p = qMax( qMin( myPos.x(), max.x() ), min.x() );
+ r = QRect( p - 1, myMain->mapToGlobal( QPoint( 0, 0 ) ).y(), 3, myMain->height() );
+ }
+ myRubber->setGeometry( r );
+ if ( !myRubber->isVisible() )
+ myRubber->show();
+ }
+}
+
+QMouseEvent* QtxMainWindow::Resizer::finalEvent() const
+{
+ return myFinEvent;
+}
+
+void QtxMainWindow::Resizer::setFinalEvent( QMouseEvent* e )
+{
+ myFinEvent = e;
+}
+
+/*!
+ \brief Event filter.
+
+ \param o recevier object
+ \param e event
+*/
+bool QtxMainWindow::Resizer::eventFilter( QObject* o, QEvent* e )
+{
+ if ( e->type() == QEvent::Timer ) {
+ if ( !finalEvent() )
+ return true;
+
+ setFilters( false );
+ QApplication::postEvent( myMain, finalEvent() );
+ myFinEvent = 0;
+ deleteLater();
+ }
+
+ return QObject::eventFilter( o, e );
+}
+
+void QtxMainWindow::Resizer::setFilters( bool on )
+{
+ if ( myMain ) {
+ if ( on )
+ myMain->layout()->installEventFilter( this );
+ else
+ myMain->layout()->removeEventFilter( this );
+ }
+
+ QTimer* t = qFindChild<QTimer*>( myMain->layout() );
+ if ( t ) {
+ if ( on )
+ t->installEventFilter( this );
+ else
+ t->removeEventFilter( this );
+ }
+}
/*!
\class QtxMainWindow
QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f )
: QMainWindow( parent, f ),
myMenuBar( 0 ),
- myStatusBar( 0 )
+ myStatusBar( 0 ),
+ myOpaque( true ),
+ myResizer( 0 ),
+ myMouseMove( 0 ),
+ myFullScreenAllowed(true)
{
+ //rnv: Enables tooltips for inactive windows.
+ //rnv: For details see http://bugtracker.opencascade.com/show_bug.cgi?id=20893
+ setAttribute(Qt::WA_AlwaysShowToolTips);
}
/*!
}
}
+bool QtxMainWindow::isOpaqueResize() const
+{
+ return myOpaque;
+}
+
+void QtxMainWindow::setOpaqueResize( bool on )
+{
+ myOpaque = on;
+}
+
/*!
\brief Dump main window geometry to the string.
\return string represenation of the window geometry
state = QString( "min" );
break;
case Qt::WindowFullScreen:
- state = QString( "full" );
+ state = isFullScreenAllowed() ? QString( "full" ) : QString( "max" );
break;
}
}
}
+bool QtxMainWindow::event( QEvent* e )
+{
+// if ( e->type() == QEvent::WindowDeactivate ) {
+// printf( "----------------> Deactivated\n" );
+// }
+
+ if ( myResizer ) {
+ QMouseEvent* me = static_cast<QMouseEvent*>( e );
+ if ( ( e->type() == QEvent::MouseButtonRelease && me->button() == Qt::LeftButton ) ||
+ ( e->type() == QEvent::MouseButtonPress && me->button() != Qt::LeftButton ) ) {
+ if ( me->button() == Qt::LeftButton ) {
+ if ( myMouseMove ) {
+ QMainWindow::event( myMouseMove );
+ delete myMouseMove;
+ myMouseMove = 0;
+ }
+
+ QMouseEvent* me = static_cast<QMouseEvent*>( e );
+ myResizer->setFinalEvent( new QMouseEvent( QEvent::MouseButtonRelease, me->pos(), me->globalPos(),
+ Qt::LeftButton, me->buttons(), me->modifiers() ) );
+ myResizer = 0;
+ return true;
+ }
+ }
+ }
+
+ if ( myResizer && e->type() == QEvent::MouseMove ) {
+ QMouseEvent* me = static_cast<QMouseEvent*>( e );
+ if ( myMouseMove )
+ delete myMouseMove;
+ myMouseMove = new QMouseEvent( me->type(), me->pos(), me->globalPos(),
+ me->button(), me->buttons(), me->modifiers() );
+ myResizer->setPosition( me->globalPos() );
+ }
+
+ bool ok = QMainWindow::event( e );
+
+ if ( !myResizer && e->type() == QEvent::MouseButtonPress ) {
+ QMouseEvent* me = static_cast<QMouseEvent*>( e );
+ if ( !isOpaqueResize() && ok && testAttribute( Qt::WA_SetCursor ) && me->button() == Qt::LeftButton ) {
+ bool status = true;
+ Qt::Orientation o;
+ switch ( cursor().shape() )
+ {
+ case Qt::SplitHCursor:
+ o = Qt::Vertical;
+ break;
+ case Qt::SplitVCursor:
+ o = Qt::Horizontal;
+ break;
+ default:
+ status = false;
+ break;
+ }
+ if ( status ) {
+ myResizer = new Resizer( me->globalPos(), o, this );
+ myMouseMove = new QMouseEvent( me->type(), me->pos(), me->globalPos(),
+ me->button(), me->buttons(), me->modifiers() );
+ }
+ }
+ }
+
+ return ok;
+}
+
+/*!
+ \brief FullScreenAllowed flag allowed dump in the main window geometry
+ Qt::WindowFullScreen parameter.
+ \return \c fullScreenAllowed flag.
+*/
+bool QtxMainWindow::isFullScreenAllowed() const {
+ return myFullScreenAllowed;
+}
+
+
+/*!
+ \brief Set FullScreenAllowed flag.
+ The default value is true.
+ \param f value of the fullScreenAllowed flag.
+*/
+void QtxMainWindow::setFullScreenAllowed( const bool f ) {
+ myFullScreenAllowed = f;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
-//
-// File: QtxMainWindow.h
-// Author: Sergey TELKOV
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File: QtxMainWindow.h
+// Author: Sergey TELKOV
+
#ifndef QTXMAINWINDOW_H
#define QTXMAINWINDOW_H
Q_OBJECT
class Filter;
+ class Resizer;
public:
QtxMainWindow( QWidget* = 0, Qt::WindowFlags = 0 );
virtual ~QtxMainWindow();
+ bool isOpaqueResize() const;
+ void setOpaqueResize( bool );
+
bool isDockableMenuBar() const;
void setDockableMenuBar( const bool );
QString storeGeometry() const;
void retrieveGeometry( const QString& );
+ bool isFullScreenAllowed() const;
+ void setFullScreenAllowed( const bool );
+
+protected:
+ virtual bool event( QEvent* );
+
private slots:
void onDestroyed( QObject* );
private:
QToolBar* myMenuBar; //!< dockable menu bar
QToolBar* myStatusBar; //!< dockable status bar
+
+ bool myFullScreenAllowed;
+
+ bool myOpaque;
+ Resizer* myResizer;
+ QMouseEvent* myMouseMove;
};
#endif // QTXMAINWINDOW_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : QtxMap.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxMenu.cxx
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxMenu.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxMultiAction.cxx
// Author: Sergey TELKOV
//
if ( e->type() == QEvent::Leave ) {
QToolButton* tb = qobject_cast<QToolButton*>( o );
if ( tb )
- tb->setDown( false );
+ tb->setDown( false );
}
return QObject::eventFilter( o, e );
}
*/
QtxMultiAction::~QtxMultiAction()
{
+ // to avoid memory leak
+ if( QMenu* aMenu = menu() )
+ {
+ delete aMenu;
+ aMenu = 0;
+ }
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxMultiAction.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPagePrefMgr.cxx
// Author: Sergey TELKOV
//
#include "QtxComboBox.h"
#include "QtxIntSpinBox.h"
#include "QtxColorButton.h"
+#include "QtxBiColorTool.h"
#include "QtxDoubleSpinBox.h"
+#include "QtxShortcutEdit.h"
+#include "QtxBackgroundTool.h"
+#include "QtxResourceMgr.h"
#include <QEvent>
#include <QLayout>
#include <QApplication>
#include <QDateTimeEdit>
#include <QStackedWidget>
+#include <QSlider>
+
+#include <stdio.h>
/*!
\class QtxPagePrefMgr
for string, integer and double values.
*/
+static void fixupAndSet( QLineEdit* le, const QString& txt )
+{
+ if ( le ) {
+ QString val = txt;
+ if ( le->validator() ) {
+ const QDoubleValidator* de = dynamic_cast<const QDoubleValidator*>( le->validator() );
+ if ( de ) {
+ int dec = de->decimals();
+ int idx = val.lastIndexOf( QRegExp( QString("[.|%1]").arg( le->locale().decimalPoint () ) ) );
+ if ( idx >= 0 ) {
+ QString tmp = val.mid( idx+1 );
+ QString exp;
+ val = val.left( idx+1 );
+ idx = tmp.indexOf( QRegExp( QString("[e|E]") ) );
+ if ( idx >= 0 ) {
+ exp = tmp.mid( idx );
+ tmp = tmp.left( idx );
+ }
+ tmp.truncate( dec );
+ val = val + tmp + exp;
+ }
+ }
+ int pos = 0;
+ if ( le->validator()->validate( val, pos ) == QValidator::Invalid )
+ val.clear();
+ }
+ le->setText( val );
+ }
+}
+
/*!
\brief Constructor.
QtxPagePrefEditItem::QtxPagePrefEditItem( const QString& title, QtxPreferenceItem* parent,
const QString& sect, const QString& param )
: QtxPageNamedPrefItem( title, parent, sect, param ),
- myType( String )
+ myType( String ),
+ myDecimals( 1000 ),
+ myEchoMode( 0 )
{
setControl( myEditor = new QLineEdit() );
updateEditor();
*/
QtxPagePrefEditItem::QtxPagePrefEditItem( const int type, const QString& title,
QtxPreferenceItem* parent, const QString& sect,
- const QString& param )
+ const QString& param )
: QtxPageNamedPrefItem( title, parent, sect, param ),
- myType( type )
+ myType( type ),
+ myDecimals( 1000 ),
+ myEchoMode( 0 )
{
setControl( myEditor = new QLineEdit() );
updateEditor();
updateEditor();
}
+/*!
+ \brief Get number of digits after decimal point (for Double input type)
+ \return preference item decimals value
+ \sa setDecimals()
+*/
+int QtxPagePrefEditItem::decimals() const
+{
+ return myDecimals;
+}
+
+/*!
+ \brief Set number of digits after decimal point (for Double input type)
+ \param dec new preference item decimals value
+ \sa decimals()
+*/
+void QtxPagePrefEditItem::setDecimals( const int dec )
+{
+ if ( myDecimals == dec )
+ return;
+
+ myDecimals = dec;
+ updateEditor();
+}
+
+/*!
+ \brief Get the line edit's echo mode
+ \return preference item echo mode value
+ \sa setEchoMode()
+*/
+int QtxPagePrefEditItem::echoMode() const
+{
+ return myEchoMode;
+}
+
+/*!
+ \brief Set the line edit's echo mode
+ \param echo new preference item echo mode value
+ \sa echoMode()
+*/
+void QtxPagePrefEditItem::setEchoMode( const int echo )
+{
+ if ( myEchoMode == echo )
+ return;
+
+ myEchoMode = echo;
+ updateEditor();
+}
+
/*!
\brief Store preference item to the resource manager.
\sa retrieve()
void QtxPagePrefEditItem::retrieve()
{
QString txt = getString();
- if ( myEditor->validator() )
- {
- int pos = 0;
- if ( myEditor->validator()->validate( txt, pos ) == QValidator::Invalid )
- txt.clear();
- }
- myEditor->setText( txt );
+ fixupAndSet( myEditor, txt );
}
/*!
{
if ( name == "input_type" || name == "type" )
return inputType();
+ else if ( name == "precision" || name == "prec" || name == "decimals" )
+ return decimals();
+ else if ( name == "echo" || name == "echo_mode" || name == "echomode")
+ return echoMode();
else
return QtxPageNamedPrefItem::optionValue( name );
}
if ( val.canConvert( QVariant::Int ) )
setInputType( val.toInt() );
}
+ else if ( name == "precision" || name == "prec" || name == "decimals" ) {
+ if ( val.canConvert( QVariant::Int ) )
+ setDecimals( val.toInt() );
+ }
+ else if ( name == "echo" || name == "echo_mode" || name == "echomode") {
+ if ( val.canConvert( QVariant::Int ) )
+ setEchoMode( val.toInt() );
+ }
else
QtxPageNamedPrefItem::setOptionValue( name, val );
}
*/
void QtxPagePrefEditItem::updateEditor()
{
+ switch (myEchoMode)
+ {
+ case 0:
+ myEditor->setEchoMode(QLineEdit::Normal);
+ break;
+ case 1:
+ myEditor->setEchoMode(QLineEdit::NoEcho);
+ break;
+ case 2:
+ myEditor->setEchoMode(QLineEdit::Password);
+ break;
+ case 3:
+ myEditor->setEchoMode(QLineEdit::PasswordEchoOnEdit);
+ break;
+ default:
+ myEditor->setEchoMode(QLineEdit::Normal);
+ }
+
QValidator* val = 0;
switch ( inputType() )
{
break;
case Double:
val = new QDoubleValidator( myEditor );
+ dynamic_cast<QDoubleValidator*>( val )->setDecimals( myDecimals < 0 ? 1000 : myDecimals );
break;
default:
break;
}
- if ( !myEditor->text().isEmpty() && val )
+ QString txt = myEditor->text();
+ delete myEditor->validator();
+ myEditor->setValidator( val );
+ fixupAndSet( myEditor, txt );
+}
+
+/*!
+ \class QtxPagePrefSliderItem
+*/
+
+/*!
+ \brief Constructor.
+
+ Creates preference item with slider widget
+
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefSliderItem::QtxPagePrefSliderItem( const QString& title, QtxPreferenceItem* parent,
+ const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+ setControl( mySlider = new QSlider( Qt::Horizontal ) );
+ widget()->layout()->addWidget( myLabel = new QLabel( ) );
+
+ setMinimum( 0 );
+ setMaximum( 0 );
+ setSingleStep( 1 );
+ setPageStep( 1 );
+
+ mySlider->setTickPosition( QSlider::TicksBothSides );
+
+ connect (mySlider, SIGNAL(valueChanged(int)), this, SLOT(setIcon(int)));
+ updateSlider();
+}
+
+/*!
+ \brief Destructor.
+*/
+QtxPagePrefSliderItem::~QtxPagePrefSliderItem()
+{
+}
+
+/*!
+ \brief Get slider preference item step value.
+ \return slider single step value
+ \sa setSingleStep()
+*/
+int QtxPagePrefSliderItem::singleStep() const
+{
+ return mySlider->singleStep();
+}
+
+/*!
+ \brief Get slider preference item step value.
+ \return slider page step value
+ \sa setPageStep()
+*/
+int QtxPagePrefSliderItem::pageStep() const
+{
+ return mySlider->pageStep();
+}
+
+/*!
+ \brief Get slider preference item minimum value.
+ \return slider minimum value
+ \sa setMinimum()
+*/
+int QtxPagePrefSliderItem::minimum() const
+{
+ return mySlider->minimum();
+}
+
+/*!
+ \brief Get slider preference item maximum value.
+ \return slider maximum value
+ \sa setMaximum()
+*/
+int QtxPagePrefSliderItem::maximum() const
+{
+ return mySlider->maximum();
+}
+
+/*!
+ \brief Get the list of the icons associated with the selection widget items
+ \return list of icons
+ \sa setIcons()
+*/
+QList<QIcon> QtxPagePrefSliderItem::icons() const
+{
+ return myIcons;
+}
+
+/*!
+ \brief Set slider preference item step value.
+ \param step new slider single step value
+ \sa step()
+*/
+void QtxPagePrefSliderItem::setSingleStep( const int& step )
+{
+ mySlider->setSingleStep( step );
+}
+
+/*!
+ \brief Set slider preference item step value.
+ \param step new slider single step value
+ \sa step()
+*/
+void QtxPagePrefSliderItem::setPageStep( const int& step )
+{
+ mySlider->setPageStep( step );
+}
+
+/*!
+ \brief Set slider preference item minimum value.
+ \param min new slider minimum value
+ \sa minimum()
+*/
+void QtxPagePrefSliderItem::setMinimum( const int& min )
+{
+ mySlider->setMinimum( min );
+ setIcon( mySlider->value() );
+}
+
+/*!
+ \brief Set slider preference item maximum value.
+ \param max new slider maximum value
+ \sa maximum()
+*/
+void QtxPagePrefSliderItem::setMaximum( const int& max )
+{
+ mySlider->setMaximum( max );
+ setIcon( mySlider->value() );
+}
+
+/*!
+ \brief Set the list of the icons to the selection widget items
+ \param icns new list of icons
+ \sa icons()
+*/
+void QtxPagePrefSliderItem::setIcons( const QList<QIcon>& icns )
+{
+ if ( icns.isEmpty() )
+ return;
+ myIcons = icns;
+
+ QSize maxsize(0, 0);
+ for ( QList<QIcon>::const_iterator it = myIcons.begin(); it != myIcons.end(); ++it ) {
+ if ( (*it).isNull() ) continue;
+ maxsize = maxsize.expandedTo( (*it).availableSizes().first() );
+ }
+ myLabel->setFixedSize( maxsize );
+
+ updateSlider();
+}
+
+/*!
+ \brief Store preference item to the resource manager.
+ \sa retrieve()
+*/
+void QtxPagePrefSliderItem::store()
+{
+ setInteger( mySlider->value() );
+}
+
+/*!
+ \brief Retrieve preference item from the resource manager.
+ \sa store()
+*/
+void QtxPagePrefSliderItem::retrieve()
+{
+ mySlider->setValue( getInteger( mySlider->value() ) );
+}
+
+/*!
+ \brief Get preference item option value.
+ \param name option name
+ \return property value or null integer if option is not set
+ \sa setOptionValue()
+*/
+QVariant QtxPagePrefSliderItem::optionValue( const QString& name ) const
+{
+ if ( name == "minimum" || name == "min" )
+ return minimum();
+ else if ( name == "maximum" || name == "max" )
+ return maximum();
+ else if ( name == "single_step" )
+ return singleStep();
+ else if ( name == "page_step" )
+ return pageStep();
+ else if ( name == "icons" || name == "pixmaps" )
+ {
+ QList<QVariant> lst;
+ QList<QIcon> ics = icons();
+ for ( QList<QIcon>::const_iterator it = ics.begin(); it != ics.end(); ++it )
+ lst.append( *it );
+ return lst;
+ }
+ else
+ return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+ \brief Set preference item option value.
+ \param name option name
+ \param val new property value
+ \sa optionValue()
+*/
+void QtxPagePrefSliderItem::setOptionValue( const QString& name, const QVariant& val )
+{
+ if ( val.canConvert( QVariant::Int ) )
{
- int pos = 0;
- QString str = myEditor->text();
- if ( val->validate( str, pos ) == QValidator::Invalid )
- myEditor->clear();
+ if ( name == "minimum" || name == "min" )
+ setMinimum( val.toInt() );
+ else if ( name == "maximum" || name == "max" )
+ setMaximum( val.toInt() );
+ else if ( name == "single_step" )
+ setSingleStep( val.toInt() );
+ else if ( name == "page_step" )
+ setPageStep( val.toInt() );
+ else
+ QtxPageNamedPrefItem::setOptionValue( name, val );
}
+ else if ( name == "icons" || name == "pixmaps" )
+ setIcons( val );
+ else
+ QtxPageNamedPrefItem::setOptionValue( name, val );
+}
- delete myEditor->validator();
- myEditor->setValidator( val );
+void QtxPagePrefSliderItem::setIcon( int pos )
+{
+ int index = pos - mySlider->minimum();
+ if ( !myIcons.isEmpty() && index >= 0 && index < myIcons.size() && !myIcons[index].isNull() )
+ myLabel->setPixmap( myIcons[index].pixmap( myIcons[index].availableSizes().first() ) );
+ else
+ myLabel->clear();
+}
+
+/*!
+ \brief Update slider widget.
+*/
+void QtxPagePrefSliderItem::updateSlider()
+{
+ int val = mySlider->value();
+ int stp = singleStep();
+ int ptp = pageStep();
+ int min = minimum();
+ int max = maximum();
+
+ control()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ mySlider->setFocusPolicy(Qt::StrongFocus);
+
+ mySlider->setValue( val );
+ setSingleStep( stp );
+ setPageStep( ptp );
+ setMinimum( min );
+ setMaximum( max );
+
+ myLabel->setVisible( !myIcons.empty() );
+ widget()->layout()->setSpacing( !myIcons.empty() ? 6 : 0 );
+}
+
+/*!
+ \brief Set the list of the icons from the resource manager.
+ \param var new icons list
+ \internal
+*/
+void QtxPagePrefSliderItem::setIcons( const QVariant& var )
+{
+ if ( var.type() != QVariant::List )
+ return;
+
+ QList<QIcon> lst;
+ QList<QVariant> varList = var.toList();
+ for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
+ {
+ if ( (*it).canConvert<QIcon>() )
+ lst.append( (*it).value<QIcon>() );
+ else if ( (*it).canConvert<QPixmap>() )
+ lst.append( (*it).value<QPixmap>() );
+ else
+ lst.append( QIcon() );
+ }
+ setIcons( lst );
}
/*!
/*!
\brief Get the list of the values from the selection widget.
\return list of values
- \sa numbers(), setStrings()
+ \sa numbers(), icons(), setStrings()
*/
QStringList QtxPagePrefSelectItem::strings() const
{
/*!
\brief Get the list of the values identifiers from the selection widget.
\return list of values IDs
- \sa strings(), setNumbers()
+ \sa strings(), icons(), setNumbers()
*/
QList<int> QtxPagePrefSelectItem::numbers() const
{
return res;
}
+/*!
+ \brief Get the list of the icons associated with the selection widget.items
+ \return list of icons
+ \sa strings(), numbers(), setIcons()
+*/
+QList<QIcon> QtxPagePrefSelectItem::icons() const
+{
+ QList<QIcon> res;
+ for ( uint i = 0; i < mySelector->count(); i++ )
+ res.append( mySelector->itemIcon( i ) );
+ return res;
+}
+
/*!
\brief Set the list of the values to the selection widget.
\param lst new list of values
- \sa strings(), setNumbers()
+ \sa strings(), setNumbers(), setIcons()
*/
void QtxPagePrefSelectItem::setStrings( const QStringList& lst )
{
}
/*!
- \brief Set the list of the values identifiers to the selection widget.
+ \brief Set the list of the values identifiers to the selection widget
\param ids new list of values IDs
- \sa numbers(), setStrings()
+ \sa numbers(), setStrings(), setIcons()
*/
void QtxPagePrefSelectItem::setNumbers( const QList<int>& ids )
{
uint i = 0;
- for ( QList<int>::const_iterator it = ids.begin(); it != ids.end() && i < mySelector->count(); ++it, i++ )
+ for ( QList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it, i++ ) {
+ if ( i >= mySelector->count() )
+ mySelector->addItem(QString("") );
+
mySelector->setId( i, *it );
+ }
+}
+
+/*!
+ \brief Set the list of the icons to the selection widget items
+
+ Important: call this method after setStrings() or setNumbers()
+
+ \param icns new list of icons
+ \sa icons(), setStrings(), setNumbers()
+*/
+void QtxPagePrefSelectItem::setIcons( const QList<QIcon>& icns )
+{
+ uint i = 0;
+ for ( QList<QIcon>::const_iterator it = icns.begin(); it != icns.end() && i < mySelector->count(); ++it, i++ )
+ mySelector->setItemIcon( i, *it );
}
/*!
lst.append( *it );
return lst;
}
+ else if ( name == "icons" || name == "pixmaps" )
+ {
+ QList<QVariant> lst;
+ QList<QIcon> ics = icons();
+ for ( QList<QIcon>::const_iterator it = ics.begin(); it != ics.end(); ++it )
+ lst.append( *it );
+ return lst;
+ }
else
return QtxPageNamedPrefItem::optionValue( name );
}
setStrings( val );
else if ( name == "numbers" || name == "ids" || name == "indexes" )
setNumbers( val );
+ else if ( name == "icons" || name == "pixmaps" )
+ setIcons( val );
else
QtxPageNamedPrefItem::setOptionValue( name, val );
}
setNumbers( lst );
}
+/*!
+ \brief Set the list of the icons from the resource manager.
+ \param var new icons list
+ \internal
+*/
+void QtxPagePrefSelectItem::setIcons( const QVariant& var )
+{
+ if ( var.type() != QVariant::List )
+ return;
+
+ QList<QIcon> lst;
+ QList<QVariant> varList = var.toList();
+ for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it )
+ {
+ if ( (*it).canConvert<QIcon>() )
+ lst.append( (*it).value<QIcon>() );
+ else if ( (*it).canConvert<QPixmap>() )
+ lst.append( (*it).value<QPixmap>() );
+ else
+ lst.append( QIcon() );
+ }
+ setIcons( lst );
+}
+
/*!
\brief Update selector widget.
*/
*/
QtxPagePrefSpinItem::QtxPagePrefSpinItem( const int type, const QString& title,
QtxPreferenceItem* parent, const QString& sect,
- const QString& param )
+ const QString& param )
: QtxPageNamedPrefItem( title, parent, sect, param ),
myType( type )
{
return QVariant();
}
+/*!
+ \brief Get double spin box preference item precision value.
+ \return double spin box precision
+ \sa setPrecision()
+*/
+QVariant QtxPagePrefSpinItem::precision() const
+{
+ if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+ return dsb->decimals();
+ else
+ return QVariant();
+}
+
/*!
\brief Get spin box preference item minimum value.
\return spin box minimum value
}
}
+/*!
+ \brief Set double spin box preference item precision value.
+ \param step new double spin box precision value
+ \sa precision()
+*/
+void QtxPagePrefSpinItem::setPrecision( const QVariant& prec )
+{
+ if ( QtxDoubleSpinBox* dsb = ::qobject_cast<QtxDoubleSpinBox*>( control() ) )
+ {
+ if ( prec.canConvert( QVariant::Int ) ) {
+ dsb->setDecimals( qAbs( prec.toInt() ) );
+ dsb->setPrecision( prec.toInt() );
+ }
+ }
+}
+
/*!
\brief Set spin box preference item minimum value.
\param min new spin box minimum value
return maximum();
else if ( name == "step" )
return step();
+ else if ( name == "precision" )
+ return precision();
else if ( name == "prefix" )
return prefix();
else if ( name == "suffix" )
setMaximum( val );
else if ( name == "step" )
setStep( val );
+ else if ( name == "precision" )
+ setPrecision( val );
else if ( name == "prefix" )
{
if ( val.canConvert( QVariant::String ) )
{
QVariant val;
QVariant stp = step();
+ QVariant prec = precision();
QVariant min = minimum();
QVariant max = maximum();
control()->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
setStep( stp );
+ setPrecision( prec );
setMinimum( min );
setMaximum( max );
\param param resource file parameter associated with the preference item
*/
QtxPagePrefTextItem::QtxPagePrefTextItem( QtxPreferenceItem* parent, const QString& sect,
- const QString& param )
+ const QString& param )
: QtxPageNamedPrefItem( QString(), parent, sect, param )
{
myEditor = new QTextEdit();
}
/*!
- \class QtxPagePrefFontItem
- \brief GUI implementation of the resources font item.
+ \class QtxPagePrefBiColorItem
+ \brief GUI implementation of the resources item to store a bi-color value.
+
+ The main color is specified explicitly. The secondary color is calculated
+ by changing "value" and "saturation" parameters of the main color in the
+ HSV notation using specified delta.
*/
/*!
\brief Constructor.
- \param feat font editor widget features (QtxFontEdit::Features)
\param title preference item title
\param parent parent preference item
\param sect resource file section associated with the preference item
\param param resource file parameter associated with the preference item
*/
-QtxPagePrefFontItem::QtxPagePrefFontItem( const int feat, const QString& title,
- QtxPreferenceItem* parent, const QString& sect,
- const QString& param )
+QtxPagePrefBiColorItem::QtxPagePrefBiColorItem( const QString& title, QtxPreferenceItem* parent,
+ const QString& sect, const QString& param )
: QtxPageNamedPrefItem( title, parent, sect, param )
{
- setControl( myFont = new QtxFontEdit( feat ) );
+ setControl( myColors = new QtxBiColorTool( 0 ) );
}
/*!
- \brief Constructor.
+ \brief Destructor.
+*/
+QtxPagePrefBiColorItem::~QtxPagePrefBiColorItem()
+{
+}
+
+/*!
+ \bried Get auxiliary text
+ \return text assigned to the item
+ \sa setText()
+*/
+QString QtxPagePrefBiColorItem::text() const
+{
+ return myColors->text();
+}
+
+/*!
+ \bried Set auxiliary text
+ \param t text being assigned to the item
+ \sa text()
+*/
+void QtxPagePrefBiColorItem::setText( const QString& t )
+{
+ myColors->setText( t );
+}
+
+/*!
+ \brief Store preference item to the resource manager.
+ \sa retrieve()
+*/
+void QtxPagePrefBiColorItem::store()
+{
+ setString( Qtx::biColorToString( myColors->mainColor(), myColors->delta() ) );
+}
+
+/*!
+ \brief Retrieve preference item from the resource manager.
+ \sa store()
+*/
+void QtxPagePrefBiColorItem::retrieve()
+{
+ QColor c;
+ int d;
+ Qtx::stringToBiColor( getString(), c, d );
+ myColors->setMainColor( c );
+ myColors->setDelta( d );
+}
+
+/*!
+ \brief Get preference item option value.
+ \param name option name
+ \return property value or null QVariant if option is not set
+ \sa setOptionValue()
+*/
+QVariant QtxPagePrefBiColorItem::optionValue( const QString& name ) const
+{
+ if ( name == "text" )
+ return text();
+ else
+ return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+ \brief Set preference item option value.
+ \param name option name
+ \param val new property value
+ \sa optionValue()
+*/
+void QtxPagePrefBiColorItem::setOptionValue( const QString& name, const QVariant& val )
+{
+ if ( name == "text" )
+ {
+ if ( val.canConvert( QVariant::String ) )
+ setText( val.toString() );
+ }
+ else
+ QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+ \class QtxPagePrefFontItem
+ \brief GUI implementation of the resources font item.
+*/
+
+/*!
+ \brief Constructor.
+ \param feat font editor widget features (QtxFontEdit::Features)
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefFontItem::QtxPagePrefFontItem( const int feat, const QString& title,
+ QtxPreferenceItem* parent, const QString& sect,
+ const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+ setControl( myFont = new QtxFontEdit( feat ) );
+}
+
+/*!
+ \brief Constructor.
\param title preference item title
\param parent parent preference item
\param sect resource file section associated with the preference item
myDateTime->setDisplayFormat( dispFmt );
}
+
+/*!
+ \brief Constructor.
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefShortcutBtnsItem::QtxPagePrefShortcutBtnsItem( const QString& title, QtxPreferenceItem* parent, const QString& sect,
+ const QString& param ): QtxPageNamedPrefItem( title, parent, sect, param )
+{
+ setControl( myShortcut = new QtxShortcutEdit() );
+}
+
+/*!
+ \brief Destructor.
+*/
+QtxPagePrefShortcutBtnsItem::~QtxPagePrefShortcutBtnsItem()
+{
+}
+
+/*!
+ \brief Store preference item to the resource manager.
+ \sa retrieve()
+*/
+void QtxPagePrefShortcutBtnsItem::store()
+{
+ setString( myShortcut->shortcut().toString() );
+}
+
+/*!
+ \brief Retrieve preference item from the resource manager.
+ \sa store()
+*/
+void QtxPagePrefShortcutBtnsItem::retrieve()
+{
+ myShortcut->setShortcut( QKeySequence::fromString( getString() ) );
+}
+
+/*!
+ \brief Constructor.
+
+ Creates preference item for editing of key bindings
+
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefShortcutTreeItem::QtxPagePrefShortcutTreeItem( const QString& title, QtxPreferenceItem* parent, const QString& sect,
+ const QString& param ): QtxPageNamedPrefItem( title, parent, sect, "" )
+{
+ mySection = sect;
+
+ myShortcutTree = new QtxShortcutTree();
+
+ // Retrieve shortcuts common sections from resources
+ QtxResourceMgr* resMgr = resourceMgr();
+ if ( resMgr ){
+ QString generalSections = resourceMgr()->stringValue( "shortcuts_settings", "general_sections", QString() );
+ QStringList sectionsList = generalSections.split( ";", QString::SkipEmptyParts );
+ myShortcutTree->setGeneralSections( sectionsList );
+ }
+
+ setControl( myShortcutTree );
+}
+
+/*!
+ \brief Destructor.
+*/
+QtxPagePrefShortcutTreeItem::~QtxPagePrefShortcutTreeItem()
+{
+}
+
+/*!
+ \brief Retrieve preference item from the resource manager.
+ \sa store()
+*/
+void QtxPagePrefShortcutTreeItem::retrieve()
+{
+ QtxResourceMgr* resMgr = resourceMgr();
+ if ( resMgr ){
+ QStringList secLst = resMgr->subSections( mySection, false );
+ ShortcutMap aMap; QStringList paramLst;
+ for( int i = 0; i < secLst.size(); i++ ) {
+ paramLst = resMgr->parameters( QStringList() << mySection << secLst.at( i ) );
+ for( int j = 0; j < paramLst.size(); j++ )
+ resMgr->value( mySection + resMgr->sectionsToken() + secLst.at( i ), paramLst.at( j ),aMap[ paramLst.at( j ) ], false );
+ myShortcutTree->setBindings( secLst.at( i ), aMap );
+ aMap.clear();
+ }
+ }
+}
+
+/*!
+ \brief Store preference item to the resource manager.
+ \sa retrieve()
+*/
+void QtxPagePrefShortcutTreeItem::store()
+{
+ QStringList lst = myShortcutTree->sections();
+ QString aSection;
+ QtxResourceMgr* resMgr = resourceMgr();
+
+ if ( resMgr ) {
+ for( int i = 0; i < lst.size(); i++ ) {
+ ShortcutMap* aMap( myShortcutTree->bindings( lst.at( i ) ) );
+ aSection = mySection + resMgr->sectionsToken() + lst.at( i );
+ for( ShortcutMap::const_iterator it = aMap->constBegin(); it != aMap->constEnd(); ++it )
+ resMgr->setValue( aSection, it.key(), it.value() );
+ }
+ }
+}
+
+/*!
+ \class QtxPagePrefBackgroundItem
+ \brief GUI implementation of the resources item to store background data.
+
+ Preference item allows specifying background data in different ways:
+ - solid color
+ - texture image file
+ - simple two-color gradient
+ - complex custom gradient (NOT IMPLEMENTED YET)
+
+ Allowed background modes can be specified using setModeAllowed() method.
+ Texture modes can be enabled/disabled using setTextureModeAllowed() method.
+ Also, showing texture controls can be enabled/disabled by means of
+ setTextureAllowed() method.
+ Verical or horizontal orientation of the widget can be chosen via setOrientation()
+ method (default orientation is horizontal).
+
+ Simple gradient types can be specified using setGradients() method.
+
+ \sa Qtx::BackgroundData, QtxBackgroundTool
+*/
+
+/*!
+ \brief Constructor.
+ \param title preference item title
+ \param parent parent preference item
+ \param sect resource file section associated with the preference item
+ \param param resource file parameter associated with the preference item
+*/
+QtxPagePrefBackgroundItem::QtxPagePrefBackgroundItem( const QString& title, QtxPreferenceItem* parent,
+ const QString& sect, const QString& param )
+: QtxPageNamedPrefItem( title, parent, sect, param )
+{
+ setControl( myBgTool = new QtxBackgroundTool( 0 ) );
+}
+
+/*!
+ \brief Destructor.
+*/
+QtxPagePrefBackgroundItem::~QtxPagePrefBackgroundItem()
+{
+}
+
+/*!
+ \brief Get allowed two-color gradients to the widget
+ \param gradients gradients names are returned via this parameter
+ \param ids gradients identifiers are returned via this parameter (empty list can be returned)
+*/
+void QtxPagePrefBackgroundItem::gradients( QStringList& gradList, QIntList& idList ) const
+{
+ myBgTool->gradients( gradList, idList );
+}
+
+/*!
+ \brief Set allowed two-color gradients to the widget
+ \param gradients gradients names
+ \param ids optional gradients identifiers; if not specified, gradients are automatically numbered starting from 0
+*/
+void QtxPagePrefBackgroundItem::setGradients( const QStringList& gradients, const QIntList& ids )
+{
+ myBgTool->setGradients( gradients, ids );
+}
+
+/*!
+ \brief Check if specific background mode is allowed
+ \param mode background mode
+ \return \c true if specified background mode is enabled or \c false otherwise
+ \sa setModeAllowed()
+*/
+bool QtxPagePrefBackgroundItem::isModeAllowed( Qtx::BackgroundMode mode ) const
+{
+ return myBgTool->isModeAllowed( mode );
+}
+
+/*!
+ \brief Enable / disable specific background mode
+ \param mode background mode
+ \param on enable / disable flag
+ \sa isModeAllowed()
+*/
+void QtxPagePrefBackgroundItem::setModeAllowed( Qtx::BackgroundMode mode, bool on )
+{
+ myBgTool->setModeAllowed( mode, on );
+}
+
+/*!
+ \brief Check if specific texture mode is allowed
+ \param mode texture mode
+ \return \c true if specified texture mode is enabled or \c false otherwise
+ \sa setTextureModeAllowed(), setTextureAllowed()
+*/
+bool QtxPagePrefBackgroundItem::isTextureModeAllowed( Qtx::TextureMode mode ) const
+{
+ return myBgTool->isTextureModeAllowed( mode );
+}
+
+/*!
+ \brief Enable / disable specific texture mode
+ \param mode texture mode
+ \param on enable / disable flag (\c true by default)
+ \sa isTextureModeAllowed(), setTextureAllowed()
+*/
+void QtxPagePrefBackgroundItem::setTextureModeAllowed( Qtx::TextureMode mode, bool on )
+{
+ myBgTool->setTextureModeAllowed( mode, on );
+}
+
+/*!
+ \brief Check if texture controls are allowed (shown)
+ \return \c true if texture controls are enabled or \c false otherwise
+ \sa setTextureAllowed(), setTextureModeAllowed()
+*/
+bool QtxPagePrefBackgroundItem::isTextureAllowed() const
+{
+ return myBgTool->isTextureAllowed();
+}
+
+/*!
+ \brief Enable / disable texture controls
+ \param on enable / disable flag (\c true by default)
+ \sa isTextureAllowed(), setTextureModeAllowed()
+*/
+void QtxPagePrefBackgroundItem::setTextureAllowed( bool on )
+{
+ myBgTool->setTextureAllowed( on );
+}
+
+/*!
+ \brief Get allowed image formats
+ \return image formats
+*/
+QString QtxPagePrefBackgroundItem::imageFormats() const
+{
+ return myBgTool->imageFormats();
+}
+
+/*!
+ \brief Set allowed image formats
+ \param formats image formats
+*/
+void QtxPagePrefBackgroundItem::setImageFormats( const QString& formats )
+{
+ myBgTool->setImageFormats( formats );
+}
+
+/*!
+ \brief Get widget editor orientation
+ \return orientation
+*/
+Qt::Orientation QtxPagePrefBackgroundItem::orientation() const
+{
+ return myBgTool->orientation();
+}
+
+/*!
+ \brief Set widget editor orientation
+ \param o orientation
+*/
+void QtxPagePrefBackgroundItem::setOrientation( Qt::Orientation o )
+{
+ myBgTool->setOrientation( o );
+}
+
+/*!
+ \brief Store preference item to the resource manager.
+ \sa retrieve()
+*/
+void QtxPagePrefBackgroundItem::store()
+{
+ setString( Qtx::backgroundToString( myBgTool->data() ) );
+}
+
+/*!
+ \brief Retrieve preference item from the resource manager.
+ \sa store()
+*/
+void QtxPagePrefBackgroundItem::retrieve()
+{
+ myBgTool->setData( Qtx::stringToBackground( getString() ) );
+}
+
+/*!
+ \brief Get preference item option value.
+ \param name option name
+ \return property value or null QVariant if option is not set
+ \sa setOptionValue()
+*/
+QVariant QtxPagePrefBackgroundItem::optionValue( const QString& name ) const
+{
+ if ( name == "texture_enabled" )
+ return isTextureAllowed();
+ else if ( name == "color_enabled" )
+ return isModeAllowed( Qtx::ColorBackground );
+ else if ( name == "gradient_enabled" )
+ return isModeAllowed( Qtx::SimpleGradientBackground );
+ else if ( name == "custom_enabled" )
+ return isModeAllowed( Qtx::CustomGradientBackground );
+ else if ( name == "texture_center_enabled" )
+ return isTextureModeAllowed( Qtx::CenterTexture );
+ else if ( name == "texture_tile_enabled" )
+ return isTextureModeAllowed( Qtx::TileTexture );
+ else if ( name == "texture_stretch_enabled" )
+ return isTextureModeAllowed( Qtx::StretchTexture );
+ else if ( name == "orientation" )
+ return orientation();
+ else if ( name == "image_formats" )
+ return imageFormats();
+ else if ( name == "gradient_names" ) {
+ QStringList grList;
+ QIntList idList;
+ gradients( grList, idList );
+ return grList;
+ }
+ else if ( name == "gradient_ids" ) {
+ QStringList grList;
+ QIntList idList;
+ gradients( grList, idList );
+ QList<QVariant> lst;
+ for ( QIntList::const_iterator it = idList.begin(); it != idList.end(); ++it )
+ lst.append( *it );
+ return lst;
+ }
+ else
+ return QtxPageNamedPrefItem::optionValue( name );
+}
+
+/*!
+ \brief Set preference item option value.
+ \param name option name
+ \param val new property value
+ \sa optionValue()
+*/
+void QtxPagePrefBackgroundItem::setOptionValue( const QString& name, const QVariant& val )
+{
+ if ( name == "texture_enabled" ) {
+ if ( val.canConvert( QVariant::Bool ) )
+ setTextureAllowed( val.toBool() );
+ }
+ else if ( name == "color_enabled" ) {
+ if ( val.canConvert( QVariant::Bool ) )
+ setModeAllowed( Qtx::ColorBackground, val.toBool() );
+ }
+ else if ( name == "gradient_enabled" ) {
+ if ( val.canConvert( QVariant::Bool ) )
+ setModeAllowed( Qtx::SimpleGradientBackground, val.toBool() );
+ }
+ else if ( name == "custom_enabled" ) {
+ if ( val.canConvert( QVariant::Bool ) )
+ setModeAllowed( Qtx::CustomGradientBackground, val.toBool() );
+ }
+ else if ( name == "texture_center_enabled" ) {
+ if ( val.canConvert( QVariant::Bool ) )
+ setTextureModeAllowed( Qtx::CenterTexture, val.toBool() );
+ }
+ else if ( name == "texture_tile_enabled" ) {
+ if ( val.canConvert( QVariant::Bool ) )
+ setTextureModeAllowed( Qtx::TileTexture, val.toBool() );
+ }
+ else if ( name == "texture_stretch_enabled" ) {
+ if ( val.canConvert( QVariant::Bool ) )
+ setTextureModeAllowed( Qtx::StretchTexture, val.toBool() );
+ }
+ else if ( name == "orientation" ) {
+ if ( val.canConvert( QVariant::Int ) )
+ setOrientation( (Qt::Orientation)val.toInt() );
+ }
+ else if ( name == "image_formats" ) {
+ if ( val.canConvert( QVariant::String ) )
+ setImageFormats( val.toString() );
+ }
+ else if ( name == "gradient_names" ) {
+ if ( val.canConvert( QVariant::StringList ) )
+ setGradients( val.toStringList() );
+ }
+ else if ( name == "gradient_ids" ) {
+ if ( val.canConvert( QVariant::List ) ) {
+ QStringList grList;
+ QIntList idList;
+ gradients( grList, idList );
+ idList.clear();
+ QList<QVariant> varList = val.toList();
+ for ( QList<QVariant>::const_iterator it = varList.begin(); it != varList.end(); ++it ) {
+ if ( (*it).canConvert( QVariant::Int ) )
+ idList.append( (*it).toInt() );
+ }
+ setGradients( grList, idList );
+ }
+ }
+ else
+ QtxPageNamedPrefItem::setOptionValue( name, val );
+}
+
+/*!
+ \brief Constructor.
+
+ Creates preference item of user defined widget. The item widget has to be inherited from
+ QtxUserDefinedContent class. An instance of this class has to be installed into the item
+ with help of setContent method. Methods optionValue and setOptionValue use pointer on the
+ content widget an qint64 value.
+
+ \param parent parent preference item
+*/
+QtxUserDefinedItem::QtxUserDefinedItem( QtxPreferenceItem* parent )
+ : QtxPageNamedPrefItem(QString(), parent), myContent(0)
+{
+}
+
+/*!
+ \brief Lets to Store preferences for content instance
+ \sa retrieve()
+*/
+void QtxUserDefinedItem::store()
+{
+ if (myContent) {
+ myContent->store( resourceMgr(), preferenceMgr());
+ }
+}
+
+/*!
+ \brief Lets to Retrieve preferences for content instance
+ \sa store()
+*/
+void QtxUserDefinedItem::retrieve()
+{
+ if (myContent) {
+ myContent->retrieve( resourceMgr(), preferenceMgr());
+ }
+}
+
+/*!
+ * \brief Returns option value
+ * \param theName is a string "content"
+ * \return pointer on QtxUserDefinedContent class instance as a qint64 value
+ */
+QVariant QtxUserDefinedItem::optionValue( const QString& theName ) const
+{
+ if ( theName == "content" )
+ return (qint64) myContent;
+ else
+ return QtxPreferenceItem::optionValue( theName );
+}
+
+/*!
+ * \brief Sets option value
+ * \param theName is a string "content"
+ * \param theVal is a pointer on QtxUserDefinedContent class instance represented as qint64 value
+ */
+void QtxUserDefinedItem::setOptionValue( const QString& theName, const QVariant& theVal)
+{
+ if ( theName == "content" ) {
+ if ( theVal.canConvert( QVariant::ULongLong ) ) {
+ setContent( (QtxUserDefinedContent*)theVal.toULongLong() );
+ }
+ } else
+ QtxPreferenceItem::setOptionValue( theName, theVal );
+}
+
+/*!
+ * \brief Defines content of the property item as a Widget which has to be inherited from
+ * QtxUserDefinedContent class.
+ * \param theContent is an QtxUserDefinedContent class instance.
+ */
+void QtxUserDefinedItem::setContent( QtxUserDefinedContent* theContent )
+{
+ myContent = theContent;
+ setControl(myContent);
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPagePrefMgr.h
// Author: Sergey TELKOV
//
#include <QFrame>
#include <QLabel>
#include <QPointer>
+#include <QIcon>
class QtxGridBox;
class QtxFontEdit;
class QtxGroupBox;
class QtxComboBox;
class QtxColorButton;
+class QtxBiColorTool;
+class QtxShortcutEdit;
+class QtxShortcutTree;
+class QtxBackgroundTool;
class QToolBox;
class QLineEdit;
class QFileDialog;
class QDateTimeEdit;
class QStackedWidget;
+class QSlider;
+class QTreeWidget;
class QTX_EXPORT QtxPagePrefMgr : public QFrame, public QtxPreferenceMgr
{
int inputType() const;
void setInputType( const int );
+ int decimals() const;
+ void setDecimals( const int );
+
+ int echoMode() const;
+ void setEchoMode( const int );
+
virtual void store();
virtual void retrieve();
private:
int myType;
+ int myDecimals;
+ int myEchoMode;
QLineEdit* myEditor;
};
+class QTX_EXPORT QtxPagePrefSliderItem : public QObject,public QtxPageNamedPrefItem
+{
+ Q_OBJECT
+
+public:
+ QtxPagePrefSliderItem( const QString&, QtxPreferenceItem* = 0,
+ const QString& = QString(), const QString& = QString() );
+ virtual ~QtxPagePrefSliderItem();
+
+ int singleStep() const;
+ int pageStep() const;
+ int minimum() const;
+ int maximum() const;
+ QList<QIcon> icons() const;
+
+ void setSingleStep( const int& );
+ void setPageStep( const int& );
+ void setMinimum( const int& );
+ void setMaximum( const int& );
+ void setIcons( const QList<QIcon>& );
+
+ virtual void store();
+ virtual void retrieve();
+
+protected:
+ virtual QVariant optionValue( const QString& ) const;
+ virtual void setOptionValue( const QString&, const QVariant& );
+
+private slots:
+ void setIcon( int );
+
+private:
+ void updateSlider();
+ void setIcons( const QVariant& );
+
+private:
+ QSlider* mySlider;
+ QLabel* myLabel;
+ QList<QIcon> myIcons;
+};
+
class QTX_EXPORT QtxPagePrefSelectItem : public QtxPageNamedPrefItem
{
public:
QStringList strings() const;
QList<int> numbers() const;
+ QList<QIcon> icons() const;
void setStrings( const QStringList& );
void setNumbers( const QList<int>& );
+ void setIcons( const QList<QIcon>& );
virtual void store();
virtual void retrieve();
void updateSelector();
void setStrings( const QVariant& );
void setNumbers( const QVariant& );
+ void setIcons( const QVariant& );
private:
int myType;
virtual ~QtxPagePrefSpinItem();
QVariant step() const;
+ QVariant precision() const;
QVariant minimum() const;
QVariant maximum() const;
QString specialValueText() const;
void setStep( const QVariant& );
+ void setPrecision( const QVariant& );
void setMinimum( const QVariant& );
void setMaximum( const QVariant& );
QtxColorButton* myColor;
};
+class QTX_EXPORT QtxPagePrefBiColorItem : public QtxPageNamedPrefItem
+{
+public:
+ QtxPagePrefBiColorItem( const QString&, QtxPreferenceItem* = 0,
+ const QString& = QString(), const QString& = QString() );
+ virtual ~QtxPagePrefBiColorItem();
+
+ virtual QString text() const;
+ virtual void setText( const QString& );
+
+ virtual void store();
+ virtual void retrieve();
+
+protected:
+ virtual QVariant optionValue( const QString& ) const;
+ virtual void setOptionValue( const QString&, const QVariant& );
+
+private:
+ QtxBiColorTool* myColors;
+};
+
class QTX_EXPORT QtxPagePrefFontItem : public QObject, public QtxPageNamedPrefItem
{
Q_OBJECT
QDateTimeEdit* myDateTime;
};
+class QTX_EXPORT QtxPagePrefShortcutBtnsItem : public QtxPageNamedPrefItem
+{
+public:
+ QtxPagePrefShortcutBtnsItem( const QString&, QtxPreferenceItem* = 0,
+ const QString& = QString(), const QString& = QString() );
+ virtual ~QtxPagePrefShortcutBtnsItem();
+ virtual void store();
+ virtual void retrieve();
+
+private:
+ QtxShortcutEdit* myShortcut;
+};
+
+class QTX_EXPORT QtxPagePrefShortcutTreeItem : public QtxPageNamedPrefItem
+{
+public:
+ QtxPagePrefShortcutTreeItem( const QString&, QtxPreferenceItem* = 0,
+ const QString& = QString(), const QString& = QString() );
+ virtual ~QtxPagePrefShortcutTreeItem();
+ virtual void store();
+ virtual void retrieve();
+
+private:
+ QtxShortcutTree* myShortcutTree;
+ QString mySection;
+};
+
+class QTX_EXPORT QtxPagePrefBackgroundItem : public QObject, public QtxPageNamedPrefItem
+{
+ Q_OBJECT
+
+public:
+ QtxPagePrefBackgroundItem( const QString&, QtxPreferenceItem* = 0,
+ const QString& = QString(), const QString& = QString() );
+ virtual ~QtxPagePrefBackgroundItem();
+
+ void gradients( QStringList&, QIntList& ) const;
+ void setGradients( const QStringList&, const QIntList& = QIntList() );
+
+ bool isModeAllowed( Qtx::BackgroundMode ) const;
+ void setModeAllowed( Qtx::BackgroundMode, bool );
+
+ bool isTextureModeAllowed( Qtx::TextureMode ) const;
+ void setTextureModeAllowed( Qtx::TextureMode, bool );
+
+ bool isTextureAllowed() const;
+ void setTextureAllowed( bool );
+
+ QString imageFormats() const;
+ void setImageFormats( const QString& );
+
+ Qt::Orientation orientation() const;
+ void setOrientation( Qt::Orientation );
+
+ virtual void store();
+ virtual void retrieve();
+
+protected:
+ virtual QVariant optionValue( const QString& ) const;
+ virtual void setOptionValue( const QString&, const QVariant& );
+
+private:
+ QtxBackgroundTool* myBgTool;
+};
+
+class QtxUserDefinedContent: public QWidget
+{
+ public:
+ QtxUserDefinedContent(QWidget* parent = 0, Qt::WindowFlags f = 0 ):QWidget(parent, f) {};
+ virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref) = 0;
+ virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref) = 0;
+};
+
+
+class QTX_EXPORT QtxUserDefinedItem : public QtxPageNamedPrefItem
+{
+public:
+ QtxUserDefinedItem( QtxPreferenceItem* parent );
+
+ void setContent( QtxUserDefinedContent* theContent );
+
+ virtual void store();
+ virtual void retrieve();
+
+protected:
+ virtual QVariant optionValue( const QString& theName ) const;
+ virtual void setOptionValue( const QString& theName, const QVariant& theVal );
+
+private:
+ QtxUserDefinedContent* myContent;
+};
+
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPathDialog.cxx
// Author: Sergey TELKOV
//
bool QtxPathDialog::acceptData() const
{
bool ok = true;
-
+
QWidget* parent = (QWidget*)this;
FileEntryMap::ConstIterator it;
if ( entry.edit->text().isEmpty() )
{
QMessageBox::critical( parent, windowTitle(), tr( "File name not specified" ),
- QMessageBox::Ok, QMessageBox::NoButton );
+ QMessageBox::Ok, QMessageBox::NoButton );
ok = false;
}
else switch ( entry.mode )
case OpenFile:
if ( !fileInfo.exists() )
{
- QMessageBox::critical( parent, windowTitle(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ),
- QMessageBox::Ok, QMessageBox::NoButton );
- ok = false;
+ QMessageBox::critical( parent, windowTitle(), tr( "File \"%1\" does not exist" ).arg( fileInfo.filePath() ),
+ QMessageBox::Ok, QMessageBox::NoButton );
+ ok = false;
}
break;
case SaveFile:
if ( fileInfo.exists() )
- ok = QMessageBox::warning( parent, windowTitle(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ),
- QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+ ok = QMessageBox::warning( parent, windowTitle(), tr( "File \"%1\" already exist. Do you want to overwrite it?" ).arg( fileInfo.filePath() ),
+ QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
break;
case OpenDir:
if ( !fileInfo.exists() || !fileInfo.isDir() )
{
- QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ),
- QMessageBox::Ok, QMessageBox::NoButton );
- ok = false;
+ QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" does not exist" ).arg( fileInfo.filePath() ),
+ QMessageBox::Ok, QMessageBox::NoButton );
+ ok = false;
}
break;
case SaveDir:
if ( fileInfo.exists() && !fileInfo.isDir() )
{
- QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
- QMessageBox::Ok, QMessageBox::NoButton );
- ok = false;
+ QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
+ QMessageBox::Ok, QMessageBox::NoButton );
+ ok = false;
}
break;
case NewDir:
if ( fileInfo.exists() )
{
- if ( !fileInfo.isDir() )
- {
- QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
- QMessageBox::Ok, QMessageBox::NoButton );
- ok = false;
- }
- else if ( QDir( fileInfo.filePath() ).count() > 2 )
- ok = QMessageBox::warning( parent, windowTitle(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ),
- QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
+ if ( !fileInfo.isDir() )
+ {
+ QMessageBox::critical( parent, windowTitle(), tr( "Directory \"%1\" can't be created because file with the same name exist" ).arg( fileInfo.filePath() ),
+ QMessageBox::Ok, QMessageBox::NoButton );
+ ok = false;
+ }
+ else if ( QDir( fileInfo.filePath() ).count() > 2 )
+ ok = QMessageBox::warning( parent, windowTitle(), tr( "Directory \"%1\" not empty. Do you want to remove all files in this directory?" ).arg( fileInfo.filePath() ),
+ QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
}
break;
default:
{
int mode;
QLineEdit* le = fileEntry( id, mode );
-
+
if ( le )
{
if ( autoExt && ( mode == OpenFile || mode == SaveFile ) )
\return created file entry ID
*/
int QtxPathDialog::createFileEntry( const QString& lab, const int mode,
- const QString& filter, const int id )
+ const QString& filter, const int id )
{
int num = id;
if ( num == -1 )
for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it )
{
if ( (*it).indexOf( "." ) != -1 )
- res.append( (*it).trimmed() );
+ res.append( (*it).trimmed() );
}
}
return res;
for ( QObjectList::const_iterator it = aChildren.begin(); it != aChildren.end() && !res; ++it )
{
if ( (*it)->isWidgetType() )
- res = ((QWidget*)(*it))->isVisibleTo( wid );
+ res = ((QWidget*)(*it))->isVisibleTo( wid );
}
}
return res;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPathDialog.h
// Author: Sergey TELKOV
//
void initialize();
void updateVisibility();
QStringList prepareFilters( const QString& ) const;
- bool hasVisibleChildren( QWidget* ) const;
+ bool hasVisibleChildren( QWidget* ) const;
QStringList filterWildCards( const QString& ) const;
QString autoExtension( const QString&, const QString& = QString() ) const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPathEdit.cxx
// Author: Sergey TELKOV
//
void QtxPathEdit::onBrowse( bool /*on*/ )
{
QString path;
- QString initial = QFileInfo( myPath->text() ).path();
+ QString initial = QFileInfo( Qtx::makeEnvVarSubst( myPath->text() ) ).filePath();
switch ( pathType() )
{
case Qtx::PT_OpenFile:
base->setSpacing( 5 );
base->addWidget( myPath = new QLineEdit( this ) );
- myPath->setValidator( new QRegExpValidator( QRegExp( "^([\\w/]{2}|[A-Z]:)[^:;\\*\\?]*[\\w\\\\/\\.]$" ), myPath ) );
+ myPath->setValidator( new QRegExpValidator( QRegExp( "^([\\$]|[\\%]|[\\w/]{2}|[A-Z]:)[^:;\\*\\?]*[\\w\\\\/\\.]$" ), myPath ) );
QToolButton* browse = new QToolButton( this );
browse->setIcon( QPixmap( browse_icon ) );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPathEdit.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPathListEdit.cxx
// Author: Sergey TELKOV
//
if (found) {
if (found != myLastSelected) {
// it is forbidden to add directory more then once
- if ( !quietMode )
- QMessageBox::critical(this,
- tr("Error"),
- tr("Directory already specified."),
- tr("Ok"));
- myEdit->setFocus();
+ if ( !quietMode )
+ QMessageBox::critical(this,
+ tr("Error"),
+ tr("Directory already specified."),
+ tr("Ok"));
+ myEdit->setFocus();
return false;
}
}
else {
if (!dir.exists()) {
- if ( !quietMode && QMessageBox::information(this,
- tr("Warning"),
- tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()),
- tr("Yes"), tr("No"), QString(), 1, 1) == 1) {
- myEdit->setFocus();
+ if ( !quietMode && QMessageBox::information(this,
+ tr("Warning"),
+ tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()),
+ tr("Yes"), tr("No"), QString(), 1, 1) == 1) {
+ myEdit->setFocus();
return false;
- }
+ }
}
// append
appendDir(myLastSelected, dir.absPath());
if ( pathType() == Qtx::PT_SaveFile )
return true;
- bool ok = QFileInfo( str ).exists();
+ QFileInfo aFI = QFileInfo( Qtx::makeEnvVarSubst( str ) );
+ bool ok = aFI.exists();
if ( !ok && msg )
ok = QMessageBox::question( this, tr( "Warning" ), tr( "Path \"%1\" doesn't exist. Add it to list anyway?" ).arg( str ),
QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes;
- if ( ok && QFileInfo( str ).exists() )
+ if ( ok && aFI.exists() )
{
switch ( pathType() )
{
case Qtx::PT_OpenFile:
- ok = QFileInfo( str ).isFile();
+ ok = aFI.isFile();
if ( !ok && msg )
QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to file" ).arg( str ) );
break;
case Qtx::PT_Directory:
- ok = QFileInfo( str ).isDir();
+ ok = aFI.isDir();
if ( !ok && msg )
QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to directory" ).arg( str ) );
break;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPathListEdit.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPopupMgr.cxx
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
{
const QList<QVariant>& aList1 = v1.toList(), aList2 = v2.toList();
QList<QVariant>::const_iterator anIt1 = aList1.begin(), aLast1 = aList1.end(),
- anIt2 = aList2.begin(), aLast2 = aList2.end();
+ anIt2 = aList2.begin(), aLast2 = aList2.end();
for ( ; anIt1 != aLast1 && anIt2 != aLast2; anIt1++, anIt2++ )
{
- if ( (*anIt1) != (*anIt2) )
- return (*anIt1)<(*anIt2);
+ if ( (*anIt1) != (*anIt2) )
+ return (*anIt1)<(*anIt2);
}
return anIt1 == aLast1 && anIt2 != aLast2;
}
const ItemAttributes&, const int );
virtual QString rule( const ItemAttributes&,
- const QtxPopupMgr::RuleType = VisibleRule ) const;
+ const QtxPopupMgr::RuleType = VisibleRule ) const;
private:
QtxPopupMgr* myMgr;
\return rule for the menu item corresponding to the rule type
*/
QString QtxPopupMgr::PopupCreator::rule( const ItemAttributes& /*attr*/,
- const QtxPopupMgr::RuleType /*ruleType*/ ) const
+ const QtxPopupMgr::RuleType /*ruleType*/ ) const
{
return QString();
}
mySelection = sel;
- if ( mySelection )
+ if ( mySelection ) {
mySelection->setParent( this );
+ mySelection->setPopupMgr( this );
+ }
+
connect( mySelection, SIGNAL( destroyed( QObject* ) ),
- this, SLOT( onSelectionDestroyed( QObject* ) ) );
+ this, SLOT( onSelectionDestroyed( QObject* ) ) );
QtxActionMgr::triggerUpdate();
}
for ( int i = 0; i < mySelection->count() && !res; i++ )
{
QList<QVariant> c;
- for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 )
+ for ( QStringList::const_iterator anIt1 = specific.begin(); anIt1 != specific.end(); ++anIt1 )
c.append( parameter( *anIt1, i ) );
aCorteges.insert( c, 0 );
}
for ( QMap<QList<QVariant>, int>::const_iterator anIt = aCorteges.begin(); anIt != aCorteges.end(); ++anIt )
{
- const QList<QVariant>& aCortege = anIt.key();
- QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
- QList<QVariant>::const_iterator anIt2 = aCortege.begin();
- for ( ; anIt1 != aLast1; anIt1++, anIt2++ )
- p->setParameter( *anIt1, *anIt2 );
- res = res || result( p );
+ const QList<QVariant>& aCortege = anIt.key();
+ QStringList::const_iterator anIt1 = specific.begin(), aLast1 = specific.end();
+ QList<QVariant>::const_iterator anIt2 = aCortege.begin();
+ for ( ; anIt1 != aLast1; anIt1++, anIt2++ )
+ p->setParameter( *anIt1, *anIt2 );
+ res = res || result( p );
}
}
else
\brief Constructor.
*/
QtxPopupSelection::QtxPopupSelection()
-: QObject( 0 )
+ : QObject( 0 ),
+ myPopupMgr( 0 )
{
}
myOptions.insert( optName, opt );
}
+QtxPopupMgr* QtxPopupSelection::popupMgr() const
+{
+ return myPopupMgr;
+}
+
+void QtxPopupSelection::setPopupMgr( QtxPopupMgr* pm )
+{
+ myPopupMgr = pm;
+}
+
/*!
\brief Get the parameter value.
\param str parameter name
{
QtxEvalSetSets::ValueSet set;
QString par = str.mid( equalityParam().length() );
+
+ QtxPopupMgr* pMgr = popupMgr();
for ( int i = 0; i < (int)count(); i++ )
{
- QVariant v = parameter( i, par );
+ QVariant v = pMgr ? pMgr->parameter( par, i ) : parameter( i, par );
if ( v.isValid() )
- QtxEvalSetSets::add( set, v );
+ QtxEvalSetSets::add( set, v );
else
- return QVariant();
+ return QVariant();
}
return set;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPopupMgr.h
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
RuleMap myRules;
CacheMap myCache;
QtxPopupSelection* mySelection;
+
+ friend class QtxPopupSelection;
};
class QTX_EXPORT QtxPopupSelection : public QObject
QString option( const QString& ) const;
void setOption( const QString&, const QString& );
+ QtxPopupMgr* popupMgr() const;
+ void setPopupMgr( QtxPopupMgr* );
+
private:
QString equalityParam() const;
QString selCountParam() const;
private:
typedef QMap<QString, QString> OptionsMap;
+ typedef QPointer<QtxPopupMgr> PopupMgrPtr;
private:
OptionsMap myOptions;
+ PopupMgrPtr myPopupMgr;
};
#endif // QTXPOPUPMGR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPreferenceMgr.cxx
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxPreferenceMgr.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxResourceMgr.cxx
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
#include "QtxResourceMgr.h"
#include "QtxTranslator.h"
+#include <QSet>
#include <QDir>
#include <QFile>
+#include <QFileInfo>
#include <QRegExp>
#include <QTextStream>
#include <QApplication>
+#include <QLibraryInfo>
+#include <QtDebug>
#ifndef QT_NO_DOM
#include <QDomDocument>
#include <QDomElement>
QPixmap loadPixmap( const QString&, const QString&, const QString& ) const;
QTranslator* loadTranslator( const QString&, const QString&, const QString& ) const;
- QString environmentVariable( const QString&, int&, int& ) const;
QString makeSubstitution( const QString&, const QString&, const QString& ) const;
void clear();
QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, const QString& prefix, const QString& name ) const
{
QTranslator* trans = new QtxTranslator( 0 );
- QString fname = fileName( sect, prefix, name );
+ QString fname = QDir::convertSeparators( fileName( sect, prefix, name ) );
if ( !trans->load( Qtx::file( fname, false ), Qtx::dir( fname ) ) )
{
delete trans;
return trans;
}
-/*!
- \brief Parse given string to retrieve environment variable.
-
- Looks through the string for the patterns: ${name} or $(name) or %name%.
- If string contains variable satisfying any pattern, the variable name
- is returned, start index of the variable is returned in the \a start parameter,
- and length of the variable is returned in the \a len parameter.
-
- \param str string being processed
- \param start if variable is found, this parameter contains its starting
- position in the \a str
- \param len if variable is found, this parameter contains its length
- \return first found variable or null QString if there is no ones
-*/
-QString QtxResourceMgr::Resources::environmentVariable( const QString& str, int& start, int& len ) const
-{
- QString varName;
- len = 0;
-
- QRegExp rx( "(^\\$\\{|[^\\$]\\$\\{)([a-zA-Z]+[a-zA-Z0-9_]*)(\\})|(^\\$\\(|[^\\$]\\$\\()([a-zA-Z]+[a-zA-Z0-9_]*)(\\))|(^\\$|[^\\$]\\$)([a-zA-Z]+[a-zA-Z0-9_]*)|(^%|[^%]%)([a-zA-Z]+[a-zA-Z0-9_]*)(%[^%]|%$)" );
-
- int pos = rx.indexIn( str, start );
- if ( pos != -1 )
- {
- int i = 1;
- while ( i <= rx.numCaptures() && varName.isEmpty() )
- {
- QString capStr = rx.cap( i );
- if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) )
- varName = capStr;
- i++;
- }
-
- if ( !varName.isEmpty() )
- {
- int capIdx = i - 1;
- start = rx.pos( capIdx );
- int end = start + varName.length();
- if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) )
- start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) );
- if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() )
- end++;
- len = end - start;
- }
- }
- return varName;
-}
-
/*!
\brief Substitute variables by their values.
int start( 0 ), len( 0 );
while ( true )
{
- QString envName = environmentVariable( res, start, len );
+ QString envName = Qtx::findEnvVar( res, start, len );
if ( envName.isNull() )
break;
protected:
virtual bool load( const QString&, QMap<QString, Section>& );
virtual bool save( const QString&, const QMap<QString, Section>& );
+
+private:
+ bool load( const QString&, QMap<QString, Section>&, QSet<QString>& );
};
/*!
*/
bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Section>& secMap )
{
- QFile file( fname );
+ QSet<QString> importHistory;
+ return load( fname, secMap, importHistory );
+}
+
+
+/*!
+ \brief Load resources from xml-file.
+ \param fname resources file name
+ \param secMap resources map to be filled in
+ \param importHistory list of already imported resources files (to prevent import loops)
+ \return \c true on success or \c false on error
+*/
+bool QtxResourceMgr::IniFormat::load( const QString& fname, QMap<QString, Section>& secMap, QSet<QString>& importHistory )
+{
+ QString aFName = fname.trimmed();
+ if ( !QFileInfo( aFName ).exists() )
+ {
+ if ( QFileInfo( aFName + ".ini" ).exists() )
+ aFName += ".ini";
+ else if ( QFileInfo( aFName + ".INI" ).exists() )
+ aFName += ".INI";
+ else
+ return false; // file does not exist
+ }
+ QFileInfo aFinfo( aFName );
+ aFName = aFinfo.canonicalFilePath();
+
+ if ( !importHistory.contains( aFName ) )
+ importHistory.insert( aFName );
+ else
+ return true; // already imported (prevent import loops)
+
+ QFile file( aFName );
if ( !file.open( QFile::ReadOnly ) )
- return false;
+ return false; // file is not accessible
QTextStream ts( &file );
if ( section.isEmpty() )
{
res = false;
- qWarning( "Empty section in line %d", line );
+ qWarning() << "QtxResourceMgr: Empty section in line:" << line;
}
}
- else if ( data.contains( "=" ) && !section.isEmpty() )
+ else if ( data.contains( separator ) && !section.isEmpty() )
{
int pos = data.indexOf( separator );
QString key = data.left( pos ).trimmed();
QString val = data.mid( pos + 1 ).trimmed();
secMap[section].insert( key, val );
}
+ else if ( section == "import" )
+ {
+ QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( data, Qtx::Always ) );
+ QFileInfo impFInfo( impFile );
+ if ( impFInfo.isRelative() )
+ impFInfo.setFile( aFinfo.absoluteDir(), impFile );
+
+ QMap<QString, Section> impMap;
+ if ( !load( impFInfo.absoluteFilePath(), impMap, importHistory ) )
+ {
+ qDebug() << "QtxResourceMgr: Error with importing file:" << data;
+ }
+ else
+ {
+ QMap<QString, Section>::const_iterator it = impMap.constBegin();
+ for ( ; it != impMap.constEnd() ; ++it )
+ {
+ if ( !secMap.contains( it.key() ) )
+ {
+ // insert full section
+ secMap.insert( it.key(), it.value() );
+ }
+ else
+ {
+ // insert all parameters from the section
+ Section::ConstIterator paramIt = it.value().begin();
+ for ( ; paramIt != it.value().end() ; ++paramIt )
+ {
+ if ( !secMap[it.key()].contains( paramIt.key() ) )
+ secMap[it.key()].insert( paramIt.key(), paramIt.value() );
+ }
+ }
+ }
+ }
+ }
else
{
res = false;
- section.isEmpty() ? qWarning( "Current section is empty" ) : qWarning( "Error in line: %d", line );
+ if ( section.isEmpty() )
+ qWarning() << "QtxResourceMgr: Current section is empty";
+ else
+ qWarning() << "QtxResourceMgr: Error in line:" << line;
}
}
file.close();
- return res;
+ return res;
}
/*!
*/
bool QtxResourceMgr::IniFormat::save( const QString& fname, const QMap<QString, Section>& secMap )
{
+ if ( !Qtx::mkDir( QFileInfo( fname ).absolutePath() ) )
+ return false;
+
QFile file( fname );
if ( !file.open( QFile::WriteOnly ) )
return false;
QTextStream ts( &file );
+ ts << "# This file is automatically created by SALOME application." << endl;
+ ts << "# Changes made in this file can be lost!" << endl;
+ ts << endl;
+
bool res = true;
for ( QMap<QString, Section>::ConstIterator it = secMap.begin(); it != secMap.end() && res; ++it )
{
QString docTag() const;
QString sectionTag() const;
QString parameterTag() const;
+ QString importTag() const;
QString nameAttribute() const;
QString valueAttribute() const;
+
+ bool load( const QString&, QMap<QString, Section>&, QSet<QString>& );
};
/*!
*/
bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Section>& secMap )
{
+ QSet<QString> importHistory;
+ return load( fname, secMap, importHistory );
+}
+
+/*!
+ \brief Load resources from xml-file.
+ \param fname resources file name
+ \param secMap resources map to be filled in
+ \param importHistory list of already imported resources files (to prevent import loops)
+ \return \c true on success and \c false on error
+*/
+bool QtxResourceMgr::XmlFormat::load( const QString& fname, QMap<QString, Section>& secMap, QSet<QString>& importHistory )
+{
+ QString aFName = fname.trimmed();
+ if ( !QFileInfo( aFName ).exists() )
+ {
+ if ( QFileInfo( aFName + ".xml" ).exists() )
+ aFName += ".xml";
+ else if ( QFileInfo( aFName + ".XML" ).exists() )
+ aFName += ".XML";
+ else
+ return false; // file does not exist
+ }
+ QFileInfo aFinfo( aFName );
+ aFName = aFinfo.canonicalFilePath();
+
+ if ( !importHistory.contains( aFName ) )
+ importHistory.insert( aFName );
+ else
+ return true; // already imported (prevent import loops)
+
bool res = false;
#ifndef QT_NO_DOM
- QFile file( fname );
+ QFile file( aFName );
if ( !file.open( QFile::ReadOnly ) )
{
- qDebug( "File cannot be opened" );
+ qDebug() << "QtxResourceMgr: File is not accessible:" << aFName;
return false;
}
if ( !res )
{
- qDebug( "File is empty" );
+ qDebug() << "QtxResourceMgr: File is empty:" << aFName;
return false;
}
QDomElement root = doc.documentElement();
if ( root.isNull() || root.tagName() != docTag() )
{
- qDebug( "Invalid root" );
+ qDebug() << "QtxResourceMgr: Invalid root in file:" << aFName;
return false;
}
{
QString paramName = paramElem.attribute( nameAttribute() );
QString paramValue = paramElem.attribute( valueAttribute() );
-
secMap[section].insert( paramName, paramValue );
}
else
- {
- qDebug( "Invalid parameter element" );
+ {
+ qDebug() << "QtxResourceMgr: Invalid parameter element in file:" << aFName;
res = false;
- }
+ }
+ }
+ else
+ {
+ res = paramNode.isComment();
+ if ( !res )
+ qDebug() << "QtxResourceMgr: Node is neither element nor comment in file:" << aFName;
}
- else
- {
- res = paramNode.isComment();
- if( !res )
- qDebug( "Node isn't element nor comment" );
- }
paramNode = paramNode.nextSibling();
}
}
+ else if ( sectElem.tagName() == importTag() && sectElem.hasAttribute( nameAttribute() ) )
+ {
+ QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( sectElem.attribute( nameAttribute() ), Qtx::Always ) );
+ QFileInfo impFInfo( impFile );
+ if ( impFInfo.isRelative() )
+ impFInfo.setFile( aFinfo.absoluteDir(), impFile );
+
+ QMap<QString, Section> impMap;
+ if ( !load( impFInfo.absoluteFilePath(), impMap, importHistory ) )
+ {
+ qDebug() << "QtxResourceMgr: Error with importing file:" << sectElem.attribute( nameAttribute() );
+ }
+ else
+ {
+ QMap<QString, Section>::const_iterator it = impMap.constBegin();
+ for ( ; it != impMap.constEnd() ; ++it )
+ {
+ if ( !secMap.contains( it.key() ) )
+ {
+ // insert full section
+ secMap.insert( it.key(), it.value() );
+ }
+ else
+ {
+ // insert all parameters from the section
+ Section::ConstIterator paramIt = it.value().begin();
+ for ( ; paramIt != it.value().end() ; ++paramIt )
+ {
+ if ( !secMap[it.key()].contains( paramIt.key() ) )
+ secMap[it.key()].insert( paramIt.key(), paramIt.value() );
+ }
+ }
+ }
+ }
+ }
else
{
- qDebug( "Invalid section" );
- res = false;
+ qDebug() << "QtxResourceMgr: Invalid section in file:" << aFName;
+ res = false;
}
}
else
{
res = sectNode.isComment(); // if it's a comment -- let it be, pass it..
- if( !res )
- qDebug( "Node isn't element nor comment" );
+ if ( !res )
+ qDebug() << "QtxResourceMgr: Node is neither element nor comment in file:" << aFName;
}
sectNode = sectNode.nextSibling();
}
#endif
-
+
if ( res )
- qDebug( "File '%s' is loaded successfully", (const char*)fname.toLatin1() );
+ qDebug() << "QtxResourceMgr: File" << fname << "is loaded successfully";
return res;
}
#ifndef QT_NO_DOM
+ if ( !Qtx::mkDir( QFileInfo( fname ).absolutePath() ) )
+ return false;
+
QFile file( fname );
if ( !file.open( QFile::WriteOnly ) )
return false;
QDomDocument doc( docTag() );
+ QDomComment comment = doc.createComment( "\nThis file is automatically created by SALOME application.\nChanges made in this file can be lost!\n" );
+ doc.appendChild( comment );
QDomElement root = doc.createElement( docTag() );
doc.appendChild( root );
return tag;
}
+/*!
+ \brief Get import tag name
+ \return XML import tag name
+*/
+QString QtxResourceMgr::XmlFormat::importTag() const
+{
+ QString tag = option( "import_tag" );
+ if ( tag.isEmpty() )
+ tag = QString( "import" );
+ return tag;
+}
+
/*!
\brief Get parameter tag's "name" attribute name
\return XML parameter tag's "name" attribute name
\brief Get the value of the option with specified name.
If option doesn't exist then null QString is returned.
-
+
\param opt option name
\return option value
*/
if ( status )
res->mySections = sections;
else
- qDebug( "QtxResourceMgr: Could not load resource file \"%s\"", (const char*)res->myFileName.toLatin1() );
+ qDebug() << "QtxResourceMgr: Can't load resource file:" << res->myFileName;
return status;
}
\brief Get linear gradient parameter value.
\param sect section name
\param name parameter name
- \param gVal parameter to return resulting linear gradient value value
+ \param gVal parameter to return resulting linear gradient value
\return \c true if parameter is found and \c false if parameter is not found
(in this case \a gVal value is undefined)
*/
\brief Get radial gradient parameter value.
\param sect section name
\param name parameter name
- \param gVal parameter to return resulting radial gradient value value
+ \param gVal parameter to return resulting radial gradient value
\return \c true if parameter is found and \c false if parameter is not found
(in this case \a gVal value is undefined)
*/
\brief Get conical gradient parameter value.
\param sect section name
\param name parameter name
- \param gVal parameter to return resulting conical gradient value value
+ \param gVal parameter to return resulting conical gradient value
\return \c true if parameter is found and \c false if parameter is not found
(in this case \a gVal value is undefined)
*/
return Qtx::stringToConicalGradient( val, gVal );
}
+/*!
+ \brief Get background parameter value.
+ \param sect section name
+ \param name parameter name
+ \param bgVal parameter to return resulting background value
+ \return \c true if parameter is found and \c false if parameter is not found
+ (in this case \a bgVal value is undefined)
+*/
+bool QtxResourceMgr::value( const QString& sect, const QString& name, Qtx::BackgroundData& bgVal ) const
+{
+ QString val;
+ if ( !value( sect, name, val, true ) )
+ return false;
+
+ bgVal = Qtx::stringToBackground( val );
+ return bgVal.isValid();
+}
+
/*!
\brief Get string parameter value (native format).
\param sect section name
return val;
}
+/*!
+ \brief Get background parameter value.
+
+ If the specified parameter is not found, the specified default value is returned instead.
+
+ \param sect section name
+ \param name parameter name
+ \param def default value
+ \return parameter value (or default value if parameter is not found)
+*/
+Qtx::BackgroundData QtxResourceMgr::backgroundValue( const QString& sect, const QString& name, const Qtx::BackgroundData& def ) const
+{
+ Qtx::BackgroundData val;
+ if ( !value( sect, name, val ) )
+ val = def;
+ return val;
+}
+
/*!
\brief Check parameter existence.
\param sect section name
setResource( sect, name, Qtx::gradientToString( val ) );
}
+/*!
+ \brief Set background parameter value.
+ \param sect section name
+ \param name parameter name
+ \param val parameter value
+*/
+void QtxResourceMgr::setValue( const QString& sect, const QString& name, const Qtx::BackgroundData& val )
+{
+ Qtx::BackgroundData res;
+ if ( checkExisting() && value( sect, name, res ) && res == val )
+ return;
+
+ setResource( sect, name, Qtx::backgroundToString( val ) );
+}
+
/*!
\brief Remove resources section.
\param sect section name
return map.keys();
}
+/*!
+ \brief Get all sections names matching specified regular expression.
+ \param re searched regular expression
+ \return list of sections names
+*/
+QStringList QtxResourceMgr::sections(const QRegExp& re) const
+{
+ return sections().filter( re );
+}
+
+/*!
+ \brief Get all sections names with the prefix specified by passed
+ list of parent sections names.
+
+ Sub-sections are separated inside the section name by the sections
+ separator token, for example "splash:color:label".
+
+ \param names parent sub-sections names
+ \return list of sections names
+*/
+QStringList QtxResourceMgr::sections(const QStringList& names) const
+{
+ QStringList nm = names;
+ nm << ".+";
+ QRegExp re( QString( "^%1$" ).arg( nm.join( sectionsToken() ) ) );
+ return sections( re );
+}
+
+/*!
+ \brief Get list of sub-sections names for the specified parent section name.
+
+ Sub-sections are separated inside the section name by the sections
+ separator token, for example "splash:color:label".
+
+ \param section parent sub-section name
+ \param full if \c true return full names of child sub-sections, if \c false,
+ return only top-level sub-sections names
+ \return list of sub-sections names
+*/
+QStringList QtxResourceMgr::subSections(const QString& section, const bool full) const
+{
+ QStringList names = sections( QStringList() << section );
+ QMutableListIterator<QString> it( names );
+ while ( it.hasNext() ) {
+ QString name = it.next().mid( section.size() + 1 ).trimmed();
+ if ( name.isEmpty() ) {
+ it.remove();
+ continue;
+ }
+ if ( !full ) name = name.split( sectionsToken() ).first();
+ it.setValue( name );
+ }
+ names.removeDuplicates();
+ names.sort();
+ return names;
+}
+
/*!
\brief Get all parameters name in specified section.
\param sec section name
return pmap.keys();
}
+/*!
+ \brief Get all parameters name in specified
+ list of sub-sections names.
+
+ Sub-sections are separated inside the section name by the sections
+ separator token, for example "splash:color:label".
+
+ \param names parent sub-sections names
+ \return list of settings names
+*/
+QStringList QtxResourceMgr::parameters( const QStringList& names ) const
+{
+ return parameters( names.join( sectionsToken() ) );
+}
+
/*!
\brief Get absolute path to the file which name is defined by the parameter.
\brief Get application resources section name.
By default, application resources section name is "resources" but
- it can be changed by setting the corresponding resources manager option.
+ it can be changed by setting the "res_section_name" resources manager option.
\return section corresponding to the resources directories
\sa option(), setOption()
\brief Get application language section name.
By default, application language section name is "language" but
- it can be changed by setting the corresponding resources manager option.
+ it can be changed by setting the "lang_section_name" resources manager option.
\return section corresponding to the application language settings
\sa option(), setOption()
return res;
}
+/*!
+ \brief Get sections separator token.
+
+ By default, sections separator token is colon symbol ":" but
+ it can be changed by setting the "section_token" resources manager option.
+
+ \return string corresponding to the current section separator token
+ \sa option(), setOption()
+*/
+QString QtxResourceMgr::sectionsToken() const
+{
+ QString res = option( "section_token" );
+ if ( res.isEmpty() )
+ res = QString( ":" );
+ return res;
+}
+
/*!
\brief Get default pixmap.
if ( lang.isEmpty() )
{
lang = QString( "en" );
- qWarning( "Language not specified. Assumed: %s", (const char*)lang.toLatin1() );
+ qWarning() << "QtxResourceMgr: Language not specified. Assumed:" << lang;
}
substMap.insert( 'L', lang );
if ( trList.isEmpty() )
{
trList.append( "%P_msg_%L.qm" );
- qWarning( "Translators not defined. Assumed: %s", (const char*)trList[0].toLatin1() );
+ qWarning() << "QtxResourceMgr: Translators not defined. Assumed:" << trList[0];
}
QStringList prefixList;
else
prefixList = parameters( resSection() );
+ if ( pref.isEmpty() && lang != "en" ) {
+ // load Qt resources
+ QString qt_translations = QLibraryInfo::location( QLibraryInfo::TranslationsPath );
+ QString qt_dir_trpath;
+ if ( ::getenv( "QTDIR" ) )
+ qt_dir_trpath = QString( ::getenv( "QTDIR" ) );
+ if ( !qt_dir_trpath.isEmpty() )
+ qt_dir_trpath = QDir( qt_dir_trpath ).absoluteFilePath( "translations" );
+
+ QTranslator* trans = new QtxTranslator( 0 );
+ if ( trans->load( QString("qt_%1").arg( lang ), qt_translations ) || trans->load( QString("qt_%1").arg( lang ), qt_dir_trpath ) )
+ QApplication::instance()->installTranslator( trans );
+ }
+
for ( QStringList::ConstIterator iter = prefixList.begin(); iter != prefixList.end(); ++iter )
{
QString prefix = *iter;
the configuration file from the previous versions of the application).
\param appName application name
- \param for_load boolean flag indicating that file is opened for loading or saving (not used)
+ \param for_load boolean flag indicating that file is opened for loading or saving (not used in default implementation)
\return user configuration file name
\sa globalFileName()
*/
QString fileName;
QString pathName = QDir::homePath();
+ QString cfgAppName = QApplication::applicationName();
+ if ( !cfgAppName.isEmpty() )
+ pathName = Qtx::addSlash( Qtx::addSlash( pathName ) + QString( ".config" ) ) + cfgAppName;
+
#ifdef WIN32
fileName = QString( "%1.%2" ).arg( appName ).arg( currentFormat() );
#else
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxResourceMgr.h
// Author: Alexander SOLOVYOV, Sergey TELKOV
//
bool value( const QString&, const QString&, QLinearGradient& ) const;
bool value( const QString&, const QString&, QRadialGradient& ) const;
bool value( const QString&, const QString&, QConicalGradient& ) const;
+ bool value( const QString&, const QString&, Qtx::BackgroundData& ) const;
bool value( const QString&, const QString&, QString&, const bool = true ) const;
int integerValue( const QString&, const QString&, const int = 0 ) const;
QLinearGradient linearGradientValue( const QString&, const QString&, const QLinearGradient& = QLinearGradient() ) const;
QRadialGradient radialGradientValue( const QString&, const QString&, const QRadialGradient& = QRadialGradient() ) const;
QConicalGradient conicalGradientValue( const QString&, const QString&, const QConicalGradient& = QConicalGradient() ) const;
+ Qtx::BackgroundData backgroundValue( const QString&, const QString&, const Qtx::BackgroundData& = Qtx::BackgroundData() ) const;
bool hasSection( const QString& ) const;
bool hasValue( const QString&, const QString& ) const;
void setValue( const QString&, const QString&, const QLinearGradient& );
void setValue( const QString&, const QString&, const QRadialGradient& );
void setValue( const QString&, const QString&, const QConicalGradient& );
+ void setValue( const QString&, const QString&, const Qtx::BackgroundData& );
void remove( const QString& );
void remove( const QString&, const QString& );
QString resSection() const;
QString langSection() const;
+ QString sectionsToken() const;
QPixmap loadPixmap( const QString&, const QString& ) const;
QPixmap loadPixmap( const QString&, const QString&, const bool ) const;
bool save();
QStringList sections() const;
+ QStringList sections(const QRegExp&) const;
+ QStringList sections(const QStringList&) const;
+ QStringList subSections(const QString&, const bool = true) const;
QStringList parameters( const QString& ) const;
+ QStringList parameters( const QStringList& ) const;
void refresh();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxRubberBand.cxx
// Author: Alexander A. BORODIN
//
QtxRectRubberBand::QtxRectRubberBand(QWidget* parent)
- :QtxAbstractRubberBand( parent )
+ :QtxAbstractRubberBand( parent )
{
myPoints.resize( 4 );
myIsClosed = true;
void QtxRectRubberBand::setEndPoint( const QPoint& thePoint)
{
- myPoints[2] = thePoint;
+ myPoints[2] = thePoint;
myPoints[1].setX( thePoint.x() );
myPoints[3].setY( thePoint.y() );
updateMask();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxRubberBand.h
// Author: Alexander A. BORODIN
//
void initGeometry( const QRect& );
void setStartPoint( const QPoint& );
void setEndPoint( const QPoint& );
-
+
virtual void clearGeometry();
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : QtxSearchTool.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
const char* const first_xpm[] = {
"16 16 14 1",
-" c None",
-". c #111111",
-"+ c #0A0A0A",
-"@ c #161616",
-"# c #ACACAC",
-"$ c #FC6D6E",
-"% c #FB6364",
-"& c #F25B5C",
-"* c #EA5859",
-"= c #C1494A",
-"- c #B64545",
-"; c #AB4040",
-"> c #A03C3C",
-", c #99393A",
+" c None",
+". c #111111",
+"+ c #0A0A0A",
+"@ c #161616",
+"# c #ACACAC",
+"$ c #FC6D6E",
+"% c #FB6364",
+"& c #F25B5C",
+"* c #EA5859",
+"= c #C1494A",
+"- c #B64545",
+"; c #AB4040",
+"> c #A03C3C",
+", c #99393A",
" . ",
" +@+ ..# ",
" +$+# .$.... ",
const char* const last_xpm[] = {
"16 16 14 1",
-" c None",
-". c #111111",
-"+ c #0A0A0A",
-"@ c #161616",
-"# c #FC6D6E",
-"$ c #ACACAC",
-"% c #FB6364",
-"& c #F25B5C",
-"* c #EA5859",
-"= c #C1494A",
-"- c #B64545",
-"; c #AB4040",
-"> c #A03C3C",
-", c #99393A",
+" c None",
+". c #111111",
+"+ c #0A0A0A",
+"@ c #161616",
+"# c #FC6D6E",
+"$ c #ACACAC",
+"% c #FB6364",
+"& c #F25B5C",
+"* c #EA5859",
+"= c #C1494A",
+"- c #B64545",
+"; c #AB4040",
+"> c #A03C3C",
+", c #99393A",
" . ",
" .. +@+ ",
" ....#. +#+$",
const char* const prev_xpm[] = {
"16 16 12 1",
-" c None",
-". c #111111",
-"+ c #ACACAC",
-"@ c #FC6D6E",
-"# c #FB6364",
-"$ c #F25B5C",
-"% c #EA5859",
-"& c #C1494A",
-"* c #B64545",
-"= c #AB4040",
-"- c #A03C3C",
-"; c #99393A",
+" c None",
+". c #111111",
+"+ c #ACACAC",
+"@ c #FC6D6E",
+"# c #FB6364",
+"$ c #F25B5C",
+"% c #EA5859",
+"& c #C1494A",
+"* c #B64545",
+"= c #AB4040",
+"- c #A03C3C",
+"; c #99393A",
" . ",
" ..+ ",
" .@...... ",
const char* const next_xpm[] = {
"16 16 12 1",
-" c None",
-". c #111111",
-"+ c #FC6D6E",
-"@ c #FB6364",
-"# c #F25B5C",
-"$ c #EA5859",
-"% c #C1494A",
-"& c #B64545",
-"* c #ACACAC",
-"= c #AB4040",
-"- c #A03C3C",
-"; c #99393A",
+" c None",
+". c #111111",
+"+ c #FC6D6E",
+"@ c #FB6364",
+"# c #F25B5C",
+"$ c #EA5859",
+"% c #C1494A",
+"& c #B64545",
+"* c #ACACAC",
+"= c #AB4040",
+"- c #A03C3C",
+"; c #99393A",
" . ",
" .. ",
" ......+. ",
const char* const close_xpm[] = {
"16 16 8 1",
-" c None",
-". c #D73727",
-"+ c #E17765",
-"@ c #E7957F",
-"# c #DE6F48",
-"$ c #DF7B4F",
-"% c #FAE9E4",
-"& c #FFFFFF",
+" c None",
+". c #D73727",
+"+ c #E17765",
+"@ c #E7957F",
+"# c #DE6F48",
+"$ c #DF7B4F",
+"% c #FAE9E4",
+"& c #FFFFFF",
" ",
" ............ ",
" .+@@@@@@@@@@+. ",
\param controls ORed controls flags (QtxSearchTool::Controls)
\sa setWatchedWidget(), setControls()
*/
-QtxSearchTool::QtxSearchTool( QWidget* parent, QWidget* watched, int controls )
+QtxSearchTool::QtxSearchTool( QWidget* parent, QWidget* watched, int controls, Qt::Orientation orientation )
: QFrame( parent ),
myWatched( watched ? watched : parent ),
mySearcher( 0 ),
myAutoHideTimer( 0 ),
myAutoHideEnabled( true )
{
- init();
+ init( orientation );
}
/*!
\param controls ORed controls flags (QtxSearchTool::Controls)
\sa setWatchedWidget(), setControls()
*/
-QtxSearchTool::QtxSearchTool( QWidget* parent, int controls )
+QtxSearchTool::QtxSearchTool( QWidget* parent, int controls, Qt::Orientation orientation )
: QFrame( parent ),
myWatched( parent ),
mySearcher( 0 ),
myAutoHideTimer( 0 ),
myAutoHideEnabled( true )
{
- init();
+ init( orientation );
}
/*!
wid = id < 0 ? --_wid : id;
- QVBoxLayout* vbox = qobject_cast<QVBoxLayout*>( layout() );
+ QBoxLayout* vbox = qobject_cast<QBoxLayout*>( layout() );
w->setParent( this );
vbox->addWidget( w );
myWidgets.insert( wid, w );
QPalette p = myData->palette();
p.setColor( QPalette::Active,
- QPalette::Base,
- QApplication::palette( myData ).color( QPalette::Active,
- QPalette::Base ) );
+ QPalette::Base,
+ QApplication::palette( myData ).color( QPalette::Active,
+ QPalette::Base ) );
bool found = true;
if ( mySearcher && !what.isEmpty() )
\brief Initialize the search tool widget.
\internal
*/
-void QtxSearchTool::init()
+void QtxSearchTool::init( Qt::Orientation orientation )
{
setFrameStyle( QFrame::StyledPanel | QFrame::Plain );
- QVBoxLayout* vbox = new QVBoxLayout();
- vbox->setSpacing( 0 );
- vbox->setMargin( 5 );
- setLayout( vbox );
myBtnWidget = new QWidget( this );
QHBoxLayout* myBtnWidget_layout = new QHBoxLayout( myBtnWidget );
myBtnWidget_layout->setSpacing( 0 );
myBtnWidget_layout->setMargin( 0 );
- vbox->addWidget( myBtnWidget );
myModWidget = new QWidget( this );
QHBoxLayout* myModWidget_layout = new QHBoxLayout( myModWidget );
myModWidget_layout->setSpacing( 0 );
myModWidget_layout->setMargin( 0 );
- vbox->addWidget( myModWidget );
myClose = new QToolButton( myBtnWidget );
myClose->setIcon( QIcon( close_xpm ) );
setShortcuts( QKeySequence( "Ctrl+S" ) );
setActivators( Any );
+
+ QBoxLayout* box = orientation == Qt::Vertical ? (QBoxLayout*)( new QVBoxLayout ) : (QBoxLayout*)( new QHBoxLayout );
+ box->setSpacing( 0 );
+ box->setMargin( 5 );
+ box->addWidget( myBtnWidget );
+ box->addWidget( myModWidget );
+ setLayout( box );
+
updateControls();
}
ShortcutList::Iterator it;
for ( it = myShortcuts.begin(), i = 0; it != myShortcuts.end(); ++it, i++ )
{
- (*it)->setEnabled( isEnabled() && ( i < 3 && myActivators & StandardKey ||
- i > 2 && myActivators & HotKey ) );
+ (*it)->setEnabled( isEnabled() && ( ( i < 3 && myActivators & StandardKey ) ||
+ ( i > 2 && myActivators & HotKey ) ) );
}
}
if ( myView->model() )
return myView->model()->match( myView->model()->index( 0, myColumn ),
- Qt::DisplayRole,
- s, -1, fl );
+ Qt::DisplayRole,
+ s, -1, fl );
return QModelIndexList();
}
appropriate item
*/
QModelIndex QtxTreeViewSearcher::findNearest( const QModelIndex& index,
- const QModelIndexList& lst,
- bool direction )
+ const QModelIndexList& lst,
+ bool direction )
{
if ( direction )
{
{
QModelIndex found = it.next();
if ( compareIndices( found, index ) > 0 )
- return found;
+ return found;
}
}
else
{
QModelIndex found = it.previous();
if ( compareIndices( found, index ) < 0 )
- return found;
+ return found;
}
}
return QModelIndex();
and positive value otherwise
*/
int QtxTreeViewSearcher::compareIndices( const QModelIndex& left,
- const QModelIndex& right )
+ const QModelIndex& right )
{
QString leftId = getId( left );
QString rightId = getId( right );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : QtxSearchTool.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
Any = HotKey | SlashKey | StandardKey | PrintKey //!< search tool is activated by any of above mentioned ways
} Activator;
- QtxSearchTool( QWidget*, QWidget* = 0, int = All );
- QtxSearchTool( QWidget*, int = All );
+ QtxSearchTool( QWidget*, QWidget* = 0, int = All, Qt::Orientation = Qt::Vertical );
+ QtxSearchTool( QWidget*, int = All, Qt::Orientation = Qt::Vertical );
virtual ~QtxSearchTool();
QWidget* watchedWidget() const;
void modifierSwitched();
private:
- void init();
+ void init( Qt::Orientation );
bool focused() const;
void clearShortcuts();
void initShortcuts( const QList<QKeySequence>& );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : QtxSplash.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#include "QtxSplash.h"
#include "QtxResourceMgr.h"
+#include <cstdio>
#include <QApplication>
#include <QPainter>
if ( mySplash ) {
mySplash->setError( code );
QMessageBox::critical( mySplash,
- title.isEmpty() ? tr( "Error" ) : title,
- error,
- tr( "&OK" ) );
+ title.isEmpty() ? tr( "Error" ) : title,
+ error,
+ tr( "&OK" ) );
}
else {
printf( "QtxSplash::error: %s\n",error.toLatin1().constData() );
\sa progressColors()
*/
void QtxSplash::setProgressColors( const QColor& startColor,
- const QColor& endColor,
+ const QColor& endColor,
const Qt::Orientation orientation )
{
if ( !startColor.isValid() )
fl = 0;
QStringList opts = pf.split( QRegExp( "," ), QString::SkipEmptyParts );
for ( int i = 0; i < opts.count(); i++ ) {
- QString opt = opts[i].trimmed().toLower();
- if ( opt == "left" )
- fl = fl | LeftSide;
- else if ( opt == "right" )
- fl = fl | RightSide;
- else if ( opt == "top" )
- fl = fl | TopSide;
- else if ( opt == "bottom" )
- fl = fl | BottomSide;
- else if ( opt == "left_to_right" )
- fl = fl | LeftToRight;
- else if ( opt == "right_to_left" )
- fl = fl | RightToLeft;
+ QString opt = opts[i].trimmed().toLower();
+ if ( opt == "left" )
+ fl = fl | LeftSide;
+ else if ( opt == "right" )
+ fl = fl | RightSide;
+ else if ( opt == "top" )
+ fl = fl | TopSide;
+ else if ( opt == "bottom" )
+ fl = fl | BottomSide;
+ else if ( opt == "left_to_right" )
+ fl = fl | LeftToRight;
+ else if ( opt == "right_to_left" )
+ fl = fl | RightToLeft;
}
}
setProgressFlags( fl );
fl = 0;
QStringList opts = al.split( QRegExp( "," ), QString::SkipEmptyParts );
for ( int i = 0; i < opts.count(); i++ ) {
- QString opt = opts[i].trimmed().toLower();
- if ( opt == "left" )
- fl = fl | Qt::AlignLeft;
- else if ( opt == "right" )
- fl = fl | Qt::AlignRight;
- else if ( opt == "top" )
- fl = fl | Qt::AlignTop;
- else if ( opt == "bottom" )
- fl = fl | Qt::AlignBottom;
- else if ( opt == "hcenter" )
- fl = fl | Qt::AlignHCenter;
- else if ( opt == "vcenter" )
- fl = fl | Qt::AlignVCenter;
- else if ( opt == "justify" )
- fl = fl | Qt::AlignJustify;
- else if ( opt == "center" )
- fl = fl | Qt::AlignCenter;
+ QString opt = opts[i].trimmed().toLower();
+ if ( opt == "left" )
+ fl = fl | Qt::AlignLeft;
+ else if ( opt == "right" )
+ fl = fl | Qt::AlignRight;
+ else if ( opt == "top" )
+ fl = fl | Qt::AlignTop;
+ else if ( opt == "bottom" )
+ fl = fl | Qt::AlignBottom;
+ else if ( opt == "hcenter" )
+ fl = fl | Qt::AlignHCenter;
+ else if ( opt == "vcenter" )
+ fl = fl | Qt::AlignVCenter;
+ else if ( opt == "justify" )
+ fl = fl | Qt::AlignJustify;
+ else if ( opt == "center" )
+ fl = fl | Qt::AlignCenter;
}
}
setTextAlignment( fl );
setProgressColors( lgrad );
}
else if ( resMgr->value( resSection, "progress_color", rgrad ) ||
- resMgr->value( resSection, "progress_colors", rgrad ) ) {
+ resMgr->value( resSection, "progress_colors", rgrad ) ) {
// radial gradient-colored progress bar
setProgressColors( rgrad );
}
else if ( resMgr->value( resSection, "progress_color", cgrad ) ||
- resMgr->value( resSection, "progress_colors", cgrad ) ) {
+ resMgr->value( resSection, "progress_colors", cgrad ) ) {
// conical gradient-colored progress bar
setProgressColors( cgrad );
}
else if ( resMgr->value( resSection, "progress_color", pc ) ||
- resMgr->value( resSection, "progress_colors", pc ) ) {
+ resMgr->value( resSection, "progress_colors", pc ) ) {
// one/two-colored progress bar
QStringList colors = pc.split( "|", QString::SkipEmptyParts );
QColor c1, c2;
bool bOk;
gt = colors[2].toInt( &bOk );
if ( bOk ) {
- if ( gt == 0 )
- o = Qt::Horizontal;
+ if ( gt == 0 )
+ o = Qt::Horizontal;
}
else {
- if ( colors[2].toLower().startsWith( "h" ) )
- o = Qt::Horizontal;
+ if ( colors[2].toLower().startsWith( "h" ) )
+ o = Qt::Horizontal;
}
}
setProgressColors( c1, c2, o );
\sa message(), constantInfo(), setConstantInfo()
*/
void QtxSplash::setMessage( const QString& msg,
- int alignment,
- const QColor& color )
+ int alignment,
+ const QColor& color )
{
myMessage = msg;
myAlignment = alignment;
QLinearGradient lg;
const QLinearGradient* other = static_cast<const QLinearGradient*>( progressColors() );
if ( checkGradient( other ) ) {
- // gradient is defined in relative coordinates [0.0 - 1.0]
- lg.setStart( r.left() + r.width() * other->start().x(),
- r.top() + r.height() * other->start().y() );
- lg.setFinalStop( r.left() + r.width() * other->finalStop().x(),
- r.top() + r.height() * other->finalStop().y() );
+ // gradient is defined in relative coordinates [0.0 - 1.0]
+ lg.setStart( r.left() + r.width() * other->start().x(),
+ r.top() + r.height() * other->start().y() );
+ lg.setFinalStop( r.left() + r.width() * other->finalStop().x(),
+ r.top() + r.height() * other->finalStop().y() );
}
else {
- // gradient is defined in absolute coordinates
- // according to its dimensions
- lg.setStart( r.topLeft() + other->start() );
- lg.setFinalStop( r.topLeft() + other->finalStop() );
+ // gradient is defined in absolute coordinates
+ // according to its dimensions
+ lg.setStart( r.topLeft() + other->start() );
+ lg.setFinalStop( r.topLeft() + other->finalStop() );
}
lg.setStops( other->stops() );
QRadialGradient rg;
const QRadialGradient* other = static_cast<const QRadialGradient*>( progressColors() );
if ( checkGradient( other ) ) {
- // gradient is defined in relative coordinates [0.0 - 1.0]
- rg.setCenter( r.left() + r.width() * other->center().x(),
- r.top() + r.height() * other->center().y() );
- rg.setFocalPoint( r.left() + r.width() * other->focalPoint().x(),
- r.top() + r.height() * other->focalPoint().y() );
+ // gradient is defined in relative coordinates [0.0 - 1.0]
+ rg.setCenter( r.left() + r.width() * other->center().x(),
+ r.top() + r.height() * other->center().y() );
+ rg.setFocalPoint( r.left() + r.width() * other->focalPoint().x(),
+ r.top() + r.height() * other->focalPoint().y() );
}
else {
- // gradient is defined in absolute coordinates
- // according to its dimensions
- rg.setCenter( r.topLeft() + other->center() );
- rg.setFocalPoint( r.topLeft() + other->focalPoint() );
+ // gradient is defined in absolute coordinates
+ // according to its dimensions
+ rg.setCenter( r.topLeft() + other->center() );
+ rg.setFocalPoint( r.topLeft() + other->focalPoint() );
}
// only width is taken into account for the radius in relative mode
QConicalGradient cg;
const QConicalGradient* other = static_cast<const QConicalGradient*>( progressColors() );
if ( checkGradient( other ) ) {
- // gradient is defined in relative coordinates [0.0 - 1.0]
- cg.setCenter( r.left() + r.width() * other->center().x(),
- r.top() + r.height() * other->center().y() );
+ // gradient is defined in relative coordinates [0.0 - 1.0]
+ cg.setCenter( r.left() + r.width() * other->center().x(),
+ r.top() + r.height() * other->center().y() );
}
else {
- // gradient is defined in absolute coordinates
- // according to its dimensions
- cg.setCenter( r.topLeft() + other->center() );
+ // gradient is defined in absolute coordinates
+ // according to its dimensions
+ cg.setCenter( r.topLeft() + other->center() );
}
cg.setAngle( other->angle() );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : QtxSplash.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
int progressFlags() const;
void setProgressColors( const QColor&,
- const QColor& = QColor(),
- const Qt::Orientation = Qt::Vertical );
+ const QColor& = QColor(),
+ const Qt::Orientation = Qt::Vertical );
void setProgressColors( const QGradient& );
const QGradient* progressColors() const;
public slots:
void setMessage( const QString&,
- const int,
- const QColor& = QColor() );
+ const int,
+ const QColor& = QColor() );
void setMessage( const QString& );
void clear();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxTable.cxx
// Author: Sergey TELKOV
//
if ( o == myHeaderEditor && e->type() == QEvent::KeyPress && isHeaderEditing() )
{
- QKeyEvent* ke = (QKeyEvent*)e;
+ QKeyEvent* ke = (QKeyEvent*)e;
if ( ke->key() == Key_Escape )
{
endHeaderEdit( false );
if ( o == myHeaderEditor && e->type() == QEvent::FocusOut &&
isHeaderEditing() && ((QFocusEvent*)e)->reason() != QFocusEvent::Popup )
{
- endHeaderEdit();
- return true;
+ endHeaderEdit();
+ return true;
}
if ( e->type() == QEvent::Wheel && isHeaderEditing() )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxTable.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxToolBar.cxx
// Author: Sergey TELKOV
//
bool updVis = ( o != myCont && ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) ) ||
- ( o == myCont && ( e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show ||
- e->type() == QEvent::ShowToParent || e->type() == QEvent::ActionAdded ||
- e->type() == QEvent::ActionRemoved ) );
+ ( o == myCont && ( e->type() == QEvent::ChildAdded || e->type() == QEvent::ChildRemoved || e->type() == QEvent::Show ||
+ e->type() == QEvent::ShowToParent || e->type() == QEvent::Hide ||
+ e->type() == QEvent::HideToParent || e->type() == QEvent::ActionAdded ||
+ e->type() == QEvent::ActionRemoved ) );
if ( updVis )
{
}
}
- vis = !empty && isVisible();
+ vis = (!isEmpty() && isVisible());
if ( vis != myCont->isVisibleTo( myCont->parentWidget() ) )
vis ? showContainer() : hideContainer();
}
*/
void QtxToolBar::setVisible( bool visible )
{
+ if ( isVisible() == visible ) return;
if ( myWatcher )
{
if ( visible )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxToolBar.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxToolTip.cxx
// Author: Sergey TELKOV
//
palette.setColor( backgroundRole(), QColor( 255, 255, 231 ) );
setPalette( palette );
- myWidgetRegion = QRect( -1, -1, -1, -1 );
+ myWidgetRegion = QRect( -1, -1, -1, -1 );
- setFrameShape( QFrame::Panel );
- setFrameShadow( QFrame::Plain );
+ setFrameShape( QFrame::Panel );
+ setFrameShadow( QFrame::Plain );
parent->setMouseTracking( true );
- parent->installEventFilter( this );
- installEventFilter( this );
+ parent->installEventFilter( this );
+ installEventFilter( this );
- mySleepTimer = new QTimer( this );
+ mySleepTimer = new QTimer( this );
mySleepTimer->setSingleShot( true );
- myWakeUpTimer = new QTimer( this );
+ myWakeUpTimer = new QTimer( this );
myWakeUpTimer->setSingleShot( true );
- connect( mySleepTimer, SIGNAL( timeout() ), this, SLOT( onSleepTimeOut() ) );
- connect( myWakeUpTimer, SIGNAL( timeout() ), this, SLOT( onWakeUpTimeOut() ) );
+ connect( mySleepTimer, SIGNAL( timeout() ), this, SLOT( onSleepTimeOut() ) );
+ connect( myWakeUpTimer, SIGNAL( timeout() ), this, SLOT( onWakeUpTimeOut() ) );
myWakeUpDelayTime = 700;
myShowDelayTime = 5000;
*/
bool QtxToolTip::eventFilter( QObject* o, QEvent* e )
{
- if ( ( e->type() == QEvent::Destroy ) || ( e->type() == QEvent::Close ) || ( e->type() == QEvent::Hide ) )
- {
- hideTip();
- }
- if ( e->type() == QEvent::Leave )
- {
- if ( isVisible() && ( o == this ) )
- hideTip();
- myWakeUpTimer->stop();
- }
- if ( e->type() == QEvent::MouseMove )
- {
- QMouseEvent* me = (QMouseEvent*)e;
- QPoint thePos = parentWidget()->mapFromGlobal( me->globalPos() );
- if ( myWakeUpTimer->isActive() )
- {
- myWakeUpTimer->stop();
- myWakeUpTimer->start( myWakeUpDelayTime );
- }
- if ( isVisible() )
- {
- if ( !myWidgetRegion.contains( thePos ) )
+ if ( ( e->type() == QEvent::Destroy ) || ( e->type() == QEvent::Close ) || ( e->type() == QEvent::Hide ) )
+ {
+ hideTip();
+ }
+ if ( e->type() == QEvent::Leave )
+ {
+ if ( isVisible() && ( o == this ) )
+ hideTip();
+ myWakeUpTimer->stop();
+ }
+ if ( e->type() == QEvent::MouseMove )
+ {
+ QMouseEvent* me = (QMouseEvent*)e;
+ QPoint thePos = parentWidget()->mapFromGlobal( me->globalPos() );
+ if ( myWakeUpTimer->isActive() )
+ {
+ myWakeUpTimer->stop();
+ myWakeUpTimer->start( myWakeUpDelayTime );
+ }
+ if ( isVisible() )
+ {
+ if ( !myWidgetRegion.contains( thePos ) )
{
- hideTip();
+ hideTip();
myWidgetRegion = QRect( -1, -1, -1, -1 );
}
- }
- else
- {
- if ( !myWidgetRegion.isValid() || myWidgetRegion.contains( thePos ) )
- myWakeUpTimer->start( myWakeUpDelayTime );
- }
- }
- if ( e->type() == QEvent::KeyPress )
- {
- hideTip();
- }
- if ( o == parent() && ( e->type() == QEvent::MouseButtonPress ||
+ }
+ else
+ {
+ if ( !myWidgetRegion.isValid() || myWidgetRegion.contains( thePos ) )
+ myWakeUpTimer->start( myWakeUpDelayTime );
+ }
+ }
+ if ( e->type() == QEvent::KeyPress )
+ {
+ hideTip();
+ }
+ if ( o == parent() && ( e->type() == QEvent::MouseButtonPress ||
e->type() == QEvent::MouseButtonRelease ) )
- {
- hideTip();
- }
- return false;
+ {
+ hideTip();
+ }
+ return false;
}
/*!
*/
void QtxToolTip::showTip( const QPoint& aPos, const QString& text, const QRect& aWidgetRegion )
{
- QFontMetrics theFM = fontMetrics();
- int theHeight = theFM.height();
- int theWidth = theFM.width( text ) + 2;
- showTip( QRect( QPoint( aPos.x(), aPos.y() + 10 ), QSize( theWidth, theHeight ) ), text, aWidgetRegion );
+ QFontMetrics theFM = fontMetrics();
+ int theHeight = theFM.height();
+ int theWidth = theFM.width( text ) + 2;
+ showTip( QRect( QPoint( aPos.x(), aPos.y() + 10 ), QSize( theWidth, theHeight ) ), text, aWidgetRegion );
}
/*!
*/
void QtxToolTip::showTip( const QRect& aRegion, const QString& text, const QRect& aWidgetRegion )
{
- setText( text );
- myWidgetRegion = aWidgetRegion;
- setGeometry( aRegion );
- if ( myShowDelayTime != 0 )
- mySleepTimer->start( myShowDelayTime );
- show();
+ setText( text );
+ myWidgetRegion = aWidgetRegion;
+ setGeometry( aRegion );
+ if ( myShowDelayTime != 0 )
+ mySleepTimer->start( myShowDelayTime );
+ show();
}
/*!
*/
void QtxToolTip::hideTip()
{
- hide();
+ hide();
myWidgetRegion = QRect( -1, -1, -1, -1 );
- mySleepTimer->stop();
+ mySleepTimer->stop();
}
/*!
*/
void QtxToolTip::maybeTip( const QPoint& pos )
{
- QString text;
- QRect textRegion, theRegion( -1, -1, -1, -1 );
- QFont theFnt = font();
+ QString text;
+ QRect textRegion, theRegion( -1, -1, -1, -1 );
+ QFont theFnt = font();
emit maybeTip( pos, text, theFnt, textRegion, theRegion );
if ( theRegion.isValid() )
- {
- setFont( theFnt );
- int margin = lineWidth() + indent();
- QRect dspRegion( QPoint( textRegion.x() - margin, textRegion.y() ),
- QSize( textRegion.width() + 2 * margin, textRegion.height() ) );
- QRect tipRegion( parentWidget()->mapToGlobal( dspRegion.topLeft() ), dspRegion.size() );
- if ( tipRegion.left() < 0 )
- tipRegion.translate( -1 * tipRegion.left(), 0 );
- showTip( tipRegion, text, theRegion );
- }
+ {
+ setFont( theFnt );
+ int margin = lineWidth() + indent();
+ QRect dspRegion( QPoint( textRegion.x() - margin, textRegion.y() ),
+ QSize( textRegion.width() + 2 * margin, textRegion.height() ) );
+ QRect tipRegion( parentWidget()->mapToGlobal( dspRegion.topLeft() ), dspRegion.size() );
+ if ( tipRegion.left() < 0 )
+ tipRegion.translate( -1 * tipRegion.left(), 0 );
+ showTip( tipRegion, text, theRegion );
+ }
}
/*!
*/
void QtxToolTip::onSleepTimeOut()
{
- mySleepTimer->stop();
- hideTip();
+ mySleepTimer->stop();
+ hideTip();
}
/*!
*/
void QtxToolTip::onWakeUpTimeOut()
{
- myWakeUpTimer->stop();
+ myWakeUpTimer->stop();
QPoint pos = QCursor::pos();
if ( parentWidget() )
pos = parentWidget()->mapFromGlobal( pos );
*/
void QtxToolTip::mousePressEvent( QMouseEvent* e )
{
- hideTip();
- QWidget* reciever = parentWidget();
- QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonPress,
- reciever->mapFromGlobal( e->globalPos() ),
- e->button(), e->buttons(), Qt::KeypadModifier );
- QApplication::sendEvent( reciever, me );
+ hideTip();
+ QWidget* reciever = parentWidget();
+ QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonPress,
+ reciever->mapFromGlobal( e->globalPos() ),
+ e->button(), e->buttons(), Qt::KeypadModifier );
+ QApplication::sendEvent( reciever, me );
}
/*!
*/
void QtxToolTip::mouseDoubleClickEvent( QMouseEvent* e )
{
- hideTip();
- QWidget* reciever = parentWidget();
- QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonDblClick,
- reciever->mapFromGlobal( e->globalPos() ),
- e->button(), e->buttons(), Qt::KeypadModifier );
- QApplication::sendEvent( reciever, me );
+ hideTip();
+ QWidget* reciever = parentWidget();
+ QMouseEvent* me = new QMouseEvent( QEvent::MouseButtonDblClick,
+ reciever->mapFromGlobal( e->globalPos() ),
+ e->button(), e->buttons(), Qt::KeypadModifier );
+ QApplication::sendEvent( reciever, me );
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxToolTip.h
// Author: Sergey TELKOV
//
class QTX_EXPORT QtxToolTip : public QLabel
{
- Q_OBJECT
+ Q_OBJECT
public:
- QtxToolTip( QWidget* = 0 );
- virtual ~QtxToolTip();
+ QtxToolTip( QWidget* = 0 );
+ virtual ~QtxToolTip();
- void hideTip();
+ void hideTip();
- virtual void showTip( const QPoint& aPos,
+ virtual void showTip( const QPoint& aPos,
const QString& text, const QRect& aWidgetRegion );
- virtual void showTip( const QRect& aRegion,
+ virtual void showTip( const QRect& aRegion,
const QString& text, const QRect& aWidgetRegion );
- virtual bool eventFilter( QObject* o, QEvent* e );
+ virtual bool eventFilter( QObject* o, QEvent* e );
void setWakeUpDelayTime( int );
void setShowDelayTime( int );
void maybeTip( QPoint, QString&, QFont&, QRect&, QRect& );
protected slots:
- void onSleepTimeOut();
- void onWakeUpTimeOut();
+ void onSleepTimeOut();
+ void onWakeUpTimeOut();
protected:
- virtual void maybeTip( const QPoint& );
- virtual void mousePressEvent( QMouseEvent* );
- virtual void mouseDoubleClickEvent( QMouseEvent* );
+ virtual void maybeTip( const QPoint& );
+ virtual void mousePressEvent( QMouseEvent* );
+ virtual void mouseDoubleClickEvent( QMouseEvent* );
QTimer* sleepTimer() const;
QTimer* wakeUpTimer() const;
private:
- QTimer* myWakeUpTimer;
- QTimer* mySleepTimer;
- QRect myWidgetRegion;
+ QTimer* myWakeUpTimer;
+ QTimer* mySleepTimer;
+ QRect myWidgetRegion;
int myShowDelayTime;
int myWakeUpDelayTime;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxTranslator.cxx
// Author: Alexander SOLOVYOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxTranslator.h
// Author: Alexander SOLOVYOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxTreeView.cxx
// Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
QIcon icon;
if ( iconData.isValid() ) {
if ( qVariantCanConvert<QIcon>( iconData ) )
- icon = qVariantValue<QIcon>( iconData );
+ icon = qVariantValue<QIcon>( iconData );
else if ( qVariantCanConvert<QPixmap>( iconData ) )
- icon = qVariantValue<QPixmap>( iconData );
+ icon = qVariantValue<QPixmap>( iconData );
}
if( ( !lab.isEmpty() || !icon.isNull() ) &&
- appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
- {
+ appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
+ {
QAction* a = menu.addAction( icon, lab );
a->setCheckable( true );
a->setChecked( !isSectionHidden( i ) );
QAction* sortAction = 0;
if ( count() > 0 && myEnableSortMenu ) {
menu.addSeparator();
- sortAction = menu.addAction( tr( "Enable sorting" ) );
+ sortAction = menu.addAction( QtxTreeView::tr( "Enable sorting" ) );
sortAction->setCheckable( true );
sortAction->setChecked( isSortIndicatorShown() );
}
setClickable( a->isChecked() );
QtxTreeView* view = qobject_cast<QtxTreeView*>( parent() );
if ( view ) {
- view->emitSortingEnabled( a->isChecked() );
- if ( a->isChecked() ) {
- connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
- view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() );
- }
- else {
- disconnect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
- view->sortByColumn( 0, Qt::AscendingOrder );
- }
+ view->emitSortingEnabled( a->isChecked() );
+ if ( a->isChecked() ) {
+ connect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
+ view->sortByColumn( sortIndicatorSection(), sortIndicatorOrder() );
+ }
+ else {
+ disconnect( this, SIGNAL( sectionClicked( int ) ), view, SLOT( onHeaderClicked( int ) ) );
+ view->sortByColumn( 0, Qt::AscendingOrder );
+ }
}
}
}
\param deselected previous selection
*/
void QtxTreeView::selectionChanged( const QItemSelection& selected,
- const QItemSelection& deselected )
+ const QItemSelection& deselected )
{
QTreeView::selectionChanged( selected, deselected );
emit( selectionChanged() );
*/
void QtxTreeView::rowsAboutToBeRemoved( const QModelIndex& parent, int start, int end )
{
- setCurrentIndex( QModelIndex() );
+ QModelIndex curIndex = currentIndex();
+ while ( curIndex.isValid() && curIndex.parent() != parent )
+ curIndex = curIndex.parent();
+ if ( curIndex.isValid() && curIndex.row() >= start && curIndex.row() <= end )
+ setCurrentIndex( QModelIndex() );
QTreeView::rowsAboutToBeRemoved( parent, start, end );
}
QTreeView::setModel( m );
if ( model() )
connect( model(), SIGNAL( headerDataChanged( Qt::Orientation, int, int ) ),
- this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) );
+ this, SLOT( onAppropriate( Qt::Orientation, int, int ) ) );
}
void QtxTreeView::onAppropriate( Qt::Orientation orient, int first, int last )
{
if( orient==Qt::Horizontal )
for( int i=first; i<=last; i++ )
- {
- int appr = model()->headerData( i, orient, Qtx::AppropriateRole ).toInt();
- header()->setSectionHidden( i, appr==Qtx::Hidden );
- }
+ {
+ int appr = model()->headerData( i, orient, Qtx::AppropriateRole ).toInt();
+ header()->setSectionHidden( i, appr==Qtx::Hidden );
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxTreeView.h
// Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxValidator.cxx
// Author: Alexandre SOLOVYOV
//
\param parent parent object
*/
QtxDoubleValidator::QtxDoubleValidator( const double bot, const double top,
- const int dec, QObject* parent )
+ const int dec, QObject* parent )
: QDoubleValidator( bot, top, dec, parent )
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxValidator.h
// Author: Alexandre SOLOVYOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkspace.cxx
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkspace.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkspaceAction.cxx
// Author: Sergey TELKOV
//
ws->cascade();
- int w = ws->width();
- int h = ws->height();
+ int w = ws->width();
+ int h = ws->height();
- QWidgetList winList = ws->windowList();
+ QWidgetList winList = ws->windowList();
for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
- (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) );
+ (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) );
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkspaceAction.h
// Author: Sergey TELKOV
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkstack.cxx
// Author: Sergey TELKOV
//
#include <QRegExp>
#include <QLayout>
#include <QPainter>
-#include <QSplitter>
+#include <QDataStream>
#include <QFocusEvent>
#include <QMouseEvent>
#include <QRubberBand>
class QtxWorkstackArea::WidgetEvent : public QEvent
{
public:
- WidgetEvent( Type t, QWidget* w = 0 ) : QEvent( t ), myWidget( w ) {};
+ WidgetEvent( Type t, QtxWorkstackChild* w = 0 ) : QEvent( t ), myChild( w ) {};
+
+ QtxWorkstackChild* child() const { return myChild; }
+
+private:
+ QtxWorkstackChild* myChild; // event receiver widget
+};
+
+/*!
+ \class QtxWorkstackArea::RestoreEvent
+ \internal
+ \brief Internal class used to forward restore info events to the workarea
+*/
+
+class QtxWorkstackArea::RestoreEvent : public QtxWorkstackArea::WidgetEvent
+{
+public:
+ RestoreEvent( Type t, int id, int f, QtxWorkstackChild* w )
+ : WidgetEvent( t, w ), myId( id ), myFlags( f ) {};
- QWidget* widget() const { return myWidget; }
+ int id() const { return myId; }
+ int flags() const { return myFlags; }
private:
- QWidget* myWidget; // event receiver widget
+ int myId;
+ int myFlags;
};
/*!
/*!
\brief Called when drop operation is finished.
-
+
Inserts dropped widget to the target workarea.
*/
void QtxWorkstackDrag::dropWidget()
{
if ( myArea )
- myArea->insertWidget( myChild->widget(), myTab );
+ myArea->insertChild( myChild, myTab );
}
/*!
{
ensurePolished();
int dim = 0;
- if( !icon().isNull() )
+ if( !icon().isNull() )
{
const QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ),
QIcon::Normal );
\return minimum size value
*/
QSize CloseButton::minimumSizeHint() const
-{
- return sizeHint();
+{
+ return sizeHint();
}
/*!
QPixmap pm = icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ), isEnabled() ?
underMouse() ? QIcon::Active : QIcon::Normal
- : QIcon::Disabled,
+ : QIcon::Disabled,
isDown() ? QIcon::On : QIcon::Off );
style()->drawItemPixmap( &p, r, Qt::AlignCenter, pm );
}
+
+/*!
+ \class QtxWorkstackSplitter
+ \internal
+ \brief Workstack splitter.
+*/
+
+/*!
+ \brief Constructor.
+ \param parent parent widget
+*/
+QtxWorkstackSplitter::QtxWorkstackSplitter( QWidget* parent )
+: QSplitter( parent )
+{
+ setChildrenCollapsible( false );
+}
+
+/*!
+ \brief Destructor.
+*/
+QtxWorkstackSplitter::~QtxWorkstackSplitter()
+{
+}
+
+/*!
+ \brief Get parent workstack
+ \return workstack owning this workarea
+*/
+QtxWorkstack* QtxWorkstackSplitter::workstack() const
+{
+ QtxWorkstack* ws = 0;
+ QWidget* wid = parentWidget();
+ while ( wid && !ws )
+ {
+ ws = ::qobject_cast<QtxWorkstack*>( wid );
+ wid = wid->parentWidget();
+ }
+ return ws;
+}
+
+/*!
+ \brief Save the widget area configuration into data stream.
+*/
+void QtxWorkstackSplitter::saveState( QDataStream& stream ) const
+{
+ stream << QtxWorkstack::SplitMarker;
+
+ uchar flags = 0;
+ if ( orientation() == Qt::Horizontal )
+ flags |= QtxWorkstack::Horizontal;
+
+ stream << flags;
+ stream << count();
+
+ QList<int> sz = sizes();
+ for ( QList<int>::const_iterator it = sz.begin(); it != sz.end(); ++it )
+ stream << *it;
+
+ for ( int i = 0; i < count(); i++ )
+ {
+ QWidget* wid = widget( i );
+ QtxWorkstackSplitter* split = ::qobject_cast<QtxWorkstackSplitter*>( wid );
+ if ( split )
+ split->saveState( stream );
+ else
+ {
+ QtxWorkstackArea* area = ::qobject_cast<QtxWorkstackArea*>( wid );
+ if ( area )
+ area->saveState( stream );
+ }
+ }
+}
+
+/*!
+ \brief Restore the widget area configuration from data stream info.
+ \return \c true in successful case.
+*/
+bool QtxWorkstackSplitter::restoreState( QDataStream& stream, QMap<QString, QtxWorkstackChild*>& map )
+{
+ int num = 0;
+ uchar flags = 0;
+
+ stream >> flags;
+ stream >> num;
+
+ setOrientation( flags & QtxWorkstack::Horizontal ? Qt::Horizontal : Qt::Vertical );
+
+ QList<int> sz;
+ for ( int s = 0; s < num; s++ )
+ {
+ int sn = 0;
+ stream >> sn;
+ sz.append( sn );
+ }
+
+ bool ok = true;
+ for ( int i = 0; i < num && ok; i++ )
+ {
+ int marker;
+ stream >> marker;
+
+ if ( stream.status() != QDataStream::Ok )
+ return false;
+
+ if ( marker == QtxWorkstack::SplitMarker )
+ {
+ QtxWorkstackSplitter* split = new QtxWorkstackSplitter( this );
+ addWidget( split );
+ split->setVisible( true );
+
+ ok = split->restoreState( stream, map );
+ }
+ else if ( marker == QtxWorkstack::AreaMarker )
+ {
+ QtxWorkstack* ws = workstack();
+ QtxWorkstackArea* area = ws->createArea( this );
+ addWidget( area );
+ area->setVisible( true );
+
+ ok = area->restoreState( stream, map );
+ }
+ else
+ return false;
+ }
+
+ if ( ok )
+ setSizes( sz );
+
+ return ok;
+}
+
/*!
\class QtxWorkstackArea
\internal
bool QtxWorkstackArea::isEmpty() const
{
bool res = false;
- for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !res; ++it )
- res = it.value().vis;
+ for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !res; ++it )
+ res = (*it)->visibility();
return !res;
}
\param f widget flags
\return child widget container object (or 0 if index is invalid)
*/
-QWidget* QtxWorkstackArea::insertWidget( QWidget* wid, const int idx, Qt::WindowFlags f )
+QtxWorkstackChild* QtxWorkstackArea::insertWidget( QWidget* wid, const int idx, Qt::WindowFlags f )
{
if ( !wid )
return 0;
- int pos = myList.indexOf( wid );
+ QtxWorkstackChild* c = child( wid );
+ if ( !c )
+ c = new QtxWorkstackChild( wid, myStack, f );
+
+ insertChild( c, idx );
+
+ return c;
+}
+
+void QtxWorkstackArea::insertChild( QtxWorkstackChild* child, const int idx )
+{
+ if ( !child )
+ return;
+
+ QtxWorkstackArea* a = child->area();
+ if ( a && a != this )
+ a->removeChild( child, false );
+
+ int pos = myList.indexOf( child );
if ( pos != -1 && ( pos == idx || ( idx < 0 && pos == (int)myList.count() - 1 ) ) )
- return 0;
+ return;
+
+ bool found = myList.contains( child );
- myList.removeAll( wid );
+ myList.removeAll( child );
pos = idx < 0 ? myList.count() : idx;
- myList.insert( qMin( pos, (int)myList.count() ), wid );
- if ( !myInfo.contains( wid ) )
+ myList.insert( qMin( pos, (int)myList.count() ), child );
+
+ if ( !found )
{
- QtxWorkstackChild* child = new QtxWorkstackChild( wid, myStack, f );
- myChild.insert( wid, child );
- myInfo.insert( wid, WidgetInfo() );
- myInfo[wid].id = generateId();
- myInfo[wid].vis = wid->isVisibleTo( wid->parentWidget() );
+ bool hasId = false;
+ for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !hasId; ++it )
+ hasId = (*it)->id() == child->id();
+
+ if ( hasId || child->id() < 0 )
+ child->setId( generateId() );
connect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) );
- connect( wid, SIGNAL( destroyed() ), this, SLOT( onWidgetDestroyed() ) );
connect( child, SIGNAL( shown( QtxWorkstackChild* ) ), this, SLOT( onChildShown( QtxWorkstackChild* ) ) );
connect( child, SIGNAL( hidden( QtxWorkstackChild* ) ), this, SLOT( onChildHidden( QtxWorkstackChild* ) ) );
connect( child, SIGNAL( activated( QtxWorkstackChild* ) ), this, SLOT( onChildActivated( QtxWorkstackChild* ) ) );
updateState();
- setWidgetActive( wid );
- wid->setFocus();
-
- return myChild[wid];
+ setWidgetActive( child->widget() );
+ child->widget()->setFocus();
}
/*!
}
/*!
- \brief Called when area's child widget is destroyed.
-
- Removes child widget from the area.
+ \brief Remove widget from workarea.
+ \param wid widget to be removed
+ \param del if \c true the widget should be also deleted
*/
-void QtxWorkstackArea::onWidgetDestroyed()
+void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
{
- if ( sender() )
- removeWidget( (QWidget*)sender(), false );
+ removeChild( child( wid ), del );
}
/*!
- \brief Remove widget from workarea.
- \param wid widget to be removed
+ \brief Remove child from workarea.
+ \param child child to be removed
\param del if \c true the widget should be also deleted
*/
-void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del )
+void QtxWorkstackArea::removeChild( QtxWorkstackChild* child, const bool del )
{
- if ( !myList.contains( wid ) )
+ if ( !myList.contains( child ) )
return;
- if ( myBar->indexOf( widgetId( wid ) ) != -1 )
- myBar->removeTab( myBar->indexOf( widgetId( wid ) ) );
+ myStack->removeWidget( child );
- myStack->removeWidget( child( wid ) );
+ if ( myBar->indexOf( child->id() ) != -1 )
+ myBar->removeTab( myBar->indexOf( child->id() ) );
- myList.removeAll( wid );
- myInfo.remove( wid );
- myChild.remove( wid );
+ myList.removeAll( child );
if ( del )
- delete child( wid );
+ delete child;
+ else if ( child->widget() )
+ {
+ disconnect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) );
+ disconnect( child, SIGNAL( shown( QtxWorkstackChild* ) ), this, SLOT( onChildShown( QtxWorkstackChild* ) ) );
+ disconnect( child, SIGNAL( hidden( QtxWorkstackChild* ) ), this, SLOT( onChildHidden( QtxWorkstackChild* ) ) );
+ disconnect( child, SIGNAL( activated( QtxWorkstackChild* ) ), this, SLOT( onChildActivated( QtxWorkstackChild* ) ) );
+ disconnect( child, SIGNAL( captionChanged( QtxWorkstackChild* ) ), this, SLOT( onChildCaptionChanged( QtxWorkstackChild* ) ) );
+ }
if ( isNull() )
deleteLater();
updateState();
}
+QList<QtxWorkstackChild*> QtxWorkstackArea::childList() const
+{
+ return myList;
+}
+
/*!
\brief Get all visible child widgets.
\return list of visible child widgets
QWidgetList QtxWorkstackArea::widgetList() const
{
QWidgetList lst;
- for ( QWidgetList::const_iterator it = myList.begin(); it != myList.end(); ++it )
+ for ( ChildList::const_iterator it = myList.begin(); it != myList.end(); ++it )
{
- if ( widgetVisibility( *it ) )
- lst.append( *it );
+ QtxWorkstackChild* c = *it;
+ if ( c->visibility() )
+ lst.append( c->widget() );
}
return lst;
}
*/
bool QtxWorkstackArea::contains( QWidget* wid ) const
{
- return myList.contains( wid );
-}
-
-/*!
- \brief Show/hide workarea.
- \param on new visibility state
-*/
-void QtxWorkstackArea::setVisible( bool on )
-{
- QMap<QWidget*, bool> map;
- for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
- {
- map.insert( *it, isBlocked( *it ) );
- setBlocked( *it, true );
- }
-
- QFrame::setVisible( on );
-
- for ( QWidgetList::iterator itr = myList.begin(); itr != myList.end(); ++itr )
- setBlocked( *itr, map.contains( *itr ) ? map[*itr] : false );
+ return child( wid );
}
/*!
QWidget* wid = parentWidget();
while ( wid && !ws )
{
- if ( wid->inherits( "QtxWorkstack" ) )
- ws = (QtxWorkstack*)wid;
+ ws = ::qobject_cast<QtxWorkstack*>( wid );
wid = wid->parentWidget();
}
return ws;
return false;
}
+/*!
+ \brief Save the own widgets configuration into data stream.
+*/
+void QtxWorkstackArea::saveState( QDataStream& stream ) const
+{
+ stream << QtxWorkstack::AreaMarker;
+ stream << myList.count();
+ stream << myBar->tabId( myBar->currentIndex() );
+ for ( ChildList::const_iterator it = myList.begin(); it != myList.end(); ++it )
+ {
+ QtxWorkstackChild* c = *it;
+
+ stream << QtxWorkstack::WidgetMarker;
+
+ stream << c->widget()->objectName();
+ stream << c->id();
+
+ uchar flags = 0;
+ if ( c->visibility() )
+ flags |= QtxWorkstack::Visible;
+
+ stream << flags;
+ }
+}
+
+/*!
+ \brief Restore the widgets configuration from data stream info.
+ \return \c true in successful case.
+*/
+bool QtxWorkstackArea::restoreState( QDataStream& stream, QMap<QString, QtxWorkstackChild*>& map )
+{
+ int num = 0;
+ int cur = -1;
+
+ stream >> num;
+ stream >> cur;
+
+ QtxWorkstackChild* curChild = 0;
+ for ( int i = 0; i < num; i++ )
+ {
+ int marker;
+ stream >> marker;
+
+ if ( stream.status() != QDataStream::Ok || marker != QtxWorkstack::WidgetMarker )
+ return false;
+
+ QString name;
+ stream >> name;
+
+ int id = -1;
+ stream >> id;
+
+ uchar flags = 0;
+ stream >> flags;
+
+ QtxWorkstackChild* c = map.contains( name ) ? map[name] : 0;
+ if ( !c )
+ {
+ qWarning( "QtxWorkstack: Restored child widget \"%s\" not found.", (const char*)name.toLatin1() );
+ return false;
+ }
+
+ map.remove( name );
+
+ if ( id == cur )
+ curChild = c;
+
+ QApplication::postEvent( this, new RestoreEvent( (QEvent::Type)RestoreWidget, id, flags, c ) );
+ }
+
+ if ( curChild )
+ QApplication::postEvent( this, new WidgetEvent( (QEvent::Type)MakeCurrent, curChild ) );
+
+ return true;
+}
+
/*!
\brief Get rectangle to be drawn when highlighting drop area.
\return area drop rectangle
if ( activeWidget()->focusWidget()->hasFocus() )
{
QFocusEvent in( QEvent::FocusIn );
- QApplication::sendEvent( this, &in );
- }
- else {
+ QApplication::sendEvent( this, &in );
+ }
+ else
+ {
activeWidget()->focusWidget()->setFocus();
- myBar->updateActiveState();
- }
+ myBar->updateActiveState();
+ }
}
}
break;
- case RemoveWidget:
- removeWidget( we->widget() );
+ case MakeCurrent:
+ if ( we->child()->widget() )
+ setActiveWidget( we->child()->widget() );
+ break;
+ case RestoreWidget:
+ if ( we->child() )
+ {
+ QtxWorkstackChild* c = we->child();
+ RestoreEvent* re = (RestoreEvent*)we;
+ if ( c->widget() )
+ c->widget()->setVisible( re->flags() & QtxWorkstack::Visible );
+ c->setId( re->id() );
+ insertChild( c );
+ }
break;
default:
break;
*/
void QtxWorkstackArea::onChildDestroyed( QObject* obj )
{
- QtxWorkstackChild* child = (QtxWorkstackChild*)obj;
- myStack->removeWidget( child );
-
- QWidget* wid = 0;
- for ( ChildMap::ConstIterator it = myChild.begin(); it != myChild.end() && !wid; ++it )
- {
- if ( it.value() == child )
- wid = it.key();
- }
-
- myChild.remove( wid );
-
- QApplication::postEvent( this, new WidgetEvent( (QEvent::Type)RemoveWidget, wid ) );
+ removeChild( (QtxWorkstackChild*)obj, false );
}
/*!
*/
void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c )
{
- setWidgetShown( c->widget(), true );
+ updateState();
}
/*!
*/
void QtxWorkstackArea::onChildHidden( QtxWorkstackChild* c )
{
- setWidgetShown( c->widget(), false );
+ updateState();
}
/*!
*/
void QtxWorkstackArea::updateCurrent()
{
- QMap<QWidget*, bool> map;
- for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
- {
- map.insert( *it, isBlocked( *it ) );
- setBlocked( *it, true );
- }
-
QWidget* cur = child( widget( myBar->tabId( myBar->currentIndex() ) ) );
if ( cur )
myStack->setCurrentWidget( cur );
-
- for ( QWidgetList::iterator itr = myList.begin(); itr != myList.end(); ++itr )
- setBlocked( *itr, map.contains( *itr ) ? map[*itr] : false );
}
/*!
*/
QWidget* QtxWorkstackArea::widget( const int id ) const
{
- QWidget* wid = 0;
- for ( WidgetInfoMap::ConstIterator it = myInfo.begin(); it != myInfo.end() && !wid; ++it )
- {
- if ( it.value().id == id )
- wid = it.key();
- }
- return wid;
+ QtxWorkstackChild* c = child( id );
+
+ return c ? c->widget() : 0;
}
/*!
*/
int QtxWorkstackArea::widgetId( QWidget* wid ) const
{
- int id = -1;
- if ( myInfo.contains( wid ) )
- id = myInfo[wid].id;
- return id;
-}
+ QtxWorkstackChild* c = child( wid );
-/*!
- \brief Get child widget's visibility.
- \param wid widget
- \return \c true if widget is visible
-*/
-bool QtxWorkstackArea::widgetVisibility( QWidget* wid ) const
-{
- bool res = false;
- if ( myInfo.contains( wid ) )
- res = myInfo[wid].vis;
- return res;
+ return c ? c->id() : -1;
}
/*!
myBar->setCurrentIndex( myBar->indexOf( id ) );
}
-/*!
- \brief Show/hide child widget.
- \param wid widget
- \param on new visibility state
-*/
-void QtxWorkstackArea::setWidgetShown( QWidget* wid, const bool on )
-{
- if ( isBlocked( wid ) || !myInfo.contains( wid ) || myInfo[wid].vis == on )
- return;
-
- myInfo[wid].vis = on;
- updateState();
-}
-
/*!
\brief Update internal state.
*/
QWidget* prev = activeWidget();
int idx = 0;
- for ( QWidgetList::iterator it = myList.begin(); it != myList.end(); ++it )
+ for ( ChildList::iterator it = myList.begin(); it != myList.end(); ++it )
{
- QWidget* wid = *it;
- int id = widgetId( wid );
+ QtxWorkstackChild* cont = *it;
+ QWidget* wid = cont->widget();;
+ int id = cont->id();
if ( id < 0 )
continue;
- bool vis = widgetVisibility( wid );
+ bool vis = cont->visibility();
int cIdx = myBar->indexOf( id );
if ( cIdx != -1 && ( !vis || myBar->indexOf( id ) != idx ) )
updateTab( wid );
- bool block = isBlocked( wid );
- setBlocked( wid, true );
-
- QtxWorkstackChild* cont = child( wid );
-
if ( !vis )
myStack->removeWidget( cont );
else if ( myStack->indexOf( cont ) < 0 )
if ( vis )
idx++;
-
- setBlocked( wid, block );
}
int curId = widgetId( prev );
if ( myBar->indexOf( curId ) < 0 )
{
- QWidget* wid = 0;
- int pos = myList.indexOf( prev );
- for ( int i = pos - 1; i >= 0 && !wid; i-- )
+ QtxWorkstackChild* c = 0;
+ int pos = myList.indexOf( child( prev ) );
+ for ( int i = pos - 1; i >= 0 && !c; i-- )
{
- if ( widgetVisibility( myList.at( i ) ) )
- wid = myList.at( i );
+ if ( myList.at( i )->visibility() )
+ c = myList.at( i );
}
- for ( int j = pos + 1; j < (int)myList.count() && !wid; j++ )
+ for ( int j = pos + 1; j < (int)myList.count() && !c; j++ )
{
- if ( widgetVisibility( myList.at( j ) ) )
- wid = myList.at( j );
+ if ( myList.at( j )->visibility() )
+ c = myList.at( j );
}
- if ( wid )
- curId = widgetId( wid );
+ if ( c )
+ curId = c->id();
}
myBar->setCurrentIndex( myBar->indexOf( curId ) );
{
QMap<int, int> map;
- for ( WidgetInfoMap::const_iterator it = myInfo.begin(); it != myInfo.end(); ++it )
- map.insert( it.value().id, 0 );
+ for ( ChildList::const_iterator it = myList.begin(); it != myList.end(); ++it )
+ map.insert( (*it)->id(), 0 );
int id = 0;
while ( map.contains( id ) )
return id;
}
-/*!
- \brief Check if the child wiget is blocked.
- \param wid widget
- \return \c true if the widget is blocked
-*/
-bool QtxWorkstackArea::isBlocked( QWidget* wid ) const
-{
- return myBlock.contains( wid );
-}
-
-/*!
- \brief Block widget.
- \param wid widget
- \param on new blocked state
-*/
-void QtxWorkstackArea::setBlocked( QWidget* wid, const bool on )
-{
- if ( on )
- myBlock.insert( wid, 0 );
- else
- myBlock.remove( wid );
-}
-
/*!
\brief Get child widget container.
\param wid child widget
QtxWorkstackChild* QtxWorkstackArea::child( QWidget* wid ) const
{
QtxWorkstackChild* res = 0;
- if ( myChild.contains( wid ) )
- res = myChild[wid];
+ for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !res; ++it )
+ {
+ if ( (*it)->widget() == wid )
+ res = *it;
+ }
return res;
}
+QtxWorkstackChild* QtxWorkstackArea::child( const int id ) const
+{
+ QtxWorkstackChild* c = 0;
+ for ( ChildList::const_iterator it = myList.begin(); it != myList.end() && !c; ++it )
+ {
+ if ( (*it)->id() == id )
+ c = *it;
+ }
+ return c;
+}
+
/*!
\fn void QtxWorkstackArea::activated( QWidget* w )
\brief Emitted when child widget is activated.
*/
QtxWorkstackChild::QtxWorkstackChild( QWidget* wid, QWidget* parent, Qt::WindowFlags f )
: QWidget( parent ),
+ myId( 0 ),
myWidget( wid )
{
- myWidget->setParent( this, f );
- myWidget->installEventFilter( this );
- QVBoxLayout* base = new QVBoxLayout( this );
- base->setMargin( 0 );
- base->addWidget( myWidget );
+ if ( myWidget )
+ {
+ myWidget->setParent( this, f );
+ myWidget->installEventFilter( this );
+ if ( myWidget->focusProxy() )
+ myWidget->focusProxy()->installEventFilter( this );
+ myWidget->setVisible( myWidget->isVisibleTo( myWidget->parentWidget() ) );
+
+ QVBoxLayout* base = new QVBoxLayout( this );
+ base->setMargin( 0 );
+ base->addWidget( myWidget );
- connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+ connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
+ }
}
/*!
widget()->hide();
widget()->removeEventFilter( this );
+ if ( widget()->focusProxy() )
+ widget()->focusProxy()->removeEventFilter( this );
widget()->setParent( 0 );
}
return myWidget;
}
+/*!
+ \brief Returns the id.
+*/
+int QtxWorkstackChild::id() const
+{
+ return myId;
+}
+
+/*!
+ \brief Sets the id.
+*/
+void QtxWorkstackChild::setId( const int id )
+{
+ myId = id;
+}
+
+/*!
+ \brief Returns true if this child window should be visible.
+*/
+bool QtxWorkstackChild::visibility()
+{
+ return myWidget ? myWidget->isVisibleTo( this ) : false;
+}
+
+QtxWorkstackArea* QtxWorkstackChild::area() const
+{
+ QtxWorkstackArea* a = 0;
+ QWidget* w = parentWidget();
+ while ( !a && w )
+ {
+ a = ::qobject_cast<QtxWorkstackArea*>( w );
+ w = w->parentWidget();
+ }
+
+ return a;
+}
+
/*!
\brief Custom event filter.
*/
void QtxWorkstackChild::onDestroyed( QObject* obj )
{
- if ( obj != widget() )
- return;
-
- myWidget = 0;
deleteLater();
}
*/
QtxWorkstackTabBar::QtxWorkstackTabBar( QWidget* parent )
: QTabBar( parent ),
- myId( -1 )
+ myId( -1 ),myActive(false)
{
setDrawBase( true );
setElideMode( Qt::ElideNone );
\brief Workstack widget.
Organizes the child widgets in the tabbed space.
- Allows splitting the working area to arrange the child widgets in
+ Allows splitting the working area to arrange the child widgets in
arbitrary way. Any widgets can be moved to another working area with
drag-n-drop operation.
- This widget can be used as workspace of the application main window,
+ This widget can be used as workspace of the application main window,
for example, as kind of implementation of multi-document interface.
*/
QVBoxLayout* base = new QVBoxLayout( this );
base->setMargin( 0 );
- mySplit = new QSplitter( this );
- mySplit->setChildrenCollapsible( false );
+ mySplit = new QtxWorkstackSplitter( this );
base->addWidget( mySplit );
}
}
/*!
- \brief Get list of all widgets in all areas or in specified area which given
+ \brief Get list of all widgets in all areas or in specified area which given
widget belongs to
- \param wid widget specifying area if it is equal to null when widgets of all
+ \param wid widget specifying area if it is equal to null when widgets of all
areas are retuned
\return list of widgets
*/
{
areas( mySplit, lst, true );
}
- else
+ else
{
QtxWorkstackArea* area = wgArea( wid );
if ( area )
QList<QtxWorkstackArea*> allAreas;
areas(mySplit, allAreas, true);
-
for ( QList<QtxWorkstackArea*>::iterator it = allAreas.begin(); it != allAreas.end() && !area; ++it )
{
if ( (*it)->contains( wid ) )
if ( !area )
return;
+ QWidget* curWid = area->activeWidget();
+ if ( !curWid )
+ return;
+
QWidgetList wids = area->widgetList();
if ( wids.count() < 2 )
return;
{
area->removeWidget( wid_i );
newArea->insertWidget( wid_i );
+ wid_i->showMaximized();
}
}
break;
{
area->removeWidget( *itr );
newArea->insertWidget( *itr );
+ (*itr)->showMaximized();
}
}
break;
case SplitMove:
area->removeWidget( wid );
newArea->insertWidget( wid );
+ wid->showMaximized();
break;
}
distributeSpace( trg );
+
+ curWid->show();
+ curWid->setFocus();
}
/*!
if ( !area1 || !area2 )
return;
+ QSplitter* s1 = splitter( area1 );
+
QWidget* curWid = area1->activeWidget();
if ( !curWid )
return;
// Set wid1 at first position, wid2 at second
area1->insertWidget( wid1 );
area1->insertWidget( wid2, 1 );
+ wid1->showMaximized();
+ wid2->showMaximized();
}
else
{
QWidgetList wids1 = area1->widgetList();
for ( QWidgetList::iterator itr1 = wids1.begin(); itr1 != wids1.end() && *itr1 != wid1; ++itr1, ++wid1_ind );
area1->insertWidget( wid2, wid1_ind + 1 );
+ wid2->showMaximized();
}
}
else
area1->insertWidget( *itr2, wid1_ind + 1 );
else
area1->insertWidget( *itr2, ind );
+ (*itr2)->showMaximized();
}
}
else
// Set wid2 right after wid1
area2->removeWidget( wid2 );
area1->insertWidget( wid2, wid1_ind + 1 );
+ wid2->showMaximized();
}
}
+ distributeSpace( s1 );
+
area1->setActiveWidget( curWid );
+
+ wid2->show();
+ wid1->setFocus();
+ curWid->show();
+ curWid->setFocus();
}
/*!
/*!
\brief Set actions to be visible in the context popup menu.
-
- Actions, which IDs are set in \a flags parameter, will be shown in the
+
+ Actions, which IDs are set in \a flags parameter, will be shown in the
context popup menu. Other actions will not be shown.
\param flags ORed together actions flags
/*!
\brief Set actions to be visible in the context popup menu.
-
- Actions, which IDs are set in \a flags parameter, will be shown in the
+
+ Actions, which IDs are set in \a flags parameter, will be shown in the
context popup menu. Other actions will not be shown.
\param flags ORed together actions flags
QIntList szList = pSplit->sizes();
- QSplitter* wrap = new QSplitter( 0 );
- wrap->setChildrenCollapsible( false );
+ QSplitter* wrap = new QtxWorkstackSplitter( 0 );
pSplit->insertWidget( pSplit->indexOf( area ) + 1, wrap );
wrap->setVisible( true );
wrap->addWidget( area );
connect( area, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );
connect( area, SIGNAL( activated( QWidget* ) ), this, SLOT( onWindowActivated( QWidget* ) ) );
connect( area, SIGNAL( contextMenuRequested( QWidget*, QPoint ) ),
- this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) );
+ this, SLOT( onContextMenuRequested( QWidget*, QPoint ) ) );
connect( area, SIGNAL( deactivated( QtxWorkstackArea* ) ), this, SLOT( onDeactivated( QtxWorkstackArea* ) ) );
return area;
if ( areaList.isEmpty() && splitList.isEmpty() )
delete split;
- else if ( vis )
- split->show();
else
- split->hide();
+ split->setVisible( vis );
}
/*!
- \brief Get splitter info (for debug purposes)
- \param split splitter
- \param info string to be filled with splitter data.
+ \brief Dump workstack configuration to the state description array.
+ \param version number
+ \return state byte array.
*/
-void QtxWorkstack::splitterInfo( QSplitter* split, QString& info ) const
+QByteArray QtxWorkstack::saveState( int version ) const
{
- if ( !split )
- return;
-
- /*const QObjectList& objs = */split->children(); // VSR: is it needed ???
-
- QString sizesStr;
- QList<int> sizes = split->sizes();
- for ( QList<int>::iterator sIt = sizes.begin(); sIt != sizes.end(); ++sIt )
- {
- if ( *sIt > 1 ) // size 1 pixel usually means empty Workstack area, which will NOT be re-created,
- sizesStr += QString( ":%1" ).arg( *sIt ); // so we don't need to store its size
- }
-
- if ( !sizesStr.isEmpty() ) // cut the first ':'
- sizesStr = sizesStr.right( sizesStr.length() - 1 );
+ QByteArray data;
- info += QString( "(splitter orientation=%1 sizes=%3 " ).arg( split->orientation() ).arg( sizesStr );
+ QDataStream stream( &data, QIODevice::WriteOnly );
+ stream << QtxWorkstack::VersionMarker;
+ stream << version;
+ saveState( stream );
- for( int index = 0, count = split->count(); index < count; index++ )
- {
- QObject* obj = split->widget( index );
- if ( obj->inherits( "QSplitter" ) )
- splitterInfo( (QSplitter*)obj, info );
- else if ( obj->inherits( "QtxWorkstackArea" ) )
- {
- QtxWorkstackArea* area = (QtxWorkstackArea*)obj;
- if ( area->isEmpty() )
- continue;
- info += QString( "(views active='%1'" ).arg( area->activeWidget()->objectName() );
- QWidgetList views = area->widgetList();
- for ( QWidgetList::iterator wIt = views.begin(); wIt != views.end(); ++wIt )
- info += QString( " '%1'" ).arg( (*wIt)->objectName() );
- info += ')';
- }
- }
-
- info += ')';
- printf( (const char*)QString( info + '\n' ).toLatin1() );
+ return data;
}
/*!
- \brief Remove round brackets symbols from the string.
- \internal
- \param parameters string to be processed
+ \brief Restore workstack configuration from the state description array.
+ \param version number
+ \return restore performing state
*/
-static void cutBrackets( QString& parameters )
+bool QtxWorkstack::restoreState( const QByteArray& state, int version )
{
- QChar c1 = parameters[0];
- QChar c2 = parameters[int(parameters.length()-1)];
- if ( !parameters.isEmpty() && c1 == '(' && c2 == ')' )
- parameters = parameters.mid( 1, parameters.length()-2 );
-}
-
-/*!
- \brief Parse string to get some parameter value.
- \internal
-
- String \a str can contain the parameters description of kind "<param>=<value> ...".
- For example:
- \code
- QString s = "splitter orientation=0 children=2 sizes=332:478";
- QString orient_val = getValue( s, "children" ); // orient_val contains "2"
- QString size_val = getValue( s, "sizes" ); // val contains "332:478"
- \endcode
+ if ( state.isEmpty() )
+ return false;
- \param str string to be processed
- \param valName parameter name
- \return parameter value (or null QStrinhg if parameter is not found)
-*/
-static QString getValue( const QString& str, const QString& valName )
-{
- int i = str.indexOf( valName );
- if ( i != -1 )
- {
- int equal_i = str.indexOf( '=', i );
- if ( equal_i != -1 )
- {
- int space_i = str.indexOf( ' ', ++equal_i );
- if ( space_i != -1 )
- return str.mid( equal_i, space_i - equal_i );
- }
- }
- return QString();
-}
+ QByteArray sd = state;
+ QDataStream stream( &sd, QIODevice::ReadOnly );
+ int marker, ver;
+ stream >> marker;
+ stream >> ver;
+ if ( stream.status() != QDataStream::Ok || marker != QtxWorkstack::VersionMarker || ver != version )
+ return false;
-/*!
- \brief Check format of splitter parameters string.
- \internal
- \param parameters splitter parameters description
- \return \c true on success and \c false on error
-*/
-static bool checkFormat( const QString& parameters )
-{
- QString params( parameters );
- // 1. begins and ends with brackets
- QChar c1 = params[0];
- QChar c2 = params[int(params.length()-1)];
- bool ok = ( c1 == '(' && c2 == ')' );
- if ( !ok ) return ok;
- ::cutBrackets( params );
- // 2. has splitter word
- ok = ( params.left( 8 ) == "splitter" );
- if ( !ok ) return ok;
- // 3. has children? = '(' is found
- int i = params.indexOf( '(' );
- ok = i != -1;
- if ( !ok ) return ok;
- params = params.left( i ); // cut all children, they will be checked later
- // 4. has orientation word and correct value
- ::getValue( params, "orientation" ).toInt( &ok );
- if ( !ok ) return ok;
- // 5. has sizes word and values
- ok = ! ::getValue( params, "sizes" ).isEmpty();
- if ( !ok ) return ok;
- // 6. check children -> number of '(' == number of ')' in original string
- ok = ( parameters.contains( '(' ) == parameters.contains( ')' ) );
- return ok;
+ return restoreState( stream );
}
-/*!
- \brief Get splitter's children descriptions from the string.
- \internal
-
- Child widgets descriptions are separated by '(' and ')' symbols.
-
- \param str string to be processed
- \return child widgets descriptions
-*/
-static QStringList getChildren( const QString& str )
+void QtxWorkstack::saveState( QDataStream& stream ) const
{
- QStringList lst;
- if ( !str.startsWith( "(" ) )
- return lst;
-
- int i = 1,
- nOpen = 1, // count brackets: '(' increments nOpen, ')' decrements
- start = 0;
- while ( i < (int)str.length() )
- {
- if ( str[i] == '(' )
- {
- nOpen++;
- if ( nOpen == 1 )
- start = i;
- }
- else if ( str[i] == ')' )
- {
- nOpen--;
- if ( nOpen == 0 )
- lst.append( str.mid( start, i-start+1 ) );
- }
- i++;
- }
-
- return lst;
+ mySplit->saveState( stream );
}
-/*!
- \brief Get view name by index.
- \internal
-
- Example:
- \code
- QString s = "views active='AnotherView' 'GLView' 'AnotherView'";
- QString a0 = getViewName( s, 0 ); // --> a0 contains "GLView"
- QString a1 = getViewName( s, 1 ); // --> a1 contains "AnotherView"
- \endcode
-
- \param str string to be processed
- \param i index
- \return view name
-*/
-static QString getViewName( const QString& str, int i )
+bool QtxWorkstack::restoreState( QDataStream& stream )
{
- QRegExp exp( "\\s'\\w+'" );
- int start = 0; // start index of view name in the string
- int num = 0 ; // index of found match
- while ( ( start = exp.indexIn( str, start ) ) != -1 && num < i )
+ QMap<QString, QtxWorkstackChild*> map;
+ QList<QtxWorkstackArea*> areaList;
+ areas( mySplit, areaList, true );
+ for ( QList<QtxWorkstackArea*>::const_iterator it = areaList.begin(); it != areaList.end(); ++it )
{
- start += exp.matchedLength();
- num ++;
- }
- if ( start != -1 ) // +2 and -3 avoid starting space and starting and ending ' symbols
- return str.mid( start + 2, exp.matchedLength() - 3 );
-
- return QString();
-}
+ QtxWorkstackArea* area = *it;
+ QList<QtxWorkstackChild*> childList = area->childList();
+ for ( QList<QtxWorkstackChild*>::iterator itr = childList.begin(); itr != childList.end(); ++itr )
+ {
+ QtxWorkstackChild* c = *itr;
+ if ( !c->widget() )
+ continue;
-/*!
- \brief Get child widget with specified name.
- \internal
- \param parent parent widget
- \param aName child widget name
- \return child widget or 0 if not found
-*/
-static QWidget* getView( const QWidget* parent, const QString& aName )
-{
- QWidget* view = 0;
- QList<QWidget*> l = qFindChildren<QWidget*>( parent->topLevelWidget(), aName );
- if ( !l.isEmpty() )
- view = ::qobject_cast<QWidget*>( l.first() );
- return view;
-}
+ map.insert( c->widget()->objectName(), c );
-/*!
- \brief Setup splitter according to the specified parameters string.
- \param splitter splitter to be set up
- \param parameters splitter parameters description
- \param sMap map containing resulting child splitters sizes
-*/
-void QtxWorkstack::setSplitter( QSplitter* splitter, const QString& parameters, QMap<QSplitter*, QList<int> >& sMap )
-{
- printf( QString( parameters + '\n' ).toLatin1() );
- if ( !::checkFormat( parameters ) ) {
- printf( "\nInvalid format of workstack parameters. Positions of viewers can not be restored.\n" );
- return;
+ qDebug( "QtxWorkstack::restoreState: found widget \"%s\"", (const char*)c->widget()->objectName().toLatin1() );
+ }
}
- QString params( parameters );
- ::cutBrackets( params );
-
- // get splitter sizes and store it in the map for future setting
- QList<int> sizes;
- QStringList sizesLst = ::getValue( params, "sizes" ).split( ':', QString::SkipEmptyParts );
- QStringList::Iterator it;
- for ( it = sizesLst.begin(); it != sizesLst.end(); ++it )
- sizes.append( (*it).toInt() );
- sMap[ splitter ] = sizes;
+ int marker;
+ stream >> marker;
+ if ( stream.status() != QDataStream::Ok || marker != QtxWorkstack::SplitMarker )
+ return false;
- // set orientation of splitter
- int orient = ::getValue( params, "orientation" ).toInt();
- splitter->setOrientation( (Qt::Orientation)orient );
+ QtxWorkstackSplitter* split = new QtxWorkstackSplitter( this );
+ if ( layout() )
+ layout()->addWidget( split );
- // get children
- QString options = params.left( params.indexOf( '(' ) );
- QString childrenStr = params.right( params.length()-options.length() );
- QStringList children = ::getChildren( childrenStr );
+ bool ok = split->restoreState( stream, map );
+ if ( !ok )
+ delete split;
+ else
+ {
+ mySplit->deleteLater();
+ mySplit = split;
- // debug output..
- // printf (" splitter orient=%d, sizes_count=%d, children=%d\n", orient, sizes.count(), children.count() );
- // for ( QStringList::Iterator tit = children.begin(); tit != children.end(); ++tit )
- // printf (" |-> child = [%s]\n", (*tit).latin1() );
+ QList<QtxWorkstackArea*> aList;
+ areas( mySplit, aList, true );
- for ( it = children.begin(); it != children.end(); ++it )
- {
- if ( (*it).startsWith( "(splitter" ) )
- {
- QSplitter* newSplitter = new QSplitter( splitter );
- setSplitter( newSplitter, *it, sMap );
- }
- else if ( (*it).startsWith( "(views" ) )
+ QtxWorkstackArea* a = !aList.isEmpty() ? aList.first() : 0;
+ for ( QMap<QString, QtxWorkstackChild*>::const_iterator it = map.begin(); it != map.end(); ++it )
{
- QtxWorkstackArea* newArea = createArea( splitter );
- QString activeViewName = ::getValue( *it, "active" );
- QWidget* activeView = 0;
- activeViewName = activeViewName.mid( 1, activeViewName.length()-2 ); // chop off ' symbols
- int i = 0;
- QString viewName = ::getViewName( *it, i );
- while ( !viewName.isEmpty() )
- {
- if ( QWidget* view = ::getView( splitter, viewName ) )
- {
- newArea->insertWidget( view );
- if ( activeViewName == view->objectName() )
- activeView = view;
- }
- viewName = ::getViewName( *it, ++i );
- }
- if ( activeView )
- newArea->setActiveWidget( activeView );
+ QtxWorkstackChild* c = it.value();
+ if ( c->widget() )
+ c->widget()->setVisible( false );
+ if ( a )
+ a->insertChild( c );
+ else
+ c->setVisible( false );
}
}
+
+ return ok;
}
/*!
- \brief Restore workstack configuration from the state description string.
- \param parameters workstack state description
- \return reference to this workstack
+ \brief Set resize mode of all splitters opaque or transparent.
+ \param opaque opaque mode
*/
-QtxWorkstack& QtxWorkstack::operator<<( const QString& parameters )
+void QtxWorkstack::setOpaqueResize( bool opaque )
{
- // clear the main splitter - remove all child splitters and empty areas from it
QList<QSplitter*> splitList;
- QList<QtxWorkstackArea*> areaList;
- splitters( mySplit, splitList, false );
- areas( mySplit, areaList, false );
- for ( QList<QSplitter*>::iterator iter = splitList.begin(); iter != splitList.end(); ++iter )
- delete *iter;
-
- for ( QList<QtxWorkstackArea*>::iterator it = areaList.begin(); it != areaList.end(); ++it )
- {
- if ( (*it)->isEmpty() )
- delete *it;
- }
-
- // restore splitter recursively
- QMap< QSplitter*, QList<int> > sMap;
- setSplitter( mySplit, parameters, sMap );
-
- // now mySplit may contains empty area (where all views were located before restoring)
- // in order setSize to work correctly we have to exclude this area
- areaList.clear();
- areas( mySplit, areaList, false );
- for ( QList<QtxWorkstackArea*>::iterator delIt = areaList.begin(); delIt != areaList.end(); ++delIt )
- {
- if ( (*delIt)->isEmpty() )
- delete *delIt;
- }
-
- QApplication::instance()->processEvents();
-
- // restore splitters' sizes (map of sizes is filled in setSplitters)
- for ( QMap< QSplitter*, QList<int> >::iterator itm = sMap.begin(); itm != sMap.end(); ++itm )
- itm.key()->setSizes( itm.value() );
-
- return (*this);
+ splitters( mySplit, splitList, true );
+ splitList << mySplit;
+ foreach( QSplitter* split, splitList )
+ split->setOpaqueResize( opaque );
}
/*!
- \brief Dump workstack configuration to the state description string.
- \param parameters resulting workstack state description
- \return reference to this workstack
+ \brief Get resize mode of all splitters: opaque (\c true) or transparent (\c false).
+ \return current opaque mode
*/
-QtxWorkstack& QtxWorkstack::operator>>( QString& outParameters )
+bool QtxWorkstack::opaqueResize() const
{
- splitterInfo( mySplit, outParameters );
- return (*this);
+ return mySplit->opaqueResize();
}
+
/*!
\fn void QtxWorkstack::windowActivated( QWidget* w )
\brief Emitted when the workstack's child widget \w is activated.
\brief Moves the first widget to the same area which the second widget belongs to
\param wid widget to be moved
\param wid_to widget specified the destination area
- \param before specifies whether the first widget has to be moved before or after
+ \param before specifies whether the first widget has to be moved before or after
the second widget
- \return TRUE if operation is completed successfully, FALSE otherwise
+ \return TRUE if operation is completed successfully, FALSE otherwise
*/
bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before )
{
/*!
\brief Group all windows in one area
- \return TRUE if operation is completed successfully, FALSE otherwise
+ \return TRUE if operation is completed successfully, FALSE otherwise
*/
void QtxWorkstack::stack()
{
area_to = wgArea( *it );
area_src = area_to;
}
- else
+ else
area_src = wgArea( *it );
if ( area_src != area_to )
{
area_src->removeWidget( *it, true );
area_to->insertWidget( *it, -1 );
+ (*it)->showMaximized();
}
}
}
+
+QAction* QtxWorkstack::action( const int id ) const
+{
+ return myActionsMap.contains( id ) ? myActionsMap[id] : 0;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkstack.h
// Author: Sergey TELKOV
//
#include "Qtx.h"
-#include <QWidget>
+#include <QMap>
#include <QFrame>
-#include <QTabBar>
#include <QEvent>
-#include <QMap>
+#include <QWidget>
+#include <QTabBar>
+#include <QPointer>
+#include <QSplitter>
+#include <QByteArray>
class QAction;
-class QSplitter;
-class QStackedWidget;
+class QDataStream;
class QRubberBand;
+class QStackedWidget;
class QAbstractButton;
class QtxWorkstackArea;
class QtxWorkstackDrag;
class QtxWorkstackChild;
class QtxWorkstackTabBar;
+class QtxWorkstackSplitter;
#ifdef WIN32
#pragma warning( disable:4251 )
public:
//! Workstack actions (context menu items)
enum { SplitVertical = 0x01, //!< "Split vertically" menu item
- SplitHorizontal = 0x02, //!< "Split horizontally" menu item
- Close = 0x04, //!< "Close" menu item
- Rename = 0x08, //!< "Rename" menu item
- All = SplitVertical | SplitHorizontal |
- Close | Rename //!< all menu items
+ SplitHorizontal = 0x02, //!< "Split horizontally" menu item
+ Close = 0x04, //!< "Close" menu item
+ Rename = 0x08, //!< "Rename" menu item
+ All = SplitVertical | SplitHorizontal |
+ Close | Rename //!< all menu items
+ };
+
+ enum { VersionMarker = 0x01,
+ SplitMarker = 0x02,
+ AreaMarker = 0x04,
+ WidgetMarker = 0x08
};
-
+
+ enum { Horizontal = 0x01,
+ Visible = 0x02
+ };
+
//! Workstack splitting type
enum SplitType
{
void setMenuActions( const int );
int menuActions() const;
+ void stack();
void split( const int );
bool move( QWidget* wid, QWidget* wid_to, const bool before );
- void stack();
QWidget* addWindow( QWidget*, Qt::WindowFlags = 0 );
+ QByteArray saveState( int ) const;
+ bool restoreState( const QByteArray&, int );
+
+ void setOpaqueResize( bool = true );
+ bool opaqueResize() const;
+
void Split( QWidget* wid, const Qt::Orientation o, const SplitType type );
void Attract( QWidget* wid1, QWidget* wid2, const bool all );
void SetRelativePosition( QWidget* wid, const Qt::Orientation o, const double pos );
void SetRelativePositionInSplitter( QWidget* wid, const double pos );
- // asv: Store/Restore visual parameters - geometry of inner windows
- QtxWorkstack& operator<<( const QString& );
- QtxWorkstack& operator>>( QString& );
-
signals:
void windowActivated( QWidget* );
public slots:
void splitVertical();
void splitHorizontal();
-
+
private slots:
void onRename();
void onCloseWindow();
protected:
virtual void customEvent( QEvent* );
+ QAction* action( const int ) const;
+
+ void saveState( QDataStream& ) const;
+ bool restoreState( QDataStream& );
+
private:
QSplitter* splitter( QtxWorkstackArea* ) const;
void splitters( QSplitter*, QList<QSplitter*>&, const bool = false ) const;
void updateState( QSplitter* );
void distributeSpace( QSplitter* ) const;
+
int setPosition( QWidget* wid, QSplitter* split, const Qt::Orientation o,
- const int need_pos, const int splitter_pos );
-
- void splitterInfo( QSplitter*, QString& ) const;
- void setSplitter( QSplitter*, const QString&, QMap< QSplitter*, QList<int> >& );
-
+ const int need_pos, const int splitter_pos );
+
private:
- QWidget* myWin; //!< active widget
- QtxWorkstackArea* myArea; //!< active workarea
- QSplitter* mySplit; //!< tol-level splitter
- QWidget* myWorkWin; //!< widget where popup menu is invoked (used internally)
- QtxWorkstackArea* myWorkArea; //!< workarea where popup menu is invoked (used internally)
+ QPointer<QWidget> myWin; //!< active widget
+ QPointer<QtxWorkstackArea> myArea; //!< active workarea
+ QtxWorkstackSplitter* mySplit; //!< tol-level splitter
+ QPointer<QWidget> myWorkWin; //!< widget where popup menu is invoked (used internally)
+ QPointer<QtxWorkstackArea> myWorkArea; //!< workarea where popup menu is invoked (used internally)
QMap<int, QAction*> myActionsMap; //!< actions map
friend class QtxWorkstackArea;
friend class QtxWorkstackDrag;
+ friend class QtxWorkstackAction;
+ friend class QtxWorkstackSplitter;
+};
+
+class QtxWorkstackSplitter : public QSplitter
+{
+ Q_OBJECT
+
+public:
+ QtxWorkstackSplitter( QWidget* = 0 );
+ virtual ~QtxWorkstackSplitter();
+
+ QtxWorkstack* workstack() const;
+
+ void saveState( QDataStream& ) const;
+ bool restoreState( QDataStream&, QMap<QString, QtxWorkstackChild*>& );
};
class QtxWorkstackArea : public QFrame
Q_OBJECT
class WidgetEvent;
+ class RestoreEvent;
public:
QtxWorkstackArea( QWidget* );
bool isNull() const;
bool isEmpty() const;
- QWidget* insertWidget( QWidget*, const int = -1, Qt::WindowFlags = 0 );
+ QtxWorkstackChild* insertWidget( QWidget*, const int = -1, Qt::WindowFlags = 0 );
void removeWidget( QWidget*, const bool = true );
+ void insertChild( QtxWorkstackChild*, const int = -1 );
+ void removeChild( QtxWorkstackChild*, const bool = true );
+
QWidget* activeWidget() const;
void setActiveWidget( QWidget* );
bool contains( QWidget* ) const;
QWidgetList widgetList() const;
+ QList<QtxWorkstackChild*> childList() const;
bool isActive() const;
void updateActiveState();
int tabAt( const QPoint& ) const;
+ void saveState( QDataStream& ) const;
+ bool restoreState( QDataStream&, QMap<QString, QtxWorkstackChild*>& );
+
signals:
void activated( QWidget* );
void contextMenuRequested( QWidget*, QPoint );
void deactivated( QtxWorkstackArea* );
-public slots:
- virtual void setVisible( bool );
-
private slots:
void onClose();
void onCurrentChanged( int );
- void onWidgetDestroyed();
-
void onChildDestroyed( QObject* );
void onChildShown( QtxWorkstackChild* );
void onChildHidden( QtxWorkstackChild* );
private:
//! Custom events
enum { ActivateWidget = QEvent::User, //!< activate widget event
- FocusWidget, //!< focus receiving widget event
- RemoveWidget //!< widget removing event
+ FocusWidget, //!< focus receiving widget event
+ MakeCurrent,
+ RestoreWidget
};
private:
QWidget* widget( const int ) const;
int widgetId( QWidget* ) const;
- bool widgetVisibility( QWidget* ) const;
+
+ QtxWorkstackChild* child( QWidget* ) const;
+ QtxWorkstackChild* child( const int ) const;
void setWidgetActive( QWidget* );
- void setWidgetShown( QWidget*, const bool );
int generateId() const;
- bool isBlocked( QWidget* ) const;
- void setBlocked( QWidget*, const bool );
-
- QtxWorkstackChild* child( QWidget* ) const;
-
private:
- struct WidgetInfo
- {
- WidgetInfo() : id( 0 ), vis( false ) {}
- int id; bool vis;
- };
-
- typedef QMap<QWidget*, bool> BlockMap;
- typedef QMap<QWidget*, QtxWorkstackChild*> ChildMap;
- typedef QMap<QWidget*, WidgetInfo> WidgetInfoMap;
+ typedef QList<QtxWorkstackChild*> ChildList;
private:
QtxWorkstackTabBar* myBar; //!< workarea tab bar header
+ ChildList myList; //!< child widgets list
QAbstractButton* myClose; //!< close button
QStackedWidget* myStack; //!< widget stack
-
- QWidgetList myList; //!< child widgets list
- WidgetInfoMap myInfo; //!< widgets states mp
- ChildMap myChild; //!< child widget containers map
- BlockMap myBlock; //!< blocked widgets
};
class QtxWorkstackChild : public QWidget
QtxWorkstackChild( QWidget*, QWidget* = 0, Qt::WindowFlags = 0 );
virtual ~QtxWorkstackChild();
- QWidget* widget() const;
+ QWidget* widget() const
+;
+
+ int id() const;
+ void setId( const int );
+
+ bool visibility();
+
+ QtxWorkstackArea* area() const;
virtual bool eventFilter( QObject*, QEvent* );
virtual void childEvent( QChildEvent* );
private:
- QWidget* myWidget; //!< child widget
+ int myId; //!< id
+ QPointer<QWidget> myWidget; //!< child widget
};
class QtxWorkstackTabBar : public QTabBar
void onCurrentChanged( int );
protected:
+ virtual void changeEvent( QEvent* );
virtual void mouseMoveEvent( QMouseEvent* );
virtual void mousePressEvent( QMouseEvent* );
virtual void mouseReleaseEvent( QMouseEvent* );
virtual void contextMenuEvent( QContextMenuEvent* );
- virtual void changeEvent( QEvent* );
-
-// virtual void paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
private:
int myId; //!< current tab page index
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkstackAction.cxx
// Author: Sergey TELKOV
//
myWorkstack( ws ),
myWindowsFlag( true )
{
- insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ),
- tr( "Split vertically" ), 0, this ), SplitVertical );
- insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ),
- tr( "Split horizontally" ), 0, this ), SplitHorizontal );
+ if ( myWorkstack )
+ insertAction( myWorkstack->action( QtxWorkstack::SplitVertical ), SplitVertical );
+ else
+ insertAction( new QtxAction( tr( "Split the active window on two vertical parts" ),
+ tr( "Split vertically" ), 0, this ), SplitVertical );
+
+ if ( myWorkstack )
+ insertAction( myWorkstack->action( QtxWorkstack::SplitHorizontal ), SplitHorizontal );
+ else
+ insertAction( new QtxAction( tr( "Split the active window on two horizontal parts" ),
+ tr( "Split horizontally" ), 0, this ), SplitHorizontal );
connect( this, SIGNAL( triggered( int ) ), this, SLOT( onTriggered( int ) ) );
/*!
\brief Set actions to be visible in the menu.
-
- Actions, which IDs are set in \a flags parameter, will be shown in the
+
+ Actions, which IDs are set in \a flags parameter, will be shown in the
menu bar. Other actions will not be shown.
\param flags ORed together actions flags
*/
void QtxWorkstackAction::perform( const int type )
{
+ /*
switch ( type )
{
case SplitVertical:
splitHorizontal();
break;
}
+ */
}
/*!
/*!
\brief Called when menu item is activated by the user.
-
+
Perform the corresponding action.
\param id menu item identifier
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: QtxWorkstackAction.h
// Author: Sergey TELKOV
//
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+##############################################################
+# VSR: WARNING! THIS PACKAGE IS OBSOLETE
+##############################################################
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
nodist_salomeres_DATA = \
QxGraph_images.qm \
- QxGraph_msg_en.qm
+ QxGraph_msg_en.qm \
+ QxGraph_msg_fr.qm
libQxGraph_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#ifdef WNT
-#ifdef QXGRAPH_EXPORTS
+#if defined QXGRAPH_EXPORTS || defined QxGraph_EXPORTS
#define QXGRAPH_EXPORT __declspec(dllexport)
#else
#define QXGRAPH_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = QxGraph
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT
-
-LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += QXGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = QxGraph_ActiveItem.h
-HEADERS += QxGraph_Prs.h
-HEADERS += QxGraph_Canvas.h
-HEADERS += QxGraph_CanvasView.h
-HEADERS += QxGraph_ViewWindow.h
-HEADERS += QxGraph_ViewManager.h
-HEADERS += QxGraph_ViewModel.h
-HEADERS += QxGraph_Def.h
-HEADERS += QxGraph.h
-
-SOURCES = QxGraph_Prs.cxx
-SOURCES += QxGraph_Canvas.cxx
-SOURCES += QxGraph_CanvasView.cxx
-SOURCES += QxGraph_ViewWindow.cxx
-SOURCES += QxGraph_ViewManager.cxx
-SOURCES += QxGraph_ViewModel.cxx
-
-TRANSLATIONS = resources/QxGraph_images.ts \
- resources/QxGraph_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QXGRAPH_ACTIVEITEM_H
#define QXGRAPH_ACTIVEITEM_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#include "QxGraph_Canvas.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#ifndef QXGRAPH_CANVAS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#include "QxGraph_CanvasView.h"
int aCursorType;
if ( anActItem && anActItem->isResizable(myPoint,aCursorType) )
{ // resize itself only active items if it is resizable
- anActItem->beforeResizing(aCursorType);
- myCurrentItem = *it;
- return;
+ anActItem->beforeResizing(aCursorType);
+ myCurrentItem = *it;
+ return;
}
else if ( anActItem && anActItem->isMoveable() )
{ // move itself only active items if it is moveable
- anActItem->beforeMoving();
- myCurrentItem = *it;
- return;
+ anActItem->beforeMoving();
+ myCurrentItem = *it;
+ return;
}
}
}
if ( myOperation == PANVIEW )
{ // Panning
scrollBy(myGlobalPoint.x() - aGlobalPoint.x(),
- myGlobalPoint.y() - aGlobalPoint.y());
+ myGlobalPoint.y() - aGlobalPoint.y());
myGlobalPoint = aGlobalPoint;
myMovingDone = true;
return;
if ( anActItem ) anActItem->setTMatrix(m);
(*it)->show();
}
-
+
myGlobalPoint = aGlobalPoint;
myMovingDone = true;
if ( myCurrentItem->x() && myCurrentItem->y() ) {
double cx = myCurrentItem->x() - myPoint.x();
double cy = myCurrentItem->y() - myPoint.y();
-
+
if (aPoint.x()+cx < 0) aPoint.setX(-(int)cx);
if (aPoint.y()+cy < 0) aPoint.setY(-(int)cy);
}
myCurrentItem->moveBy(aPoint.x() - myPoint.x(),
- aPoint.y() - myPoint.y());
+ aPoint.y() - myPoint.y());
myMovingDone = true;
myPoint = aPoint;
canvas()->update();
QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
if (!isHilightPerformed && anActItem) {
- // hilight
- anActItem->hilight(aPoint);
- if (anActItem != myHilightedItem) {
- if (myHilightedItem)
- myHilightedItem->hilight(aPoint, false);
- myHilightedItem = anActItem;
- }
- isHilightPerformed = true;
-
- // show tooltip
- QxGraph_ToolTip* aToolTip = new QxGraph_ToolTip(this);
- aToolTip->maybeTip(aPoint);
+ // hilight
+ anActItem->hilight(aPoint);
+ if (anActItem != myHilightedItem) {
+ if (myHilightedItem)
+ myHilightedItem->hilight(aPoint, false);
+ myHilightedItem = anActItem;
+ }
+ isHilightPerformed = true;
+
+ // show tooltip
+ QxGraph_ToolTip* aToolTip = new QxGraph_ToolTip(this);
+ aToolTip->maybeTip(aPoint);
}
int aCursorType;
if ( anActItem && anActItem->isResizable(aPoint,aCursorType) ) {
- // set resize cursor
- QCursor resizeCursor;
- switch (aCursorType)
- {
- case 1: //left
- case 3: //right
- resizeCursor = QCursor(Qt::SizeHorCursor);
- break;
- case 2: //top
- case 4: //bottom
- resizeCursor = QCursor(Qt::SizeVerCursor);
- break;
- case 5: //left-top
- case 7: //right-bottom
- resizeCursor = QCursor(Qt::SizeFDiagCursor);
- break;
- case 6: //right-top
- case 8: //left-bottom
- resizeCursor = QCursor(Qt::SizeBDiagCursor);
- break;
- default :
- resizeCursor = QCursor(Qt::ArrowCursor);
- break;
- }
- setCursor(resizeCursor);
- return;
+ // set resize cursor
+ QCursor resizeCursor;
+ switch (aCursorType)
+ {
+ case 1: //left
+ case 3: //right
+ resizeCursor = QCursor(Qt::SizeHorCursor);
+ break;
+ case 2: //top
+ case 4: //bottom
+ resizeCursor = QCursor(Qt::SizeVerCursor);
+ break;
+ case 5: //left-top
+ case 7: //right-bottom
+ resizeCursor = QCursor(Qt::SizeFDiagCursor);
+ break;
+ case 6: //right-top
+ case 8: //left-bottom
+ resizeCursor = QCursor(Qt::SizeBDiagCursor);
+ break;
+ default :
+ resizeCursor = QCursor(Qt::ArrowCursor);
+ break;
+ }
+ setCursor(resizeCursor);
+ return;
}
else {
- // reset old cursor
- setCursor(QCursor(Qt::ArrowCursor));
- return;
+ // reset old cursor
+ setCursor(QCursor(Qt::ArrowCursor));
+ return;
}
}
}
if ( cursor().shape() == Qt::SizeVerCursor || cursor().shape() == Qt::SizeHorCursor
- || cursor().shape() == Qt::SizeBDiagCursor || cursor().shape() == Qt::SizeFDiagCursor)
+ || cursor().shape() == Qt::SizeBDiagCursor || cursor().shape() == Qt::SizeFDiagCursor)
setCursor(QCursor(Qt::ArrowCursor));
}
}
QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
if (!isSelectionPerformed && anActItem)
{
- anActItem->select(aPoint);
- if (anActItem != mySelectedItem)
- {
- if (mySelectedItem && isSelectedItemInCanvas() &&
- !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
- mySelectedItem = anActItem;
-
- // unhilight hilighted item if selection was performed
- if (myHilightedItem) {
- myHilightedItem->hilight(aPoint, false);
- myHilightedItem = 0;
- }
- }
- isSelectionPerformed = true;
+ anActItem->select(aPoint);
+ if (anActItem != mySelectedItem)
+ {
+ if (mySelectedItem && isSelectedItemInCanvas() &&
+ !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
+ mySelectedItem = anActItem;
+
+ // unhilight hilighted item if selection was performed
+ if (myHilightedItem) {
+ myHilightedItem->hilight(aPoint, false);
+ myHilightedItem = 0;
+ }
+ }
+ isSelectionPerformed = true;
}
}
{
if ( mySelectedItem )
{
- if ( isSelectedItemInCanvas() ) mySelectedItem->select(aPoint, false);
- mySelectedItem = 0;
+ if ( isSelectedItemInCanvas() ) mySelectedItem->select(aPoint, false);
+ mySelectedItem = 0;
}
// Background popup
printf("Background popup\n");
QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
- theEvent->pos(), theEvent->globalPos(),
- theEvent->state() );
+ theEvent->pos(), theEvent->globalPos(),
+ theEvent->state() );
if ( getViewWindow() )
- getViewWindow()->contextPopupEvent(&aEvent); // => emit contextMenuRequested( &aEvent );
+ getViewWindow()->contextPopupEvent(&aEvent); // => emit contextMenuRequested( &aEvent );
}
else
{ // show context popup for the selected item
else
{
for (QCanvasItemList::Iterator it = aList.begin(); it != aList.end(); ++it) {
- QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
- if (anActItem)
- {
- anActItem->select(aPoint);
- if (anActItem != mySelectedItem)
- {
- if (mySelectedItem && isSelectedItemInCanvas() &&
- !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
- mySelectedItem = anActItem;
- }
- break;
- }
+ QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
+ if (anActItem)
+ {
+ anActItem->select(aPoint);
+ if (anActItem != mySelectedItem)
+ {
+ if (mySelectedItem && isSelectedItemInCanvas() &&
+ !mySelectedItem->arePartsOfOtherItem(anActItem)) mySelectedItem->select(aPoint, false);
+ mySelectedItem = anActItem;
+ }
+ break;
+ }
}
}
}
QxGraph_ActiveItem* anActItem = dynamic_cast<QxGraph_ActiveItem*>( *it );
if (anActItem)
{
- QRect aRect;
- QString aText = anActItem->getToolTipText(theMousePos, aRect);
- int avX, avY;
- QWMatrix aWM = ((QCanvasView*)parentWidget())->worldMatrix();
- ((QCanvasView*)parentWidget())->contentsToViewport((int)(aRect.left()*aWM.m11()),
- (int)(aRect.top()*aWM.m22()),
- avX, avY);
- QRect aTipRect(avX, avY, (int)(aRect.width()*aWM.m11()), (int)(aRect.height()*aWM.m22()));
- if (!aText.isEmpty())
- tip(aTipRect, aText);
- return;
+ QRect aRect;
+ QString aText = anActItem->getToolTipText(theMousePos, aRect);
+ int avX, avY;
+ QWMatrix aWM = ((QCanvasView*)parentWidget())->worldMatrix();
+ ((QCanvasView*)parentWidget())->contentsToViewport((int)(aRect.left()*aWM.m11()),
+ (int)(aRect.top()*aWM.m22()),
+ avX, avY);
+ QRect aTipRect(avX, avY, (int)(aRect.width()*aWM.m11()), (int)(aRect.height()*aWM.m22()));
+ if (!aText.isEmpty())
+ tip(aTipRect, aText);
+ return;
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#ifndef QXGRAPH_CANVASVIEW_H
public:
enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, PANGLOBAL,
- WINDOWFIT, FITALLVIEW, RESETVIEW };
+ WINDOWFIT, FITALLVIEW, RESETVIEW };
QxGraph_CanvasView(QxGraph_Canvas* theCanvas, QxGraph_ViewWindow* theViewWindow);
virtual ~QxGraph_CanvasView();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#ifndef QXGRAPH_DEF_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#include "QxGraph_Prs.h"
QxGraph_Prs::~QxGraph_Prs()
{
for ( DMode2ItemList::iterator it1 = myDisplayMap.begin();
- it1 != myDisplayMap.end();
- it1++ )
+ it1 != myDisplayMap.end();
+ it1++ )
{
for ( std::list<QCanvasItem*>::iterator it2 = (*it1).second.begin();
- it2 != (*it1).second.end();
- it2++ )
+ it2 != (*it1).second.end();
+ it2++ )
{
QCanvasItem* anItem = *it2;
if ( anItem ) delete anItem;
update();
for ( std::list<QCanvasItem*>::iterator it = myDisplayMap[myDMode].begin();
- it != myDisplayMap[myDMode].end();
- it++ )
+ it != myDisplayMap[myDMode].end();
+ it++ )
{
QCanvasItem* anItem = *it;
if ( anItem )
void QxGraph_Prs::hide()
{
for ( DMode2ItemList::iterator it1 = myDisplayMap.begin();
- it1 != myDisplayMap.end();
- it1++ )
+ it1 != myDisplayMap.end();
+ it1++ )
{
for ( std::list<QCanvasItem*>::iterator it2 = (*it1).second.begin();
- it2 != (*it1).second.end();
- it2++ )
+ it2 != (*it1).second.end();
+ it2++ )
{
QCanvasItem* anItem = *it2;
if ( anItem )
{
- anItem->setCanvas( 0 );
+ anItem->setCanvas( 0 );
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QXGRAPH_PRS_H
#define QXGRAPH_PRS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QxGraph_ViewManager.h"
/*!
Constructor
*/
QxGraph_ViewManager::QxGraph_ViewManager( SUIT_Study* theStudy,
- SUIT_Desktop* theDesktop,
- SUIT_ViewModel* theViewModel )
+ SUIT_Desktop* theDesktop,
+ SUIT_ViewModel* theViewModel )
: SUIT_ViewManager( theStudy, theDesktop, theViewModel )
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QXGRAPH_VIEWMANAGER_H
#define QXGRAPH_VIEWMANAGER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QxGraph_ViewModel.h"
#include "QxGraph_ViewWindow.h"
#include "QxGraph_Canvas.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QXGRAPH_VIEWMODEL_H
#define QXGRAPH_VIEWMODEL_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#include "QxGraph_ViewWindow.h"
//QT Include
#include <qlayout.h>
#include <qcolor.h>
-//#include <qcolordialog.h>
-
-using namespace std;
/*!
Constructor
// FitAll
aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_FITALL" ) ),
- tr( "MNU_FITALL" ), 0, this);
+ tr( "MNU_FITALL" ), 0, this);
aAction->setStatusTip(tr("DSC_FITALL"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll()));
myActionsMap[ FitAllId ] = aAction;
// FitRect
aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_FITAREA" ) ),
- tr( "MNU_FITRECT" ), 0, this);
+ tr( "MNU_FITRECT" ), 0, this);
aAction->setStatusTip(tr("DSC_FITRECT"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea()));
myActionsMap[ FitRectId ] = aAction;
// Zoom
aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_ZOOM" ) ),
- tr( "MNU_ZOOM_VIEW" ), 0, this);
+ tr( "MNU_ZOOM_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom()));
myActionsMap[ ZoomId ] = aAction;
// Panning
aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_PAN" ) ),
- tr( "MNU_PAN_VIEW" ), 0, this);
+ tr( "MNU_PAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_PAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
myActionsMap[ PanId ] = aAction;
// Global Panning
aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_GLOBALPAN" ) ),
- tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+ tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan()));
myActionsMap[ GlobalPanId ] = aAction;
// Reset
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "QxGraph", tr( "ICON_QXGRAPH_RESET" ) ),
- tr( "MNU_RESET_VIEW" ), 0, this);
+ tr( "MNU_RESET_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
myActionsMap[ ResetId ] = aAction;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxGraph : build Supervisor viewer into desktop
//
#ifndef QXGRAPH_VIEWWINDOW_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: QxGraph_images.po
-# Created: 03/02/2007
-# Author: Margarita Karpunina
-
-
-msgid "ICON_QXGRAPH_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_QXGRAPH_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_QXGRAPH_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_QXGRAPH_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_QXGRAPH_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_QXGRAPH_RESET"
-msgstr "view_reset.png"
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: QxGraph_msg_en.po
-# Created: 03/02/2007
-# Author: Margarita Karpunina
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "MEN_CHANGE_BACKGROUND"
-msgstr "Change background..."
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __DEBTRACE_HXX__
#define __DEBTRACE_HXX__
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libQxScene.la
nodist_salomeres_DATA= \
QxSceneViewer_images.qm \
- QxSceneViewer_msg_en.qm
+ QxSceneViewer_msg_en.qm \
+ QxSceneViewer_msg_fr.qm
libQxScene_la_CPPFLAGS=$(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxScene : build Supervisor viewer into desktop
//
#ifdef WNT
-#ifdef QXSCENE_EXPORTS
+#if defined QXSCENE_EXPORTS || defined QxScene_EXPORTS
#define QXSCENE_EXPORT __declspec(dllexport)
#else
#define QXSCENE_EXPORT __declspec(dllimport)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxScene : build Supervisor viewer into desktop
//
#ifndef QXSCENE_DEF_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QxScene_ViewManager.h"
#include "QxScene_ViewWindow.h"
Constructor
*/
QxScene_ViewManager::QxScene_ViewManager( SUIT_Study* theStudy,
- SUIT_Desktop* theDesktop,
- SUIT_ViewModel* theViewModel )
+ SUIT_Desktop* theDesktop,
+ SUIT_ViewModel* theViewModel )
: SUIT_ViewManager( theStudy, theDesktop, theViewModel )
{
DEBTRACE("QxScene_ViewManager::QxScene_ViewManager");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QXSCENE_VIEWMANAGER_H
#define QXSCENE_VIEWMANAGER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "QxScene_ViewModel.h"
#include "QxScene_ViewWindow.h"
#include "QxScene_ViewManager.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef QXSCENE_VIEWMODEL_H
#define QXSCENE_VIEWMODEL_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxScene : build Supervisor viewer into desktop
//
#include "QxScene_ViewWindow.h"
//#define _DEVDEBUG_
#include "DebTrace.hxx"
-using namespace std;
-
/*!
Constructor
*/
aAction = new QtxAction( tr( "MNU_FITALL" ),
aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITALL" ) ),
tr( "MNU_FITALL" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_FITALL" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitAll() ) );
mgr->registerAction( aAction, FitAllId );
aAction = new QtxAction( tr( "MNU_FITRECT" ),
aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_FITAREA" ) ),
tr( "MNU_FITRECT" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_FITRECT" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewFitArea() ) );
mgr->registerAction( aAction, FitRectId );
// 2.3. Zoom
aAction = new QtxAction( tr( "MNU_ZOOM_VIEW" ),
- aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_ZOOM" ) ),
tr( "MNU_ZOOM_VIEW" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_ZOOM_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewZoom() ) );
mgr->registerAction( aAction, ZoomId );
// 3.1. Panning
aAction = new QtxAction( tr( "MNU_PAN_VIEW" ),
- aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
- tr( "MNU_PAN_VIEW" ),
- 0, this);
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_PAN" ) ),
+ tr( "MNU_PAN_VIEW" ),
+ 0, this);
aAction->setStatusTip( tr( "DSC_PAN_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewPan() ) );
mgr->registerAction( aAction, PanId );
// 3.2. Global Panning
aAction = new QtxAction( tr( "MNU_GLOBALPAN_VIEW" ),
- aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_GLOBALPAN" ) ),
tr( "MNU_GLOBALPAN_VIEW" ),
- 0, this);
+ 0, this);
aAction->setStatusTip( tr( "DSC_GLOBALPAN_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewGlobalPan() ) );
mgr->registerAction( aAction, GlobalPanId );
// reset
aAction = new QtxAction( tr( "MNU_RESET_VIEW" ),
- aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
- tr( "MNU_RESET_VIEW" ),
- 0, this);
+ aResMgr->loadPixmap( "QxSceneViewer", tr( "ICON_QXSCENE_RESET" ) ),
+ tr( "MNU_RESET_VIEW" ),
+ 0, this);
aAction->setStatusTip( tr( "DSC_RESET_VIEW" ) );
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewReset() ) );
mgr->registerAction( aAction, ResetId );
{
DEBTRACE("QxScene_ViewWindow::createToolBar");
QtxActionToolMgr* mgr = toolMgr();
- myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
+ myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
mgr->append( ScaleOpId, myToolBar );
mgr->append( MoveOpId, myToolBar );
mgr->append( ResetId, myToolBar );
bool QxScene_ViewWindow::closeRequested()
{
DEBTRACE("QxScene_ViewWindow::closeRequested");
- bool isClosed = false;
+ bool isClosed = true;
emit tryClose(isClosed, this);
DEBTRACE("isClosed=" << isClosed);
return isClosed;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME QxScene : build Supervisor viewer into desktop
//
#ifndef QXSCENE_VIEWWINDOW_H
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: QxScene_images.po
-# Created: 03/02/2007
-# Author: Margarita Karpunina
-
-
-msgid "ICON_QXSCENE_FITALL"
-msgstr "qx_view_fitall.png"
-
-msgid "ICON_QXSCENE_FITAREA"
-msgstr "qx_view_fitarea.png"
-
-msgid "ICON_QXSCENE_ZOOM"
-msgstr "qx_view_zoom.png"
-
-msgid "ICON_QXSCENE_PAN"
-msgstr "qx_view_pan.png"
-
-msgid "ICON_QXSCENE_GLOBALPAN"
-msgstr "qx_view_glpan.png"
-
-msgid "ICON_QXSCENE_RESET"
-msgstr "qx_view_reset.png"
-
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: QxScene_msg_en.po
-# Created: 03/02/2007
-# Author: Margarita Karpunina
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "MEN_CHANGE_BACKGROUND"
-msgstr "Change background..."
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
bin_PROGRAMS = ResourceExporter
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE =
-TARGET = ResourceExporter
-DESTDIR = ../../bin
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES +=
-
-SOURCES = ResourceExporter.cxx
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : ResourceExporter.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
The number of parameters is limeted only by maximum possible length of the command line.
*/
+#include "GUI_version.h"
#include "SUIT_ResourceMgr.h"
#include <QFile>
#include <QDir>
*/
static QString salomeVersion()
{
- QString path( ::getenv( "GUI_ROOT_DIR" ) );
- if ( !path.isEmpty() )
- path += QDir::separator();
- path += QString( "bin/salome/VERSION" );
-
- QFile vf( path );
- if ( !vf.open( QIODevice::ReadOnly ) )
- return QString();
-
- QString line( vf.readLine( 1024 ) );
- vf.close();
-
- if ( line.isEmpty() )
- return QString();
-
- while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
- line.remove( line.length() - 1, 1 );
-
- QString ver;
- int idx = line.lastIndexOf( ":" );
- if ( idx != -1 )
- ver = line.mid( idx + 1 ).trimmed();
-
- return ver;
+ return GUI_VERSION_STR;
}
/*!
for ( int i = 1; i < argc; i ++ ) {
QString anArg = QString( argv[i] ).trimmed();
if ( anArg.startsWith( "-" ) ) {
- anArg.remove( 0, 1 );
- if ( anArg.contains( ":" ) ) {
- QStringList vals = anArg.split( ":", QString::SkipEmptyParts );
- QString section = vals[ 0 ].trimmed();
- QString param = vals[ 1 ].trimmed();
- if ( section.isEmpty() || param.isEmpty() ) continue;
- resMgr->remove( section, param );
- }
+ anArg.remove( 0, 1 );
+ if ( anArg.contains( ":" ) ) {
+ QStringList vals = anArg.split( ":", QString::SkipEmptyParts );
+ QString section = vals[ 0 ].trimmed();
+ QString param = vals[ 1 ].trimmed();
+ if ( section.isEmpty() || param.isEmpty() ) continue;
+ resMgr->remove( section, param );
+ }
}
else if ( anArg.contains( "+=" ) ) {
- QStringList vals = anArg.split( "+=", QString::SkipEmptyParts );
- if ( vals[ 0 ].contains( ":" ) ) {
- QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
- QString section = vals1[ 0 ].trimmed();
- QString param = vals1[ 1 ].trimmed();
- QString newValue = vals [ 1 ].trimmed();
- QString separ = ","; // default separator
- if ( newValue.contains( "|" ) ) {
- QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts );
- newValue = vals2[ 0 ].trimmed();
- separ = vals2[ 1 ].trimmed();
- }
- if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue;
- QString value = resMgr->stringValue( section, param );
- QStringList valsOld = value.split( separ, QString::SkipEmptyParts );
- QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts );
- for ( int i = 0; i < (int)valsNew.count(); i++ )
- if ( !valsOld.contains( valsNew[i] ) )
- valsOld.append( valsNew[i] );
- resMgr->setValue( section, param, valsOld.join( separ ) );
- }
+ QStringList vals = anArg.split( "+=", QString::SkipEmptyParts );
+ if ( vals[ 0 ].contains( ":" ) ) {
+ QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
+ QString section = vals1[ 0 ].trimmed();
+ QString param = vals1[ 1 ].trimmed();
+ QString newValue = vals [ 1 ].trimmed();
+ QString separ = ","; // default separator
+ if ( newValue.contains( "|" ) ) {
+ QStringList vals2 = newValue.split( "|", QString::SkipEmptyParts );
+ newValue = vals2[ 0 ].trimmed();
+ separ = vals2[ 1 ].trimmed();
+ }
+ if ( section.isEmpty() || param.isEmpty() || newValue.isEmpty() || separ.isEmpty() ) continue;
+ QString value = resMgr->stringValue( section, param );
+ QStringList valsOld = value.split( separ, QString::SkipEmptyParts );
+ QStringList valsNew = newValue.split( separ, QString::SkipEmptyParts );
+ for ( int i = 0; i < (int)valsNew.count(); i++ )
+ if ( !valsOld.contains( valsNew[i] ) )
+ valsOld.append( valsNew[i] );
+ resMgr->setValue( section, param, valsOld.join( separ ) );
+ }
}
else if ( anArg.contains( "=" ) ) {
- QStringList vals = anArg.split( "=", QString::SkipEmptyParts );
- if ( vals[ 0 ].contains( ":" ) ) {
- QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
- QString section = vals1[ 0 ].trimmed();
- QString param = vals1[ 1 ].trimmed();
- QString value = vals [ 1 ].trimmed();
- if ( section.isEmpty() || param.isEmpty() ) continue;
- resMgr->setValue( section, param, value );
- }
+ QStringList vals = anArg.split( "=", QString::SkipEmptyParts );
+ if ( vals[ 0 ].contains( ":" ) ) {
+ QStringList vals1 = vals[ 0 ].split( ":", QString::SkipEmptyParts );
+ QString section = vals1[ 0 ].trimmed();
+ QString param = vals1[ 1 ].trimmed();
+ QString value = vals [ 1 ].trimmed();
+ if ( section.isEmpty() || param.isEmpty() ) continue;
+ resMgr->setValue( section, param, value );
+ }
}
}
resMgr->save();
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME SALOME_PY : binding of VTK graphics and Python
# File : Makefile.in
# Author : Paul RASCLE, EDF
libSalomePy_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \
$(OGL_INCLUDES) $(CAS_CXXFLAGS) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ \
- -DHAVE_CONFIG_H -I$(srcdir)/../SalomeApp -I$(srcdir)/../LightApp \
+ -DHAVE_CONFIG_H -I$(srcdir)/../LightApp \
-I$(srcdir)/../Event -I$(srcdir)/../Session -I$(srcdir)/../SVTK \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../CAM \
-I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../OBJECT \
- @CAS_CPPFLAGS@ \
- -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+ @CAS_CPPFLAGS@
+
libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
- ../SalomeApp/libSalomeApp.la \
- -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD
+ ../LightApp/libLightApp.la \
+ -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD -lvtkPythonCore
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOME_PY : binding of VTK graphics and Python
// File : SalomePy.cxx
// Author : Paul RASCLE, EDF
//
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
#include <Python.h>
#include <vtkPythonUtil.h>
#include <SALOME_Event.h>
#include <SUIT_Session.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_Study.h>
#include <SVTK_ViewManager.h>
#include <SVTK_ViewWindow.h>
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+
/*!
\brief Python wrappings for VTK viewer of the SALOME desktop.
static PyObject* aVTKModule = 0;
PyObject* aPyClass = 0;
if( !aVTKModule ) {
- if ( VTK_MAJOR_VERSION > 3 )
- aVTKModule = PyImport_ImportModule( "libvtkRenderingPython" );
- else
- aVTKModule = PyImport_ImportModule( "libVTKGraphicsPython" );
+#if VTK_XVERSION < 30000
+ aVTKModule = PyImport_ImportModule( "libVTKGraphicsPython" );
+#elif VTK_XVERSION < 50700
+ aVTKModule = PyImport_ImportModule( "vtk.libvtkRenderingPython" );
+#else
+ aVTKModule = PyImport_ImportModule( "vtkRenderingPython" );
+#endif
if( PyErr_Occurred() ) {
PyErr_Print();
}
SVTK_ViewWindow* aVW = 0;
if ( SUIT_Session::session() ) {
// get application
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
if ( anApp ) {
// get active study
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( anApp->activeStudy() );
if ( aStudy ) {
- // find or create VTK view manager
- if ( toCreate == __Create ) {
- SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->createViewManager( "VTKViewer" ) );
- if ( aVM ) {
- aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
- if ( !aVW )
- aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->createViewWindow() );
- // VSR : When new view window is created it can be not active yet at this moment,
- // so the following is a some workaround
- if ( !aVW && !aVM->getViews().isEmpty() )
- aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
- }
- }
- else {
- SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->getViewManager( "VTKViewer", toCreate == __FindOrCreate ) );
- if ( aVM ) {
- aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
- // VSR : When new view window is created it can be not active yet at this moment,
- // so the following is a some workaround
- if ( !aVW && !aVM->getViews().isEmpty() )
- aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
- }
- }
+ // find or create VTK view manager
+ if ( toCreate == __Create ) {
+ SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->createViewManager( "VTKViewer" ) );
+ if ( aVM ) {
+ aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
+ if ( !aVW )
+ aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->createViewWindow() );
+ // VSR : When new view window is created it can be not active yet at this moment,
+ // so the following is a some workaround
+ if ( !aVW && !aVM->getViews().isEmpty() )
+ aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
+ }
+ }
+ else {
+ SVTK_ViewManager* aVM = dynamic_cast<SVTK_ViewManager*>( anApp->getViewManager( "VTKViewer", toCreate == __FindOrCreate ) );
+ if ( aVM ) {
+ aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getActiveView() );
+ // VSR : When new view window is created it can be not active yet at this moment,
+ // so the following is a some workaround
+ if ( !aVW && !aVM->getViews().isEmpty() )
+ aVW = dynamic_cast<SVTK_ViewWindow*>( aVM->getViews()[0] );
+ }
+ }
}
}
}
::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
if( aVTKViewWindow && aPyClass ) {
vtkRenderer* aVTKObject = aVTKViewWindow->getRenderer();
+#if VTK_XVERSION < 50700
myResult = PyVTKObject_New( aPyClass, aVTKObject );
+#else
+ myResult = PyVTKObject_New( aPyClass, NULL, aVTKObject );
+#endif
}
}
};
::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
if( aVTKViewWindow && aPyClass ) {
vtkRenderWindow* aVTKObject = aVTKViewWindow->getRenderWindow();
+#if VTK_XVERSION < 50700
myResult = PyVTKObject_New( aPyClass, aVTKObject );
+#else
+ myResult = PyVTKObject_New( aPyClass, NULL, aVTKObject );
+#endif
}
}
};
::GetVTKViewWindow( myCreate ? __Create : __FindOrCreate );
if( aVTKViewWindow && aPyClass ) {
vtkRenderWindowInteractor* aVTKObject = aVTKViewWindow->getInteractor();
+#if VTK_XVERSION < 50700
myResult = PyVTKObject_New( aPyClass, aVTKObject );
+#else
+ myResult = PyVTKObject_New( aPyClass, NULL, aVTKObject );
+#endif
}
}
};
virtual void Execute()
{
if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
- if ( aVTKViewWindow->isTrihedronDisplayed() != myShow )
- aVTKViewWindow->onViewTrihedron();
+ if ( aVTKViewWindow->isTrihedronDisplayed() != myShow )
+ aVTKViewWindow->onViewTrihedron();
}
}
};
virtual void Execute()
{
if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
- aVTKViewWindow->onFitAll();
+ aVTKViewWindow->onFitAll();
}
}
};
virtual void Execute()
{
if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
- switch( myType ) {
- case ViewFront:
- aVTKViewWindow->onFrontView(); break;
- case ViewBack:
- aVTKViewWindow->onBackView(); break;
- case ViewTop:
- aVTKViewWindow->onTopView(); break;
- case ViewBottom:
- aVTKViewWindow->onBottomView(); break;
- case ViewRight:
- aVTKViewWindow->onRightView(); break;
- case ViewLeft:
- aVTKViewWindow->onLeftView(); break;
- default:
- PyErr_Format(PyExc_ValueError,"setView%: wrong parameter value; must be between %d and %d", ViewFront, ViewLeft );
- break;
- }
+ switch( myType ) {
+ case ViewFront:
+ aVTKViewWindow->onFrontView(); break;
+ case ViewBack:
+ aVTKViewWindow->onBackView(); break;
+ case ViewTop:
+ aVTKViewWindow->onTopView(); break;
+ case ViewBottom:
+ aVTKViewWindow->onBottomView(); break;
+ case ViewRight:
+ aVTKViewWindow->onRightView(); break;
+ case ViewLeft:
+ aVTKViewWindow->onLeftView(); break;
+ default:
+ PyErr_Format(PyExc_ValueError,"setView%: wrong parameter value; must be between %d and %d", ViewFront, ViewLeft );
+ break;
+ }
}
}
};
virtual void Execute()
{
if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
- aVTKViewWindow->onResetView();
+ aVTKViewWindow->onResetView();
}
}
};
*/
extern "C" void initlibSalomePy()
{
- static char* modulename = "libSalomePy";
+ static char* modulename = (char*)"libSalomePy";
// init module
PyObject* aModule = Py_InitModule( modulename, Module_Methods );
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
# Module : SALOME
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-SUBDIRS = SALOME_PYQT_GUI SalomePyQt
+SUBDIRS = SALOME_PYQT_GUILight SalomePyQt
+
+if GUI_ENABLE_CORBA
+ SUBDIRS += SALOME_PYQT_GUI
+endif
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Nicolas REJNERI
# Module : SALOME
# library target
lib_LTLIBRARIES = libSalomePyQtGUI.la
-# extra source files (generated by sip)
-SIP_SRC = sipAPISalomePyQtGUI.h \
- sipSalomePyQtGUIcmodule.cc
-
-# Sip definition file
-SIP_FILES = SALOME_PYQT_GUI.sip
-
-# extra dist files
-EXTRA_DIST += $(SIP_FILES)
-
-# extra clean files
-CLEANFILES = $(SIP_SRC)
-
# moc files (generated my moc)
MOC_FILES = SALOME_PYQT_Module_moc.cxx
# exported header files
-salomeinclude_HEADERS = \
- SALOME_PYQT_GUI.h \
- SALOME_PYQT_PyInterp.h \
- SALOME_PYQT_Module.h
+salomeinclude_HEADERS = \
+ SALOME_PYQT_GUI.h \
+ SALOME_PYQT_Module.h
# library sources
dist_libSalomePyQtGUI_la_SOURCES = \
- SALOME_PYQT_PyInterp.cxx \
- SALOME_PYQT_Module.cxx
-nodist_libSalomePyQtGUI_la_SOURCES = $(MOC_FILES) $(SIP_SRC)
+ SALOME_PYQT_Module.cxx
+
+nodist_libSalomePyQtGUI_la_SOURCES = $(MOC_FILES)
# compilation flags
libSalomePyQtGUI_la_CPPFLAGS = $(QT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES) \
$(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS) \
-DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -DCALL_OLD_METHODS \
- -I@builddir@ -I$(srcdir)/../../PyInterp -I$(srcdir)/../../SalomeApp \
+ -I. -I$(srcdir)/../../PyInterp -I$(srcdir)/../../SalomeApp \
-I$(srcdir)/../../SUIT -I$(srcdir)/../../Qtx -I$(srcdir)/../../LightApp \
+ -I$(srcdir)/../SALOME_PYQT_GUILight \
-I$(srcdir)/../../Plot2d -I$(srcdir)/../../OCCViewer \
-I$(srcdir)/../../SalomeApp -I$(srcdir)/../../CAM -I$(srcdir)/../../STD \
- -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
# linkage flags
libSalomePyQtGUI_la_LIBADD = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) \
$(OGL_LIBS) ../../PyInterp/libPyInterp.la ../../SalomeApp/libSalomeApp.la \
- ../../OCCViewer/libOCCViewer.la ../../Plot2d/libPlot2d.la
-
-# Custom build step: generate C++ wrapping according to $(SIP_FILES)
-$(SIP_SRC): $(SIP_FILES)
- $(SIP) $(PYQT_SIPFLAGS) $<
-
-# extra dependency (SALOME_PYQT_Module.cxx depends on header files generated by sip)
-$(dist_libSalomePyQtGUI_la_SOURCES): $(SIP_SRC)
-
+ ../../OCCViewer/libOCCViewer.la ../../Plot2d/libPlot2d.la \
+ ../SALOME_PYQT_GUILight/libSalomePyQtGUILight.la
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_PYQT_GUI.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
// ========================================================
// set dllexport type for Win platform
#ifdef WIN32
-# ifdef SALOME_PYQT_EXPORTS
+# if defined SALOME_PYQT_EXPORTS || defined SalomePyQtGUI_EXPORTS
# define SALOME_PYQT_EXPORT __declspec(dllexport)
# else
# define SALOME_PYQT_EXPORT __declspec(dllimport)
+++ /dev/null
-// Copyright (C) 2007-2008 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
-//
-// File : SALOME_PYQT_GUI.sip
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-%Module SalomePyQtGUI
-
-%Import QtGuimod.sip
-%Import QtXmlmod.sip
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SALOME_PYQT_Module.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-#include "SALOME_PYQT_Module.h"
#include <PyInterp_Dispatcher.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_ViewModel.h>
-#include <SUIT_ViewWindow.h>
-#include <SUIT_ViewManager.h>
-#include <STD_MDIDesktop.h>
-#include <STD_TabDesktop.h>
-#include <LightApp_Preferences.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-
-#include <QtxWorkstack.h>
-#include <QtxWorkspace.h>
-#include <QtxActionGroup.h>
-#include <QtxActionMenuMgr.h>
-#include <QtxActionToolMgr.h>
+#include "SALOME_PYQT_Module.h"
+#include "SalomeApp_Application.h"
+#include "SALOME_PYQT_ModuleLight.h"
#include <SALOME_LifeCycleCORBA.hxx>
#include <Container_init_python.hxx>
+#include <CORBA.h>
-#include <QFile>
-#include <QDomDocument>
-#include <QDomNode>
-#include <QDomElement>
-#include <QMenuBar>
-#include <QMenu>
-#include <QAction>
-
-#include "sipAPISalomePyQtGUI.h"
-
-#include <sip.h>
-#if SIP_VERSION < 0x040700
-#include "sipQtGuiQWidget.h"
-#include "sipQtGuiQMenu.h"
-#endif
-
-/*!
- \brief Default name of the module, replaced at the moment
- of module creation.
- \internal
-*/
-const char* DEFAULT_NAME = "SALOME_PYQT_Module";
-
-/*!
- \brief Default menu group number.
- \internal
-*/
-const int DEFAULT_GROUP = 40;
-
-/*!
- \var IsCallOldMethods
- \brief Allow calling obsolete callback methods.
- \internal
-
- If the macro CALL_OLD_METHODS is not defined, the invoking
- of obsolete Python module's methods like setSetting(), definePopup(),
- etc. is blocked.
-
- CALL_OLD_METHODS macro can be defined for example by adding
- -DCALL_OLD_METHODS compilation option to the Makefile.
-*/
-#ifdef CALL_OLD_METHODS
-const bool IsCallOldMethods = true;
-#else
-const bool IsCallOldMethods = false;
-#endif
-
-/* Py_ssize_t for old Pythons */
-/* This code is as recommended by: */
-/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-# define PY_SSIZE_T_MAX INT_MAX
-# define PY_SSIZE_T_MIN INT_MIN
-#endif
-
-//
-// NB: Python requests.
-// General rule for Python requests created by SALOME_PYQT_Module:
-// all requests should be executed SYNCHRONOUSLY within the main GUI thread.
-// However, it is obligatory that ANY Python call is wrapped with a request object,
-// so that ALL Python API calls are serialized with PyInterp_Dispatcher.
-//
-
-/*!
- \class SALOME_PYQT_Module::XmlHandler
- \brief XML resource files parser.
- \internal
-
- This class is used to provide backward compatibility with
- existing Python modules in which obsolete menu definition system
- (via XML files) is used.
-*/
-
-class SALOME_PYQT_Module::XmlHandler
-{
-public:
- XmlHandler( SALOME_PYQT_Module* module, const QString& fileName );
- void createActions();
- void createPopup ( QMenu* menu,
- const QString& context,
- const QString& parent,
- const QString& object );
- void activateMenus( bool );
-
-protected:
- void createToolBar ( QDomNode& parentNode );
- void createMenu ( QDomNode& parentNode,
- const int parentMenuId = -1,
- QMenu* parentPopup = 0 );
-
- void insertPopupItems( QDomNode& parentNode,
- QMenu* menu );
-
-private:
- SALOME_PYQT_Module* myModule;
- QDomDocument myDoc;
- QList<int> myMenuItems;
-};
//
// NB: Library initialization
-// Since the SalomePyQtGUI library is not imported in Python it's initialization function
+// Since the SalomePyQtGUILight library is not imported in Python it's initialization function
// should be called manually (and only once) in order to initialize global sip data
// and to get C API from sip : sipBuildResult for example
//
-#define INIT_FUNCTION initSalomePyQtGUI
+
+#define INIT_FUNCTION initSalomePyQtGUILight
#if defined(SIP_STATIC_MODULE)
extern "C" void INIT_FUNCTION();
#else
extern "C" {
SALOME_PYQT_EXPORT CAM_Module* createModule() {
+
static bool alreadyInitialized = false;
if ( !alreadyInitialized ) {
// call only once (see comment above) !
- PyEval_RestoreThread( KERNEL_PYTHON::_gtstate );
+
+ PyEval_RestoreThread( KERNEL_PYTHON::_gtstate);
INIT_FUNCTION();
- PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate );
+ PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate);
alreadyInitialized = !alreadyInitialized;
}
return new SALOME_PYQT_Module();
}
}
-/*!
- \class FuncMsg
- \brief Function call in/out tracer.
- \internal
-*/
-
-class FuncMsg
-{
-public:
- FuncMsg( const QString& funcName )
- {
- myName = funcName;
- MESSAGE( myName.toLatin1().constData() << " [ begin ]" );
- }
- ~FuncMsg()
- {
- MESSAGE( myName.toLatin1().constData() << " [ end ]" );
- }
- void message( const QString& msg )
- {
- MESSAGE( myName.toLatin1().constData() << " : " << msg.toLatin1().constData() );
- }
-private:
- QString myName;
-};
-
-/*!
- \class SALOME_PYQT_Module
- \brief This class implements module API for all the Python-based
- SALOME modules.
-*/
-
-//
-// Static variables definition
-//
-SALOME_PYQT_Module::InterpMap SALOME_PYQT_Module::myInterpMap;
-SALOME_PYQT_Module* SALOME_PYQT_Module::myInitModule = 0;
/*!
- \brief Get the module being initialized.
-
- This is a little trick :) needed to provide an access from Python
- (SalomePyQt) to the module being currently activated. The problem
- that during the process of module initialization (initialize()
- function) it is not yet available via application->activeModule()
- call.
-
- This method returns valid pointer only if called in scope of
- initialize() function.
-
- \return the module being currently initialized
+ \var __DEFAULT_NAME__ - Default name of the module, replaced at the moment of module creation
*/
-SALOME_PYQT_Module* SALOME_PYQT_Module::getInitModule()
-{
- return myInitModule;
-}
+const char* __DEFAULT_NAME__ = "SALOME_PYQT_Module";
/*!
- \brief Constructor
-*/
+ * Constructor
+ */
SALOME_PYQT_Module::SALOME_PYQT_Module()
-: SalomeApp_Module( DEFAULT_NAME ),
- myInterp( 0 ),
- myModule( 0 ),
- myXmlHandler ( 0 ),
- myLastActivateStatus( true )
+ : SalomeApp_Module(__DEFAULT_NAME__),
+ LightApp_Module(__DEFAULT_NAME__),
+ SALOME_PYQT_ModuleLight()
{
}
/*!
- \brief Destructor
-*/
+ * Destructor
+ */
SALOME_PYQT_Module::~SALOME_PYQT_Module()
{
- if ( myXmlHandler )
- delete myXmlHandler;
}
/*!
- \brief Initialization of the module.
-
- This method can be used for creation of the menus, toolbars and
- other such staff.
-
- There are two ways to do this:
- - for obsolete modules this method first tries to read
- <module>_<language>.xml resource file which contains a menu,
- toolbars and popup menus description;
- - new modules can create menus by direct calling of the
- corresponding methods of SalomePyQt Python API in the Python
- module's initialize() method which is called from here.
-
- NOTE: SALOME supports two modes of modules loading:
- - immediate (all the modules are created and initialized
- immediately when the application object is created;
- - postponed modules loading (used currently); in this mode
- the module is loaded only be request.
- If postponed modules loading is not used, the active
- study might be not yet defined at this stage, so initialize()
- method should not perform any study-based initialization.
-
- \param app parent application object
-*/
-void SALOME_PYQT_Module::initialize( CAM_Application* app )
+ * Get module engine, returns nil var if engine is not found in LifeCycleCORBA
+ */
+Engines::EngineComponent_var SALOME_PYQT_Module::getEngine() const
{
- FuncMsg fmsg( "SALOME_PYQT_Module::initialize()" );
-
- // call base implementation
- SalomeApp_Module::initialize( app );
-
- // try to get XML resource file name
- SUIT_ResourceMgr* aResMgr = getApp()->resourceMgr();
- if ( !myXmlHandler && aResMgr ) {
- // get current language
- QString aLang = aResMgr->stringValue( "language", "language", QString() );
- if ( aLang.isEmpty() )
- aLang = "en";
- // define resource file name
- QString aFileName = name() + "_" + aLang + ".xml";
- aFileName = aResMgr->path( "resources", name(), aFileName );
- // create XML handler instance
- if ( !aFileName.isEmpty() && QFile::exists( aFileName ) )
- myXmlHandler = new SALOME_PYQT_Module::XmlHandler( this, aFileName );
- // create menus & toolbars from XML file if required
- if ( myXmlHandler )
- myXmlHandler->createActions();
+ Engines::EngineComponent_var comp;
+ // temporary solution
+ try {
+ comp = getApp()->lcc()->FindOrLoad_Component( "FactoryServerPy", name().toLatin1() );
}
+ catch (CORBA::Exception&) {
+ }
+ return comp;
+}
- // perform internal initialization and call module's initialize() funtion
- // InitializeReq: request class for internal init() operation
- class InitializeReq : public PyInterp_Request
+/*!
+ * Get module engine IOR, returns empty string if engine is not found in LifeCycleCORBA
+ */
+QString SALOME_PYQT_Module::engineIOR() const
+{
+ class EngineIORReq : public PyInterp_LockRequest
{
public:
- InitializeReq( CAM_Application* _app,
- SALOME_PYQT_Module* _obj )
- : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
- myApp( _app ),
+ EngineIORReq( PyInterp_Interp* _py_interp,
+ SALOME_PYQT_Module* _obj )
+ : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
myObj( _obj ) {}
protected:
virtual void execute()
{
- myObj->init( myApp );
+ myObj->getEngineIOR();
}
private:
- CAM_Application* myApp;
SALOME_PYQT_Module* myObj;
};
// post request
- PyInterp_Dispatcher::Get()->Exec( new InitializeReq( app, this ) );
-}
+ PyInterp_Dispatcher::Get()->Exec( new EngineIORReq( myInterp, const_cast<SALOME_PYQT_Module*>( this ) ) );
-/*!
- \brief Activation of the module.
+ return myIOR;
+}
- This function is usually used in order to show the module's
- specific menus and toolbars, update actions state and perform
- other such actions required when the module is activated.
-
- Note, that returning \c false in this function prevents the
- module activation.
- \param theStudy parent study
- \return \c true if activation is successful and \c false otherwise
-*/
+/*!
+ * Redefined to invokec correct version
+ */
bool SALOME_PYQT_Module::activateModule( SUIT_Study* theStudy )
{
- FuncMsg fmsg( "SALOME_PYQT_Module::activateModule()" );
-
// call base implementation
bool res = SalomeApp_Module::activateModule( theStudy );
if ( !res )
return res;
- // reset the activation status to the default value
- myLastActivateStatus = true;
-
- // perform internal activation
- // ActivateReq: request class for internal activate() operation
- class ActivateReq : public PyInterp_Request
- {
- public:
- ActivateReq( SUIT_Study* _study,
- SALOME_PYQT_Module* _obj )
- : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
- myStudy ( _study ),
- myObj ( _obj ) {}
-
- protected:
- virtual void execute()
- {
- myObj->activate( myStudy );
- }
-
- private:
- SUIT_Study* myStudy;
- SALOME_PYQT_Module* myObj;
- };
-
- // post request
- PyInterp_Dispatcher::Get()->Exec( new ActivateReq( theStudy, this ) );
-
- // check activation status (set by activate())
- if ( !lastActivationStatus() )
- return false;
-
- // activate menus, toolbars, etc
- if ( myXmlHandler ) myXmlHandler->activateMenus( true );
- setMenuShown( true );
- setToolShown( true );
+ // internal activation
+ return activateModuleInternal( theStudy );
+}
- // connect preferences changing signal
- connect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ),
- this, SLOT( preferenceChanged( const QString&, const QString&, const QString& ) ) );
+/*!
+ * Tries to get engine IOR from the Python module using engineIOR() function.
+ * That function can load module engine using appropriate container if required.
+ * If this function is not available in Python module, the default implementation
+ * is used which loads engine to the default FactoryServerPy container.
+ */
+void SALOME_PYQT_Module::getEngineIOR()
+{
+ myIOR = "";
- // perform custom activation actions
- // CustomizeReq: request class for internal customize() operation
- class CustomizeReq : public PyInterp_Request
- {
- public:
- CustomizeReq( SUIT_Study* _study,
- SALOME_PYQT_Module* _obj )
- : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
- myStudy ( _study ),
- myObj ( _obj ) {}
+ // Python interpreter should be initialized and Python module should be
+ // import first
+ if ( !myInterp || !myModule )
+ return;
- protected:
- virtual void execute()
- {
- myObj->customize( myStudy );
+ if ( PyObject_HasAttrString( myModule , "engineIOR" ) ) {
+ PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"engineIOR", (char*)"" ) );
+ if ( !res ) {
+ PyErr_Print();
}
+ else {
+ // parse the return value, result chould be string
+ if ( PyString_Check( res ) ) {
+ myIOR = PyString_AsString( res );
+ }
+ }
+ }
+ else if ( !CORBA::is_nil( getEngine() ) )
+ myIOR = QString( getApp()->orb()->object_to_string( getEngine() ) );
+}
- private:
- SUIT_Study* myStudy;
- SALOME_PYQT_Module* myObj;
- };
-
- // post request
- PyInterp_Dispatcher::Get()->Exec( new CustomizeReq( theStudy, this ) );
-
- return true;
+CAM_DataModel* SALOME_PYQT_Module::createDataModel()
+{
+ MESSAGE( "SALOME_PYQT_Module::createDataModel()" );
+ CAM_DataModel * dm = SalomeApp_Module::createDataModel();
+ return dm;
}
/*!
- \brief Deactivation of the module.
-
- This function is usually used in order to hide the module's
- specific menus and toolbars and perform other such actions
- required when the module is deactivated.
+ \brief Process GUI action (from main menu, toolbar or
+ context popup menu action).
+*/
+void SALOME_PYQT_Module::onGUIEvent(){
+ SALOME_PYQT_ModuleLight::onGUIEvent();
+}
- \param theStudy parent study
- \return \c true if deactivation is successful and \c false otherwise
+/*!
+ \brief Signal handler closing(SUIT_ViewWindow*) of a view
+ \param pview view being closed
*/
-bool SALOME_PYQT_Module::deactivateModule( SUIT_Study* theStudy )
+void SALOME_PYQT_Module::onViewClosed( SUIT_ViewWindow* pview )
{
- FuncMsg fmsg( "SALOME_PYQT_Module::deactivateModule()" );
-
- // disconnect preferences changing signal
- disconnect( getApp(), SIGNAL( preferenceChanged( const QString&, const QString&, const QString& ) ),
- this, SLOT( preferenceChanged( const QString&, const QString&, const QString& ) ) );
-
- // perform internal deactivation
- // DeactivateReq: request class for internal deactivate() operation
- class DeactivateReq : public PyInterp_LockRequest
- {
- public:
- DeactivateReq( PyInterp_Interp* _py_interp,
- SUIT_Study* _study,
- SALOME_PYQT_Module* _obj )
- : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
- myStudy ( _study ),
- myObj ( _obj ) {}
-
- protected:
- virtual void execute()
- {
- myObj->deactivate( myStudy );
- }
-
- private:
- SUIT_Study* myStudy;
- SALOME_PYQT_Module* myObj;
- };
-
- // post request
- PyInterp_Dispatcher::Get()->Exec( new DeactivateReq( myInterp, theStudy, this ) );
-
- // deactivate menus, toolbars, etc
- if ( myXmlHandler ) myXmlHandler->activateMenus( false );
- setMenuShown( false );
- setToolShown( false );
-
- // call base implementation
- return SalomeApp_Module::deactivateModule( theStudy );
+ SALOME_PYQT_ModuleLight::onViewClosed( pview );
}
/*!
- \brief Get last activation status.
- \return status of last module activation operation
- \sa activateModule()
+ \brief Signal handler tryClose(SUIT_ViewWindow*) of a view
+ \param pview view user tries to close
*/
-bool SALOME_PYQT_Module::lastActivationStatus() const
+void SALOME_PYQT_Module::onViewTryClose( SUIT_ViewWindow* pview )
{
- return myLastActivateStatus;
+ SALOME_PYQT_ModuleLight::onViewTryClose( pview );
}
/*!
\param setting preference resource name
*/
void SALOME_PYQT_Module::preferenceChanged( const QString& module,
- const QString& section,
- const QString& setting )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::preferenceChanged()" );
-
- // perform synchronous request to Python event dispatcher
- class Event : public PyInterp_LockRequest
- {
- public:
- Event( PyInterp_Interp* _py_interp,
- SALOME_PYQT_Module* _obj,
- const QString& _section,
- const QString& _setting )
- : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
- myObj ( _obj ),
- mySection( _section ),
- mySetting( _setting ) {}
-
- protected:
- virtual void execute()
- {
- myObj->prefChanged( mySection, mySetting );
- }
-
- private:
- SALOME_PYQT_Module* myObj;
- QString mySection, mySetting;
- };
-
- if ( module != moduleName() ) {
- // module's own preferences are processed by preferencesChanged() method
- // ...
- // post the request only if dispatcher is not busy!
- // execute request synchronously
- if ( !PyInterp_Dispatcher::Get()->IsBusy() )
- PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this, section, setting ) );
- }
-}
-
-/*!
- \brief Process study activation.
-
- Called when study desktop is activated. Used for notifying the Python
- module about changing of the active study.
-*/
-void SALOME_PYQT_Module::studyActivated()
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::studyActivated()" );
-
- // StudyChangedReq: request class for internal studyChanged() operation
- class StudyChangedReq : public PyInterp_Request
- {
- public:
- StudyChangedReq( SUIT_Study* _study,
- SALOME_PYQT_Module* _obj )
- : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
- myStudy ( _study ),
- myObj ( _obj ) {}
-
- protected:
- virtual void execute()
- {
- myObj->studyChanged( myStudy );
- }
-
- private:
- SUIT_Study* myStudy;
- SALOME_PYQT_Module* myObj;
- };
-
- // post request
- PyInterp_Dispatcher::Get()->Exec( new StudyChangedReq( application()->activeStudy(), this ) );
-}
-
-/*!
- \brief Process GUI action (from main menu, toolbar or
- context popup menu action).
-*/
-void SALOME_PYQT_Module::onGUIEvent()
+ const QString& section,
+ const QString& setting )
{
- FuncMsg fmsg( "SALOME_PYQT_Module::onGUIEvent()" );
-
- // get sender action
- QAction* action = qobject_cast<QAction*>( sender() );
- if ( !action )
- return;
-
- // get action ID
- int id = actionId( action );
- fmsg.message( QString( "action id = %1" ).arg( id ) );
-
- // perform synchronous request to Python event dispatcher
- class GUIEvent : public PyInterp_LockRequest
- {
- public:
- GUIEvent( PyInterp_Interp* _py_interp,
- SALOME_PYQT_Module* _obj,
- int _id )
- : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
- myId ( _id ),
- myObj ( _obj ) {}
-
- protected:
- virtual void execute()
- {
- myObj->guiEvent( myId );
- }
-
- private:
- int myId;
- SALOME_PYQT_Module* myObj;
- };
-
- // post request
- PyInterp_Dispatcher::Get()->Exec( new GUIEvent( myInterp, this, id ) );
+ SALOME_PYQT_ModuleLight::preferenceChanged(module,section,setting);
}
/*!
- \brief Process context popup menu request.
-
- Called when user activates popup menu in some window
- (view, object browser, etc).
-
- \param theContext popup menu context (e.g. "ObjectBrowser")
- \param thePopupMenu popup menu
- \param title popup menu title (not used)
+ \brief Signal handler windowActivated(SUIT_ViewWindow*) of SUIT_Desktop
+ \param pview view being activated
*/
-void SALOME_PYQT_Module::contextMenuPopup( const QString& theContext,
- QMenu* thePopupMenu,
- QString& /*title*/ )
+void SALOME_PYQT_Module::onActiveViewChanged( SUIT_ViewWindow* pview )
{
- FuncMsg fmsg( "SALOME_PYQT_Module::contextMenuPopup()" );
- fmsg.message( QString( "context: %1" ).arg( theContext ) );
-
- // perform synchronous request to Python event dispatcher
- class PopupMenuEvent : public PyInterp_LockRequest
- {
- public:
- PopupMenuEvent( PyInterp_Interp* _py_interp,
- SALOME_PYQT_Module* _obj,
- const QString& _context,
- QMenu* _popup )
- : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
- myContext( _context ),
- myPopup ( _popup ),
- myObj ( _obj ) {}
-
- protected:
- virtual void execute()
- {
- myObj->contextMenu( myContext, myPopup );
- }
-
- private:
- SALOME_PYQT_Module* myObj;
- QString myContext;
- QMenu* myPopup;
- };
-
- // post request only if dispatcher is not busy!
- // execute request synchronously
- if ( !PyInterp_Dispatcher::Get()->IsBusy() )
- PyInterp_Dispatcher::Get()->Exec( new PopupMenuEvent( myInterp, this, theContext, thePopupMenu ) );
+ SALOME_PYQT_ModuleLight::onActiveViewChanged(pview);
}
/*!
- \brief Export preferences for the Python module.
-
- Called only once when the first instance of the module is created.
+ \brief Signal handler cloneView() of OCCViewer_ViewWindow
+ \param pview view being cloned
*/
-void SALOME_PYQT_Module::createPreferences()
+void SALOME_PYQT_Module::onViewCloned( SUIT_ViewWindow* pview )
{
- FuncMsg fmsg( "SALOME_PYQT_Module::createPreferences()" );
-
- // perform synchronous request to Python event dispatcher
- class Event : public PyInterp_LockRequest
- {
- public:
- Event( PyInterp_Interp* _py_interp,
- SALOME_PYQT_Module* _obj )
- : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
- myObj ( _obj ) {}
-
- protected:
- virtual void execute()
- {
- myObj->initPreferences();
- }
-
- private:
- SALOME_PYQT_Module* myObj;
- };
-
- // post request only if dispatcher is not busy!
- // execute request synchronously
- if ( !PyInterp_Dispatcher::Get()->IsBusy() )
- PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this ) );
-}
-
-/*!
- \brief Define the dockable windows associated with the module.
-
- To fill the list of windows the correspondind Python module's windows()
- method is called from SALOME_PYQT_Module::init() method.
-
- By default, ObjectBrowser, PythonConsole and LogWindow windows are
- associated to the module.
-
- Allowed dockable windows:
- - SalomeApp_Application::WT_ObjectBrowser : object browser
- - SalomeApp_Application::WT_PyConsole : python console
- - SalomeApp_Application::WT_LogWindow : log messages output window
-
- Dock area is defined by Qt::DockWidgetArea enumeration:
- - Qt::TopDockWidgetArea : top dock area
- - Qt::BottomDockWidgetArea : bottom dock area
- - Qt::LeftDockWidgetArea : left dock area
- - Qt::RightDockWidgetArea : right dock area
-
- \param mappa map of dockable windows: { <window_type> : <dock_area> }
-*/
-void SALOME_PYQT_Module::windows( QMap<int, int>& mappa ) const
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::windows()" );
-
- mappa = myWindowsMap;
-}
-
-/*!
- \brief Define the compatible view windows associated with the module.
-
- The associated view windows are opened automatically when the module
- is activated.
-
- To fill the list of views the correspondind Python module's views()
- method is called from SALOME_PYQT_Module::init() method.
- By default, the list is empty.
-
- \param listik list of view windows types
-*/
-void SALOME_PYQT_Module::viewManagers( QStringList& lst ) const
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::viewManagers()" );
-
- lst = myViewMgrList;
-}
-
-/*!
- \brief Process module's preferences changing.
-
- Called when the module's preferences are changed.
-
- \param section setting section
- \param setting setting name
-*/
-void SALOME_PYQT_Module::preferencesChanged( const QString& section, const QString& setting )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::preferencesChanged()" );
-
- // perform synchronous request to Python event dispatcher
- class Event : public PyInterp_LockRequest
- {
- public:
- Event( PyInterp_Interp* _py_interp,
- SALOME_PYQT_Module* _obj,
- const QString& _section,
- const QString& _setting )
- : PyInterp_LockRequest( _py_interp, 0, true ), // this request should be processed synchronously (sync == true)
- myObj ( _obj ),
- mySection( _section ),
- mySetting( _setting ) {}
-
- protected:
- virtual void execute()
- {
- myObj->prefChanged( mySection, mySetting );
- }
-
- private:
- SALOME_PYQT_Module* myObj;
- QString mySection, mySetting;
- };
-
- // post request only if dispatcher is not busy!
- // execut request synchronously
- if ( !PyInterp_Dispatcher::Get()->IsBusy() )
- PyInterp_Dispatcher::Get()->Exec( new Event( myInterp, this, section, setting ) );
-}
-
-/*!
- \brief Internal module initialization:
-
- Performs the following actions:
- - initialize or get the Python interpreter (one per study)
- - import the Python module
- - pass the workspace widget to the Python module
- - call Python module's initialize() method
- - call Python module's windows() method
- - call Python module's views() method
-
- \param app parent application object
-*/
-void SALOME_PYQT_Module::init( CAM_Application* app )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::init()" );
-
- // reset interpreter to NULL
- myInterp = NULL;
-
- // get study Id
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( app );
- if ( !anApp )
- return;
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !aStudy )
- return;
- int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
- // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
- initInterp( aStudyId );
- if ( !myInterp )
- return; // Error
-
- // import Python GUI module
- importModule();
- if ( !myModule )
- return; // Error
-
- // this module is being activated now!
- myInitModule = this;
-
- // then call Python module's initialize() method
- // ... first get python lock
- PyLockWrapper aLock = myInterp->GetLockWrapper();
- // ... (the Python module is already imported)
- // ... finally call Python module's initialize() method
- if ( PyObject_HasAttrString( myModule , "initialize" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule, "initialize", "" ) );
- if ( !res ) {
- PyErr_Print();
- }
- }
-
- // get required dockable windows list from the Python module
- // by calling windows() method
- // ... first put default values
- myWindowsMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
- myWindowsMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
- myWindowsMap.insert( SalomeApp_Application::WT_LogWindow, Qt::BottomDockWidgetArea );
-
- if ( PyObject_HasAttrString( myModule , "windows" ) ) {
- PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) );
- if ( !res1 ) {
- PyErr_Print();
- }
- else {
- myWindowsMap.clear();
- if ( PyDict_Check( res1 ) ) {
- PyObject* key;
- PyObject* value;
- Py_ssize_t pos = 0;
- while ( PyDict_Next( res1, &pos, &key, &value ) ) {
- // parse the return value
- // it should be a map: {integer:integer}
- int aKey, aValue;
- if( key && PyInt_Check( key ) && value && PyInt_Check( value ) ) {
- aKey = PyInt_AsLong( key );
- aValue = PyInt_AsLong( value );
- myWindowsMap[ aKey ] = aValue;
- }
- }
- }
- }
- }
-
- // get compatible view windows types from the Python module
- // by calling views() method
- if ( PyObject_HasAttrString( myModule , "views" ) ) {
- PyObjWrapper res2( PyObject_CallMethod( myModule, "views", "" ) );
- if ( !res2 ) {
- PyErr_Print();
- }
- else {
- // parse the return value
- // result can be one string...
- if ( PyString_Check( res2 ) ) {
- myViewMgrList.append( PyString_AsString( res2 ) );
- }
- // ... or list of strings
- else if ( PyList_Check( res2 ) ) {
- int size = PyList_Size( res2 );
- for ( int i = 0; i < size; i++ ) {
- PyObject* value = PyList_GetItem( res2, i );
- if( value && PyString_Check( value ) ) {
- myViewMgrList.append( PyString_AsString( value ) );
- }
- }
- }
- }
- }
- // module is already activated!
- myInitModule = 0;
-}
-
-/*!
- \brief Internal activation:
-
- Performs the following actions:
- - initialize or get the Python interpreter (one per study)
- - import the Python GUI module
- - call Python module's activate() method
-
- \param theStudy parent study object
-*/
-void SALOME_PYQT_Module::activate( SUIT_Study* theStudy )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::activate()" );
-
- // get study Id
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
- int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
- // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
- initInterp( aStudyId );
- if ( !myInterp )
- return; // Error
-
- // import Python GUI module
- importModule();
- if ( !myModule )
- return; // Error
-
- // get python lock
- PyLockWrapper aLock = myInterp->GetLockWrapper();
-
- // call Python module's activate() method (for the new modules)
- if ( PyObject_HasAttrString( myModule , "activate" ) ) {
- PyObject* res1 = PyObject_CallMethod( myModule, "activate", "" );
- if ( !res1 || !PyBool_Check( res1 ) ) {
- PyErr_Print();
- // always true for old modules (no return value)
- myLastActivateStatus = true;
- }
- else {
- // detect return status
- myLastActivateStatus = PyObject_IsTrue( res1 );
- }
- }
-
- // Connect the SUIT_Desktop signal windowActivated() to this->onActiveViewChanged()
- SUIT_Desktop* aDesk = theStudy->application()->desktop();
- if ( aDesk )
- {
- connect( aDesk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
- this, SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) );
- // If a active window exists send activeViewChanged
- // If a getActiveView() in SalomePyQt available we no longer need this
- SUIT_ViewWindow* aView = aDesk->activeWindow();
- if ( aView )
- activeViewChanged( aView );
-
- // get all view currently opened in the study and connect their signals to
- // the corresponding slots of the class.
- QList<SUIT_ViewWindow*> wndList = aDesk->windows();
- SUIT_ViewWindow* wnd;
- foreach ( wnd, wndList )
- connectView( wnd );
- }
-}
-
-/*!
- \brief Additional customization after module is activated:
-
- Performs the following actions:
- - get the Python interpreter (one per study)
- - import the Python GUI module
- - call Python module's setSettings() method (obsolete function,
- used for compatibility with old code)
-
- \param theStudy parent study object
-*/
-void SALOME_PYQT_Module::customize( SUIT_Study* theStudy )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::customize()" );
-
- // get study Id
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
- int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
- // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
- initInterp( aStudyId );
- if ( !myInterp )
- return; // Error
-
- // import Python GUI module
- importModule();
- if ( !myModule )
- return; // Error
-
- if ( IsCallOldMethods ) {
- // call Python module's setWorkspace() method
- setWorkSpace();
- }
-
- // get python lock
- PyLockWrapper aLock = myInterp->GetLockWrapper();
-
- if ( IsCallOldMethods ) {
- // call Python module's setSettings() method (obsolete)
- if ( PyObject_HasAttrString( myModule , "setSettings" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule, "setSettings", "" ) );
- if( !res ) {
- PyErr_Print();
- }
- }
- }
-}
-
-/*!
- \brief Internal deactivation:
-
- Performs the following actions:
- - call Python module's deactivate() method
-
- \param theStudy parent study object
-*/
-void SALOME_PYQT_Module::deactivate( SUIT_Study* theStudy )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::deactivate()" );
-
- // check if the subinterpreter is initialized and Python module is imported
- if ( !myInterp || !myModule ) {
- // Error! Python subinterpreter should be initialized and module should be imported first!
- return;
- }
- // then call Python module's deactivate() method
- if ( PyObject_HasAttrString( myModule , "deactivate" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule, "deactivate", "" ) );
- if( !res ) {
- PyErr_Print();
- }
- }
-
- // Disconnect the SUIT_Desktop signal windowActivated()
- SUIT_Desktop* aDesk = theStudy->application()->desktop();
- if ( aDesk )
- {
- disconnect( aDesk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
- this, SLOT( onActiveViewChanged( SUIT_ViewWindow* ) ) );
- }
-}
-
-/*!
- \brief Perform internal actions when active study is changed.
-
- Called when active the study is actived (user brings its
- desktop to top):
- - initialize or get the Python interpreter (one per study)
- - import the Python GUI module
- - call Python module's activeStudyChanged() method
-
- \param theStudy study being activated
-*/
-void SALOME_PYQT_Module::studyChanged( SUIT_Study* theStudy )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::studyChanged()" );
-
- // get study Id
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( theStudy );
- int aStudyId = aStudy ? aStudy->studyDS()->StudyId() : 0;
-
- // initialize Python subinterpreter (on per study) and put it in <myInterp> variable
- initInterp( aStudyId );
- if ( !myInterp )
- return; // Error
-
- // import Python GUI module
- importModule();
- if ( !myModule )
- return; // Error
-
- if ( IsCallOldMethods ) {
- // call Python module's setWorkspace() method
- setWorkSpace();
- }
-
- // get python lock
- PyLockWrapper aLock = myInterp->GetLockWrapper();
-
- // call Python module's activeStudyChanged() method
- if ( PyObject_HasAttrString( myModule , "activeStudyChanged" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule, "activeStudyChanged", "i", aStudyId ) );
- if( !res ) {
- PyErr_Print();
- }
- }
-}
-
-/*!
- \brief Get module engine.
-
- Returns nil var if engine is not found in LifeCycleCORBA.
-
- \return module's engine reference
-*/
-Engines::Component_var SALOME_PYQT_Module::getEngine() const
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::getEngine()" );
-
- Engines::Component_var comp;
- try {
- comp = getApp()->lcc()->FindOrLoad_Component( "FactoryServerPy", name().toLatin1() );
- }
- catch ( CORBA::Exception& ) {
- }
- return comp;
-}
-
-/*!
- \birief Get module engine IOR.
-
- Returns empty string if engine is not found in LifeCycleCORBA.
-
- \return module's engine IOR
-*/
-QString SALOME_PYQT_Module::engineIOR() const
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::engineIOR()" );
-
- QString anIOR = "";
- if ( !CORBA::is_nil( getEngine() ) )
- anIOR = getApp()->orb()->object_to_string( getEngine() );
- return anIOR;
-}
-
-/*!
- \brief Process (internally) context popup menu request.
-
- Performs the following actions:
- - calls Python module's definePopup(...) method (obsolete function,
- used for compatibility with old code) to define the popup menu context
- - parses XML resourses file (if exists) and fills the popup menu with the items)
- - calls Python module's customPopup(...) method (obsolete function,
- used for compatibility with old code) to allow module to customize the popup menu
- - for new modules calls createPopupMenu() function to allow the
- modules to build the popup menu by using insertItem(...) Qt functions.
-
- \param theContext popup menu context
- \param thePopupMenu popup menu
-*/
-void SALOME_PYQT_Module::contextMenu( const QString& theContext, QMenu* thePopupMenu )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::contextMenu()" );
-
- // Python interpreter should be initialized and Python module should be
- // import first
- if ( !myInterp || !myModule )
- return;
-
- QString aContext( "" ), aObject( "" ), aParent( theContext );
-
- if ( IsCallOldMethods && PyObject_HasAttrString( myModule , "definePopup" ) ) {
- // call definePopup() Python module's function
- // this is obsolete function, used only for compatibility reasons
- PyObjWrapper res( PyObject_CallMethod( myModule,
- "definePopup",
- "sss",
- aContext.toLatin1().constData(),
- aObject.toLatin1().constData(),
- aParent.toLatin1().constData() ) );
- if( !res ) {
- PyErr_Print();
- }
- else {
- // parse return value
- char *co, *ob, *pa;
- if( PyArg_ParseTuple( res, "sss", &co, &ob, &pa ) ) {
- aContext = co;
- aObject = ob;
- aParent = pa;
- }
- }
- } // if ( IsCallOldMethods ... )
-
- // first try to create menu via XML parser:
- // we create popup menus without help of QtxPopupMgr
- if ( myXmlHandler )
- myXmlHandler->createPopup( thePopupMenu, aContext, aParent, aObject );
-
- PyObjWrapper sipPopup( sipBuildResult( 0, "M", thePopupMenu, sipClass_QMenu ) );
-
- // then call Python module's createPopupMenu() method (for new modules)
- if ( PyObject_HasAttrString( myModule , "createPopupMenu" ) ) {
- PyObjWrapper res1( PyObject_CallMethod( myModule,
- "createPopupMenu",
- "Os",
- sipPopup.get(),
- aContext.toLatin1().constData() ) );
- if( !res1 ) {
- PyErr_Print();
- }
- }
-
- if ( IsCallOldMethods && PyObject_HasAttrString( myModule , "customPopup" ) ) {
- // call customPopup() Python module's function
- // this is obsolete function, used only for compatibility reasons
- PyObjWrapper res2( PyObject_CallMethod( myModule,
- "customPopup",
- "Osss",
- sipPopup.get(),
- aContext.toLatin1().constData(),
- aObject.toLatin1().constData(),
- aParent.toLatin1().constData() ) );
- if( !res2 ) {
- PyErr_Print();
- }
- }
-}
-
-/*!
- \brief Internal GUI event handling.
-
- Performs the following actions:
- - calls Python module's OnGUIEvent() method
-
- \param theId GUI action ID
-*/
-void SALOME_PYQT_Module::guiEvent( const int theId )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::guiEvent()" );
-
- // Python interpreter should be initialized and Python module should be
- // import first
- if ( !myInterp || !myModule )
- return;
-
- if ( PyObject_HasAttrString( myModule , "OnGUIEvent" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule, "OnGUIEvent", "i", theId ) );
- if( !res ) {
- PyErr_Print();
- }
- }
-}
-
-/*!
- \brief Initialize (internally) preferences for the module.
-
- Performs the following actions:
- - calls Python module's createPreferences() method
-*/
-void SALOME_PYQT_Module::initPreferences()
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::initPreferences()" );
-
- // Python interpreter should be initialized and Python module should be
- // import first
- if ( !myInterp || !myModule )
- return;
-
- // temporary set myInitModule because createPreferences() method
- // might be called during the module intialization process
- myInitModule = this;
-
- if ( PyObject_HasAttrString( myModule , "createPreferences" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule, "createPreferences", "" ) );
- if( !res ) {
- PyErr_Print();
- }
- }
-
- myInitModule = 0;
-}
-
-/*!
- \brief Initialize python subinterpreter (one per study).
- \param theStudyId study ID
-*/
-void SALOME_PYQT_Module::initInterp( int theStudyId )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::initInterp()" );
-
- // check study Id
- if ( !theStudyId ) {
- // Error! Study Id must not be 0!
- myInterp = NULL;
- return;
- }
- // try to find the subinterpreter
- if( myInterpMap.contains( theStudyId ) ) {
- // found!
- myInterp = myInterpMap[ theStudyId ];
- return;
- }
- // not found - create a new one!
- ///////////////////////////////////////////////////////////////////
- // Attention: the creation of Python interpretor must be protected
- // by a C++ Lock because of C threads
- ///////////////////////////////////////////////////////////////////
- myInterp = new SALOME_PYQT_PyInterp();
- myInterp->initialize();
- myInterpMap[ theStudyId ] = myInterp;
-
- // import 'salome' module and call 'salome_init' method;
- // do it only once on interpreter creation
- // ... first get python lock
- PyLockWrapper aLock = myInterp->GetLockWrapper();
- // ... then import a module
- PyObjWrapper aMod = PyImport_ImportModule( "salome" );
- if( !aMod ) {
- // Error!
- PyErr_Print();
- return;
- }
- // ... then call a method
- int embedded = 1;
- PyObjWrapper aRes( PyObject_CallMethod( aMod, "salome_init", "ii", theStudyId, embedded ) );
- if( !aRes ) {
- // Error!
- PyErr_Print();
- return;
- }
-}
-
-/*!
- \brief Import Python GUI module and remember the reference to the module.
-
- Attention! initInterp() should be called first!!!
-*/
-void SALOME_PYQT_Module::importModule()
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::importModule()" );
-
- // check if the subinterpreter is initialized
- if ( !myInterp ) {
- // Error! Python subinterpreter should be initialized first!
- myModule = 0;
- return;
- }
- // import Python GUI module and puts it in <myModule> attribute
- // ... first get python lock
- PyLockWrapper aLock = myInterp->GetLockWrapper();
- // ... then import a module
- QString aMod = name() + "GUI";
- myModule = PyImport_ImportModule( aMod.toLatin1().data() );
- if( !myModule ) {
- // Error!
- PyErr_Print();
- return;
- }
-}
-
-/*!
- \brief Set study workspace to the Python module.
-
- Calls setWorkSpace() method of the Pythohn module with
- PyQt QWidget object to use with interpreter.
-
- Attention! initInterp() and importModule() should be called first!!!
-*/
-void SALOME_PYQT_Module::setWorkSpace()
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::setWorkSpace()" );
-
- // check if the subinterpreter is initialized and Python module is imported
- if ( !myInterp || !myModule ) {
- // Error! Python subinterpreter should be initialized and module should be imported first!
- return;
- }
-
- // call setWorkspace() method
- // ... first get python lock
- PyLockWrapper aLock = myInterp->GetLockWrapper();
-
- // ... then try to import SalomePyQt module. If it's not possible don't go on.
- PyObjWrapper aQtModule( PyImport_ImportModule( "SalomePyQt" ) );
- if( !aQtModule ) {
- // Error!
- PyErr_Print();
- return;
- }
-
- if ( IsCallOldMethods ) {
- // ... then get workspace object
- QWidget* aWorkspace = 0;
- if ( getApp()->desktop()->inherits( "STD_MDIDesktop" ) ) {
- STD_MDIDesktop* aDesktop = dynamic_cast<STD_MDIDesktop*>( getApp()->desktop() );
- if ( aDesktop )
- aWorkspace = aDesktop->workspace();
- }
- else if ( getApp()->desktop()->inherits( "STD_TabDesktop" ) ) {
- STD_TabDesktop* aDesktop = dynamic_cast<STD_TabDesktop*>( getApp()->desktop() );
- if ( aDesktop )
- aWorkspace = aDesktop->workstack();
- }
- PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget ) );
- // ... and finally call Python module's setWorkspace() method (obsolete)
- if ( PyObject_HasAttrString( myModule , "setWorkSpace" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule, "setWorkSpace", "O", pyws.get() ) );
- if( !res ) {
- PyErr_Print();
- }
- }
- }
-}
-
-/*!
- \brief Preference changing callback function (internal).
-
- Performs the following actions:
- - call Python module's preferenceChanged() method
-
- \param section setting section name
- \param setting setting name
-*/
-void SALOME_PYQT_Module::prefChanged( const QString& section, const QString& setting )
-{
- FuncMsg fmsg( "SALOME_PYQT_Module::prefChanged()" );
-
- // Python interpreter should be initialized and Python module should be
- // import first
- if ( !myInterp || !myModule )
- return;
-
- if ( PyObject_HasAttrString( myModule , "preferenceChanged" ) ) {
- PyObjWrapper res( PyObject_CallMethod( myModule,
- "preferenceChanged",
- "ss",
- section.toLatin1().constData(),
- setting.toLatin1().constData() ) );
- if( !res ) {
- PyErr_Print();
- }
- }
-}
-
-/*!
- \brief Get default menu group identifier
- \return menu group ID (40 by default)
-*/
-int SALOME_PYQT_Module::defaultMenuGroup()
-{
- return DEFAULT_GROUP;
-}
-
-//
-// The next methods call the parent implementation.
-// This is done to open protected methods from CAM_Module class.
-//
-
-/*!
- \brief Create toolbar with specified \a name.
- \param name toolbar name
- \return toolbar ID or -1 if toolbar creation is failed
-*/
-int SALOME_PYQT_Module::createTool( const QString& name )
-{
- return SalomeApp_Module::createTool( name );
-}
-
-/*!
- \brief Insert action with specified \a id to the toolbar.
- \param id action ID
- \param tBar toolbar ID
- \param idx required index in the toolbar
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( const int id, const int tBar, const int idx )
-{
- return SalomeApp_Module::createTool( id, tBar, idx );
-}
-
-/*!
- \brief Insert action with specified \a id to the toolbar.
- \param id action ID
- \param tBar toolbar name
- \param idx required index in the toolbar
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( const int id, const QString& tBar, const int idx )
-{
- return SalomeApp_Module::createTool( id, tBar, idx );
-}
-
-/*!
- \brief Insert action to the toolbar.
- \param a action
- \param tBar toolbar ID
- \param id required action ID
- \param idx required index in the toolbar
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( QAction* a, const int tBar, const int id, const int idx )
-{
- return SalomeApp_Module::createTool( a, tBar, id, idx );
-}
-
-/*!
- \brief Insert action to the toolbar.
- \param a action
- \param tBar toolbar name
- \param id required action ID
- \param idx required index in the toolbar
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx )
-{
- return SalomeApp_Module::createTool( a, tBar, id, idx );
-}
-
-/*!
- \brief Create main menu.
- \param subMenu menu name
- \param menu parent menu ID
- \param id required menu ID
- \param group menu group ID
- \param idx required index in the menu
- \return menu ID or -1 if menu could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx )
-{
- return SalomeApp_Module::createMenu( subMenu, menu, id, group, idx );
-}
-
-/*!
- \brief Create main menu.
- \param subMenu menu name
- \param menu parent menu name (list of menu names separated by "|")
- \param id required menu ID
- \param group menu group ID
- \param idx required index in the menu
- \return menu ID or -1 if menu could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx )
-{
- return SalomeApp_Module::createMenu( subMenu, menu, id, group, idx );
-}
-
-/*!
- \brief Insert action to the main menu.
- \param id action ID
- \param menu parent menu ID
- \param group menu group ID
- \param idx required index in the menu
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const int id, const int menu, const int group, const int idx )
-{
- return SalomeApp_Module::createMenu( id, menu, group, idx );
-}
-
-/*!
- \brief Insert action to the main menu.
- \param id action ID
- \param menu parent menu name (list of menu names separated by "|")
- \param group menu group ID
- \param idx required index in the menu
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( const int id, const QString& menu, const int group, const int idx )
-{
- return SalomeApp_Module::createMenu( id, menu, group, idx );
-}
-
-/*!
- \brief Insert action to the main menu.
- \param a action
- \param menu parent menu ID
- \param group menu group ID
- \param idx required index in the menu
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
-{
- return SalomeApp_Module::createMenu( a, menu, id, group, idx );
-}
-
-/*!
- \brief Insert action to the main menu.
- \param a action
- \param menu parent menu name (list of menu names separated by "|")
- \param group menu group ID
- \param idx required index in the menu
- \return action ID or -1 if action could not be added
-*/
-int SALOME_PYQT_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
-{
- return SalomeApp_Module::createMenu( a, menu, id, group, idx );
-}
-
-/*!
- \brief Create separator action which can be used in the menu or toolbar.
- \return new separator action
-*/
-QAction* SALOME_PYQT_Module::separator()
-{
- return SalomeApp_Module::separator();
-}
-
-/*!
- \brief Get action by specified \a id.
- \return action or 0 if it is not found
-*/
-QAction* SALOME_PYQT_Module::action( const int id ) const
-{
- QAction* a = SalomeApp_Module::action( id );
- if ( !a ) {
- // try menu
- QMenu* m = menuMgr()->findMenu( id );
- if ( m ) a = m->menuAction();
- }
- return a;
-}
-
-/*!
- \brief Get action identifier.
- \return action ID or -1 if action is not registered
-*/
-int SALOME_PYQT_Module::actionId( const QAction* a ) const
-{
- return SalomeApp_Module::actionId( a );
-}
-
-/*!
- \brief Create new action.
-
- If the action with specified identifier already registered
- it is not created, but its attributes are only modified.
-
- \param id action ID
- \param text tooltip text
- \param icon icon
- \param menu menu text
- \param tip status tip
- \param key keyboard shortcut
- \param toggle \c true for checkable action
- \return created action
-*/
-QAction* SALOME_PYQT_Module::createAction( const int id, const QString& text, const QString& icon,
- const QString& menu, const QString& tip, const int key,
- const bool toggle, QObject* parent )
-{
- QIcon anIcon = loadIcon( icon );
- QAction* a = action( id );
- if ( a ) {
- if ( a->toolTip().isEmpty() && !text.isEmpty() ) a->setToolTip( text );
- if ( a->text().isEmpty() && !menu.isEmpty() ) a->setText( menu );
- if ( a->icon().isNull() && !anIcon.isNull() ) a->setIcon( anIcon );
- if ( a->statusTip().isEmpty() && !tip.isEmpty() ) a->setStatusTip( tip );
- if ( a->shortcut().isEmpty() && key ) a->setShortcut( key );
- if ( a->isCheckable() != toggle ) a->setCheckable( toggle );
- disconnect( a, SIGNAL( triggered( bool ) ), this, SLOT( onGUIEvent() ) );
- connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onGUIEvent() ) );
- }
- else {
- a = SalomeApp_Module::createAction( id,
- text,
- anIcon,
- menu,
- tip,
- key,
- parent ? parent : this,
- toggle,
- this,
- SLOT( onGUIEvent() ) );
- }
- return a;
-}
-
-/*!
- \brief Create new action group.
-
- If the action with specified identifier already registered
- it is not created, but its attributes are only modified.
-
- \param id action ID
- \param text tooltip text
- \param icon icon
- \param menu menu text
- \param tip status tip
- \param key keyboard shortcut
- \param toggle \c true for checkable action
- \return created action
-*/
-QtxActionGroup* SALOME_PYQT_Module::createActionGroup(const int id, const bool exclusive)
-{
- QtxActionGroup* a = qobject_cast<QtxActionGroup*>( action( id ) );
- if ( !a ) {
- a = new QtxActionGroup( this );
- SalomeApp_Module::registerAction( id, a );
- }
- a->setExclusive( exclusive );
- return a;
-}
-
-/*!
- \brief Load icon from resource file.
- \param fileName icon file name
- \return icon (null icon if loading failed)
-*/
-QIcon SALOME_PYQT_Module::loadIcon( const QString& fileName )
-{
- QIcon anIcon;
- if ( !fileName.isEmpty() ) {
- QPixmap pixmap = getApp()->resourceMgr()->loadPixmap( name(), tr( fileName.toLatin1() ) );
- if ( !pixmap.isNull() )
- anIcon = QIcon( pixmap );
- }
- return anIcon;
-}
-
-/*!
- \brief Add global application preference (for example,
- application specific section).
- \param label preference name
- \return preference ID
-*/
-int SALOME_PYQT_Module::addGlobalPreference( const QString& label )
-{
- LightApp_Preferences* pref = preferences();
- if ( !pref )
- return -1;
-
- return pref->addPreference( label, -1 );
-}
-
-/*!
- \brief Add preference.
- \param label preference name
- \return preference ID
-*/
-int SALOME_PYQT_Module::addPreference( const QString& label )
-{
- return SalomeApp_Module::addPreference( label );
-}
-
-/*!
- \brief Add preference.
- \param label preference name
- \param pId parent preference ID
- \param type preference type
- \param section resource file section name
- \param param resource file setting name
- \return preference ID
-*/
-int SALOME_PYQT_Module::addPreference( const QString& label,
- const int pId, const int type,
- const QString& section,
- const QString& param )
-{
- return SalomeApp_Module::addPreference( label, pId, type, section, param );
-}
-
-/*!
- \brief Get the preference property.
- \param id preference ID
- \param prop property name
- \return property value (invalid QVariant() if property is not found)
-*/
-QVariant SALOME_PYQT_Module::preferenceProperty( const int id,
- const QString& prop ) const
-{
- QVariant v = SalomeApp_Module::preferenceProperty( id, prop );
- return v;
-}
-
-/*!
- \brief Set the preference property.
- \param id preference ID
- \param prop property name
- \param var property value
-*/
-void SALOME_PYQT_Module::setPreferenceProperty( const int id,
- const QString& prop,
- const QVariant& var )
-{
- SalomeApp_Module::setPreferenceProperty( id, prop, var );
-}
-
-
-/*!
- \brief Signal handler windowActivated(SUIT_ViewWindow*) of SUIT_Desktop
- \param pview view being activated
-*/
-void SALOME_PYQT_Module::onActiveViewChanged( SUIT_ViewWindow* pview )
-{
- class ActiveViewChange : public PyInterp_LockRequest
- {
- public:
- ActiveViewChange( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
- : PyInterp_LockRequest( _py_interp, 0, true ),
- myObj(_obj),myView(_pview) {}
-
- protected:
- virtual void execute()
- {
- myObj->activeViewChanged( myView );
- }
-
- private:
- SALOME_PYQT_Module* myObj;
- const SUIT_ViewWindow * myView;
- };
-
- PyInterp_Dispatcher::Get()->Exec( new ActiveViewChange( myInterp, this, pview ) );
-}
-
-/*!
- \brief Processes the view changing, calls Python module's activeViewChanged() method
- \param pview view being activated
-*/
-void SALOME_PYQT_Module::activeViewChanged( const SUIT_ViewWindow* pview )
-{
- if ( !myInterp || !myModule )
- return;
-
- // Do not use SUIT_ViewWindow::closing() signal here. View manager reacts on
- // this signal and deletes view. So our slot does not works if it is connected
- // on this signal. SUIT_ViewManager::deleteView(SUIT_ViewWindow*) is used here
-
- connectView( pview );
-
- if ( PyObject_HasAttrString( myModule, "activeViewChanged" ) )
- {
- if ( !pview )
- return;
-
- PyObjWrapper res( PyObject_CallMethod( myModule, "activeViewChanged", "i" , pview->getId() ) );
- if( !res )
- PyErr_Print();
- }
-}
-
-/*!
- \brief Signal handler cloneView() of OCCViewer_ViewWindow
- \param pview view being cloned
-*/
-void SALOME_PYQT_Module::onViewCloned( SUIT_ViewWindow* pview )
-{
- class ViewClone : public PyInterp_LockRequest
- {
- public:
- ViewClone( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
- : PyInterp_LockRequest( _py_interp, 0, true ),
- myObj(_obj), myView(_pview) {}
-
- protected:
- virtual void execute()
- {
- myObj->viewCloned( myView );
- }
-
- private:
- SALOME_PYQT_Module* myObj;
- const SUIT_ViewWindow* myView;
- };
-
- PyInterp_Dispatcher::Get()->Exec( new ViewClone( myInterp, this, pview ) );
-}
-
-/*!
- \brief Processes the view cloning, calls Python module's activeViewCloned() method
- \param pview view being cloned
-*/
-void SALOME_PYQT_Module::viewCloned( const SUIT_ViewWindow* pview )
-{
- if ( !myInterp || !myModule || !pview )
- return;
-
- if ( PyObject_HasAttrString( myModule, "viewCloned" ) )
- {
- PyObjWrapper res( PyObject_CallMethod( myModule, "viewCloned", "i", pview->getId() ) );
- if( !res )
- PyErr_Print();
- }
-}
-
-/*!
- \brief Signal handler closing(SUIT_ViewWindow*) of a view
- \param pview view being closed
-*/
-void SALOME_PYQT_Module::onViewClosed( SUIT_ViewWindow* pview )
-{
- class ViewClose : public PyInterp_LockRequest
- {
- public:
- ViewClose( PyInterp_Interp* _py_interp, SALOME_PYQT_Module* _obj, const SUIT_ViewWindow* _pview )
- : PyInterp_LockRequest( _py_interp, 0, true ),
- myObj(_obj),myView(_pview) {}
-
- protected:
- virtual void execute()
- {
- myObj->viewClosed( myView );
- }
-
- private:
- SALOME_PYQT_Module* myObj;
- const SUIT_ViewWindow * myView;
- };
-
- PyInterp_Dispatcher::Get()->Exec( new ViewClose( myInterp, this, pview ) );
-}
-
-/*!
- \brief Processes the view closing, calls Python module's viewClosed() method
- \param pview view being closed
-*/
-void SALOME_PYQT_Module::viewClosed( const SUIT_ViewWindow* pview )
-{
- if ( !myInterp || !myModule )
- return;
-
- if ( PyObject_HasAttrString( myModule, "viewClosed" ) )
- {
- PyObjWrapper res( PyObject_CallMethod( myModule, "viewClosed", "i", pview->getId() ) );
- if ( !res )
- {
- PyErr_Print();
- }
- }
-}
-
-/*!
- \brief Connects or disconnects signals about activating and cloning view on the module slots
- \param pview view which is connected/disconnected
-*/
-void SALOME_PYQT_Module::connectView( const SUIT_ViewWindow* pview )
-{
- SUIT_ViewManager* viewMgr = pview->getViewManager();
- SUIT_ViewModel* viewModel = viewMgr ? viewMgr->getViewModel() : 0;
-
- if ( viewMgr )
- {
- disconnect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
- this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
-
- connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
- this, SLOT( onViewClosed( SUIT_ViewWindow* ) ) );
- }
-
- // Connect cloneView() signal of an OCC View
- if ( pview->inherits( "OCCViewer_ViewWindow" ) )
- {
- disconnect( pview, SIGNAL( viewCloned( SUIT_ViewWindow* ) ),
- this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
- connect( pview, SIGNAL( viewCloned( SUIT_ViewWindow* ) ),
- this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
- }
- // Connect cloneView() signal of Plot2d View manager
- else if ( viewModel && viewModel->inherits( "Plot2d_Viewer" ) )
- {
- disconnect( viewModel, SIGNAL( viewCloned( SUIT_ViewWindow* ) ),
- this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
- connect( viewModel, SIGNAL( viewCloned( SUIT_ViewWindow* ) ),
- this, SLOT( onViewCloned( SUIT_ViewWindow* ) ) );
- }
-}
-
-/*!
- \brief Get tag name for the DOM element.
- \param element DOM element
- \return empty string if the element does not have tag name
- \internal
-*/
-static QString tagName( const QDomElement& element )
-{
- return element.tagName().trimmed();
-}
-
-/*!
- \brief Get DOM element's attribute by its name.
- \param element DOM element
- \param attName attribute name
- \return empty string if the element does not have such attribute
- \internal
-*/
-static QString attribute( const QDomElement& element, const QString& attName )
-{
- return element.attribute( attName ).trimmed();
-}
-
-/*!
- \brief Inspect specified string for the boolean value.
-
- This function returns \c true if string represents boolean value:
- - "true", "yes" or "1" for \c true
- - "false", "no" or "0" for \c false
- Second parameter allows to specify what boolean value is expected:
- - 1: \c true
- - 0: \c false
- - other value is not taken into account (return represented value)
-
- \param value inspected string
- \param check expected boolean value
- \return boolean value represented by the string (\a check is not 1 or 0)
- or \c true if value correspond to the specified \a check
-*/
-static bool checkBool( const QString& value, const int check = -1 )
-{
- QString v = value.toLower();
- if ( ( v == "true" || v == "yes" || v == "1" ) && ( check != 0 ) )
- return true;
- if ( ( v == "false" || v == "no" || v == "0" ) && ( check == 0 ) )
- return true;
- return false;
-}
-
-/*!
- \brief Inspect specified string for the integer value.
-
- This function returns returns -1 if item is empty or represents
- an invalid number.
- \param value inspected string
- \param def default value
- \param shift shift value (it is added to the integer value to produce shifted result)
-*/
-static int checkInt( const QString& value, const int def = -1, const int shift = -1 )
-{
- bool bOk;
- int val = value.toInt( &bOk );
- if ( !bOk ) val = def;
- if ( shift > 0 && bOk && val < 0 )
- val += shift;
- return val;
-}
-
-/*!
- \brief Constructor
- \internal
- \param module parent module pointer
- \param fileName XML file path
-*/
-SALOME_PYQT_Module::XmlHandler::XmlHandler( SALOME_PYQT_Module* module,
- const QString& fileName )
-: myModule( module )
-{
- if ( fileName.isEmpty() )
- return;
- QFile aFile( fileName );
- if ( !aFile.open( QIODevice::ReadOnly ) )
- return;
- myDoc.setContent( &aFile );
- aFile.close();
-}
-
-/*!
- \brief Parse XML file and create actions.
- \internal
-
- Called by SALOME_PYQT_Module::activate() in order to create actions
- (menus, toolbars).
-*/
-void SALOME_PYQT_Module::XmlHandler::createActions()
-{
- // get document element
- QDomElement aDocElem = myDoc.documentElement();
-
- // create main menu actions
- QDomNodeList aMenuList = aDocElem.elementsByTagName( "menu-item" );
- for ( int i = 0; i < aMenuList.count(); i++ ) {
- QDomNode n = aMenuList.item( i );
- createMenu( n );
- }
-
- // create toolbars actions
- QDomNodeList aToolsList = aDocElem.elementsByTagName( "toolbar" );
- for ( int i = 0; i < aToolsList.count(); i++ ) {
- QDomNode n = aToolsList.item( i );
- createToolBar( n );
- }
-}
-
-/*!
- \brief Create popup menu.
- \internal
- \param menu popup menu
- \param context popup menu context
- \param context popup menu parent object name
- \param context popup menu object name
-*/
-void SALOME_PYQT_Module::XmlHandler::createPopup( QMenu* menu,
- const QString& context,
- const QString& parent,
- const QString& object )
-{
- // get document element
- QDomElement aDocElem = myDoc.documentElement();
-
- // get popup menus actions
- QDomNodeList aPopupList = aDocElem.elementsByTagName( "popupmenu" );
- for ( int i = 0; i < aPopupList.count(); i++ ) {
- QDomNode n = aPopupList.item( i );
- if ( !n.isNull() && n.isElement() ) {
- QDomElement e = n.toElement();
- // QString lab = attribute( e, "label-id" ); // not used //
- QString ctx = attribute( e, "context-id" );
- QString prt = attribute( e, "parent-id" );
- QString obj = attribute( e, "object-id" );
- if ( ctx == context && prt == parent && obj == object ) {
- insertPopupItems( n, menu );
- break;
- }
- }
- }
-}
-
-/*!
- \brief Activate menus
- \internal
- \param enable if \c true menus are activated, otherwise menus are deactivated
-*/
-void SALOME_PYQT_Module::XmlHandler::activateMenus( bool enable )
-{
- if ( !myModule )
- return;
-
- QtxActionMenuMgr* mgr = myModule->menuMgr();
- int id;
- foreach( id, myMenuItems ) mgr->setEmptyEnabled( id, enable );
-}
-
-/*!
- \brief Create main menu item and insert actions to it.
- \internal
- \param parentNode XML node with menu description
- \param parentMenuId parent menu ID (-1 for top-level menu)
- \param parentPopup parent popup menu (0 for top-level menu)
-*/
-void SALOME_PYQT_Module::XmlHandler::createMenu( QDomNode& parentNode,
- const int parentMenuId,
- QMenu* parentPopup )
-{
- if ( !myModule || parentNode.isNull() )
- return;
-
- QDomElement parentElement = parentNode.toElement();
- if ( !parentElement.isNull() ) {
- QString plabel = attribute( parentElement, "label-id" );
- int pid = checkInt( attribute( parentElement, "item-id" ) );
- int ppos = checkInt( attribute( parentElement, "pos-id" ) );
- int group = checkInt( attribute( parentElement, "group-id" ),
- myModule->defaultMenuGroup() );
- if ( !plabel.isEmpty() ) {
- QMenu* popup = 0;
- int menuId = -1;
- // create menu
- menuId = myModule->createMenu( plabel, // label
- parentMenuId, // parent menu ID, -1 for top-level menu
- pid, // ID
- group, // group ID
- ppos ); // position
- myMenuItems.append( menuId );
- QDomNode node = parentNode.firstChild();
- while ( !node.isNull() ) {
- if ( node.isElement() ) {
- QDomElement elem = node.toElement();
- QString aTagName = tagName( elem );
- if ( aTagName == "popup-item" ) {
- int id = checkInt( attribute( elem, "item-id" ) );
- int pos = checkInt( attribute( elem, "pos-id" ) );
- int group = checkInt( attribute( elem, "group-id" ),
- myModule->defaultMenuGroup() );
- QString label = attribute( elem, "label-id" );
- QString icon = attribute( elem, "icon-id" );
- QString tooltip = attribute( elem, "tooltip-id" );
- QString accel = attribute( elem, "accel-id" );
- bool toggle = checkBool( attribute( elem, "toggle-id" ) );
-
- // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
- // also check if the action with given ID is already created
- if ( id != -1 ) {
- // create menu action
- QAction* action = myModule->createAction( id, // ID
- tooltip, // tooltip
- icon, // icon
- label, // menu text
- tooltip, // status-bar text
- QKeySequence( accel ), // keyboard accelerator
- toggle ); // toogled action
- myModule->createMenu( action, // action
- menuId, // parent menu ID
- id, // ID (same as for createAction())
- group, // group ID
- pos ); // position
- }
- }
- else if ( aTagName == "submenu" ) {
- // create sub-menu
- createMenu( node, menuId, popup );
- }
- else if ( aTagName == "separator" ) {
- // create menu separator
- int id = checkInt( attribute( elem, "item-id" ) ); // separator can have ID
- int pos = checkInt( attribute( elem, "pos-id" ) );
- int group = checkInt( attribute( elem, "group-id" ),
- myModule->defaultMenuGroup() );
- QAction* action = myModule->separator();
- myModule->createMenu( action, // separator action
- menuId, // parent menu ID
- id, // ID
- group, // group ID
- pos ); // position
- }
- }
- node = node.nextSibling();
- }
- }
- }
-}
-
-/*!
- \brief Create a toolbar and insert actions to it.
- \param parentNode XML node with toolbar description
-*/
-void SALOME_PYQT_Module::XmlHandler::createToolBar( QDomNode& parentNode )
-{
- if ( !myModule || parentNode.isNull() )
- return;
-
- QDomElement parentElement = parentNode.toElement();
- if ( !parentElement.isNull() ) {
- QString aLabel = attribute( parentElement, "label-id" );
- if ( !aLabel.isEmpty() ) {
- // create toolbar
- int tbId = myModule->createTool( aLabel );
- QDomNode node = parentNode.firstChild();
- while ( !node.isNull() ) {
- if ( node.isElement() ) {
- QDomElement elem = node.toElement();
- QString aTagName = tagName( elem );
- if ( aTagName == "toolbutton-item" ) {
- int id = checkInt( attribute( elem, "item-id" ) );
- int pos = checkInt( attribute( elem, "pos-id" ) );
- QString label = attribute( elem, "label-id" );
- QString icon = attribute( elem, "icon-id" );
- QString tooltip = attribute( elem, "tooltip-id" );
- QString accel = attribute( elem, "accel-id" );
- bool toggle = checkBool( attribute( elem, "toggle-id" ) );
-
- // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
- // also check if the action with given ID is already created
- if ( id != -1 ) {
- // create toolbar action
- QAction* action = myModule->createAction( id, // ID
- tooltip, // tooltip
- icon, // icon
- label, // menu text
- tooltip, // status-bar text
- QKeySequence( accel ), // keyboard accelerator
- toggle ); // toogled action
- myModule->createTool( action, tbId, -1, pos );
- }
- }
- else if ( aTagName == "separatorTB" || aTagName == "separator" ) {
- // create toolbar separator
- int pos = checkInt( attribute( elem, "pos-id" ) );
- QAction* action = myModule->separator();
- myModule->createTool( action, tbId, -1, pos );
- }
- }
- node = node.nextSibling();
- }
- }
- }
-}
-
-/*!
- \brief Fill popup menu with the items.
- \param parentNode XML node with popup menu description
- \param menu popup menu
-*/
-void SALOME_PYQT_Module::XmlHandler::insertPopupItems( QDomNode& parentNode, QMenu* menu )
-{
- if ( !myModule && parentNode.isNull() )
- return;
-
- // we create popup menus without help of QtxPopupMgr
- QDomNode node = parentNode.firstChild();
- while ( !node.isNull() ) {
- if ( node.isElement() ) {
- QDomElement elem = node.toElement();
- QString aTagName = tagName( elem );
- QList<QAction*> actions = menu->actions();
- if ( aTagName == "popup-item" ) {
- // insert a command item
- int id = checkInt( attribute( elem, "item-id" ) );
- int pos = checkInt( attribute( elem, "pos-id" ) );
- QString label = attribute( elem, "label-id" );
- QString icon = attribute( elem, "icon-id" );
- QString tooltip = attribute( elem, "tooltip-id" );
- QString accel = attribute( elem, "accel-id" );
- bool toggle = checkBool( attribute( elem, "toggle-id" ) );
-
- // -1 action ID is not allowed : it means that <item-id> attribute is missed in the XML file!
- // also check if the action with given ID is already created
- if ( id != -1 ) {
- QAction* action = myModule->createAction( id, // ID
- tooltip, // tooltip
- icon, // icon
- label, // menu text
- tooltip, // status-bar text
- QKeySequence( accel ), // keyboard accelerator
- toggle ); // toogled action
- QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
- menu->insertAction( before, action );
- }
- }
- else if ( aTagName == "submenu" ) {
- // create sub-menu
- ////int id = checkInt( attribute( elem, "item-id" ) ); // not used //
- int pos = checkInt( attribute( elem, "pos-id" ) );
- QString label = attribute( elem, "label-id" );
- QString icon = attribute( elem, "icon-id" );
-
- QIcon anIcon;
- if ( !icon.isEmpty() ) {
- QPixmap pixmap = myModule->getApp()->resourceMgr()->loadPixmap( myModule->name(), icon );
- if ( !pixmap.isNull() )
- anIcon = QIcon( pixmap );
- }
-
- QMenu* newPopup = menu->addMenu( anIcon, label );
- QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
- menu->insertMenu( before, newPopup );
- insertPopupItems( node, newPopup );
- }
- else if ( aTagName == "separator" ) {
- // create menu separator
- int pos = checkInt( attribute( elem, "pos-id" ) );
- QAction* action = myModule->separator();
- QAction* before = ( pos >= 0 && pos < actions.count() ) ? actions[ pos ] : 0;
- menu->insertAction( before, action );
- }
- }
- node = node.nextSibling();
- }
+ SALOME_PYQT_ModuleLight::onViewCloned(pview);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SALOME_PYQT_Module.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#ifndef SALOME_PYQT_MODULE_H
#define SALOME_PYQT_MODULE_H
#include "SALOME_PYQT_GUI.h"
-#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_Interp.h)!
-
-#include <SalomeApp_Module.h>
-
-#include <QStringList>
-#include <QList>
-#include <QMap>
-#include <QIcon>
-
+#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_base.h)!*/
+#include "SALOME_PYQT_ModuleLight.h"
+#include "SalomeApp_Module.h"
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_Component)
-class SALOME_PYQT_PyInterp;
-class SUIT_ViewWindow;
-class QAction;
-class QtxActionGroup;
-class QMenu;
-class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module
+
+class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module,
+ public SALOME_PYQT_ModuleLight
{
Q_OBJECT;
-private:
- class XmlHandler;
-
- //! study to Python subinterpreter map
- typedef QMap<int, SALOME_PYQT_PyInterp*> InterpMap;
-
- static InterpMap myInterpMap; //!< study to Python subinterpreter map
- SALOME_PYQT_PyInterp* myInterp; //!< current Python subinterpreter
- PyObjWrapper myModule; //!< Python GUI module
- static SALOME_PYQT_Module* myInitModule; //!< Python GUI being initialized (not zero only during the initialization)
-
- XmlHandler* myXmlHandler; //!< XML resource file parser
- QMap<int, int> myWindowsMap; //!< windows map
- QStringList myViewMgrList;//!< compatible view managers list
-
- bool myLastActivateStatus; //!< latest module activation status
-
public:
SALOME_PYQT_Module();
~SALOME_PYQT_Module();
-public:
- static SALOME_PYQT_Module* getInitModule();
-
- void initialize( CAM_Application* );
- void windows( QMap<int, int>& ) const;
- void viewManagers( QStringList& ) const;
- void contextMenuPopup( const QString&, QMenu*, QString& );
- void createPreferences();
- QString engineIOR() const;
- void studyActivated();
- void preferencesChanged( const QString&, const QString& );
-
- static int defaultMenuGroup();
-
- int createTool( const QString& );
- int createTool( const int, const int, const int = -1 );
- int createTool( const int, const QString&, const int = -1 );
- int createTool( QAction*, const int,
- const int = -1, const int = -1 );
- int createTool( QAction*, const QString&,
- const int = -1, const int = -1 );
-
- int createMenu( const QString&, const int,
- const int = -1, const int = -1, const int = -1 );
- int createMenu( const QString&, const QString&,
- const int = -1, const int = -1, const int = -1 );
- int createMenu( const int, const int,
- const int = -1, const int = -1 );
- int createMenu( const int, const QString&,
- const int = -1, const int = -1 );
- int createMenu( QAction*, const int,
- const int = -1, const int = -1, const int = -1 );
- int createMenu( QAction*, const QString&,
- const int = -1, const int = -1, const int = -1 );
-
- QAction* separator();
-
- QAction* action( const int ) const;
- int actionId( const QAction* ) const;
- QAction* createAction( const int, const QString&, const QString&,
- const QString&, const QString&, const int,
- const bool = false, QObject* = 0 );
- QtxActionGroup* createActionGroup( const int, const bool );
-
-
- QIcon loadIcon( const QString& fileName );
-
- int addGlobalPreference( const QString& );
- int addPreference( const QString& );
- int addPreference( const QString&, const int, const int = LightApp_Preferences::Auto,
- const QString& = QString(),
- const QString& = QString() );
- QVariant preferenceProperty( const int, const QString& ) const;
- void setPreferenceProperty( const int, const QString&,
- const QVariant& );
+ /* get module engine IOR */
+ virtual QString engineIOR() const;
public slots:
virtual bool activateModule( SUIT_Study* );
- virtual bool deactivateModule( SUIT_Study* );
void preferenceChanged( const QString&,
- const QString&,
- const QString& );
+ const QString&,
+ const QString& );
void onGUIEvent();
-
void onActiveViewChanged( SUIT_ViewWindow* );
void onViewClosed( SUIT_ViewWindow* );
+ void onViewTryClose( SUIT_ViewWindow* );
void onViewCloned( SUIT_ViewWindow* );
protected:
- Engines::Component_var getEngine() const;
+ /* create data model */
+ virtual CAM_DataModel* createDataModel();
-private:
- void init( CAM_Application* );
- void activate( SUIT_Study* );
- void deactivate( SUIT_Study* );
- bool lastActivationStatus() const;
- void customize( SUIT_Study* );
- void studyChanged( SUIT_Study* );
- void contextMenu( const QString&, QMenu* );
- void guiEvent( const int );
- void initPreferences();
- void prefChanged( const QString&, const QString& );
+ Engines::EngineComponent_var getEngine() const;
- void initInterp ( int );
- void importModule();
- void setWorkSpace();
-
- void activeViewChanged( const SUIT_ViewWindow* );
- void viewClosed( const SUIT_ViewWindow* );
- void viewCloned( const SUIT_ViewWindow* );
- void connectView( const SUIT_ViewWindow* );
+private:
+ void getEngineIOR();
- friend class XmlHandler;
+private:
+ QString myIOR;
};
#endif // SALOME_PYQT_MODULE_H
+++ /dev/null
-// Copyright (C) 2007-2008 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
-//
-// File : SALOME_PYQT_PyInterp.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_base.h)!
-#include <utilities.h>
-#include <Container_init_python.hxx>
-
-/*!
- * constructor : the main SALOME Python interpreter is used for PyQt GUI.
- * calls initialize method defined in base class, which calls virtual methods
- * initstate & initcontext redefined here
- */
-SALOME_PYQT_PyInterp::SALOME_PYQT_PyInterp(): PyInterp_Interp()
-{
-}
-
-SALOME_PYQT_PyInterp::~SALOME_PYQT_PyInterp()
-{
-}
-
-bool SALOME_PYQT_PyInterp::initState()
-{
- /*
- * The GIL is assumed to not be held on the call
- * The GIL is acquired in initState and will be held on initState exit
- * It is the caller responsability to release the lock on exit if needed
- */
- SCRUTE(KERNEL_PYTHON::_gtstate);
- _tstate = KERNEL_PYTHON::_gtstate;
- PyEval_AcquireThread(_tstate);
- SCRUTE(_tstate);
- PyEval_ReleaseThread(_tstate);
- return true;
-}
-
-bool SALOME_PYQT_PyInterp::initContext()
-{
- /*
- * The GIL is assumed to be held
- * It is the caller responsability to acquire the GIL before calling initContext
- * It will still be held on initContext exit
- */
- _g = PyDict_New(); // create interpreter dictionnary context
- PyObject *bimod = PyImport_ImportModule("__builtin__");
- PyDict_SetItemString(_g, "__builtins__", bimod);
- Py_DECREF(bimod);
- return true;
-}
-
-int SALOME_PYQT_PyInterp::run(const char *command)
-{
- MESSAGE("compile");
- PyObject *code = Py_CompileString((char *)command,"PyGUI",Py_file_input);
- if(!code){
- // Une erreur s est produite en general SyntaxError
- PyErr_Print();
- return -1;
- }
- //#if PY_VERSION_HEX < 0x02040000 // python version earlier than 2.4.0
- // PyObject *r = PyEval_EvalCode(code,_g,_g);
- //#else
- PyObject *r = PyEval_EvalCode((PyCodeObject *)code,_g,_g);
- //#endif
- Py_DECREF(code);
- if(!r){
- // Une erreur s est produite a l execution
- PyErr_Print();
- return -1 ;
- }
- Py_DECREF(r);
- return 0;
-}
+++ /dev/null
-// Copyright (C) 2007-2008 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
-//
-// File : SALOME_PYQT_PyInterp.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#ifndef SALOME_PYQT_PYINTERP_H
-#define SALOME_PYQT_PYINTERP_H
-
-#include "SALOME_PYQT_GUI.h"
-
-#include <PyInterp_Interp.h> // this include must be first (see PyInterp_base.h)!
-
-class SALOME_PYQT_EXPORT SALOME_PYQT_PyInterp : public PyInterp_Interp
-{
-public:
- SALOME_PYQT_PyInterp();
- ~SALOME_PYQT_PyInterp();
-
- int run( const char* );
-
-protected:
- virtual bool initState();
- virtual bool initContext();
-};
-
-#endif // SALOME_PYQT_PYINTERP_H
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Nicolas REJNERI
# Module : SALOME
MOC_FILES = SalomePyQt_moc.cxx
# compilation flags
-COMMON_CPP_FLAGS = $(QT_INCLUDES) $(QWT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES) \
- $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS) \
- -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -I$(top_builddir)/salomeadn/unix \
- -I$(srcdir) -I$(top_builddir)/idl \
- -I$(srcdir)/../../SUIT -I$(srcdir)/../../CAM -I$(srcdir)/../../STD \
- -I$(srcdir)/../../Qtx -I$(srcdir)/../../SalomeApp -I$(srcdir)/../../Event \
- -I$(srcdir)/../../SalomeSession -I$(srcdir)/../../LogWindow \
- -I$(srcdir)/../../VTKViewer -I$(srcdir)/../../TOOLSGUI \
- -I$(srcdir)/../../OCCViewer -I$(srcdir)/../../Plot2d \
- -I$(srcdir)/../SALOME_PYQT_GUI -I$(srcdir)/../../PyInterp \
- -I$(srcdir)/../../LightApp -I$(srcdir)/../../ObjBrowser \
- -I$(srcdir)/../../OBJECT \
- -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+COMMON_CPP_FLAGS = $(QT_INCLUDES) $(QWT_INCLUDES) $(SIP_INCLUDES) $(PYTHON_INCLUDES) \
+ $(CAS_CPPFLAGS) $(VTK_INCLUDES) $(OGL_INCLUDES) $(BOOST_CPPFLAGS) \
+ -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ -I$(top_builddir)/salomeadn/unix \
+ -I$(srcdir) -I$(top_builddir)/idl \
+ -I$(srcdir)/../../SUIT -I$(srcdir)/../../CAM -I$(srcdir)/../../STD \
+ -I$(srcdir)/../../Qtx -I$(srcdir)/../../Event \
+ -I$(srcdir)/../../LogWindow \
+ -I$(srcdir)/../../VTKViewer \
+ -I$(srcdir)/../../OCCViewer -I$(srcdir)/../../Plot2d \
+ -I$(srcdir)/../SALOME_PYQT_GUILight -I$(srcdir)/../../PyInterp \
+ -I$(srcdir)/../../LightApp -I$(srcdir)/../../ObjBrowser \
+ -I$(srcdir)/../../OBJECT
# linkage flags
-COMMON_LIBS = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(QWT_LIBS) \
- $(OGL_LIBS) ../../SUIT/libsuit.la ../../CAM/libCAM.la ../../STD/libstd.la \
- ../../Qtx/libqtx.la ../../SalomeApp/libSalomeApp.la ../../Event/libEvent.la \
- ../../Session/libSalomeSession.la ../../LogWindow/libLogWindow.la \
- ../../VTKViewer/libVTKViewer.la ../../TOOLSGUI/libToolsGUI.la \
- ../SALOME_PYQT_GUI/libSalomePyQtGUI.la ../../OCCViewer/libOCCViewer.la \
+COMMON_LIBS = $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(QWT_LIBS) \
+ $(OGL_LIBS) ../../SUIT/libsuit.la ../../CAM/libCAM.la ../../STD/libstd.la \
+ ../../Qtx/libqtx.la ../../Event/libEvent.la \
+ ../../LogWindow/libLogWindow.la \
+ ../../VTKViewer/libVTKViewer.la \
+ ../SALOME_PYQT_GUILight/libSalomePyQtGUILight.la ../../OCCViewer/libOCCViewer.la \
../../Plot2d/libPlot2d.la
# libraries targets
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SalomePyQt.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-#include <SALOME_PYQT_Module.h> // this include must be first!!!
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
+#include <SALOME_PYQT_ModuleLight.h> // this include must be first!!!
+#include <SALOME_PYQT_DataModelLight.h>
#include "SalomePyQt.h"
#include <QApplication>
#include <QtxActionMenuMgr.h>
#include <QtxActionGroup.h>
#include <QtxWorkstack.h>
+#include <QtxTreeView.h>
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Tools.h>
#include <SUIT_ViewManager.h>
#include <SUIT_ViewWindow.h>
+#include <SUIT_DataBrowser.h>
#include <STD_TabDesktop.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_Study.h>
#include <LightApp_SelectionMgr.h>
#include <LogWindow.h>
#include <OCCViewer_ViewWindow.h>
\internal
\return active application object or 0 if there is no any
*/
-static SalomeApp_Application* getApplication()
+static LightApp_Application* getApplication()
{
if ( SUIT_Session::session() )
- return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ return dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
return 0;
}
\internal
\return active study or 0 if there is no study opened
*/
-static SalomeApp_Study* getActiveStudy()
+static LightApp_Study* getActiveStudy()
{
if ( getApplication() )
- return dynamic_cast<SalomeApp_Study*>( getApplication()->activeStudy() );
+ return dynamic_cast<LightApp_Study*>( getApplication()->activeStudy() );
return 0;
}
This function returns correct result only if Python-based
module is currently active. Otherwize, 0 is returned.
*/
-static SALOME_PYQT_Module* getActiveModule()
+static SALOME_PYQT_ModuleLight* getActiveModule()
{
- SALOME_PYQT_Module* module = 0;
- if ( SalomeApp_Application* anApp = getApplication() ) {
- module = SALOME_PYQT_Module::getInitModule();
+ SALOME_PYQT_ModuleLight* module = 0;
+ if ( LightApp_Application* anApp = getApplication() ) {
+ module = SALOME_PYQT_ModuleLight::getInitModule();
if ( !module )
- module = dynamic_cast<SALOME_PYQT_Module*>( anApp->activeModule() );
+ module = dynamic_cast<SALOME_PYQT_ModuleLight*>( anApp->activeModule() );
}
return module;
}
\brief Map of created selection objects.
\internal
*/
-static QMap<SalomeApp_Application*, SALOME_Selection*> SelMap;
+static QMap<LightApp_Application*, SALOME_Selection*> SelMap;
/*!
\brief Get the selection object for the specified application.
\param app application object
\return selection object or 0 if \a app is invalid
*/
-SALOME_Selection* SALOME_Selection::GetSelection( SalomeApp_Application* app )
+SALOME_Selection* SALOME_Selection::GetSelection( LightApp_Application* app )
{
SALOME_Selection* sel = 0;
if ( app && SelMap.find( app ) != SelMap.end() )
\brief Constructor.
\param p parent object
*/
-SALOME_Selection::SALOME_Selection( QObject* p ) : QObject( p ), mySelMgr( 0 )
+SALOME_Selection::SALOME_Selection( QObject* p ) : QObject( 0 ), mySelMgr( 0 )
{
- SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( p );
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>( p );
if ( app ) {
mySelMgr = app->selectionMgr();
connect( mySelMgr, SIGNAL( selectionChanged() ), this, SIGNAL( currentSelectionChanged() ) );
connect( mySelMgr, SIGNAL( destroyed() ), this, SLOT ( onSelMgrDestroyed() ) );
}
}
+
/*!
\brief Destructor.
*/
SALOME_Selection::~SALOME_Selection()
{
- SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( parent() );
- if ( app && SelMap.find( app ) != SelMap.end() )
- SelMap.remove( app );
+ LightApp_Application* app = 0;
+ QMap<LightApp_Application*, SALOME_Selection*>::Iterator it;
+ for ( it = SelMap.begin(); it != SelMap.end() && !app; ++it ) {
+ if ( it.value() == this ) app = it.key();
+ }
+ if ( app ) SelMap.remove( app );
}
/*!
TGetMainMenuBarEvent() : myResult( 0 ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
myResult = anApp->desktop()->menuBar();
}
}
}
/*!
- QMenu* SalomePyQt::getPopupMenu( const MenuName menu );
+ \fn QMenu* SalomePyQt::getPopupMenu( const MenuName menu );
\brief Get main menu's child popup submenu by its identifier.
This function is obsolete.
*/
/*!
- QMenu* SalomePyQt::getPopupMenu( const QString& menu );
+ \fn QMenu* SalomePyQt::getPopupMenu( const QString& menu );
\brief Get main menu's child popup submenu by its name.
The function creates menu if it does not exist.
TGetPopupMenuEvent( const QString& menu ) : myResult( 0 ), myMenuName( menu ) {}
virtual void Execute()
{
- SalomeApp_Application* anApp = getApplication();
+ LightApp_Application* anApp = getApplication();
if ( anApp && !myMenuName.isEmpty() ) {
QtxActionMenuMgr* mgr = anApp->desktop()->menuMgr();
myResult = mgr->findMenu( myMenuName, -1, false ); // search only top menu
}
};
+/*!
+ \brief Get menu item title
+ \internal
+ \param menuId menu identifier
+ \return menu title (localized)
+*/
static QString getMenuName( const QString& menuId )
{
QStringList contexts;
return ProcessEvent( new TGetPopupMenuEvent( menu ) );
}
+/*!
+ \fn QTreeView* SalomePyQt::getObjectBrowser();
+ \brief Get object browser
+ \return object browser for the active study or 0 in case of error
+*/
+
+class TGetObjectBrowserEvent: public SALOME_Event
+{
+public:
+ typedef QTreeView* TResult;
+ TResult myResult;
+ TGetObjectBrowserEvent() : myResult( 0 ) {}
+ virtual void Execute()
+ {
+ LightApp_Application* anApp = getApplication();
+ if ( anApp ) {
+ myResult = anApp->objectBrowser()->treeView();
+ }
+ }
+};
+QTreeView* SalomePyQt::getObjectBrowser()
+{
+ return ProcessEvent( new TGetObjectBrowserEvent() );
+}
+
/*!
\fn int SalomePyQt::getStudyId();
\brief Get active study's identifier.
TGetStudyIdEvent() : myResult( 0 ) {}
virtual void Execute()
{
- if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
- myResult = aStudy->studyDS()->StudyId();
+ if ( LightApp_Study* aStudy = getActiveStudy() ) {
+ myResult = aStudy->id();
}
}
};
TPutInfoEvent( const QString& msg, const int sec = 0 ) : myMsg( msg ), mySecs( sec ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
anApp->putInfo( myMsg, mySecs * 1000 );
}
}
TGetActiveComponentEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
if ( CAM_Module* mod = anApp->activeModule() ) {
myResult = mod->name();
}
return ProcessEvent( new TGetActiveComponentEvent() );
}
+/*!
+ \fn PyObject* SalomePyQt::getActivePythonModule()
+ \brief Access to Python module object currently loaded into SALOME_PYQT_ModuleLight container.
+ \return Python module object currently loaded into SALOME_PYQT_ModuleLight container
+*/
+
+class TGetActivePyModuleEvent: public SALOME_Event
+{
+public:
+ typedef PyObject* TResult;
+ TResult myResult;
+ TGetActivePyModuleEvent() : myResult( 0 ) {}
+ virtual void Execute()
+ {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = (PyObject*)module->getPythonModule();
+ }
+};
+PyObject* SalomePyQt::getActivePythonModule()
+{
+ return ProcessEvent( new TGetActivePyModuleEvent() );
+}
+
+/*!
+ \fn bool SalomePyQt::activateModule( const QString& modName )
+ \brief Activates SALOME module with the given name
+ \return True if the module has been activated and False otherwise.
+*/
+
+class TActivateModuleEvent: public SALOME_Event
+{
+public:
+ typedef bool TResult;
+ TResult myResult;
+ QString myModuleName;
+ TActivateModuleEvent( const QString& modName )
+ : myResult( false ), myModuleName( modName ) {}
+ virtual void Execute()
+ {
+ if ( LightApp_Application* anApp = getApplication() ) {
+ myResult = anApp->activateModule( myModuleName );
+ }
+ }
+};
+bool SalomePyQt::activateModule( const QString& modName )
+{
+ return ProcessEvent( new TActivateModuleEvent( modName ) );
+}
+
/*!
\brief Update an Object Browser of the specified (by identifier) study.
if ( SUIT_Session::session() ) {
if ( getActiveStudy() && myStudyId <= 0 )
myStudyId = getActiveStudy()->id();
- if ( myStudyId > 0 ) {
+ if ( myStudyId > 0 ) {
QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
QList<SUIT_Application*>::Iterator it;
- for( it = apps.begin(); it != apps.end(); ++it ) {
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( *it );
+ for( it = apps.begin(); it != apps.end(); ++it ) {
+ LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( *it );
if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) {
- anApp->updateObjectBrowser();
- return;
- }
+ anApp->updateObjectBrowser();
+ return;
+ }
}
}
}
ProcessVoidEvent( new TEvent( studyId, updateSelection ) );
}
+
+/*!
+ SalomePyQt::isModified()
+ \return The modification status of the data model
+ for the currently active Python module
+ \sa setModified()
+*/
+class TIsModifiedEvent: public SALOME_Event
+{
+public:
+ typedef bool TResult;
+ TResult myResult;
+ TIsModifiedEvent() : myResult( false ) {}
+ virtual void Execute()
+ {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( !module )
+ return;
+
+ SALOME_PYQT_DataModelLight* aModel =
+ dynamic_cast<SALOME_PYQT_DataModelLight*>( module->dataModel() );
+ if ( aModel )
+ myResult = aModel->isModified();
+ }
+};
+bool SalomePyQt::isModified()
+{
+ return ProcessEvent(new TIsModifiedEvent());
+}
+
+/*!
+ SalomePyQt::setModified()
+
+ Sets the modification status of the data model for
+ the currently active Python module. This method should be used
+ by the Python code in order to enable/disable "Save" operation
+ depending on the module's data state.
+
+ \param New modification status of the data model
+
+ \sa isModified()
+*/
+void SalomePyQt::setModified( bool flag )
+{
+ class TEvent: public SALOME_Event
+ {
+ bool myFlag;
+ public:
+ TEvent( bool flag )
+ : myFlag( flag ) {}
+ virtual void Execute()
+ {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( !module )
+ return;
+
+ SALOME_PYQT_DataModelLight* aModel =
+ dynamic_cast<SALOME_PYQT_DataModelLight*>( module->dataModel() );
+ LightApp_Application* aLApp =
+ dynamic_cast<LightApp_Application*>( module->application() );
+ if ( !aModel || !aLApp )
+ return;
+
+ aModel->setModified( myFlag );
+ aLApp->updateActions();
+ }
+ };
+ ProcessVoidEvent( new TEvent( flag ) );
+}
+
/*!
\brief Default resource file section name.
\internal
virtual void Execute() {
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QStringList sl = myName.split( ":", QString::SkipEmptyParts );
- QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
- QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
- if ( !_sec.isEmpty() && !_nam.isEmpty() )
+ QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+ QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+ QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+ if ( !_sec.isEmpty() && !_nam.isEmpty() )
resMgr->setValue( _sec, _nam, myValue );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QStringList sl = myName.split( ":", QString::SkipEmptyParts );
- QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
- QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
- if ( !_sec.isEmpty() && !_nam.isEmpty() )
+ QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+ QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+ QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+ if ( !_sec.isEmpty() && !_nam.isEmpty() )
resMgr->setValue( _sec, _nam, myValue );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QStringList sl = myName.split( ":", QString::SkipEmptyParts );
- QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
- QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
- if ( !_sec.isEmpty() && !_nam.isEmpty() )
+ QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+ QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+ QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+ if ( !_sec.isEmpty() && !_nam.isEmpty() )
resMgr->setValue( _sec, _nam, myValue );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QStringList sl = myName.split( ":", QString::SkipEmptyParts );
- QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
- QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
- if ( !_sec.isEmpty() && !_nam.isEmpty() )
+ QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+ QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+ QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+ if ( !_sec.isEmpty() && !_nam.isEmpty() )
resMgr->setValue( _sec, _nam, myValue );
}
}
virtual void Execute() {
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QStringList sl = myName.split( ":", QString::SkipEmptyParts );
- QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
- QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
- if ( !_sec.isEmpty() && !_nam.isEmpty() )
+ QStringList sl = myName.split( ":", QString::SkipEmptyParts );
+ QString _sec = sl.count() > 1 ? sl[ 0 ].trimmed() : QString( DEFAULT_SECTION );
+ QString _nam = sl.count() > 1 ? sl[ 1 ].trimmed() : sl.count() > 0 ? sl[ 0 ].trimmed() : QString( "" );
+ if ( !_sec.isEmpty() && !_nam.isEmpty() )
resMgr->remove( _sec, _nam );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- if ( !mySection.isEmpty() && !myName.isEmpty() )
+ if ( !mySection.isEmpty() && !myName.isEmpty() )
resMgr->setValue( mySection, myName, myValue );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- if ( !mySection.isEmpty() && !myName.isEmpty() )
+ if ( !mySection.isEmpty() && !myName.isEmpty() )
resMgr->setValue( mySection, myName, myValue );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- if ( !mySection.isEmpty() && !myName.isEmpty() )
+ if ( !mySection.isEmpty() && !myName.isEmpty() )
resMgr->setValue( mySection, myName, myValue );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- if ( !mySection.isEmpty() && !myName.isEmpty() )
+ if ( !mySection.isEmpty() && !myName.isEmpty() )
resMgr->setValue( mySection, myName, myValue );
}
}
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- if ( !mySection.isEmpty() && !myName.isEmpty() )
+ if ( !mySection.isEmpty() && !myName.isEmpty() )
resMgr->setValue( mySection, myName, myValue );
}
}
/*!
\fn int SalomePyQt::integerSetting( const QString& section,
const QString& name,
- const int def );
+ const int def );
\brief Get integer setting from the application preferences.
\param section resources file section name
\param name setting name
/*!
\fn double SalomePyQt::doubleSetting( const QString& section,
const QString& name,
- const double def );
+ const double def );
\brief Get double setting from the application preferences.
\param section resources file section name
\param name setting name
/*!
\fn bool SalomePyQt::boolSetting( const QString& section,
const QString& name,
- const bool def );
+ const bool def );
\brief Get boolean setting from the application preferences.
\param section resources file section name
\param name setting name
/*!
\fn QString SalomePyQt::stringSetting( const QString& section,
const QString& name,
- const QString& def );
+ const QString& def );
\brief Get string setting from the application preferences.
\param section resources file section name
\param name setting name
/*!
\fn QColor SalomePyQt::colorSetting( const QString& section,
const QString& name,
- const QColor def );
+ const QColor def );
\brief Get color setting from the application preferences.
\param section resources file section name
\param name setting name
{
if ( SUIT_Session::session() ) {
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- if ( !mySection.isEmpty() && !myName.isEmpty() )
+ if ( !mySection.isEmpty() && !myName.isEmpty() )
resMgr->remove( mySection, myName );
}
}
/*!
\fn QString SalomePyQt::getFileName( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption,
- bool open );
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption,
+ bool open );
\brief Show 'Open/Save file' dialog box for file selection
and return a user's choice (selected file name).
\param parent parent widget
QString myCaption;
bool myOpen;
TGetFileNameEvent( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption,
- bool open )
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption,
+ bool open )
: myParent ( parent ),
myInitial( initial ),
myFilters( filters ),
myOpen ( open ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
myResult = anApp->getFileName( myOpen, myInitial, myFilters.join(";;"),
- myCaption, myParent );
+ myCaption, myParent );
}
}
};
QString SalomePyQt::getFileName( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption,
- bool open )
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption,
+ bool open )
{
return ProcessEvent( new TGetFileNameEvent( parent, initial, filters, caption, open ) );
}
/*!
\fn QStringList SalomePyQt::getOpenFileNames( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption );
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption );
\brief Show 'Open files' dialog box for multiple files selection
and return a user's choice (selected file names list).
\param parent parent widget
QStringList myFilters;
QString myCaption;
TGetOpenFileNamesEvent( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption )
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption )
: myParent ( parent ),
myInitial( initial ),
myFilters( filters ),
myCaption( caption ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
myResult = anApp->getOpenFileNames( myInitial, myFilters.join(";;"), myCaption, myParent );
}
}
};
QStringList SalomePyQt::getOpenFileNames( QWidget* parent,
- const QString& initial,
- const QStringList& filters,
- const QString& caption )
+ const QString& initial,
+ const QStringList& filters,
+ const QString& caption )
{
return ProcessEvent( new TGetOpenFileNamesEvent( parent, initial, filters, caption ) );
}
/*!
\fn QString SalomePyQt::getExistingDirectory( QWidget* parent,
- const QString& initial,
- const QString& caption );
+ const QString& initial,
+ const QString& caption );
\brief Show 'Get Directory' dialog box for the directory selection
and return a user's choice (selected directory name).
\param parent parent widget
QString myInitial;
QString myCaption;
TGetExistingDirectoryEvent( QWidget* parent,
- const QString& initial,
- const QString& caption )
+ const QString& initial,
+ const QString& caption )
: myParent ( parent ),
myInitial( initial ),
myCaption( caption ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
myResult = anApp->getDirectory( myInitial, myCaption, myParent );
}
}
};
QString SalomePyQt::getExistingDirectory( QWidget* parent,
- const QString& initial,
- const QString& caption )
+ const QString& initial,
+ const QString& caption )
{
return ProcessEvent( new TGetExistingDirectoryEvent( parent, initial, caption ) );
}
+/*!
+ \fn QString SalomePyQt::loadIcon( const QString& filename );
+ \brief Load an icon from the module resources by the specified file name.
+ \param filename icon file name
+ \return icon object
+*/
+class TLoadIconEvent: public SALOME_Event
+{
+public:
+ typedef QIcon TResult;
+ TResult myResult;
+ QString myModule;
+ QString myFileName;
+ TLoadIconEvent( const QString& module, const QString& filename )
+ : myModule( module ),
+ myFileName ( filename ) {}
+ virtual void Execute()
+ {
+ if ( LightApp_Application* anApp = getApplication() ) {
+ if ( !myFileName.isEmpty() ) {
+ QPixmap pixmap = anApp->resourceMgr()->loadPixmap( myModule,
+ QApplication::translate( myModule.toLatin1().data(),
+ myFileName.toLatin1().data() ) );
+ if ( !pixmap.isNull() )
+ myResult = QIcon( pixmap );
+ }
+ }
+ }
+};
+QIcon SalomePyQt::loadIcon( const QString& module, const QString& filename )
+{
+ return ProcessEvent( new TLoadIconEvent( module, filename ) );
+}
+
/*!
\brief Open external browser to display context help information.
\todo
: mySource( source ), myContext( context ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
anApp->onHelpContextModule( "", mySource, myContext );
}
}
: myResult ( false ), myFileName( filename ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
SUIT_ViewManager* vm = anApp->activeViewManager();
if ( vm ) {
SUIT_ViewWindow* vw = vm->getActiveView();
- if ( vw ) {
+ if ( vw ) {
QImage im = vw->dumpView();
- if ( !im.isNull() && !myFileName.isEmpty() ) {
+ if ( !im.isNull() && !myFileName.isEmpty() ) {
QString fmt = SUIT_Tools::extension( myFileName ).toUpper();
- if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format
- if ( fmt == "JPG" ) fmt = "JPEG";
- myResult = im.save( myFileName, fmt.toLatin1() );
+ if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format
+ if ( fmt == "JPG" ) fmt = "JPEG";
+ myResult = im.save( myFileName, fmt.toLatin1() );
}
- }
+ }
}
}
}
TDefMenuGroupEvent() : myResult( -1 ) {}
virtual void Execute()
{
- myResult = SALOME_PYQT_Module::defaultMenuGroup();
+ myResult = SALOME_PYQT_ModuleLight::defaultMenuGroup();
}
};
int SalomePyQt::defaultMenuGroup()
CrTool( QAction* action, const QString& tBar, const int id, const int idx )
: myCase( 4 ), myAction( action ), myTbName( tBar ), myId( id ), myIndex( idx ) {}
- int execute( SALOME_PYQT_Module* module ) const
+ int execute( SALOME_PYQT_ModuleLight* module ) const
{
if ( module ) {
switch ( myCase ) {
: myResult( -1 ), myCrTool( crTool ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = myCrTool.execute( module );
}
CrMenu( QAction* action, const QString& menu, const int id, const int group, const int idx )
: myCase( 5 ), myAction( action ), myMenuName( menu ), myId( id ), myGroup( group ), myIndex( idx ) {}
- int execute( SALOME_PYQT_Module* module ) const
+ int execute( LightApp_Module* module ) const
{
if ( module ) {
switch ( myCase ) {
: myResult( -1 ), myCrMenu( crMenu ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
- if ( module )
- myResult = myCrMenu.execute( module );
+ if ( LightApp_Application* anApp = getApplication() )
+ {
+ LightApp_Module* module = dynamic_cast<LightApp_Module*>( anApp->activeModule() );
+ if ( module )
+ myResult = myCrMenu.execute( module );
+ }
}
};
: myResult( 0 ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = (QAction*)module->separator();
}
/*!
\fn QAction* SalomePyQt::createAction( const int id,
const QString& menuText,
- const QString& tipText,
- const QString& statusText,
- const QString& icon,
- const int key,
- const bool toggle )
+ const QString& tipText,
+ const QString& statusText,
+ const QString& icon,
+ const int key,
+ const bool toggle )
\brief Create an action which can be then used in the menu or toolbar.
\param id the unique id action to be registered to
\param menuText action text which should appear in menu
int myKey;
bool myToggle;
TCreateActionEvent( const int id, const QString& menuText, const QString& tipText,
- const QString& statusText, const QString& icon, const int key, const bool toggle )
+ const QString& statusText, const QString& icon, const int key, const bool toggle )
: myResult( 0 ), myId( id ), myMenuText( menuText ), myTipText( tipText ),
myStatusText( statusText ), myIcon( icon ), myKey( key ), myToggle( toggle ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = (QAction*)module->createAction( myId, myTipText, myIcon, myMenuText, myStatusText, myKey, myToggle );
}
};
QAction* SalomePyQt::createAction( const int id, const QString& menuText,
- const QString& tipText, const QString& statusText,
- const QString& icon, const int key, const bool toggle )
+ const QString& tipText, const QString& statusText,
+ const QString& icon, const int key, const bool toggle )
{
return ProcessEvent( new TCreateActionEvent( id, menuText, tipText, statusText, icon, key, toggle ) );
}
: myId( id ), myExclusive( exclusive ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = module->createActionGroup( myId, myExclusive );
}
: myResult( 0 ), myId( id ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = (QAction*)module->action( myId );
}
: myResult( -1 ), myAction( action ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = module->actionId( myAction );
}
: myResult( -1 ), myLabel( label ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = module->addGlobalPreference( myLabel );
}
: myResult( -1 ), myLabel( label ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = module->addPreference( myLabel );
}
/*!
\fn int SalomePyQt::addPreference( const QString& label, const int pId, const int type,
- const QString& section, const QString& param );
+ const QString& section, const QString& param );
\brief Add module-related preferences.
\param label preferences group name
\param pId parent preferences group id
QString mySection;
QString myParam;
TAddPrefParamEvent( const QString& label,
- const int pId, const int type,
- const QString& section,
- const QString& param )
+ const int pId, const int type,
+ const QString& section,
+ const QString& param )
: myResult( -1 ),
myLabel( label ), myPId( pId ), myType( type ),
mySection( section ), myParam ( param ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = module->addPreference( myLabel, myPId, myType, mySection, myParam );
}
};
int SalomePyQt::addPreference( const QString& label, const int pId, const int type,
- const QString& section, const QString& param )
+ const QString& section, const QString& param )
{
return ProcessEvent( new TAddPrefParamEvent( label, pId, type, section, param ) );
}
: myId( id ), myProp( prop ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
myResult = module->preferenceProperty( myId, myProp );
}
\param var preferences property value
*/
void SalomePyQt::setPreferenceProperty( const int id,
- const QString& prop,
- const QVariant& var )
+ const QString& prop,
+ const QVariant& var )
{
class TEvent: public SALOME_Event
{
: myId( id ), myProp( prop ), myVar( var ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module )
- module->setPreferenceProperty( myId, myProp, myVar );
+ module->setPreferenceProperty( myId, myProp, myVar );
}
};
ProcessVoidEvent( new TEvent( id, prop, var) );
\param var preferences property value for the index \a idx
*/
void SalomePyQt::addPreferenceProperty( const int id,
- const QString& prop,
- const int idx,
- const QVariant& var )
+ const QString& prop,
+ const int idx,
+ const QVariant& var )
{
class TEvent: public SALOME_Event
{
: myId( id ), myProp( prop ), myIdx( idx), myVar( var ) {}
virtual void Execute()
{
- SALOME_PYQT_Module* module = getActiveModule();
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
if ( module ) {
- QVariant var = module->preferenceProperty( myId, myProp );
- if ( var.isValid() ) {
- if ( var.type() == QVariant::StringList ) {
- QStringList sl = var.toStringList();
- if ( myIdx >= 0 && myIdx < sl.count() )
- sl[myIdx] = myVar.toString();
- else
- sl.append( myVar.toString() );
- module->setPreferenceProperty( myId, myProp, sl );
- }
- else if ( var.type() == QVariant::List ) {
- QList<QVariant> vl = var.toList();
- if ( myIdx >= 0 && myIdx < vl.count() )
- vl[myIdx] = myVar;
- else
- vl.append( myVar );
- module->setPreferenceProperty( myId, myProp, vl );
- }
- }
- else {
- QList<QVariant> vl;
- vl.append( myVar );
- module->setPreferenceProperty( myId, myProp, vl );
- }
+ QVariant var = module->preferenceProperty( myId, myProp );
+ if ( var.isValid() ) {
+ if ( var.type() == QVariant::StringList ) {
+ QStringList sl = var.toStringList();
+ if ( myIdx >= 0 && myIdx < sl.count() )
+ sl[myIdx] = myVar.toString();
+ else
+ sl.append( myVar.toString() );
+ module->setPreferenceProperty( myId, myProp, sl );
+ }
+ else if ( var.type() == QVariant::List ) {
+ QList<QVariant> vl = var.toList();
+ if ( myIdx >= 0 && myIdx < vl.count() )
+ vl[myIdx] = myVar;
+ else
+ vl.append( myVar );
+ module->setPreferenceProperty( myId, myProp, vl );
+ }
+ }
+ else {
+ QList<QVariant> vl;
+ vl.append( myVar );
+ module->setPreferenceProperty( myId, myProp, vl );
+ }
}
}
};
: myMsg( msg ), myAddSep( addSeparator ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- LogWindow* lw = anApp->logWindow();
- if ( lw )
- lw->putMessage( myMsg, myAddSep );
+ if ( LightApp_Application* anApp = getApplication() ) {
+ LogWindow* lw = anApp->logWindow();
+ if ( lw )
+ lw->putMessage( myMsg, myAddSep );
}
}
};
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- LogWindow* lw = anApp->logWindow();
- if ( lw )
- lw->clear();
+ if ( LightApp_Application* anApp = getApplication() ) {
+ LogWindow* lw = anApp->logWindow();
+ if ( lw )
+ lw->clear();
}
}
};
{
SUIT_ViewWindow* resWnd = 0;
- SalomeApp_Application* app = getApplication();
+ LightApp_Application* app = getApplication();
if ( app )
{
- STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
- if ( tabDesk )
+ ViewManagerList vmlist = app->viewManagers();
+ foreach( SUIT_ViewManager* vm, vmlist )
{
- QList<SUIT_ViewWindow*> wndlist = tabDesk->windows();
- SUIT_ViewWindow* wnd;
- foreach ( wnd, wndlist )
+ QVector<SUIT_ViewWindow*> vwlist = vm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist )
{
- if ( id == wnd->getId() )
+ if ( id == vw->getId() )
{
- resWnd = wnd;
+ resWnd = vw;
break;
}
}
virtual void Execute()
{
myResult.clear();
- SalomeApp_Application* app = getApplication();
+ LightApp_Application* app = getApplication();
if ( app )
{
STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
: myResult( -1 ) {}
virtual void Execute()
{
- SalomeApp_Application* app = getApplication();
+ LightApp_Application* app = getApplication();
if ( app )
{
SUIT_ViewManager* viewMgr = app->activeViewManager();
virtual void Execute()
{
myResult.clear();
- SalomeApp_Application* app = getApplication();
+ LightApp_Application* app = getApplication();
if ( app )
{
ViewManagerList vmList;
myType( theType ) {}
virtual void Execute()
{
- SalomeApp_Application* app = getApplication();
+ LightApp_Application* app = getApplication();
if ( app )
{
SUIT_ViewManager* viewMgr = app->createViewManager( myType );
return ProcessEvent( new TCreateView( type ) );
}
+/*!
+ \fn int SalomePyQt::createView( const QString& type, QWidget* w )
+ \brief Create new view with custom widget embedded and activate it
+ \param type viewer type
+ \param w custom widget
+ \return integer identifier of created view (or -1 if view could not be created)
+*/
+
+class TCreateViewWg: public SALOME_Event
+{
+public:
+ typedef int TResult;
+ TResult myResult;
+ QString myType;
+ QWidget* myWidget;
+ TCreateViewWg( const QString& theType, QWidget* w )
+ : myResult( -1 ),
+ myType( theType ),
+ myWidget( w ) {}
+ virtual void Execute()
+ {
+ LightApp_Application* app = getApplication();
+ if ( app )
+ {
+ SUIT_ViewManager* viewMgr = app->createViewManager( myType, myWidget );
+ if ( viewMgr )
+ {
+ SUIT_ViewWindow* wnd = viewMgr->getActiveView();
+ if ( wnd )
+ myResult = wnd->getId();
+ }
+ }
+ }
+};
+int SalomePyQt::createView( const QString& type, QWidget* w )
+{
+ return ProcessEvent( new TCreateViewWg( type, w ) );
+}
+
/*!
\fn bool SalomePyQt::closeView( const int id )
\brief Close view
return ProcessEvent( new TIsViewVisible( id ) );
}
+/*!
+ \fn bool SalomePyQt::setViewClosable( const int id, const bool on )
+ \brief Set / clear view's "closable" option. By default any view is closable
+ (i.e. can be closed by the user).
+ \param id window identifier
+ \param on new "closable" option's value
+*/
+
+void SalomePyQt::setViewClosable( const int id, const bool on )
+{
+ class TEvent: public SALOME_Event
+ {
+ int myWndId;
+ bool myOn;
+ public:
+ TEvent( const int id, const bool on )
+ : myWndId( id ), myOn( on ) {}
+ virtual void Execute()
+ {
+ SUIT_ViewWindow* wnd = getWnd( myWndId );
+ if ( wnd ) wnd->setClosable( myOn );
+ }
+ };
+ ProcessVoidEvent( new TEvent( id, on ) );
+}
+
+/*!
+ \fn bool SalomePyQt::isViewClosable( const int id )
+ \brief Check whether view is closable (i.e. can be closed by the user)
+ \param id window identifier
+ \return \c true if view is closable or \c false otherwise
+*/
+
+class TIsViewClosable: public SALOME_Event
+{
+public:
+ typedef bool TResult;
+ TResult myResult;
+ int myWndId;
+ TIsViewClosable( const int id )
+ : myResult( true ),
+ myWndId( id ) {}
+ virtual void Execute()
+ {
+ SUIT_ViewWindow* wnd = getWnd( myWndId );
+ if ( wnd )
+ myResult = wnd->closable();
+ }
+};
+
+bool SalomePyQt::isViewClosable( const int id )
+{
+ return ProcessEvent( new TIsViewClosable( id ) );
+}
+
/*!
\fn bool SalomePyQt::groupAllViews()
\brief Group all views to the single tab area
: myResult( false ) {}
virtual void Execute()
{
- SalomeApp_Application* app = getApplication();
+ LightApp_Application* app = getApplication();
if ( app )
{
STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>( app->desktop() );
{
return ProcessEvent( new TNeighbourViews( id ) );
}
+
+
+/*!
+ SalomePyQt::createObject(parent)
+ Create empty data object
+*/
+class TCreateEmptyObjectEvent: public SALOME_Event {
+public:
+ typedef QString TResult;
+ TResult myResult;
+ QString myParent;
+ TCreateEmptyObjectEvent(const QString& parent) : myParent( parent ) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = (QString)module->createObject(myParent);
+ }
+};
+QString SalomePyQt::createObject(const QString& parent)
+{
+ return ProcessEvent( new TCreateEmptyObjectEvent(parent) );
+}
+
+/*!
+ SalomePyQt::createObject( name, icon, tooltip, parent )
+ Create data object with name, icon and tooltip
+*/
+class TCreateObjectEvent: public SALOME_Event {
+public:
+ typedef QString TResult;
+ TResult myResult;
+ QString myParent;
+ QString myName;
+ QString myIconName;
+ QString myToolTip;
+ TCreateObjectEvent(const QString& name,
+ const QString& iconname,
+ const QString& tooltip,
+ const QString& parent) : myName(name),
+ myIconName(iconname),
+ myToolTip(tooltip),
+ myParent( parent ){}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = (QString)module->createObject(myName, myIconName,
+ myToolTip, myParent);
+ }
+};
+QString SalomePyQt::createObject(const QString& name,
+ const QString& iconname,
+ const QString& tooltip,
+ const QString& parent)
+{
+ return ProcessEvent( new TCreateObjectEvent(name, iconname, tooltip, parent) );
+}
+
+
+/*!
+ SalomePyQt::setName(obj,name)
+ Set object name
+*/
+class TSetNameEvent: public SALOME_Event
+{
+public:
+ QString myObj;
+ QString myName;
+ TSetNameEvent( const QString& obj,
+ const QString& name) : myObj(obj),
+ myName(name) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ module->setName(myObj,myName);
+ }
+};
+void SalomePyQt::setName(const QString& obj,const QString& name)
+{
+ ProcessVoidEvent(new TSetNameEvent(obj,name));
+}
+
+
+/*!
+ SalomePyQt::setIcon(obj,icon)
+ Set object icon
+*/
+class TSetIconEvent: public SALOME_Event
+{
+public:
+ QString myObj;
+ QString myIconName;
+ TSetIconEvent( const QString& obj,
+ const QString& iconname) : myObj(obj),
+ myIconName(iconname) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ module->setIcon(myObj,myIconName);
+ }
+};
+
+void SalomePyQt::setIcon(const QString& obj,const QString& iconname)
+{
+ ProcessVoidEvent(new TSetIconEvent(obj,iconname));
+}
+
+/*!
+ SalomePyQt::setToolTip(obj,tooltip)
+ Set object tool tip
+*/
+class TSetToolTipEvent: public SALOME_Event
+{
+public:
+ QString myObj;
+ QString myToolTip;
+ TSetToolTipEvent( const QString& obj,
+ const QString& tooltip) : myObj(obj),
+ myToolTip(tooltip) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ module->setToolTip(myObj,myToolTip);
+ }
+};
+void SalomePyQt::setToolTip(const QString& obj,const QString& tooltip)
+{
+ ProcessVoidEvent(new TSetToolTipEvent(obj,tooltip));
+}
+
+/*!
+ SalomePyQt::setReference(obj,refEntry)
+ Set entry to referenced object
+*/
+class TSetRefEvent: public SALOME_Event
+{
+public:
+ QString myObj;
+ QString myRefEntry;
+ TSetRefEvent( const QString& obj,
+ const QString& refEntry) : myObj(obj),
+ myRefEntry(refEntry) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ module->setReference(myObj,myRefEntry);
+ }
+};
+void SalomePyQt::setReference(const QString& obj,const QString& refEntry)
+{
+ ProcessVoidEvent(new TSetRefEvent(obj,refEntry));
+}
+
+/*!
+ SalomePyQt::setColor(obj,color)
+ Set object color
+*/
+class TSetColorEvent: public SALOME_Event
+{
+public:
+ QString myObj;
+ QColor myColor;
+ TSetColorEvent( const QString& obj,
+ const QColor& color) : myObj(obj),
+ myColor(color) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ module->setColor(myObj,myColor);
+ }
+};
+void SalomePyQt::setColor(const QString& obj,const QColor& color)
+{
+ ProcessVoidEvent(new TSetColorEvent(obj,color));
+}
+
+/*!
+ SalomePyQt::getName(obj)
+ Return name of object
+*/
+class TGetNameEvent: public SALOME_Event
+{
+public:
+ typedef QString TResult;
+ TResult myResult;
+ QString myObj;
+ TGetNameEvent( const QString& obj ) : myObj(obj) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = (QString) module->getName(myObj);
+ }
+};
+
+QString SalomePyQt::getName(const QString& obj)
+{
+ return ProcessEvent(new TGetNameEvent(obj));
+}
+
+/*!
+ SalomePyQt::getToolTip(obj)
+ Return tool tip of object
+*/
+class TGetToolTipEvent: public SALOME_Event
+{
+public:
+ typedef QString TResult;
+ TResult myResult;
+ QString myObj;
+ TGetToolTipEvent( const QString& obj ) : myObj(obj) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = (QString)module->getToolTip(myObj);
+ }
+};
+QString SalomePyQt::getToolTip(const QString& obj)
+{
+ return ProcessEvent(new TGetToolTipEvent(obj));
+}
+
+/*!
+ SalomePyQt::getReference(obj)
+ Return entry of the referenced object (if any)
+*/
+class TGetRefEvent: public SALOME_Event
+{
+public:
+ typedef QString TResult;
+ TResult myResult;
+ QString myObj;
+ TGetRefEvent( const QString& obj ) : myObj(obj) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = module->getReference(myObj);
+ }
+};
+QString SalomePyQt::getReference(const QString& obj)
+{
+ return ProcessEvent(new TGetRefEvent(obj));
+}
+
+/*!
+ SalomePyQt::getColor(obj)
+ Return the color of the object
+*/
+class TGetColorEvent: public SALOME_Event
+{
+public:
+ typedef QColor TResult;
+ TResult myResult;
+ QString myObj;
+ TGetColorEvent( const QString& obj ) : myObj(obj) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = module->getColor(myObj);
+ }
+};
+QColor SalomePyQt::getColor(const QString& obj)
+{
+ return ProcessEvent(new TGetColorEvent(obj));
+}
+
+/*!
+ SalomePyQt::removeChild(obj)
+ Remove childrens from object
+*/
+class TRemoveChildEvent: public SALOME_Event
+{
+public:
+ QString myObj;
+ TRemoveChildEvent(const QString& obj) : myObj(obj) {}
+
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ module->removeChild(myObj);
+ }
+};
+void SalomePyQt::removeChild(const QString& obj)
+{
+ ProcessVoidEvent(new TRemoveChildEvent(obj));
+}
+
+
+/*!
+ SalomePyQt::removeObject(obj)
+ Remove object
+*/
+class TRemoveObjectEvent: public SALOME_Event
+{
+public:
+ QString myObj;
+
+ TRemoveObjectEvent( const QString& obj) : myObj(obj) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ module->removeObject(myObj);
+ }
+};
+void SalomePyQt::removeObject(const QString& obj)
+{
+ ProcessVoidEvent(new TRemoveObjectEvent(obj));
+}
+
+/*!
+ SalomePyQt::getChildren(obj)
+ Return the list of the child objects
+ if rec == true then function get all sub children.
+*/
+
+class TGetChildrenEvent: public SALOME_Event
+{
+public:
+ typedef QStringList TResult;
+ TResult myResult;
+ QString myObj;
+ bool myRec;
+ TGetChildrenEvent(const QString& obj, const bool rec) : myObj(obj),
+ myRec(rec) {}
+ virtual void Execute() {
+ SALOME_PYQT_ModuleLight* module = getActiveModule();
+ if ( module )
+ myResult = (QStringList)module->getChildren(myObj,myRec);
+ }
+};
+QStringList SalomePyQt::getChildren(const QString& obj, const bool rec)
+{
+ return ProcessEvent( new TGetChildrenEvent(obj,rec) );
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SalomePyQt.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
#ifndef SALOME_PYQT_H
#define SALOME_PYQT_H
+#include <Python.h>
+
#include <QObject>
#include <QString>
#include <QColor>
#include <LightApp_Preferences.h>
class LightApp_SelectionMgr;
-class SalomeApp_Application;
+class LightApp_Application;
class QMenuBar;
class QMenu;
class QWidget;
class QAction;
+class QTreeView;
class QtxActionGroup;
class SALOME_Selection : public QObject
public:
~SALOME_Selection();
- static SALOME_Selection* GetSelection( SalomeApp_Application* );
+ static SALOME_Selection* GetSelection( LightApp_Application* );
void Clear();
void ClearIObjects();
static QMenuBar* getMainMenuBar();
static QMenu* getPopupMenu( const MenuName );
static QMenu* getPopupMenu( const QString& );
+ static QTreeView* getObjectBrowser();
static SALOME_Selection* getSelection();
static int getStudyId();
static void putInfo( const QString&, const int = 0 );
static const QString getActiveComponent();
+ static PyObject* getActivePythonModule();
+ static bool activateModule( const QString& );
static void updateObjBrowser( const int = 0, bool = true );
+ static bool isModified();
+ static void setModified( bool );
+
static QString getFileName ( QWidget*, const QString&, const QStringList&, const QString&, bool );
static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& );
static QString getExistingDirectory( QWidget*, const QString&, const QString& );
+ static QString createObject(const QString& parent = QString(""));
+ static QString createObject(const QString& name,
+ const QString& iconname,
+ const QString& tooltip,
+ const QString& parent = QString(""));
+
+ static void removeObject( const QString& obj);
+ static void removeChild( const QString& obj = QString(""));
+ static QStringList getChildren(const QString& obj = QString(""), const bool rec = false);
+ static void setName(const QString& obj,const QString& name);
+ static void setIcon(const QString& obj,const QString& iconname);
+ static void setToolTip(const QString& obj,const QString& tooltip);
+ static QString getName(const QString& obj);
+ static QString getToolTip(const QString& obj);
+
+ static void setColor(const QString& obj,const QColor& color);
+ static QColor getColor(const QString& obj);
+
+ static void setReference( const QString& obj,
+ const QString& refEntry );
+ static QString getReference( const QString& obj );
+
+ static QIcon loadIcon( const QString&, const QString& );
+
static void helpContext( const QString&, const QString& );
static bool dumpView( const QString& );
static int createTool( QAction*, const QString&, const int = -1, const int = -1 );
static int createMenu( const QString&, const int = -1,
- const int = -1, const int = -1, const int = -1 );
+ const int = -1, const int = -1, const int = -1 );
static int createMenu( const QString&, const QString& = QString(),
- const int = -1, const int = -1, const int = -1 );
+ const int = -1, const int = -1, const int = -1 );
static int createMenu( const int, const int = -1,
- const int = -1, const int = -1 );
+ const int = -1, const int = -1 );
static int createMenu( const int, const QString& = QString(),
- const int = -1, const int = -1 );
+ const int = -1, const int = -1 );
static int createMenu( QAction*, const int, const int = -1,
- const int = -1, const int = -1 );
+ const int = -1, const int = -1 );
static int createMenu( QAction*, const QString&, const int = -1,
- const int = -1, const int = -1 );
+ const int = -1, const int = -1 );
static QAction* createSeparator();
static QAction* createAction( const int, const QString&,
- const QString& = QString(), const QString& = QString(),
- const QString& = QString(), const int = 0, const bool = false );
+ const QString& = QString(), const QString& = QString(),
+ const QString& = QString(), const int = 0, const bool = false );
static QtxActionGroup* createActionGroup( const int, const bool = true );
static int addPreference( const QString&,
const int, const int = PT_Auto,
const QString& = QString(),
- const QString& = QString() );
+ const QString& = QString() );
static QVariant preferenceProperty( const int, const QString& );
static void setPreferenceProperty( const int,
const QString&,
const QVariant& );
static void addPreferenceProperty( const int,
- const QString&,
- const int,
- const QVariant& );
+ const QString&,
+ const int,
+ const QVariant& );
static void message( const QString&, bool = true );
static void clearMessages();
static QList<int> findViews( const QString& );
static bool activateView( const int );
static int createView( const QString& );
+ static int createView( const QString&, QWidget* );
static bool closeView( const int );
static int cloneView( const int );
- static bool isViewVisible( const int id );
-
+ static bool isViewVisible( const int );
+ static void setViewClosable( const int, const bool );
+ static bool isViewClosable( const int );
+
static bool groupAllViews();
static bool splitView( const int, const Orientation, const Action );
static bool moveView( const int, const int, const bool );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SalomePyQt.sip
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
static QMenuBar* getMainMenuBar() /ReleaseGIL/ ;
static QMenu* getPopupMenu( const MenuName ) /ReleaseGIL/ ;
static QMenu* getPopupMenu( const QString& ) /ReleaseGIL/ ;
+ static QTreeView* getObjectBrowser() /ReleaseGIL/ ;
static SALOME_Selection* getSelection() /Factory,ReleaseGIL/ ;
static int getStudyId() /ReleaseGIL/ ;
static void putInfo( const QString&, const int = 0 ) /ReleaseGIL/ ;
static const QString getActiveComponent() /ReleaseGIL/ ;
- static void updateObjBrowser( const int = 0, bool = true ) /ReleaseGIL/ ;
+ static SIP_PYOBJECT getActivePythonModule() /ReleaseGIL/ ;
+ static bool activateModule( const QString& ) /ReleaseGIL/ ;
+ static void updateObjBrowser( const int = 0, bool = true ) /ReleaseGIL/ ;
+
+ static bool isModified() /ReleaseGIL/ ;
+ static void setModified( bool ) /ReleaseGIL/ ;
static QString getFileName ( QWidget*, const QString&, const QStringList&, const QString&, bool ) /ReleaseGIL/ ;
static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& ) /ReleaseGIL/ ;
static QString getExistingDirectory( QWidget*, const QString&, const QString& ) /ReleaseGIL/ ;
-
+
+ static QString createObject( const QString& = QString("") ) /ReleaseGIL/ ;
+ static QString createObject( const QString&,
+ const QString&,
+ const QString&,
+ const QString& = QString("") ) /ReleaseGIL/ ;
+
+ static void setName(const QString& ,const QString& ) /ReleaseGIL/ ;
+ static void setIcon(const QString& ,const QString& ) /ReleaseGIL/ ;
+ static void setToolTip(const QString& ,const QString& ) /ReleaseGIL/ ;
+ static QString getName(const QString& ) /ReleaseGIL/ ;
+ static QString getToolTip(const QString& ) /ReleaseGIL/ ;
+
+ static void setColor( const QString&, const QColor& ) /ReleaseGIL/ ;
+ static QColor getColor( const QString& ) /ReleaseGIL/ ;
+
+ static void setReference( const QString& ,const QString& ) /ReleaseGIL/ ;
+ static QString getReference( const QString& ) /ReleaseGIL/ ;
+
+ static void removeObject(const QString& ) /ReleaseGIL/ ;
+ static void removeChild(const QString& = QString("") ) /ReleaseGIL/ ;
+ static QStringList getChildren(const QString&=QString("") , const bool = false) /ReleaseGIL/ ;
+
+ static QIcon loadIcon( const QString&, const QString& ) /ReleaseGIL/ ;
static void helpContext( const QString&, const QString& ) /ReleaseGIL/ ;
static bool dumpView( const QString& ) /ReleaseGIL/ ;
static QList<int> findViews( const QString& ) /ReleaseGIL/ ;
static bool activateView( const int ) /ReleaseGIL/ ;
static int createView( const QString& ) /ReleaseGIL/ ;
+ static int createView( const QString&, QWidget* ) /ReleaseGIL/ ;
static bool closeView( const int ) /ReleaseGIL/ ;
static int cloneView( const int ) /ReleaseGIL/ ;
static bool isViewVisible( const int id ) /ReleaseGIL/ ;
+ static void setViewClosable( const int id, const bool ) /ReleaseGIL/ ;
+ static bool isViewClosable( const int id ) /ReleaseGIL/ ;
static bool groupAllViews() /ReleaseGIL/ ;
static bool splitView( const int, Orientation, Action ) /ReleaseGIL/ ;
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File : Help.py
-# Author : Paul RASCLE, EDF
-# Module : SALOME
-# $Header$
-#
-class SalomeDoc:
- def __init__(self, aDoc):
- self.doc = aDoc
- def __repr__(self):
- print self.doc
- return "---"
- def salome(self):
- doc_salome = '''
-MODULE : salome
----------------
-module salome gives access to Salome ressources:
-variables:
-
- salome:orb : CORBA
- salome.naming_service : instance of naming Service class
- methods:
- Resolve(name) : find a CORBA object (ior) by its pathname
- Register(name) : register a CORBA object under a pathname
- salome.lcc : instance of lifeCycleCORBA class
- methods:
- FindOrLoadComponent(server,name) :
- obtain an Engine (CORBA object)
- or launch the Engine if not found,
- with a Server name and an Engine name
- salome.sg
- methods:
- updateObjBrowser(bool):
- getActiveStudyId():
- getActiveStudyName():
-
- SelectedCount(): returns number of selected objects
- getSelected(i): returns entry of selected object number i
- getAllSelected(): returns list of entry of selected objects
- AddIObject(Entry): select an existing Interactive object
- RemoveIObject(Entry): remove object from selection
- ClearIObjects(): clear selection
-
- Display(*Entry):
- DisplayOnly(Entry):
- Erase(Entry):
- DisplayAll():
- EraseAll():
-
- IDToObject(Entry): returns CORBA reference from entry
-
- salome.myStudyName : active Study Name
- salome.myStudyId : active Study Id
- salome.myStudy : the active Study itself (CORBA ior)
- methods : defined in SALOMEDS.idl
-
-methods:
- salome.DumpStudy(study) : Dump a study, given the ior
----
-'''
- print doc_salome
-
- def geompy(self):
- doc_geompy = '''
-MODULE : geompy
----------------
-module geompy provides an encapsulation of GEOM Engine methods
-variables:
- geompy.geom : a Geometry Engine, found or loaded
- at first import of module geompy.
- methods : defined in GEOM_Gen.idl
- geompy.myBuilder : a study builder
- geompy.father : GEOM root in current study (salome.myStudy)
-
-methods:
- addToStudy(aShape, aName) : add the shape into the current study
- --- all methods of GEOM_Gen.idl that returns a shape are encapsulated,
- with the same interface : shapes are named with their ior
-'''
- print doc_geompy
-
- def supervision(self):
- doc_supervision = '''
-MODULES : SALOME_SuperVisionEditor and SALOME_SuperVisionExecutor
------------------------------------------------------------------
-this modules provide access to Editor and Executor Engine methods
-
-See SUPERV.idl
-
-In order to run the example (supervisionexample.py)
-
- Type : from supervisionexample import *
- supervisionexample.py contains comments
-
-A new python example avoids references to LifeCycleCORBA
- avoids references to NamingService
- avoids references to ModuleCatalog
- avoids SuperVisionComponent creation
- allows G.Input(...) instead of AddInput(G,...)
- replaces Editor/Executor with Graph
- allows Nodes, Ports and Links CORBA objects
- shortens methods names
- ...
-
- See /SuperVisionTest/resources/GraphExample.py
- and GraphExample.xml
----
-'''
- print doc_supervision
-
-
-
-help = SalomeDoc('''
-Availables modules:
- salome : gives access to Salome ressources
- geompy : encapsulation of GEOM Engine methods
- supervision : gives access to SuperVision Engine
-To obtain specific help on a module "truc", type: help.truc()
-To run an example, type: import example3
-''')
-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Paul RASCLE, EDF
# Module : SALOME
libSALOME_Swig.py: swig_wrap.cpp
-# library
-lib_LTLIBRARIES = _libSALOME_Swig.la
+salomepython_PYTHON = libSALOME_Swig.py
+salomepyexec_LTLIBRARIES = _libSALOME_Swig.la
+
_libSALOME_Swig_la_SOURCES = $(SWIG_SOURCES) SALOMEGUI_Swig.cxx
nodist__libSALOME_Swig_la_SOURCES = swig_wrap.cpp
salomeinclude_HEADERS = $(SWIG_SOURCES) SALOMEGUI_Swig.hxx SALOMEGUI_Swig.i
_libSALOME_Swig_la_CPPFLAGS = \
$(QT_INCLUDES) $(QWT_INCLUDES) $(PYTHON_INCLUDES) $(CAS_CPPFLAGS) $(VTK_INCLUDES) \
$(OGL_INCLUDES) $(BOOST_CPPFLAGS) -DHAVE_CONFIG_H @KERNEL_CXXFLAGS@ \
- -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl -I$(srcdir) \
- -I$(srcdir)/../SalomeApp -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT \
+ -I$(top_builddir)/idl -I$(srcdir) \
+ -I$(srcdir)/../LightApp -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT \
-I$(srcdir)/../ObjBrowser -I$(srcdir)/../LightApp -I$(srcdir)/../SOCC \
-I$(srcdir)/../SVTK -I$(srcdir)/../Event -I$(srcdir)/../OBJECT \
-I$(srcdir)/../CAM -I$(srcdir)/../STD -I$(srcdir)/../OCCViewer \
-I$(srcdir)/../Prs -I$(srcdir)/../VTKViewer -I$(srcdir)/../SPlot2d \
- -I$(srcdir)/../Plot2d \
- @CORBA_CXXFLAGS@ @CORBA_INCLUDES@
+ -I$(srcdir)/../Plot2d
_libSALOME_Swig_la_LDFLAGS = -module
_libSALOME_Swig_la_LIBADD = \
- ../SalomeApp/libSalomeApp.la \
+ ../LightApp/libLightApp.la \
@PYTHON_LIBS@
swig_wrap.cpp : $(SWIG_SOURCES)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File : PyInterp.py
-# Author : Paul RASCLE, EDF
-# Module : SALOME
-# $Header$
-#
-import sys
-from omniORB import CORBA
-from LifeCycleCORBA import *
-from libSALOME_Swig import *
-import SALOMEDS
-from SALOME_NamingServicePy import *
-
- #--------------------------------------------------------------------------
-
-def DumpComponent(Study, SO, offset):
- it = Study.NewChildIterator(SO)
- Builder = Study.NewBuilder()
- while it.More():
- CSO = it.Value()
- it.Next()
- anAttr = Builder.FindOrCreateAttribute(CSO, "AttributeName")
- AtName = anAttr._narrow(SALOMEDS.AttributeName)
- t_name = AtName.Value()
- if t_name[0] == 1:
- ofs = 1
- a = ""
- while ofs <= offset:
- a = a + "--"
- ofs = ofs +1
- print a + ">" + CSO.GetID() + " " + t_name[1]
- t_RefSO = CSO.ReferencedObject()
- if t_RefSO[0] == 1:
- RefSO = t_RefSO[1]
- ofs = 1
- a = ""
- while ofs <= offset:
- a = a + " "
- ofs = ofs +1
- print a + ">" + RefSO.GetID()
- DumpComponent(Study, CSO, offset+2)
-
- #--------------------------------------------------------------------------
-
-def DumpStudy(Study):
- itcomp = Study.NewComponentIterator()
- while itcomp.More():
- SC = itcomp.Value()
- itcomp.Next()
- name = SC.ComponentDataType()
- print "-> ComponentDataType is " + name
- DumpComponent(Study, SC, 1)
-
-
- #--------------------------------------------------------------------------
-
-# initialise the ORB
-orb = CORBA.ORB_init([''], CORBA.ORB_ID)
-
-# create an LifeCycleCORBA instance
-lcc = LifeCycleCORBA(orb)
-
-# create an SALOMEGUI_Swig instance
-sg = SALOMEGUI_Swig()
-
-#create an naming service instance
-naming_service = SALOME_NamingServicePy_i(orb)
-
-# get active study name and id
-myStudyName = sg.getActiveStudyName()
-print myStudyName
-
-myStudyId = sg.getActiveStudyId()
-print myStudyId
-
-# get Study Manager reference
-obj = naming_service.Resolve('myStudyManager')
-myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-
-# get active study
-myStudy = myStudyManager.GetStudyByName(myStudyName)
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOMEGUI_Swig.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#include <SUIT_ViewManager.h>
#include <SUIT_DataObjectIterator.h>
#include <CAM_DataModel.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-#include <SalomeApp_Module.h>
-#include <SalomeApp_DataObject.h>
+#include <LightApp_Application.h>
+#include <LightApp_Displayer.h>
+#include <LightApp_Study.h>
+#include <LightApp_Module.h>
+#include <LightApp_DataObject.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_DataOwner.h>
#include <SALOME_Prs.h>
\internal
\return active application or 0 if there is no any
*/
-static SalomeApp_Application* getApplication()
+static LightApp_Application* getApplication()
{
if ( SUIT_Session::session() )
- return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ return dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
return 0;
}
\internal
\return active study or 0 if there is no study opened
*/
-static SalomeApp_Study* getActiveStudy()
+static LightApp_Study* getActiveStudy()
{
if ( getApplication() )
- return dynamic_cast<SalomeApp_Study*>( getApplication()->activeStudy() );
+ return dynamic_cast<LightApp_Study*>( getApplication()->activeStudy() );
return 0;
}
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- anApp->updateObjectBrowser();
- anApp->updateActions(); //SRN: added in order to update the toolbar
+ if ( LightApp_Application* anApp = getApplication() ) {
+ anApp->updateObjectBrowser();
+ anApp->updateActions(); //SRN: added in order to update the toolbar
}
}
};
TGetActiveStudyIdEvent() : myResult( 0 ) {}
virtual void Execute()
{
- if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
- myResult = aStudy->studyDS()->StudyId();
+ if ( LightApp_Study* aStudy = getActiveStudy() ) {
+ myResult = aStudy->id();
}
}
};
TGetActiveStudyNameEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Study* aStudy = getActiveStudy() ) {
- myResult = aStudy->studyDS()->Name();
+ if ( LightApp_Study* aStudy = getActiveStudy() ) {
+ myResult = aStudy->id();
}
}
};
: myName( name ), myIsUserName( isUserName ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* app = getApplication() ) {
+ if ( LightApp_Application* app = getApplication() ) {
myResult = myIsUserName ? app->moduleTitle( myName ) : app->moduleName( myName );
}
}
TGetSelectedEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
+ if ( LightApp_Application* anApp = getApplication() ) {
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
if ( aStudy && aSelMgr ) {
- SUIT_DataOwnerPtrList aList;
- aSelMgr->selected( aList );
-
- for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin();
- itr != aList.end(); ++itr ) {
- const LightApp_DataOwner* owner =
- dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
- if( !owner )
- continue;
- QString entry = owner->entry();
- if( !myResult.contains( entry ) )
- myResult.append( entry );
- }
+ SUIT_DataOwnerPtrList aList;
+ aSelMgr->selected( aList );
+
+ for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin();
+ itr != aList.end(); ++itr ) {
+ const LightApp_DataOwner* owner =
+ dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+ if( !owner )
+ continue;
+ QString entry = owner->entry();
+ if( !myResult.contains( entry ) )
+ myResult.append( entry );
+ }
}
}
}
TEvent( const char* theEntry ) : myEntry( theEntry ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
- LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
- if ( aStudy && aSelMgr ) {
- SALOME_ListIO anIOList;
- anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) );
- aSelMgr->setSelectedObjects( anIOList, true );
- }
+ if ( LightApp_Application* anApp = getApplication() ) {
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
+ LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
+ if ( aStudy && aSelMgr ) {
+ SALOME_ListIO anIOList;
+ anIOList.Append( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) );
+ aSelMgr->setSelectedObjects( anIOList, true );
+ }
}
}
};
TEvent( const char* theEntry ) : myEntry( theEntry ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
- LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
- if ( aStudy && aSelMgr ) {
- SALOME_ListIO anIOList;
- // VSR: temporary solution, until LightApp_SelectionMgr::unsetSelectedObjects() method appears
- // Lately this should be replaced by the following:
- // anIOList.Append( new SALOME_InteractiveObject( myEntry, "", "" ) );
- // aSelMgr->unsetSelectedObjects( anIOList );
- ///////////////////////////////////////////////
- aSelMgr->selectedObjects( anIOList );
- SALOME_ListIteratorOfListIO anIter( anIOList );
- for( ; anIter.More(); anIter.Next() ) {
- if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) {
- anIOList.Remove( anIter );
- aSelMgr->setSelectedObjects( anIOList, true );
- return;
- }
- }
- }
+ if ( LightApp_Application* anApp = getApplication() ) {
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
+ LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
+ if ( aStudy && aSelMgr ) {
+ SALOME_ListIO anIOList;
+ // VSR: temporary solution, until LightApp_SelectionMgr::unsetSelectedObjects() method appears
+ // Lately this should be replaced by the following:
+ // anIOList.Append( new SALOME_InteractiveObject( myEntry, "", "" ) );
+ // aSelMgr->unsetSelectedObjects( anIOList );
+ ///////////////////////////////////////////////
+ aSelMgr->selectedObjects( anIOList );
+ SALOME_ListIteratorOfListIO anIter( anIOList );
+ for( ; anIter.More(); anIter.Next() ) {
+ if ( anIter.Value()->isSame( new SALOME_InteractiveObject( myEntry.toLatin1(), "", "" ) ) ) {
+ anIOList.Remove( anIter );
+ aSelMgr->setSelectedObjects( anIOList, true );
+ return;
+ }
+ }
+ }
}
}
};
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
- LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
- if ( aStudy && aSelMgr )
- aSelMgr->clearSelected();
+ if ( LightApp_Application* anApp = getApplication() ) {
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>( anApp->activeStudy() ); // for sure!
+ LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
+ if ( aStudy && aSelMgr )
+ aSelMgr->clearSelected();
}
}
};
The presentable object should be previously created and
displayed in this viewer.
- For the current moment implemented for OCC and VTK viewers only.
-
\param theEntry object entry
-*/
+*/
void SALOMEGUI_Swig::Display( const char* theEntry )
{
class TEvent: public SALOME_Event
public:
TEvent( const char* theEntry ) : myEntry( theEntry ) {}
virtual void Execute() {
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
- if ( view )
- view->Display( view->CreatePrs( myEntry.toLatin1() ) );
+ LightApp_Application* anApp = getApplication();
+ LightApp_Study* aStudy = getActiveStudy();
+ if ( anApp && aStudy ) {
+ QString mname = anApp->moduleTitle( aStudy->componentDataType( myEntry ) );
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mname, true );
+ if ( d ) {
+ QStringList entries;
+ if( aStudy->isComponent( myEntry ) )
+ aStudy->children( myEntry, entries );
+ else
+ entries.append( myEntry );
+ foreach( QString entry, entries )
+ d->Display( aStudy->referencedToEntry( entry ), false, 0 );
}
}
}
The presentable object should be previously created and
displayed in this viewer.
- For the current moment implemented for OCC and VTK viewers only.
-
\param theEntry object entry
*/
void SALOMEGUI_Swig::DisplayOnly( const char* theEntry )
TEvent( const char* theEntry ) : myEntry( theEntry ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
- if ( view ) {
- view->EraseAll( false );
- view->Display( view->CreatePrs( myEntry.toLatin1() ) );
- }
+ LightApp_Application* anApp = getApplication();
+ LightApp_Study* aStudy = getActiveStudy();
+ if ( anApp && aStudy ) {
+ QStringList comps;
+ aStudy->components( comps );
+ foreach( QString comp, comps ) {
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+ if ( d ) d->EraseAll( false, false, 0 );
+ }
+
+ QString mname = anApp->moduleTitle( aStudy->componentDataType( myEntry ) );
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mname, true );
+ if ( d ) {
+ QStringList entries;
+ if( aStudy->isComponent( myEntry ) )
+ aStudy->children( myEntry, entries );
+ else
+ entries.append( myEntry );
+ foreach( QString entry, entries )
+ d->Display( aStudy->referencedToEntry( entry ), false, 0 );
}
}
}
The presentable object should be previously created and
displayed in this viewer.
- For the current moment implemented for OCC and VTK viewers only.
-
\param theEntry object entry
-*/
+*/
void SALOMEGUI_Swig::Erase( const char* theEntry )
{
class TEvent: public SALOME_Event
TEvent( const char* theEntry ) : myEntry( theEntry ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
- if ( view )
- view->Erase( view->CreatePrs( myEntry.toLatin1() ) );
+ LightApp_Application* anApp = getApplication();
+ LightApp_Study* aStudy = getActiveStudy();
+ if ( anApp && aStudy ) {
+ QString mname = anApp->moduleTitle( aStudy->componentDataType( myEntry ) );
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mname, true );
+ if ( d ) {
+ QStringList entries;
+ if( aStudy->isComponent( myEntry ) )
+ aStudy->children( myEntry, entries );
+ else
+ entries.append( myEntry );
+ foreach( QString entry, entries )
+ d->Erase( aStudy->referencedToEntry( entry ), false, false, 0 );
}
}
}
The presentable objects should be previously created and
displayed in this viewer.
-
- For the current moment implemented for OCC and VTK viewers only.
*/
void SALOMEGUI_Swig::DisplayAll()
{
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() ); // for sure!
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- SalomeApp_Module* activeModule = dynamic_cast<SalomeApp_Module*>( anApp->activeModule() );
- if ( study && window && activeModule ) {
- SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
- if ( view ) {
- for ( SUIT_DataObjectIterator it( activeModule->dataModel()->root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
- SalomeApp_DataObject* obj = dynamic_cast<SalomeApp_DataObject*>( it.current() );
- if ( obj && !obj->entry().isEmpty() )
- view->Display( view->CreatePrs( obj->entry().toLatin1() ) );
- }
+ LightApp_Application* anApp = getApplication();
+ LightApp_Study* aStudy = getActiveStudy();
+ if ( anApp && aStudy ) {
+ QStringList comps;
+ aStudy->components( comps );
+ foreach( QString comp, comps ) {
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+ if ( d ) {
+ QStringList entries;
+ aStudy->children( aStudy->centry( comp ), entries );
+ foreach( QString entry, entries )
+ d->Display( aStudy->referencedToEntry( entry ), false, 0 );
}
}
}
/*!
\brief Erase all objects from the current view window.
-
- For the current moment implemented for OCC and VTK viewers only.
*/
void SALOMEGUI_Swig::EraseAll()
{
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
- if ( view )
- view->EraseAll( false );
+ LightApp_Application* anApp = getApplication();
+ LightApp_Study* aStudy = getActiveStudy();
+ if ( anApp && aStudy ) {
+ QStringList comps;
+ aStudy->components( comps );
+ foreach( QString comp, comps ) {
+ LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( anApp->moduleTitle( comp ), true );
+ if ( d ) d->EraseAll( false, false, 0 );
}
}
}
TIsInViewerEvent( const char* theEntry ) : myEntry( theEntry ), myResult( false ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
+ if ( LightApp_Application* anApp = getApplication() ) {
SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
if ( window ) {
- SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
- if ( view ) {
- SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
- myResult = !aPrs->IsNull();
- }
+ SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
+ if ( view ) {
+ SALOME_Prs* aPrs = view->CreatePrs( myEntry.toLatin1() );
+ myResult = !aPrs->IsNull();
+ }
}
}
}
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
- if ( view )
- view->Repaint();
- }
+ if ( LightApp_Application* anApp = getApplication() ) {
+ SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+ if ( window ) {
+ SALOME_View* view = dynamic_cast<SALOME_View*>( window->getViewManager()->getViewModel() );
+ if ( view )
+ view->Repaint();
+ }
}
}
};
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
- ( dynamic_cast<SVTK_ViewWindow*>( window ) )->onFitAll();
- else if ( dynamic_cast<SOCC_ViewWindow*>( window ) )
- ( dynamic_cast<SOCC_ViewWindow*>( window ) )->onFitAll();
- else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
- ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )->onFitAll();
- }
+ if ( LightApp_Application* anApp = getApplication() ) {
+ SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+ if ( window ) {
+ if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
+ ( dynamic_cast<SVTK_ViewWindow*>( window ) )->onFitAll();
+ else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
+ ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )->onFitAll();
+ else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
+ ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )->onFitAll();
+ }
}
}
};
TEvent() {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
- (dynamic_cast<SVTK_ViewWindow*>( window ))->onResetView();
- else if ( dynamic_cast<SOCC_ViewWindow*>( window ) )
- (dynamic_cast<SOCC_ViewWindow*>( window ))->onResetView();
- else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
- (dynamic_cast<SPlot2d_ViewWindow*>( window ))->onFitAll();
- // VSR: there is no 'ResetView' functionality for Plot2d viewer,
- // so we use 'FitAll' instead.
- }
+ if ( LightApp_Application* anApp = getApplication() ) {
+ SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+ if ( window ) {
+ if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
+ (dynamic_cast<SVTK_ViewWindow*>( window ))->onResetView();
+ else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) )
+ (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onResetView();
+ else if ( dynamic_cast<SPlot2d_ViewWindow*>( window ) )
+ (dynamic_cast<SPlot2d_ViewWindow*>( window ))->onFitAll();
+ // VSR: there is no 'ResetView' functionality for Plot2d viewer,
+ // so we use 'FitAll' instead.
+ }
}
}
};
TEvent( int view ) : myView( view ) {}
virtual void Execute()
{
- if ( SalomeApp_Application* anApp = getApplication() ) {
- SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
- if ( window ) {
- if ( dynamic_cast<SVTK_ViewWindow*>( window ) ) {
- switch( myView ) {
- case __ViewTop:
- (dynamic_cast<SVTK_ViewWindow*>( window ))->onTopView(); break;
- case __ViewBottom:
- (dynamic_cast<SVTK_ViewWindow*>( window ))->onBottomView(); break;
- case __ViewLeft:
- (dynamic_cast<SVTK_ViewWindow*>( window ))->onLeftView(); break;
- case __ViewRight:
- (dynamic_cast<SVTK_ViewWindow*>( window ))->onRightView(); break;
- case __ViewFront:
- (dynamic_cast<SVTK_ViewWindow*>( window ))->onFrontView(); break;
- case __ViewBack:
- (dynamic_cast<SVTK_ViewWindow*>( window ))->onBackView(); break;
- default:
- break;
- }
- }
- else if ( dynamic_cast<SOCC_ViewWindow*>( window ) ) {
- switch( myView ) {
- case __ViewTop:
- (dynamic_cast<SOCC_ViewWindow*>( window ))->onTopView(); break;
- case __ViewBottom:
- (dynamic_cast<SOCC_ViewWindow*>( window ))->onBottomView(); break;
- case __ViewLeft:
- (dynamic_cast<SOCC_ViewWindow*>( window ))->onLeftView(); break;
- case __ViewRight:
- (dynamic_cast<SOCC_ViewWindow*>( window ))->onRightView(); break;
- case __ViewFront:
- (dynamic_cast<SOCC_ViewWindow*>( window ))->onFrontView(); break;
- case __ViewBack:
- (dynamic_cast<SOCC_ViewWindow*>( window ))->onBackView(); break;
- default:
- break;
- }
- }
- }
+ if ( LightApp_Application* anApp = getApplication() ) {
+ SUIT_ViewWindow* window = anApp->desktop()->activeWindow();
+ if ( window ) {
+ if ( dynamic_cast<SVTK_ViewWindow*>( window ) ) {
+ switch( myView ) {
+ case __ViewTop:
+ (dynamic_cast<SVTK_ViewWindow*>( window ))->onTopView(); break;
+ case __ViewBottom:
+ (dynamic_cast<SVTK_ViewWindow*>( window ))->onBottomView(); break;
+ case __ViewLeft:
+ (dynamic_cast<SVTK_ViewWindow*>( window ))->onLeftView(); break;
+ case __ViewRight:
+ (dynamic_cast<SVTK_ViewWindow*>( window ))->onRightView(); break;
+ case __ViewFront:
+ (dynamic_cast<SVTK_ViewWindow*>( window ))->onFrontView(); break;
+ case __ViewBack:
+ (dynamic_cast<SVTK_ViewWindow*>( window ))->onBackView(); break;
+ default:
+ break;
+ }
+ }
+ else if ( dynamic_cast<OCCViewer_ViewWindow*>( window ) ) {
+ switch( myView ) {
+ case __ViewTop:
+ (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onTopView(); break;
+ case __ViewBottom:
+ (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onBottomView(); break;
+ case __ViewLeft:
+ (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onLeftView(); break;
+ case __ViewRight:
+ (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onRightView(); break;
+ case __ViewFront:
+ (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onFrontView(); break;
+ case __ViewBack:
+ (dynamic_cast<OCCViewer_ViewWindow*>( window ))->onBackView(); break;
+ default:
+ break;
+ }
+ }
+ }
}
}
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOMEGUI_Swig.hxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOMEGUI_Swig.i
// Author : Paul RASCLE, EDF
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
"""
"""
-import SALOME_Session_idl
+try:
+ import SALOME_Session_idl
+except:
+ pass
from import_hook import register_name
register_name("SalomePyQt")
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : examplevtk1.py
# Module : SALOME
#
+
+import os
import libSalomePy
-ren=libSalomePy.renderer
-#iren=libSalomePy.interactor
+from vtk import *
+
+try:
+ from libvtkRenderingPython import *
+except:
+ from vtkRenderingPython import *
-from libVTKCommonPython import *
-from libVTKGraphicsPython import *
+# get the "vtkRenderer": an OpenGL rendering context
+ren = libSalomePy.getRenderer()
+
+# create an actor and give it cone geometry
cone = vtkConeSource()
cone.SetResolution(8)
coneMapper = vtkPolyDataMapper()
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)
+# assign our actor to the renderer
ren.AddActor(coneActor)
-iren = vtkRenderWindowInteractor()
+libSalomePy.fitAll()
+
+iren = libSalomePy.getRenderWindowInteractor()
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : libSALOME_Swig.i
// Author : Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-//
+
%module libSALOME_Swig
-//%include "SALOME_NamingService.i"
%include "SALOMEGUI_Swig.i"
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File : salome.py
-# Author : Paul RASCLE, EDF
-# Module : SALOME
-# $Header$
-#
-from omniORB import CORBA
-from LifeCycleCORBA import *
-from libSALOME_Swig import *
-import SALOMEDS
-from SALOME_NamingServicePy import *
-
-from SALOME_utilities import *
-
-#--------------------------------------------------------------------------
-
-def DumpComponent(Study, SO, offset):
- it = Study.NewChildIterator(SO)
- Builder = Study.NewBuilder()
- while it.More():
- CSO = it.Value()
- it.Next()
- anAttr = Builder.FindOrCreateAttribute(CSO, "AttributeName")
- AtName = anAttr._narrow(SALOMEDS.AttributeName)
- t_name = AtName.Value()
- if t_name[0] == 1:
- ofs = 1
- a = ""
- while ofs <= offset:
- a = a + "--"
- ofs = ofs +1
- MESSAGE( a + ">" + str(CSO.GetID()) + " " + str(t_name[1]) )
- t_RefSO = CSO.ReferencedObject()
- if t_RefSO[0] == 1:
- RefSO = t_RefSO[1]
- ofs = 1
- a = ""
- while ofs <= offset:
- a = a + " "
- ofs = ofs +1
- MESSAGE( a + ">" + str(RefSO.GetID()) )
- DumpComponent(Study, CSO, offset+2)
-
- #--------------------------------------------------------------------------
-
-def DumpStudy(Study):
- itcomp = Study.NewComponentIterator()
- while itcomp.More():
- SC = itcomp.Value()
- itcomp.Next()
- name = SC.ComponentDataType()
- MESSAGE( "-> ComponentDataType is " + name )
- DumpComponent(Study, SC, 1)
-
-
- #--------------------------------------------------------------------------
-
-def ImportComponentGUI(ComponentName):
- libName = "lib" + ComponentName + "_Swig"
- command = "from " + libName + " import *"
- exec ( command )
- constructor = ComponentName + "_Swig()"
- command = "gui = " + constructor
- exec ( command )
- return gui
-
- #--------------------------------------------------------------------------
-
-def SalomeGUIgetAllSelected(self):
- selNumber = self.SelectedCount()
- listSelected = []
- for i in range(selNumber):
- listSelected.append(self.getSelected(i))
- return listSelected
-
-class SalomeGUI(SALOMEGUI_Swig):
- getAllSelected = SalomeGUIgetAllSelected
-
- #--------------------------------------------------------------------------
-
-def IDToObject(id):
- myObj = None
- mySO = myStudy.FindObjectID(id);
- if mySO is not None:
- ok, anAttr = mySO.FindAttribute("AttributeIOR")
- if ok:
- AtIOR = anAttr._narrow(SALOMEDS.AttributeIOR)
- if AtIOR.Value() != "":
- myObj = orb.string_to_object(AtIOR.Value())
- return myObj
-
-def ObjectToSObject(obj):
- mySO = None
- if obj is not None:
- ior = orb.object_to_string(obj)
- if ior != "":
- mySO = myStudy.FindObjectIOR(ior)
- return mySO
-
-def ObjectToID(obj):
- mySO = ObjectToSObject(obj)
- if mySO:
- return mySO.GetID()
- return ""
-
-def IDToSObject(id):
- mySO = myStudy.FindObjectID(id);
- return mySO
-
- #--------------------------------------------------------------------------
-
-# initialise the ORB
-orb = CORBA.ORB_init([''], CORBA.ORB_ID)
-
-# create an LifeCycleCORBA instance
-lcc = LifeCycleCORBA(orb)
-
-# create an SALOMEGUI_Swig instance
-sg = SalomeGUI()
-
-#create an naming service instance
-naming_service = SALOME_NamingServicePy_i(orb)
-
-# get active study name and id
-myStudyName = sg.getActiveStudyName()
-MESSAGE( myStudyName )
-
-myStudyId = sg.getActiveStudyId()
-MESSAGE( str(myStudyId) )
-
-# get Study Manager reference
-obj = naming_service.Resolve('myStudyManager')
-myStudyManager = obj._narrow(SALOMEDS.StudyManager)
-
-# get active study
-myStudy = myStudyManager.GetStudyByName(myStudyName)
-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
#==============================================================================
# File : supervisionexample.py
# Created : 23 nov 2001
# Author : Jean Rahuel
# Project : SALOME
#==============================================================================
-
+#
from SuperV import *
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# Generated python file of Graph GraphGeom2Essai
-
+#
from SuperV import *
import salome
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test_big_table.py
# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : visu_many_objects.py
# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test_remove_ref.py
# Module : SALOMEDS
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : test_table.py
# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
#
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Alexander Solovyov(OCN)
# Module : SOCC
-# $Header: /dn06/SALOME_CVS/GUI_SRC/src/SOCC/Makefile.in,v 1.1
+# $Header$
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-I$(srcdir)/../OCCViewer -I$(srcdir)/../Qtx
libSOCC_la_LDFLAGS = $(QT_MT_LIBS)
+
libSOCC_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
../Prs/libSalomePrs.la ../OCCViewer/libOCCViewer.la
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifdef WIN32
-#ifdef SOCC_EXPORTS
+#if defined SOCC_EXPORTS
#define SOCC_EXPORT __declspec(dllexport)
#else
#define SOCC_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = SOCC
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT ../Prs ../OCCViewer
-LIBS += -L../../lib -lqtx -lsuit -lSalomeObject -lSalomePrs -lOCCViewer
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SOCC_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = SOCC.h
-HEADERS += SOCC_ViewModel.h
-HEADERS += SOCC_Prs.h
-HEADERS += SOCC_ViewWindow.h
-
-SOURCES = SOCC_ViewModel.cxx
-SOURCES += SOCC_Prs.cxx
-SOURCES += SOCC_ViewWindow.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OCCViewer : build OCC Viewer into Salome desktop
// File : SOCC_Prs.cxx
// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
+
#include "SOCC_Prs.h"
#include <AIS_InteractiveObject.hxx>
-using namespace std;
-
/*!
Default constructor
*/
myObjects.Append( obj );
}
+/*!
+ Prepend interactive object
+*/
+void SOCC_Prs::PrependObject( const Handle(AIS_InteractiveObject)& obj )
+{
+ myObjects.Prepend( obj );
+}
+
+/*!
+ Remove first interactive object
+*/
+void SOCC_Prs::RemoveFirst()
+{
+ myObjects.RemoveFirst();
+}
+
/*!
Remove all interactive objects
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OCCViewer : build OCC Viewer into Salome desktop
// File : SOCC_Prs.h
// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
+
#ifndef SOCC_Prs_H
#define SOCC_Prs_H
// Get interactive objects list
void AddObject( const Handle(AIS_InteractiveObject)& obj );
// Add interactive object
+ void PrependObject( const Handle(AIS_InteractiveObject)& obj );
+ // Prepend interactive object
+ void RemoveFirst();
+ // Remove first interactive object
void Clear();
// Remove all interactive objects
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SOCC_ViewModel.h"
#include "SOCC_Prs.h"
#include <SALOME_AISShape.hxx>
#include <SALOME_AISObject.hxx>
#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
// Temporarily commented to avoid awful dependecy on SALOMEDS
// TODO: better mechanism of storing display/erse status in a study
//#include "SALOMEDSClient.hxx"
//#include "SALOMEDS_StudyManager.hxx"
+#include <Basics_OCCTVersion.hxx>
#include <AIS_TypeOfIso.hxx>
+#include <Precision.hxx>
// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
{
if ( !isInLocal )
OCCViewer_Viewer::highlight( ite.Value(), hilight, false );
- // highlight subshapes only when local selection is active
+ // highlight sub-shapes only when local selection is active
else
{
/*if ( ite.Value()->IsKind( STANDARD_TYPE( SALOME_AISShape ) ) )
*/
bool SOCC_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& obj )
{
- AIS_ListOfInteractive List;
- getAISContext()->DisplayedObjects( List );
-
- AIS_ListIteratorOfListOfInteractive ite( List );
- for ( ; ite.More(); ite.Next() )
- {
- Handle(SALOME_InteractiveObject) anObj =
- Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
- if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
- return getAISContext()->IsDisplayed( ite.Value() );
+ std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> >::iterator it=entry2aisobjects.find(obj->getEntry());
+ if(it != entry2aisobjects.end())
+ {
+ // get context
+ Handle (AIS_InteractiveContext) ic = getAISContext();
+ std::vector<Handle(AIS_InteractiveObject)>& List = it->second;
+ for( unsigned int ind = 0; ind < List.size(); ind++ )
+ {
+ Handle(AIS_InteractiveObject) anAIS=List[ind];
+ if(ic->IsDisplayed(anAIS))
+ return true;
+ }
}
return false;
void SOCC_Viewer::setColor( const Handle(SALOME_InteractiveObject)& obj,
const QColor& color, bool update )
{
- AIS_ListOfInteractive List;
- getAISContext()->DisplayedObjects(List);
-
- AIS_ListIteratorOfListOfInteractive ite(List);
- for ( ; ite.More(); ite.Next() )
- {
- Handle(SALOME_InteractiveObject) anObj =
- Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
+ if(obj.IsNull() || !obj->hasEntry() )
+ return;
- if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
+ if(entry2aisobjects.count(obj->getEntry())>0)
{
- OCCViewer_Viewer::setColor( ite.Value(), color, update );
- return;
+ // get context
+ Handle (AIS_InteractiveContext) ic = getAISContext();
+ std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
+ for( unsigned int ind = 0; ind < List.size(); ind++ )
+ {
+ Handle(AIS_InteractiveObject) anAIS=List[ind];
+ if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
+ OCCViewer_Viewer::setColor( anAIS, color, update );
+ }
}
- }
}
/*!
void SOCC_Viewer::switchRepresentation( const Handle(SALOME_InteractiveObject)& obj,
int mode, bool update )
{
- AIS_ListOfInteractive List;
- getAISContext()->DisplayedObjects(List);
-
- AIS_ListIteratorOfListOfInteractive ite(List);
- for ( ; ite.More(); ite.Next() )
- {
- Handle(SALOME_InteractiveObject) anObj =
- Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
+ if(obj.IsNull() || !obj->hasEntry() )
+ return;
- if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
+ if(entry2aisobjects.count(obj->getEntry())>0)
{
- OCCViewer_Viewer::switchRepresentation( ite.Value(), mode, update );
- return;
+ // get context
+ Handle (AIS_InteractiveContext) ic = getAISContext();
+ std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
+ for( unsigned int ind = 0; ind < List.size(); ind++ )
+ {
+ Handle(AIS_InteractiveObject) anAIS=List[ind];
+ if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
+ OCCViewer_Viewer::switchRepresentation( anAIS, mode, update );
+ }
}
- }
}
/*!
void SOCC_Viewer::setTransparency( const Handle(SALOME_InteractiveObject)& obj,
float trans, bool update )
{
- AIS_ListOfInteractive List;
- getAISContext()->DisplayedObjects( List );
-
- AIS_ListIteratorOfListOfInteractive ite( List );
- for ( ; ite.More(); ite.Next() )
- {
- Handle(SALOME_InteractiveObject) anObj =
- Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
+ if(obj.IsNull() || !obj->hasEntry() )
+ return;
- if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
+ if(entry2aisobjects.count(obj->getEntry())>0)
{
- OCCViewer_Viewer::setTransparency( ite.Value(), trans, update );
- return;
+ // get context
+ Handle (AIS_InteractiveContext) ic = getAISContext();
+ std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
+ for( unsigned int ind = 0; ind < List.size(); ind++ )
+ {
+ Handle(AIS_InteractiveObject) anAIS=List[ind];
+ if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
+ OCCViewer_Viewer::setTransparency( anAIS, trans, update );
+ }
}
- }
}
/*!
// get context
Handle (AIS_InteractiveContext) ic = getAISContext();
- // get all displayed objects
- AIS_ListOfInteractive List;
- ic->DisplayedObjects( List );
- // get objects in the collector
- AIS_ListOfInteractive ListCollector;
- ic->ObjectsInCollector( ListCollector );
-
// get objects to be displayed
AIS_ListOfInteractive anAISObjects;
anOCCPrs->GetObjects( anAISObjects );
if ( !anAIS.IsNull() )
{
// try to find presentation in the viewer
- bool bDisplayed = false;
- AIS_ListIteratorOfListOfInteractive ite( List );
- for ( ; ite.More(); ite.Next() )
- {
- // compare presentations by handles
- // if the object is already displayed - nothing to do more
- if ( ite.Value() == anAIS )
+
+ // if the object is already displayed - nothing to do more
+ if(ic->IsDisplayed(anAIS))
{
// Deactivate object if necessary
if ( !anOCCPrs->ToActivate() )
ic->Deactivate( anAIS );
- bDisplayed = true;
- break;
+ continue;
}
- }
-
- if ( bDisplayed )
- continue;
// then try to find presentation in the collector
- bDisplayed = false;
- ite.Initialize( ListCollector );
- for ( ; ite.More(); ite.Next() )
- {
- // compare presentations by handles
- // if the object is in collector - display it
- if ( ite.Value() == anAIS )
+ if(ic->IsInCollector(anAIS))
{
ic->DisplayFromCollector( anAIS, false );
-
// Deactivate object if necessary
if ( !anOCCPrs->ToActivate() )
ic->Deactivate( anAIS );
- bDisplayed = true;
// Set visibility flag
- // Temporarily commented to avoid awful dependecy on SALOMEDS
- // TODO: better mechanism of storing display/erse status in a study
- // should be provided...
- //Handle(SALOME_InteractiveObject) anObj =
+ // Temporarily commented to avoid awful dependecy on SALOMEDS
+ // TODO: better mechanism of storing display/erse status in a study
+ // should be provided...
+ //Handle(SALOME_InteractiveObject) anObj =
// Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
//if ( !anObj.IsNull() && anObj->hasEntry() )
//{
- // if ( study )
- // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
- //}
- break;
+ // if ( study )
+ // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+ //}
+ continue;
}
- }
- if ( bDisplayed )
- continue;
// if object is not displayed and not found in the collector - display it
if ( anAIS->IsKind( STANDARD_TYPE(AIS_Trihedron) ) )
{
Handle(AIS_Trihedron) aTrh = Handle(AIS_Trihedron)::DownCast( anAIS );
double aNewSize = 100, aSize = 100;
- getTrihedronSize( aNewSize, aSize );
+ computeTrihedronSize( aNewSize, aSize );
aTrh->SetSize( aTrh == getTrihedron() ? aNewSize : 0.5 * aNewSize );
}
ic->Display( anAIS, false );
+
+#if OCC_VERSION_LARGE > 0x06050200
+ Handle(SALOME_AISShape) aSh = Handle(SALOME_AISShape)::DownCast(anAIS);
+ if ( !aSh.IsNull() ) {
+ bool top = (aSh->isTopLevel() && aSh->switchTopLevel());
+ ic->SetZLayer( aSh, top ? getTopLayerId() : 0 );
+ if(!aSh->toActivate()) {
+ ic->Deactivate( aSh );
+ }
+ }
+#endif
+ //Register anAIS (if it has an entry) in entry2aisobjects map
+ Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
+ if ( !anObj.IsNull() && anObj->hasEntry())
+ {
+ std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[anObj->getEntry()];
+ int found=0;
+ for ( unsigned int ind = 0; ind < List.size(); ind++ )
+ {
+ if(List[ind] == anAIS)
+ {
+ found=1;
+ break;
+ }
+ }
+ if(!found)
+ {
+ List.push_back(anAIS);
+ }
+ }
// Set visibility flag
// Temporarily commented to avoid awful dependecy on SALOMEDS
ic->Deactivate( anAIS );
}
}
+ updateTrihedron();
}
//}
}
}
+ updateTrihedron();
}
ic->DisplayedObjects( aList );
AIS_ListIteratorOfListOfInteractive anIter( aList );
for ( ; anIter.More(); anIter.Next() ) {
- if ( isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) ||
- anIter.Value()->DynamicType() == STANDARD_TYPE( OCCViewer_Trihedron ))
+ if ( (isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron )) ||
+ anIter.Value()->DynamicType() == STANDARD_TYPE( OCCViewer_Trihedron ))
continue;
// erase an object
// should be provided...
//if ( !forced ) {
// Handle(SALOME_InteractiveObject) anObj =
- // Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() );
+ // Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() );
// if ( !anObj.IsNull() && anObj->hasEntry() ) {
- // if ( study )
- // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
+ // if ( study )
+ // ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
// }
//}
}
-
+
Repaint();
+ updateTrihedron();
}
/*!
SOCC_Prs* prs = new SOCC_Prs();
if ( entry )
{
- // get context
- Handle(AIS_InteractiveContext) ic = getAISContext();
-
- // get displayed objects
- AIS_ListOfInteractive List;
- ic->DisplayedObjects( List );
- // get objects in the collector
- AIS_ListOfInteractive ListCollector;
- ic->ObjectsInCollector( ListCollector );
- List.Append( ListCollector );
-
- AIS_ListIteratorOfListOfInteractive ite( List );
- for ( ; ite.More(); ite.Next() )
- {
- Handle(SALOME_InteractiveObject) anObj =
- Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
-
- if ( !anObj.IsNull() && anObj->hasEntry() && strcmp( anObj->getEntry(), entry ) == 0 )
- prs->AddObject( ite.Value() );
- }
+ if(entry2aisobjects.count(entry)>0)
+ {
+ //ais object exists
+ std::vector<Handle(AIS_InteractiveObject)> List = entry2aisobjects[entry];
+ // get context
+ Handle(AIS_InteractiveContext) ic = getAISContext();
+ //add all ais
+ for ( unsigned int ind = 0; ind < List.size(); ind++ )
+ {
+ Handle(AIS_InteractiveObject) anAIS=List[ind];
+ if(ic->IsDisplayed(anAIS)||ic->IsInCollector(anAIS))
+ {
+ prs->AddObject( anAIS );
+ }
+ }
+ }
}
return prs;
}
/*!
- Activates selection of sub shapes
+ Activates selection of sub-shapes
*/
void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const int theMode )
{
}
/*!
- Deactivates selection of sub shapes
+ Deactivates selection of sub-shapes
*/
void SOCC_Viewer::GlobalSelection( const bool update ) const
{
}
}
-/*!
- Auxiliary method called before displaying of objects
-*/
-void SOCC_Viewer::BeforeDisplay( SALOME_Displayer* d )
-{
- d->BeforeDisplay( this, SALOME_OCCViewType() );
-}
-
-/*!
- Auxiliary method called after displaying of objects
-*/
-void SOCC_Viewer::AfterDisplay( SALOME_Displayer* d )
-{
- d->AfterDisplay( this, SALOME_OCCViewType() );
-}
/*!
- Get new and current trihedron size corresponding to the current model size
+ \Collect objects visible in viewer
+ \param theList - visible objects collection
*/
-bool SOCC_Viewer::getTrihedronSize( double& theNewSize, double& theSize )
+void SOCC_Viewer::GetVisible( SALOME_ListIO& theList )
{
- theNewSize = 100;
- theSize = 100;
-
- //SRN: BUG IPAL8996, a usage of method ActiveView without an initialization
- Handle(V3d_Viewer) viewer = getViewer3d();
- viewer->InitActiveViews();
- if(!viewer->MoreActiveViews()) return false;
-
- Handle(V3d_View) view3d = viewer->ActiveView();
- //SRN: END of fix
-
- if ( view3d.IsNull() )
- return false;
-
- double Xmin = 0, Ymin = 0, Zmin = 0, Xmax = 0, Ymax = 0, Zmax = 0;
- double aMaxSide;
-
- view3d->View()->MinMaxValues( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
-
- if ( Xmin == RealFirst() || Ymin == RealFirst() || Zmin == RealFirst() ||
- Xmax == RealLast() || Ymax == RealLast() || Zmax == RealLast() )
- return false;
-
- aMaxSide = Xmax - Xmin;
- if ( aMaxSide < Ymax -Ymin ) aMaxSide = Ymax -Ymin;
- if ( aMaxSide < Zmax -Zmin ) aMaxSide = Zmax -Zmin;
-
- float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("Viewer","TrihedronSize", 105.);
-
- static float EPS = 5.0E-3;
- theSize = getTrihedron()->Size();
- theNewSize = aMaxSide*aSizeInPercents / 100.0;
+ AIS_ListOfInteractive List;
+ getAISContext()->DisplayedObjects(List);
+
+ AIS_ListIteratorOfListOfInteractive ite(List);
+ for ( ; ite.More(); ite.Next() )
+ {
+ Handle(SALOME_InteractiveObject) anObj =
+ Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
- return fabs( theNewSize - theSize ) > theSize * EPS ||
- fabs( theNewSize - theSize) > theNewSize * EPS;
+ if ( !anObj.IsNull() && anObj->hasEntry() )
+ theList.Append( anObj );
+ }
}
-
/*!
Updates current viewer
*/
/*!
create SOCC_ViewWindow
*/
-SUIT_ViewWindow* SOCC_Viewer::createView( SUIT_Desktop* theDesktop )
+/*SUIT_ViewWindow* SOCC_Viewer::createView( SUIT_Desktop* theDesktop )
{
SOCC_ViewWindow* view = new SOCC_ViewWindow(theDesktop, this);
- initView( view );
+ //initView( view );
+ initView( view->getView(OCCViewer_ViewFrame::MAIN_VIEW) );
return view;
+ }*/
+
+/*
+ * Returns a new OCCViewer_ViewWindow instance which will be placed as a sub window in ViewFrame
+ */
+OCCViewer_ViewWindow* SOCC_Viewer::createSubWindow()
+{
+ return new SOCC_ViewWindow( 0, this);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SOCC_VIEWMODEL_H
#define SOCC_VIEWMODEL_H
#include "SALOME_Prs.h"
#include "OCCViewer_ViewModel.h"
+class SALOME_ListIO;
class Handle(SALOME_InteractiveObject);
class SOCC_EXPORT SOCC_Viewer: public OCCViewer_Viewer, public SALOME_View
virtual ~SOCC_Viewer();
/* Selection management */
- bool highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
+ bool highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
bool isInViewer( const Handle(SALOME_InteractiveObject)&, bool=false );
void setColor( const Handle(SALOME_InteractiveObject)&, const QColor&, bool=true );
void rename( const Handle(SALOME_InteractiveObject)&, const QString& );
- virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+ //virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+ virtual OCCViewer_ViewWindow* createSubWindow();
/* Reimplemented from SALOME_View */
virtual void Display( const SALOME_OCCPrs* );
virtual void Erase( const SALOME_OCCPrs*, const bool = false );
virtual void EraseAll( const bool = false );
virtual SALOME_Prs* CreatePrs( const char* entry = 0 );
- virtual void BeforeDisplay( SALOME_Displayer* d );
- virtual void AfterDisplay ( SALOME_Displayer* d );
+
virtual void LocalSelection( const SALOME_OCCPrs*, const int );
virtual void GlobalSelection( const bool = false ) const;
virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
+ virtual void GetVisible( SALOME_ListIO& );
virtual void Repaint();
- // a utility function, used by SALOME_View_s methods
- bool getTrihedronSize( double& theNewSize, double& theSize );
-
+ //a map to store AIS objects associated to a SALOME entry
+ std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> > entry2aisobjects;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SOCC_ViewWindow.h"
#include "OCCViewer_ViewPort3d.h"
*/
SOCC_ViewWindow
::SOCC_ViewWindow( SUIT_Desktop* theDesktop,
- OCCViewer_Viewer* theModel)
+ OCCViewer_Viewer* theModel)
: OCCViewer_ViewWindow( theDesktop, theModel )
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SOCC_VIEWWINDOW_H
#define SOCC_VIEWWINDOW_H
#endif
#include "SOCC.h"
-#include "OCCViewer_ViewWindow.h"
+#include "OCCViewer_ViewFrame.h"
class SOCC_EXPORT SOCC_ViewWindow : public OCCViewer_ViewWindow
{
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libSPlot2d.la
salomeinclude_HEADERS = \
SPlot2d.h \
SPlot2d_Curve.h \
+ SPlot2d_Histogram.h \
SPlot2d_Prs.h \
SPlot2d_ViewModel.h \
SPlot2d_ViewWindow.h
dist_libSPlot2d_la_SOURCES = \
SPlot2d_Curve.cxx \
+ SPlot2d_Histogram.cxx \
SPlot2d_Prs.cxx \
SPlot2d_ViewModel.cxx \
SPlot2d_ViewWindow.cxx
libSPlot2d_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(QWT_INCLUDES) $(BOOST_CPPFLAGS) \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Plot2d \
-I$(srcdir)/../Prs -I$(srcdir)/../OBJECT
-libSPlot2d_la_LDFLAGS = $(QT_MT_LIBS) $(CAS_KERNEL) $(QWT_LIBS) ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la ../OBJECT/libSalomeObject.la
+libSPlot2d_la_LDFLAGS = ../SUIT/libsuit.la ../Plot2d/libPlot2d.la ../Prs/libSalomePrs.la ../OBJECT/libSalomeObject.la
+
+### VSR: 24/11/2009: remove these libs to avoid double linking to the native libraries
+###$(QT_MT_LIBS) $(CAS_KERNEL) $(QWT_LIBS)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifdef WIN32
-#ifdef SPLOT2D_EXPORTS
+#if defined SPLOT2D_EXPORTS || defined SPlot2d_EXPORTS
#define SPLOT2D_EXPORT __declspec(dllexport)
#else
#define SPLOT2D_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = SPlot2d
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-QWTHOME=$$(QWTHOME)
-QWTINC=$${QWTHOME}/include
-QWTLIB=$${QWTHOME}/lib
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} ../../include $${QWTINC} $${BOOST_CPPFLAGS}
-INCLUDEPATH += ../Qtx ../SUIT ../Plot2d ../Prs ../OBJECT
-unix:LIBS += -L$${QWTLIB} -lqwt
-win32:LIBS += /LIBPATH:$$(QWTLIB)
-LIBS += -L../../lib -lsuit -lPlot2d -lSalomePrs
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SPLOT2D_EXPORTS
-
-HEADERS = SPlot2d.h
-HEADERS = SPlot2d_Curve.h
-HEADERS = SPlot2d_Prs.h
-HEADERS = SPlot2d_ViewModel.h
-HEADERS = SPlot2d_ViewWindow.h
-
-SOURCES = SPlot2d_Curve.cxx
-SOURCES += SPlot2d_Curve.cxx
-SOURCES += SPlot2d_Prs.cxx
-SOURCES += SPlot2d_ViewModel.cxx
-SOURCES += SPlot2d_ViewWindow.cxx
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-INSTALLS += includes
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SPlot2d_Curve.cxx
-// Author : Sergey RUIN
-// Module : SUIT
-//
-#include "SPlot2d_Curve.h"
-#include <QString>
-#include <QColor>
+// Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
-using namespace std;
+#include "SPlot2d_Curve.h"
/*!
Constructor
Copy constructor. Makes deep copy of data.
*/
SPlot2d_Curve::SPlot2d_Curve( const SPlot2d_Curve& curve )
+: Plot2d_Curve( curve )
{
- myAutoAssign = curve.isAutoAssign();
- myHorTitle = curve.getHorTitle();
- myVerTitle = curve.getVerTitle();
- myHorUnits = curve.getHorUnits();
- myVerUnits = curve.getVerUnits();
- myColor = curve.getColor();
- myMarker = curve.getMarker();
- myLine = curve.getLine();
- myLineWidth = curve.getLineWidth();
- myPoints = curve.getPointList();
- myIO = curve.getIO();
- myTableIO = curve.getTableIO();
+ myIO = curve.getIO();
+ myTableIO = curve.getTableIO();
}
/*!
*/
SPlot2d_Curve& SPlot2d_Curve::operator=( const SPlot2d_Curve& curve )
{
- myAutoAssign = curve.isAutoAssign();
- myHorTitle = curve.getHorTitle();
- myVerTitle = curve.getVerTitle();
- myHorUnits = curve.getHorUnits();
- myVerUnits = curve.getVerUnits();
- myColor = curve.getColor();
- myMarker = curve.getMarker();
- myLine = curve.getLine();
- myLineWidth = curve.getLineWidth();
- myPoints = curve.getPointList();
+ Plot2d_Curve::operator=(curve);
myIO = curve.getIO();
myTableIO = curve.getTableIO();
return *this;
title = getTableIO()->getName();
return title;
}
+
+/*!
+ Add owner of the curve.
+ \param owner - owner of the curve
+*/
+void SPlot2d_Curve::addOwner(const QString& owner) {
+ myOwners.insert(owner);
+}
+
+/*!
+ Remove owner of the curve.
+ \param owner - owner of the curve
+*/
+void SPlot2d_Curve::removeOwner(const QString& owner) {
+ myOwners.insert(owner);
+}
+
+/*!
+ Get all owners of the curve.
+ \return owners of the curve.
+*/
+OwnerSet SPlot2d_Curve::getOwners() const {
+ return myOwners;
+}
+
+
+/*!
+ Add owners of the curve.
+ \param owners - owners of the curve
+*/
+void SPlot2d_Curve::addOwners(OwnerSet& owners) {
+ myOwners = myOwners|=owners;
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SPlot2d_Curve.h
-// Author : Sergey RUIN
-// Module : SUIT
-//
+// Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
+
#ifndef SPlot2d_Curve_h
#define SPlot2d_Curve_h
#include "SPlot2d.h"
-
#include "Plot2d_Curve.h"
+
+#include <QSet>
+
#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
#include <Handle_SALOME_InteractiveObject.hxx>
#endif
#include "SALOME_InteractiveObject.hxx"
-class QString;
-class QColor;
+typedef QSet<QString> OwnerSet;
class SPLOT2D_EXPORT SPlot2d_Curve : public Plot2d_Curve
{
virtual Handle(SALOME_InteractiveObject) getTableIO() const;
virtual void setTableIO( const Handle(SALOME_InteractiveObject)& );
+ virtual void addOwner(const QString& owner);
+ virtual void removeOwner(const QString& owner);
+ virtual OwnerSet getOwners() const;
+ virtual void addOwners (OwnerSet& owners);
+
private:
Handle(SALOME_InteractiveObject) myIO;
Handle(SALOME_InteractiveObject) myTableIO;
+ OwnerSet myOwners;
};
#endif // SPlot2d_Curve_h
-
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SPlot2d_Prs.cxx
-// Author : Sergey RUIN
-// Module : SUIT
-//
+// Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
+
#include "SPlot2d_Prs.h"
-#ifndef WIN32
-using namespace std;
-#endif
/*!
Default constructor
/*!
Standard constructor
*/
-SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Curve* obj )
+SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Object* obj )
:Plot2d_Prs(obj)
{
}
SPlot2d_Prs::SPlot2d_Prs( const Plot2d_Prs* prs )
{
mySecondY = prs->isSecondY();
- myCurves = prs->getCurves();
+ myObjects = prs->getObjects();
+ myIsAutoDel = false; // VSR: error? should auto-delete flag be removed
}
/*!
}
+/*!
+ Check if the presentation is empty
+*/
+bool SPlot2d_Prs::IsNull() const
+{
+ return Plot2d_Prs::IsNull();
+}
+
+/*!
+ Get contained objects
+*/
+objectList SPlot2d_Prs::GetObjects() const
+{
+ return getObjects();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SPlot2d_Prs.h
-// Author : Sergey RUIN
-// Module : SUIT
-//
+// Author : Sergey RUIN, Open CASCADE S.A.S. (sergey.ruin@opencascade.com)
+
#ifndef SPLOT2D_PRS_H
#define SPLOT2D_PRS_H
class SPLOT2D_EXPORT SPlot2d_Prs : public SALOME_Prs2d, public Plot2d_Prs
{
public:
-
// Default constructor
SPlot2d_Prs();
// Standard constructor
- SPlot2d_Prs( const Plot2d_Curve* obj );
+ SPlot2d_Prs( const Plot2d_Object* obj );
SPlot2d_Prs( const Plot2d_Prs* prs );
// Destructor
~SPlot2d_Prs();
- virtual bool IsNull() const { return Plot2d_Prs::IsNull(); }
+ virtual bool IsNull() const;
// Get curves list
- // Note: Depricated method, use method getCurves
- curveList GetObjects() const { return getCurves(); }
-
+ // Note: Deprecated method, use method getCurves
+ objectList GetObjects() const;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SPlot2d_Viewer.cxx
// Author : Sergey RUIN
// Module : SUIT
#include "SPlot2d_ViewWindow.h"
#include "SPlot2d_Prs.h"
+#include "SPlot2d_Histogram.h"
#include "SUIT_Session.h"
#include "SUIT_Application.h"
#include "SUIT_ViewManager.h"
#include "SALOME_ListIO.hxx"
+#include "SALOME_ListIteratorOfListIO.hxx"
#include <QApplication>
#include <QToolBar>
#include <qwt_plot_curve.h>
#include <stdlib.h>
-using namespace std;
-
//ASL: Temporary commented in order to avoir dependency on SALOMEDS
//#include "SALOMEDSClient.hxx"
Constructor
*/
SPlot2d_Viewer::SPlot2d_Viewer( bool theAutoDel )
-: Plot2d_Viewer( theAutoDel )
+: Plot2d_Viewer( theAutoDel ),
+ myDeselectAnalytical(true)
{
}
Renames curve if it is found
*/
void SPlot2d_Viewer::rename( const Handle(SALOME_InteractiveObject)& IObject,
- const QString& newName, Plot2d_ViewFrame* fr )
+ const QString& newName, Plot2d_ViewFrame* fr )
{
Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame();
if( !aViewFrame )
CurveDict::Iterator it = aCurves.begin();
for( ; it != aCurves.end(); ++it ) {
SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
- if(aCurve && aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject))
- return 1;
+ if(aCurve && aCurve->hasIO() && aCurve->getTableIO()->isSame(IObject))
+ return 1;
}
}
}
_PTR(SObject) aChildSO = aIter->Value();
_PTR(SObject) refSO;
if ( aChildSO->ReferencedObject( refSO ) && refSO )
- aChildSO = refSO;
+ aChildSO = refSO;
curve = getCurveByIO( new SALOME_InteractiveObject( aChildSO->GetID().c_str(), "") );
if ( curve )
- aViewFrame->eraseCurve( curve, update );
+ aViewFrame->eraseCurve( curve, update );
}
}
*/
SALOME_Prs* SPlot2d_Viewer::CreatePrs( const char* entry )
{
Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+ SPlot2d_Prs *prs = new SPlot2d_Prs();
if(aViewFrame)
{
- Plot2d_Prs* prs = aViewFrame->CreatePrs(entry);
- if( prs )
- return new SPlot2d_Prs( prs );
+ CurveDict aCurves = aViewFrame->getCurves();
+ CurveDict::Iterator it = aCurves.begin();
+ for( ; it != aCurves.end(); ++it ) {
+ SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.value());
+ OwnerSet owners = aCurve->getOwners();
+ if(aCurve) {
+ if (
+ (aCurve->hasIO() && !strcmp( aCurve->getIO()->getEntry(), entry )) ||
+ (aCurve->hasTableIO() && !strcmp( aCurve->getTableIO()->getEntry(), entry )) ||
+ owners.contains(entry)
+ ) {
+ prs->AddObject(aCurve);
+ }
+ }
+ }
}
-
- return NULL;
-}
-
-/*!
- Axiluary method called before displaying of objects
-*/
-void SPlot2d_Viewer::BeforeDisplay( SALOME_Displayer* d )
-{
- d->BeforeDisplay( this, SALOME_Plot2dViewType() );
-}
-
-/*!
- Axiluary method called after displaying of objects
-*/
-void SPlot2d_Viewer::AfterDisplay( SALOME_Displayer* d )
-{
- d->AfterDisplay( this, SALOME_Plot2dViewType() );
+ return prs;
}
/*!
return aViewFrame->isVisible( curve );
}
+/*!
+ \Collect objects visible in viewer
+ \param theList - visible objects collection
+*/
+void SPlot2d_Viewer::GetVisible( SALOME_ListIO& theList )
+{
+ Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+ if(aViewFrame == NULL) return;
+ CurveDict aCurves = aViewFrame->getCurves();
+ CurveDict::Iterator it = aCurves.begin();
+ for( ; it != aCurves.end(); ++it ) {
+ SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>(it.value());
+ if ( aCurve && aCurve->hasIO() && aViewFrame->isVisible( aCurve ) )
+ theList.Append( aCurve->getIO() );
+ }
+}
+
/*!
Return interactive obeject if is presented in the viewer
*/
\param fr - viewframe
*/
SPlot2d_Curve* SPlot2d_Viewer::getCurveByIO( const Handle(SALOME_InteractiveObject)& theIObject,
- Plot2d_ViewFrame* fr )
+ Plot2d_ViewFrame* fr )
{
if ( !theIObject.IsNull() ) {
Plot2d_ViewFrame* aViewFrame = fr ? fr : getActiveViewFrame();
CurveDict::Iterator it = aCurves.begin();
for( ; it != aCurves.end(); ++it ) {
SPlot2d_Curve* aCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
- if(aCurve) {
- if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) )
- return aCurve;
- }
+ if(aCurve) {
+ if ( aCurve->hasIO() && aCurve->getIO()->isSame( theIObject ) )
+ return aCurve;
+ }
}
}
}
SUIT_ViewWindow* SPlot2d_Viewer::createView( SUIT_Desktop* theDesktop )
{
SPlot2d_ViewWindow* aPlot2dView = new SPlot2d_ViewWindow(theDesktop, this);
+ aPlot2dView->initLayout();
if (getPrs())
aPlot2dView->getViewFrame()->Display(getPrs());
return aPlot2dView;
Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
if(aViewFrame == NULL) return;
- CurveDict aCurves = aViewFrame->getCurves();
- SPlot2d_Curve* aSCurve;
- CurveDict::Iterator it = aCurves.begin();
- for( ; it != aCurves.end(); ++it )
- {
- if ( it.key() == plotItem ) {
- aSCurve = dynamic_cast<SPlot2d_Curve*>( it.value() );
- break;
- }
+ bool isAnalytical = false;
+ AnalyticalCurveList curves = aViewFrame->getAnalyticalCurves();
+ foreach ( Plot2d_AnalyticalCurve* curve, curves ) {
+ if(plotItem == curve->plotItem()) {
+ isAnalytical = true;
+ curve->setSelected(true);
+ } else {
+ curve->setSelected(false);
+ }
+ }
+ if(isAnalytical) {
+ myDeselectAnalytical = false;
+ emit clearSelected();
+ aViewFrame->updateAnalyticalCurves();
+ myDeselectAnalytical = true;
+ return;
}
- // Highlight curve in Object Browser
- if(aSCurve && aSCurve->hasIO()) {
- QString anEntry = aSCurve->getIO()->getEntry();
- emit legendSelected( anEntry );
+
+ Plot2d_Object* anObject = aViewFrame->getPlotObject(plotItem);
+
+ if(anObject) {
+
+ // Highlight object in Object Browser
+ QString anEntry;
+ if(SPlot2d_Curve* aSCurve = dynamic_cast<SPlot2d_Curve*>(anObject)) {
+ if(aSCurve->hasIO())
+ anEntry = aSCurve->getIO()->getEntry();
+ } else if( SPlot2d_Histogram* aSHisto = dynamic_cast<SPlot2d_Histogram*>(anObject)) {
+ if(aSHisto->hasIO())
+ anEntry = aSHisto->getIO()->getEntry();
+ }
+
+ if(!anEntry.isEmpty())
+ emit legendSelected( anEntry );
+ }
+}
+
+/*!
+
+*/
+void SPlot2d_Viewer::setObjectsSelected( SALOME_ListIO& theList ) {
+ Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
+ if(aViewFrame) {
+
+ objectList allObjects;
+ aViewFrame->getObjects( allObjects );
+
+ bool isSelected = false;
+ SPlot2d_Histogram* h = 0;
+ SPlot2d_Curve* c =0;
+
+ foreach ( Plot2d_Object* o, allObjects ) {
+ isSelected = false;
+
+ Handle(SALOME_InteractiveObject) io;
+ if( (h = dynamic_cast<SPlot2d_Histogram*>(o)) && h->hasIO() ) {
+ io = h->getIO();
+ } else if((c = dynamic_cast<SPlot2d_Curve*>(o)) && c->hasIO()) {
+ io = c->getIO();
+ } else {
+ continue;
+ }
+
+ SALOME_ListIteratorOfListIO anIter( theList );
+
+ for( ; anIter.More(); anIter.Next() ) {
+ if ( anIter.Value()->hasEntry() ) {
+ if( io->isSame(anIter.Value()) ) {
+ isSelected = o->isSelected();
+ if( !isSelected ) {
+ o->setSelected(true);
+ aViewFrame->updateObject(o);
+ theList.Remove(anIter);
+ isSelected = true;
+ break;
+ } else
+ break;
+ }
+ }
+ }
+ if( !isSelected && o->isSelected() != false ) {
+ o->setSelected(false);
+ aViewFrame->updateObject(o);
+ }
+ }
+ if( myDeselectAnalytical ) {
+ aViewFrame->deselectAnalyticalCurves();
+ aViewFrame->updateAnalyticalCurves();
+ }
+ aViewFrame->Repaint();
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SPlot2d_ViewModel.h
// Author : Sergey RUIN
// Module : SUIT
#ifndef SPlot2d_ViewModel_H
#define SPlot2d_ViewModel_H
-#include "SPlot2d.h"
-
-#include "SALOME_Prs.h"
+#include "SPlot2d.h"
+#include "SPlot2d_Curve.h"
#include "Plot2d_ViewModel.h"
-#include "SALOME_InteractiveObject.hxx"
#include "Plot2d_ViewFrame.h"
#include "Plot2d_ViewWindow.h"
-#include "SPlot2d_Curve.h"
+
+#include <SALOME_Prs.h>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
{
virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
- /* display */
+ /* display */
void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject );
void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
virtual void EraseAll(const bool = false);
virtual void Repaint();
virtual SALOME_Prs* CreatePrs( const char* entry = 0 );
- virtual void BeforeDisplay( SALOME_Displayer* d );
- virtual void AfterDisplay ( SALOME_Displayer* d );
+
virtual bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
+ virtual void GetVisible( SALOME_ListIO& theList );
+
+ virtual void setObjectsSelected( SALOME_ListIO& theList );
/* operations */
signals:
void legendSelected( const QString& );
+ void clearSelected();
+private:
+ bool myDeselectAnalytical;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SPlot2d_ViewWindow.h"
#include "Plot2d_ViewFrame.h"
*/
SPlot2d_ViewWindow
::SPlot2d_ViewWindow( SUIT_Desktop* theDesktop,
- Plot2d_Viewer* theModel)
+ Plot2d_Viewer* theModel)
: Plot2d_ViewWindow( theDesktop, theModel )
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SPLOT2D_VIEWWINDOW_H
#define SPLOT2D_VIEWWINDOW_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. translating
-# from French to English, "Foo::Bar" would be translated to "Pub",
-# not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2005-06-16 12:01:13 PM MSD\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : STD
nodist_salomeres_DATA = \
STD_images.qm \
- STD_msg_en.qm
+ STD_msg_en.qm \
+ STD_msg_fr.qm
libstd_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
libstd_la_LDFLAGS = $(QT_MT_LIBS)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef STD_H
#define STD_H
#if defined WIN32
-# if defined STD_EXPORTS
+# if defined STD_EXPORTS || defined std_EXPORTS
# define STD_EXPORT __declspec( dllexport )
# else
# define STD_EXPORT __declspec( dllimport )
#if defined ( _DEBUG ) || defined ( DEBUG )
#include <assert.h>
-#define STD_VERIFY(x) (assert(x))
-#define STD_ASSERT(x) (assert(x))
+#define STD_VERIFY(x) (assert(x))
+#define STD_ASSERT(x) (assert(x))
#else
-#define STD_VERIFY(x) (x)
+#define STD_VERIFY(x) (x)
#define STD_ASSERT(x)
#endif
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = std
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += STD_EXPORTS
-
-HEADERS = STD.h
-HEADERS += STD_Application.h
-HEADERS += STD_MDIDesktop.h
-HEADERS += STD_SDIDesktop.h
-HEADERS += STD_TabDesktop.h
-
-SOURCES = STD_Application.cxx
-SOURCES += STD_MDIDesktop.cxx
-SOURCES += STD_SDIDesktop.cxx
-SOURCES += STD_TabDesktop.cxx
-
-TRANSLATIONS = resources/STD_images.ts \
- resources/STD_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm resources/*.xml resources/*.ini
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "STD_Application.h"
#include "STD_MDIDesktop.h"
tr( "MEN_DESK_FILE_OPEN" ), tr( "PRP_DESK_FILE_OPEN" ),
Qt::CTRL+Qt::Key_O, desk, false, this, SLOT( onOpenDoc() ) );
+ createAction( FileReopenId, tr( "TOT_DESK_FILE_REOPEN" ), QIcon(),
+ tr( "MEN_DESK_FILE_REOPEN" ), tr( "PRP_DESK_FILE_REOPEN" ),
+ 0, desk, false, this, SLOT( onReopenDoc() ) );
+
createAction( FileCloseId, tr( "TOT_DESK_FILE_CLOSE" ),
resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ),
tr( "MEN_DESK_FILE_CLOSE" ), tr( "PRP_DESK_FILE_CLOSE" ),
createAction( FileSaveAsId, tr( "TOT_DESK_FILE_SAVEAS" ), QIcon(),
tr( "MEN_DESK_FILE_SAVEAS" ), tr( "PRP_DESK_FILE_SAVEAS" ),
- Qt::CTRL+Qt::Key_A, desk, false, this, SLOT( onSaveAsDoc() ) );
+ Qt::CTRL+Qt::SHIFT+Qt::Key_S, desk, false, this, SLOT( onSaveAsDoc() ) );
createAction( EditCopyId, tr( "TOT_DESK_EDIT_COPY" ),
resMgr->loadPixmap( "STD", tr( "ICON_EDIT_COPY" ) ),
QAction* a = createAction( ViewStatusBarId, tr( "TOT_DESK_VIEW_STATUSBAR" ),
QIcon(), tr( "MEN_DESK_VIEW_STATUSBAR" ),
- tr( "PRP_DESK_VIEW_STATUSBAR" ), Qt::SHIFT+Qt::Key_S, desk, true );
+ tr( "PRP_DESK_VIEW_STATUSBAR" ), Qt::ALT+Qt::SHIFT+Qt::Key_S, desk, true );
a->setChecked( desk->statusBar()->isVisibleTo( desk ) );
connect( a, SIGNAL( toggled( bool ) ), this, SLOT( onViewStatusBar( bool ) ) );
createAction( HelpAboutId, tr( "TOT_DESK_HELP_ABOUT" ), QIcon(),
tr( "MEN_DESK_HELP_ABOUT" ), tr( "PRP_DESK_HELP_ABOUT" ),
- Qt::SHIFT+Qt::Key_A, desk, false, this, SLOT( onHelpAbout() ) );
+ Qt::ALT+Qt::SHIFT+Qt::Key_A, desk, false, this, SLOT( onHelpAbout() ) );
QtxDockAction* dwa = new QtxDockAction( tr( "TOT_DOCKWINDOWS" ), tr( "MEN_DESK_VIEW_DOCKWINDOWS" ), desk );
createMenu( FileNewId, fileMenu, 0 );
createMenu( FileOpenId, fileMenu, 0 );
+ createMenu( FileReopenId, fileMenu, 0 );
createMenu( FileCloseId, fileMenu, 5 );
createMenu( separator(), fileMenu, -1, 5 );
createMenu( FileSaveId, fileMenu, 5 );
return res;
}
+/*! Reload document from the file.*/
+bool STD_Application::onReopenDoc()
+{
+ bool res = false;
+
+ SUIT_Study* study = activeStudy();
+ if ( study && study->isSaved() ) {
+ // ask user for the confirmation
+ if ( SUIT_MessageBox::question( desktop(), tr( "REOPEN_STUDY" ), tr( "REOPEN_QUESTION" ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No
+ ) == SUIT_MessageBox::No )
+ return false;
+
+ // remember study name
+ QString studyName = study->studyName();
+
+ // close study
+ beforeCloseDoc( study );
+ study->closeDocument( true );
+
+ // update views / windows / status bar / title
+ clearViewManagers();
+ setActiveStudy( 0 );
+ updateDesktopTitle();
+ updateCommandsStatus();
+
+ // delete study
+ delete study;
+ study = 0;
+
+ // post closing actions
+ afterCloseDoc();
+
+ // reload study from the file
+ res = useFile( studyName ) && activeStudy();
+
+ // if reloading is failed, close the desktop
+ if ( !res ) {
+ setDesktop( 0 );
+ closeApplication();
+ }
+ }
+ return res;
+}
+
/*!Virtual function. Not implemented here.*/
void STD_Application::beforeCloseDoc( SUIT_Study* )
{
QList<SUIT_Application*> aAppList = aSession->applications();
for ( QList<SUIT_Application*>::iterator it = aAppList.begin(); it != aAppList.end() && !aApp; ++it )
{
- if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
- aApp = *it;
+ if ( (*it)->activeStudy() && (*it)->activeStudy()->studyName() == aName )
+ aApp = *it;
}
if ( aApp )
- aApp->desktop()->activateWindow();
+ aApp->desktop()->activateWindow();
else
- res = false;
+ res = false;
}
break;
case OpenNew:
{
SUIT_Application* aApp = startApplication( 0, 0 );
if ( aApp )
- res = aApp->useFile( aName );
+ res = aApp->useFile( aName );
if ( !res )
- aApp->closeApplication();
+ aApp->closeApplication();
}
break;
case OpenCancel:
putInfo( "" );
// displaying a message box as SUIT_Validator in case file can't be written (the most frequent case)
SUIT_MessageBox::critical( desktop(), tr( "ERR_ERROR" ),
- tr( "ERR_PERMISSION_DENIED" ).arg( activeStudy()->studyName() ) );
+ tr( "INF_DOC_SAVING_FAILS" ).arg( activeStudy()->studyName() ) );
}
else
putInfo( tr( "INF_DOC_SAVED" ).arg( "" ) );
{
SUIT_Application::updateCommandsStatus();
- bool aHasStudy = activeStudy() != 0;
- bool aIsNeedToSave = false;
- if ( aHasStudy )
- aIsNeedToSave = !activeStudy()->isSaved() || activeStudy()->isModified();
+ bool aHasStudy = activeStudy() != 0;
+ bool aSaved = aHasStudy && activeStudy()->isSaved();
+ bool aModified = aHasStudy && activeStudy()->isModified();
+ bool aIsNeedToSave = aHasStudy && ( !aSaved || aModified );
- if ( action( FileSaveId ) )
+ if ( action( FileReopenId ) )
+ action( FileReopenId )->setEnabled( aSaved );
+ if ( action( FileSaveId ) )
action( FileSaveId )->setEnabled( aIsNeedToSave );
if ( action( FileSaveAsId ) )
action( FileSaveAsId )->setEnabled( aHasStudy );
/*!\retval QString - return file name from dialog.*/
QString STD_Application::getFileName( bool open, const QString& initial, const QString& filters,
- const QString& caption, QWidget* parent )
+ const QString& caption, QWidget* parent )
{
if ( !parent )
parent = desktop();
isOk = true;
else
{
- int aEnd = aUsedFilter.lastIndexOf( ')' );
- int aStart = aUsedFilter.lastIndexOf( '(', aEnd );
- QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
+ int aEnd = aUsedFilter.lastIndexOf( ')' );
+ int aStart = aUsedFilter.lastIndexOf( '(', aEnd );
+ QString wcStr = aUsedFilter.mid( aStart + 1, aEnd - aStart - 1 );
int idx = 0;
QStringList extList;
if ( !extList.isEmpty() && !extList.contains( SUIT_Tools::extension( aName ) ) )
aName += QString( ".%1" ).arg( extList.first() );
- if ( QFileInfo( aName ).exists() )
+ if ( QFileInfo( aName ).exists() )
{
- int aAnswer = SUIT_MessageBox::question( desktop(), tr( "TIT_FILE_SAVEAS" ),
- tr( "MSG_FILE_EXISTS" ).arg( aName ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes );
- if ( aAnswer == SUIT_MessageBox::Cancel )
+ int aAnswer = SUIT_MessageBox::question( desktop(), tr( "TIT_FILE_SAVEAS" ),
+ tr( "MSG_FILE_EXISTS" ).arg( aName ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No | SUIT_MessageBox::Cancel, SUIT_MessageBox::Yes );
+ if ( aAnswer == SUIT_MessageBox::Cancel )
{ // cancelled
aName = QString();
- isOk = true;
+ isOk = true;
}
- else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file
- anOldPath = aName; // not to return to the same initial dir at each "while" step
- else // overwrite the existing file
- isOk = true;
+ else if ( aAnswer == SUIT_MessageBox::No ) // not save to this file
+ anOldPath = aName; // not to return to the same initial dir at each "while" step
+ else // overwrite the existing file
+ isOk = true;
}
- else
- isOk = true;
+ else
+ isOk = true;
}
}
return aName;
*/
void STD_Application::setDesktop( SUIT_Desktop* desk )
{
- SUIT_Desktop* prev = desktop();
-
SUIT_Application::setDesktop( desk );
- if ( prev != desk && desk )
+ if ( desk ) {
connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ),
- this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) );
+ this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ), Qt::UniqueConnection );
+ }
}
/*!
updateDesktopTitle();
updateCommandsStatus();
}
+
+/*!
+ Return index of the view ma
+*/
+int STD_Application::viewManagerId( const SUIT_ViewManager* theManager) const
+{
+ return myViewMgrs.indexOf(const_cast<SUIT_ViewManager*>(theManager));
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef STD_APPLICATION_H
#define STD_APPLICATION_H
Q_OBJECT
public:
- enum { MenuFileId, FileNewId, FileOpenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId,
+ enum { MenuFileId, FileNewId, FileOpenId, FileReopenId, FileCloseId, FileSaveId, FileSaveAsId, FileExitId,
MenuViewId, ViewWindowsId, ViewToolBarsId, ViewStatusBarId, NewWindowId,
MenuEditId, EditCutId, EditCopyId, EditPasteId,
MenuHelpId, HelpAboutId,
ViewManagerList viewManagers() const;
void viewManagers( ViewManagerList& ) const;
void viewManagers( const QString&, ViewManagerList& ) const;
+ virtual int viewManagerId (const SUIT_ViewManager* ) const;
virtual QString getFileFilter() const { return QString(); }
virtual QString getFileName( bool open, const QString& initial, const QString& filters,
- const QString& caption, QWidget* parent );
+ const QString& caption, QWidget* parent );
QString getDirectory( const QString& initial, const QString& caption, QWidget* parent );
virtual void start();
virtual void onOpenDoc();
virtual bool onOpenDoc( const QString& );
+ virtual bool onReopenDoc();
+
virtual void onExit();
virtual void onCopy();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "STD_MDIDesktop.h"
#include <SUIT_Session.h>
myWorkspaceAction = new QtxWorkspaceAction( workspace(), this );
myWorkspaceAction->setMenuActions( QtxWorkspaceAction::Cascade | QtxWorkspaceAction::Tile |
- QtxWorkspaceAction::HTile | QtxWorkspaceAction::VTile |
- QtxWorkspaceAction::Windows );
+ QtxWorkspaceAction::HTile | QtxWorkspaceAction::VTile |
+ QtxWorkspaceAction::Windows );
// Cascade
myWorkspaceAction->setIcon( QtxWorkspaceAction::Cascade,
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef STD_MDIDESKTOP_H
#define STD_MDIDESKTOP_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "STD_SDIDesktop.h"
#include <SUIT_ViewWindow.h>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef STD_SDIDESKTOP_H
#define STD_SDIDESKTOP_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "STD_TabDesktop.h"
#include <SUIT_Session.h>
myWorkstack = new QtxWorkstack( base );
main->addWidget( myWorkstack );
// setting Expanding size policy for central workstack. If there are several widgets
- // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TRIPOLI modules).
+ // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TRIPOLI modules).
// But the workstack must occupy as much space as possible -- set Expanding for it.
myWorkstack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
- myWorkstack->setAccel( QtxWorkstack::SplitVertical, Qt::SHIFT + Qt::Key_V );
- myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
- myWorkstack->setAccel( QtxWorkstack::Close, Qt::SHIFT + Qt::Key_C );
+ myWorkstack->setAccel( QtxWorkstack::SplitVertical, Qt::ALT + Qt::SHIFT + Qt::Key_V );
+ myWorkstack->setAccel( QtxWorkstack::SplitHorizontal, Qt::ALT + Qt::SHIFT + Qt::Key_H );
+ //myWorkstack->setAccel( QtxWorkstack::Close, Qt::CTRL + Qt::Key_F4 );
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
if ( resMgr ) {
- myWorkstack->setIcon( QtxWorkstack::SplitVertical,
- resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
+ myWorkstack->setIcon( QtxWorkstack::SplitVertical,
+ resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
myWorkstack->setIcon( QtxWorkstack::SplitHorizontal,
- resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
+ resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
myWorkstack->setIcon( QtxWorkstack::Close,
- resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ));
+ resMgr->loadPixmap( "STD", tr( "ICON_FILE_CLOSE" ) ));
}
connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ),
void STD_TabDesktop::setWindowOperations( const int first, ... )
{
va_list ints;
- va_start( ints, first );
+ va_start( ints, first );
- QList<int> typeList;
+ QList<int> typeList;
- int cur = first;
- while ( cur )
- {
- typeList.append( cur );
- cur = va_arg( ints, int );
+ int cur = first;
+ while ( cur )
+ {
+ typeList.append( cur );
+ cur = va_arg( ints, int );
}
- setWindowOperations( typeList );
+ setWindowOperations( typeList );
}
/*!
resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_HSPLIT" ) ) );
myWorkstackAction->setText( QtxWorkstackAction::SplitHorizontal, tr( "MEN_DESK_WINDOW_HSPLIT" ) );
myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitHorizontal, tr( "PRP_DESK_WINDOW_HSPLIT" ) );
- myWorkstackAction->setAccel( QtxWorkstackAction::SplitHorizontal, Qt::SHIFT + Qt::Key_H );
+ myWorkstackAction->setAccel( QtxWorkstackAction::SplitHorizontal, Qt::ALT + Qt::SHIFT + Qt::Key_H );
// Split Vertical
myWorkstackAction->setIcon( QtxWorkstackAction::SplitVertical,
resMgr->loadPixmap( "STD", tr( "ICON_DESK_WINDOW_VSPLIT" ) ) );
myWorkstackAction->setText( QtxWorkstackAction::SplitVertical, tr( "MEN_DESK_WINDOW_VSPLIT" ) );
myWorkstackAction->setStatusTip( QtxWorkstackAction::SplitVertical, tr( "PRP_DESK_WINDOW_VSPLIT" ) );
- myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical, Qt::SHIFT + Qt::Key_V );
+ myWorkstackAction->setAccel( QtxWorkstackAction::SplitVertical, Qt::ALT + Qt::SHIFT + Qt::Key_V );
QtxActionMenuMgr* mMgr = menuMgr();
if ( !mMgr )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef STD_TABDESKTOP_H
#define STD_TABDESKTOP_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_DESK_DEFAULTICON"
-msgstr "default.png"
-
-msgid "ICON_APP_DEFAULTICON"
-msgstr "default.png"
-
-msgid "ICON_FILE_NEW"
-msgstr "new.png"
-
-msgid "ICON_FILE_OPEN"
-msgstr "open.png"
-
-msgid "ICON_FILE_SAVE"
-msgstr "save.png"
-
-msgid "ICON_FILE_CLOSE"
-msgstr "close.png"
-
-msgid "ICON_EDIT_CUT"
-msgstr "cut.png"
-
-msgid "ICON_EDIT_COPY"
-msgstr "copy.png"
-
-msgid "ICON_EDIT_PASTE"
-msgstr "paste.png"
-
-msgid "ICON_HELP"
-msgstr "help.png"
-
-msgid "ICON_PRINT"
-msgstr "print.png"
-
-msgid "ICON_RESET"
-msgstr "reset.png"
-
-msgid "ICON_DESK_WINDOW_CASCADE"
-msgstr "cascade.png"
-
-msgid "ICON_DESK_WINDOW_TILE"
-msgstr "tile.png"
-
-msgid "ICON_DESK_WINDOW_VTILE"
-msgstr "vtile.png"
-
-msgid "ICON_DESK_WINDOW_HTILE"
-msgstr "htile.png"
-
-msgid "ICON_DESK_WINDOW_VSPLIT"
-msgstr "vtile.png"
-
-msgid "ICON_DESK_WINDOW_HSPLIT"
-msgstr "htile.png"
-
-msgid "ICON_APP_EDIT_UNDO"
-msgstr "undo.png"
-
-msgid "ICON_APP_EDIT_REDO"
-msgstr "redo.png"
-
-msgid "SUIT_ViewPort::ICON_CURSOR_ROTATE"
-msgstr "cursor_rotate.png"
-
-msgid "SUIT_ViewPort::ICON_CURSOR_ZOOM"
-msgstr "cursor_zoom.png"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "INF_READY"
-msgstr "Ready"
-
-msgid "BUT_OK"
-msgstr "&Ok"
-
-msgid "BUT_CANCEL"
-msgstr "&Cancel"
-
-msgid "BUT_CLOSE"
-msgstr "&Close"
-
-msgid "BUT_HELP"
-msgstr "&Help"
-
-msgid "BUT_YES"
-msgstr "&Yes"
-
-msgid "BUT_NO"
-msgstr "&No"
-
-msgid "BUT_APPLY"
-msgstr "&Apply"
-
-msgid "ERR_ERROR"
-msgstr "Error"
-
-msgid "WRN_WARNING"
-msgstr "Warning"
-
-msgid "INF_INFO"
-msgstr "Information"
-
-msgid "FILTER_FILES"
-msgstr "%1 Files (%2)"
-
-msgid "ALL_FILES"
-msgstr "All Files (*.*)"
-
-msgid "INF_CANCELLED"
-msgstr "Cancelled"
-
-msgid "ERR_UNKNOWN"
-msgstr "Unknown error"
-
-## ----------------------------------------------------
-
-msgid "INF_DESK_DOC_CREATE"
-msgstr "Create a new document"
-
-msgid "ERR_APP_NOAPP"
-msgstr "No application"
-
-msgid "INF_DESK_EXIT"
-msgstr "Exit"
-
-msgid "INF_DESK_TOOLBAR_STANDARD"
-msgstr "Standard"
-
-msgid "MEN_DESK_FILE"
-msgstr "&File"
-
-msgid "MEN_DESK_FILE_CLOSE"
-msgstr "&Close"
-
-msgid "MEN_DESK_FILE_EXIT"
-msgstr "E&xit"
-
-msgid "MEN_DESK_FILE_NEW"
-msgstr "&New"
-
-msgid "MEN_DESK_FILE_OPEN"
-msgstr "&Open..."
-
-msgid "MEN_DESK_FILE_PRINT"
-msgstr "&Print"
-
-msgid "MEN_DESK_FILE_SAVE"
-msgstr "&Save"
-
-msgid "MEN_DESK_FILE_SAVEAS"
-msgstr "Save &As..."
-
-msgid "MEN_DESK_EDIT"
-msgstr "&Edit"
-
-msgid "MEN_DESK_EDIT_CUT"
-msgstr "Cu&t"
-
-msgid "MEN_DESK_EDIT_COPY"
-msgstr "&Copy"
-
-msgid "MEN_DESK_EDIT_PASTE"
-msgstr "&Paste"
-
-msgid "MEN_DESK_HELP"
-msgstr "&Help"
-
-msgid "MEN_DESK_HELP_ABOUT"
-msgstr "&About..."
-
-msgid "MEN_DESK_HELP_CONTENTS"
-msgstr "&Contents"
-
-msgid "MEN_DESK_HELP_SEARCH"
-msgstr "&Search..."
-
-msgid "MEN_DESK_VIEW"
-msgstr "&View"
-
-msgid "MEN_DESK_VIEW_TOOLBARS"
-msgstr "T&oolbars"
-
-msgid "MEN_DESK_VIEW_DOCKWINDOWS"
-msgstr "W&indows"
-
-msgid "MEN_DESK_VIEW_STATUSBAR"
-msgstr "&Status Bar"
-
-msgid "MEN_DESK_VIEW_STDTOOLBAR"
-msgstr "&Standard"
-
-msgid "PRP_DESK_FILE_CLOSE"
-msgstr "Closes the active document"
-
-msgid "PRP_DESK_FILE_EXIT"
-msgstr "Exits the application"
-
-msgid "PRP_DESK_FILE_NEW"
-msgstr "Creates a new document"
-
-msgid "PRP_DESK_FILE_OPEN"
-msgstr "Opens an existing document"
-
-msgid "PRP_DESK_FILE_PRINT"
-msgstr "Prints the active document"
-
-msgid "PRP_DESK_FILE_SAVE"
-msgstr "Saves the active document"
-
-msgid "PRP_DESK_FILE_SAVEAS"
-msgstr "Saves the active document with a new name"
-
-msgid "PRP_DESK_EDIT_CUT"
-msgstr "Cuts the selection and puts it to the Clipboard"
-
-msgid "PRP_DESK_EDIT_COPY"
-msgstr "Copy the selection to the Clipboard"
-
-msgid "PRP_DESK_EDIT_PASTE"
-msgstr "Inserts the Clipboard content at the insertion point"
-
-msgid "PRP_DESK_HELP_ABOUT"
-msgstr "Shows \'About\' dialog"
-
-msgid "PRP_DESK_HELP_CONTENTS"
-msgstr "Shows the whole help contents"
-
-msgid "PRP_DESK_HELP_SEARCH"
-msgstr "Searches help for a topic"
-
-msgid "PRP_DESK_VIEW_STATUSBAR"
-msgstr "Toggles status bar view on/off"
-
-msgid "PRP_DESK_VIEW_STDTOOLBAR"
-msgstr "Toggles standard toolbar on/off"
-
-msgid "QUE_DESK_EXIT"
-msgstr "Do you really want to quit ?"
-
-msgid "TOT_DESK_FILE_NEW"
-msgstr "New document"
-
-msgid "TOT_DESK_FILE_OPEN"
-msgstr "Open document"
-
-msgid "TOT_DESK_FILE_CLOSE"
-msgstr "Close document"
-
-msgid "TOT_DESK_FILE_PRINT"
-msgstr "Print document"
-
-msgid "TOT_DESK_FILE_SAVE"
-msgstr "Save document"
-
-msgid "TOT_DESK_FILE_SAVEAS"
-msgstr "Save document as..."
-
-msgid "TOT_DESK_FILE_EXIT"
-msgstr "Exit from application"
-
-msgid "TOT_DESK_EDIT_CUT"
-msgstr "Cut"
-
-msgid "TOT_DESK_EDIT_COPY"
-msgstr "Copy"
-
-msgid "TOT_DESK_EDIT_PASTE"
-msgstr "Paste"
-
-msgid "TOT_DESK_HELP_ABOUT"
-msgstr "About..."
-
-msgid "STD_Application::TOT_DOCK_WINDOWS"
-msgstr "Show / hide dockable windows and toolbars"
-
-msgid "STD_Application::MEN_DOCK_WINDOWS"
-msgstr "Windows and Toolbars"
-
-msgid "ERR_DOC_UNKNOWNTYPE_OPEN"
-msgstr "You are trying to open a document of an unknown type\n( %1 )"
-
-msgid "ERR_DOC_UNKNOWNTYPE_SAVE"
-msgstr "You are trying to save this document under an unknown type\n( %1 )"
-
-msgid "ERR_DOC_PERMISSIONDENIED_SAVE"
-msgstr "Can not save file %1. Permission denied"
-
-msgid "ERR_DOC_DIRWITHNAMEEXIST_SAVE"
-msgstr "Can not save file %1.\nDirectory with this name exist on disc. Try to use another name"
-
-msgid "QUE_DOC_FILEEXISTS"
-msgstr "The file %1 already exists.\nDo you want to overwrite it ?"
-
-msgid "ERR_DESK_NOAPP"
-msgstr "No applications registered"
-
-msgid "DESK_DEFAULTTITLE"
-msgstr "Qt Application Desktop"
-
-msgid "QUE_DOC_ALREADYOPEN"
-msgstr "The document %1 is already open.\nDo you want to reload it ?"
-
-msgid "MEN_DESK_WINDOW"
-msgstr "&Window"
-
-msgid "MEN_DESK_NEWWINDOW"
-msgstr "&New Window"
-
-msgid "TOT_DESK_NEWWINDOW"
-msgstr "Create new Window"
-
-msgid "PRP_DESK_NEWWINDOW"
-msgstr "Create new Window"
-
-msgid "MEN_DESK_WINDOW_CASCADE"
-msgstr "&Cascade"
-
-msgid "PRP_DESK_WINDOW_CASCADE"
-msgstr "Arranges the windows as overlapping tiles"
-
-msgid "MEN_DESK_WINDOW_TILE"
-msgstr "&Tile"
-
-msgid "PRP_DESK_WINDOW_TILE"
-msgstr "Arranges the windows as nonoverlapping tiles"
-
-msgid "MEN_DESK_WINDOW_HTILE"
-msgstr "Tile &Horizontally"
-
-msgid "PRP_DESK_WINDOW_HTILE"
-msgstr "Arranges the windows as nonoverlapping horizontal tiles"
-
-msgid "MEN_DESK_WINDOW_VTILE"
-msgstr "Tile &Vertically"
-
-msgid "PRP_DESK_WINDOW_VTILE"
-msgstr "Arranges the windows as nonoverlapping vertical tiles"
-
-msgid "PRP_DESK_WINDOW_ACTIVATE"
-msgstr "Activates this window"
-
-msgid "MEN_DESK_WINDOW_HSPLIT"
-msgstr "Split &Horizontally"
-
-msgid "PRP_DESK_WINDOW_HSPLIT"
-msgstr "Splits the active window on two horizontal parts"
-
-msgid "MEN_DESK_WINDOW_VSPLIT"
-msgstr "Split &Vertically"
-
-msgid "PRP_DESK_WINDOW_VSPLIT"
-msgstr "Splits the active window on two vertical parts"
-
-msgid "INF_DESK_DOCALREADYOPEN"
-msgstr "A document cannot be saved under a name of a document already opened.\nPlease, type another name for the document you want to save.\n( %1 )"
-
-msgid "MEN_DESK_FILE_MRU"
-msgstr "Recent &Files"
-
-msgid "PRP_DESK_FILE_MRU"
-msgstr "Opens a document"
-
-msgid "STD_Application::ABOUT_INFO"
-msgstr "SUIT Std application"
-
-msgid "MSG_FILE_EXISTS"
-msgstr "File \"%1\" already exists.\nDo you want to overwrite it?"
-
-msgid "MSG_CANT_SAVE"
-msgstr "Can't save file \"%1\"."
-
-msgid "TIT_FILE_SAVEAS"
-msgstr "Save As"
-
-msgid "STD_Application::INF_DOC_MODIFIED"
-msgstr "Document has been modified.\nDo you want to save changes?"
-
-msgid "STD_Application::INF_DOCUMENT_MODIFIED"
-msgstr "Document \"%1\" has been modified.\nDo you want to save changes?"
-
-msgid "STD_Application::INF_DOC_SAVED"
-msgstr "Study %1 saved"
-
-msgid "STD_Application::INF_DOC_SAVING"
-msgstr "Saving study "
-
-msgid "STD_Application::INF_DOC_SAVING_FAILS"
-msgstr "Can't save file \"%1\".\nPossible reason is permission denied or disc full.\nTry to use another file name."
-
-msgid "TOT_DESK_FILE_LOAD"
-msgstr "Load document"
-
-msgid "PRP_DESK_FILE_LOAD"
-msgstr "Load a document"
-
-msgid "MEN_DESK_FILE_LOAD"
-msgstr "Conn&ect..."
-
-msgid "DLG_LOAD_STUDY_CAPTION"
-msgstr "Load Study"
-
-msgid "MEN_STUDIES_CHOICE"
-msgstr "Choose existent study."
-
-
-
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>TOT_DESK_FILE_OPEN</source>
<translation>Open document</translation>
</message>
+ <message>
+ <source>TOT_DESK_FILE_REOPEN</source>
+ <translation>Reopen document</translation>
+ </message>
<message>
<source>PRP_DESK_FILE_EXIT</source>
<translation>Exits the application</translation>
<source>PRP_DESK_FILE_OPEN</source>
<translation>Opens an existing document</translation>
</message>
+ <message>
+ <source>PRP_DESK_FILE_REOPEN</source>
+ <translation>Reload the current document from the file</translation>
+ </message>
<message>
<source>PRP_DESK_FILE_SAVE</source>
<translation>Saves the active document</translation>
</message>
<message>
<source>PRP_DESK_FILE_LOAD</source>
- <translation>Load a document</translation>
+ <translation>Loads a document</translation>
</message>
<message>
<source>PRP_DESK_WINDOW_HTILE</source>
<source>MEN_DESK_FILE_OPEN</source>
<translation>&Open...</translation>
</message>
+ <message>
+ <source>MEN_DESK_FILE_REOPEN</source>
+ <translation>Reopen</translation>
+ </message>
<message>
<source>MEN_DESK_FILE_LOAD</source>
<translation>Conn&ect...</translation>
<message>
<source>INF_DOC_SAVING_FAILS</source>
<translation>Can't save file "%1".
-Possible reason is permission denied or disc full.
+Possible reasons:
+- permission denied;
+- unsufficient disk space;
+- application error.
Try to use another file name.</translation>
</message>
<message>
<source>CLOSE_QUESTION</source>
<translation>Do you want to save study before closing?</translation>
</message>
+ <message>
+ <source>REOPEN_STUDY</source>
+ <translation>Reopen study</translation>
+ </message>
+ <message>
+ <source>REOPEN_QUESTION</source>
+ <translation>Do you really want to re-open study?
+All the changes made since last saving will be lost.</translation>
+ </message>
</context>
</TS>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : suit
SUIT_TreeModel.h \
SUIT_ViewManager.h \
SUIT_ViewModel.h \
- SUIT_ViewWindow.h
+ SUIT_ViewWindow.h \
+ SUIT_ShortcutMgr.h
dist_libsuit_la_SOURCES = \
SUIT_Accel.cxx \
SUIT_TreeModel.cxx \
SUIT_ViewManager.cxx \
SUIT_ViewModel.cxx \
- SUIT_ViewWindow.cxx
+ SUIT_ViewWindow.cxx \
+ SUIT_ShortcutMgr.cxx
MOC_FILES = \
SUIT_Accel_moc.cxx \
SUIT_TreeModel_moc.cxx \
SUIT_ViewManager_moc.cxx \
SUIT_ViewModel_moc.cxx \
- SUIT_ViewWindow_moc.cxx
+ SUIT_ViewWindow_moc.cxx \
+ SUIT_ShortcutMgr_moc.cxx
nodist_libsuit_la_SOURCES = $(MOC_FILES)
nodist_salomeres_DATA = \
- SUIT_msg_en.qm
+ SUIT_msg_en.qm \
+ SUIT_msg_fr.qm \
+ SUIT_images.qm
+
+dist_salomeres_DATA = \
+ resources/icon_visibility_on.png \
+ resources/icon_visibility_off.png
+
libsuit_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx -I$(srcdir)/../ObjBrowser
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT.h
// Author :
//
#define SUIT_H
#if defined WIN32
-# if defined SUIT_EXPORTS
+# if defined SUIT_EXPORTS || defined suit_EXPORTS
# define SUIT_EXPORT __declspec( dllexport )
# else
# define SUIT_EXPORT __declspec( dllimport )
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = suit
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx
-LIBS += -L../../lib -lqtx
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SUIT_EXPORTS
-
-HEADERS = SUIT.h
-HEADERS += SUIT_Accel.h
-HEADERS += SUIT_ActionOperation.h
-HEADERS += SUIT_Application.h
-HEADERS += SUIT_DataObject.h
-HEADERS += SUIT_DataObjectIterator.h
-HEADERS += SUIT_DataObjectKey.h
-HEADERS += SUIT_DataOwner.h
-HEADERS += SUIT_Desktop.h
-HEADERS += SUIT_ExceptionHandler.h
-HEADERS += SUIT_FileDlg.h
-HEADERS += SUIT_FileValidator.h
-HEADERS += SUIT_LicenseDlg.h
-HEADERS += SUIT_MessageBox.h
-HEADERS += SUIT_Operation.h
-HEADERS += SUIT_OverrideCursor.h
-HEADERS += SUIT_PopupClient.h
-HEADERS += SUIT_ResourceMgr.h
-HEADERS += SUIT_SelectionFilter.h
-HEADERS += SUIT_SelectionMgr.h
-HEADERS += SUIT_Selector.h
-HEADERS += SUIT_Session.h
-HEADERS += SUIT_SmartPtr.h
-HEADERS += SUIT_Study.h
-HEADERS += SUIT_Tools.h
-HEADERS += SUIT_TreeSync.h
-HEADERS += SUIT_ViewManager.h
-HEADERS += SUIT_ViewModel.h
-HEADERS += SUIT_ViewWindow.h
-
-SOURCES = SUIT_Accel.cxx
-SOURCES += SUIT_ActionOperation.cxx
-SOURCES += SUIT_Application.cxx
-SOURCES += SUIT_DataObject.cxx
-SOURCES += SUIT_DataObjectIterator.cxx
-SOURCES += SUIT_DataObjectKey.cxx
-SOURCES += SUIT_DataOwner.cxx
-SOURCES += SUIT_Desktop.cxx
-SOURCES += SUIT_ExceptionHandler.cxx
-SOURCES += SUIT_FileDlg.cxx
-SOURCES += SUIT_FileValidator.cxx
-SOURCES += SUIT_LicenseDlg.cxx
-SOURCES += SUIT_MessageBox.cxx
-SOURCES += SUIT_Operation.cxx
-SOURCES += SUIT_OverrideCursor.cxx
-SOURCES += SUIT_PopupClient.cxx
-SOURCES += SUIT_ResourceMgr.cxx
-SOURCES += SUIT_SelectionFilter.cxx
-SOURCES += SUIT_SelectionMgr.cxx
-SOURCES += SUIT_Selector.cxx
-SOURCES += SUIT_Session.cxx
-SOURCES += SUIT_Study.cxx
-SOURCES += SUIT_Tools.cxx
-SOURCES += SUIT_ViewManager.cxx
-SOURCES += SUIT_ViewModel.cxx
-SOURCES += SUIT_ViewWindow.cxx
-
-TRANSLATIONS = resources/SUIT_images.ts \
- resources/SUIT_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SUIT_Accel.cxx: implementation of the SUIT_Accel class.
//
#include "SUIT_Accel.h"
if ( key ) {
SUIT_ViewWindow* vw = ::getParentViewWindow( obj );
if ( vw ) {
- QString type = vw->getViewManager()->getViewModel()->getType();
- if ( myMap.contains( type ) ) {
- IdActionMap idActionMap = myMap[type];
- if ( idActionMap.contains( key ) ) {
- return vw->onAccelAction( idActionMap[key] );
- }
+ if ( vw->getViewManager() && vw->getViewManager()->getViewModel() )
+ {
+ QString type = vw->getViewManager()->getViewModel()->getType();
+ if ( myMap.contains( type ) ) {
+ IdActionMap idActionMap = myMap[type];
+ if ( idActionMap.contains( key ) ) {
+ return vw->onAccelAction( idActionMap[key] );
+ }
+ }
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SUIT_Accel.h: interface for the SUIT_Accel class.
//
#ifndef SUIT_ACELL_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_ActionOperation.h"
#include "SUIT_Application.h"
* Create new instance of QtxAction and set.
*/
void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon,
- const QString& menuText, QKeySequence accel,
+ const QString& menuText, QKeySequence accel,
QObject* parent, bool toggle )
{
setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) );
* Create new instance of QtxAction and set.
*/
void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
- QKeySequence accel, QObject* parent, bool toggle )
+ QKeySequence accel, QObject* parent, bool toggle )
{
setAction( new QtxAction( text, menuText, accel, parent, toggle ) );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_ACTIONOPERATION_H
#define SUIT_ACTIONOPERATION_H
/*!Provide support QtxAction*/
class SUIT_EXPORT SUIT_ActionOperation : public SUIT_Operation
{
- Q_OBJECT
+ Q_OBJECT
public:
- SUIT_ActionOperation( SUIT_Application* );
- virtual ~SUIT_ActionOperation();
+ SUIT_ActionOperation( SUIT_Application* );
+ virtual ~SUIT_ActionOperation();
- QtxAction* action() const;
+ QtxAction* action() const;
- /** @name GUI management*/
- //@{
- virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText,
- QKeySequence accel, QObject* parent, bool toggle = false );
+ /** @name GUI management*/
+ //@{
+ virtual void setAction( const QString& text, const QIcon& icon, const QString& menuText,
+ QKeySequence accel, QObject* parent, bool toggle = false );
- virtual void setAction( const QString& text, const QString& menuText,
+ virtual void setAction( const QString& text, const QString& menuText,
QKeySequence accel, QObject* parent, bool toggle = false );
- virtual void setAction( QtxAction* theAction );
-
- bool addTo( QWidget* theWidget );
+ virtual void setAction( QtxAction* theAction );
+
+ bool addTo( QWidget* theWidget );
- void setStatusTip( const QString& theTip );
- //@}
+ void setStatusTip( const QString& theTip );
+ //@}
private:
- QtxAction* myAction;
+ QtxAction* myAction;
- friend class SUIT_Study;
+ friend class SUIT_Study;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_Application.h"
#include "SUIT_Study.h"
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_ShortcutMgr.h"
#include <QTimer>
#include <QLabel>
#include <QtxActionMenuMgr.h>
#include <QtxActionToolMgr.h>
+
/*!
\class StatusLabel
\brief Status bar customization label. Used to workaroubd desktop resizing bug.
{
if ( desktop() )
desktop()->show();
+
+ // Initialize shortcut manager
+ SUIT_ShortcutMgr::Init();
}
/*!
return SUIT_Session::session()->resourceMgr();
}
+/*!
+ \brief Get access to shortcut manager.
+ \return global shortcut manager
+*/
+SUIT_ShortcutMgr* SUIT_Application::shortcutMgr() const
+{
+ return SUIT_ShortcutMgr::getShortcutMgr();
+}
+
#define DEFAULT_MESSAGE_DELAY 3000
/*!
if ( myDesktop == desk )
return;
- delete myDesktop;
+ // >> VSR 09/06/2009: workaround about the Qt 4.5.0 bug: SIGSEGV on desktop delete
+ myDesktop->deleteLater(); // delete myDesktop;
+ // << VSR 09/06/2009
myDesktop = desk;
if ( myDesktop ) {
connect( myDesktop, SIGNAL( activated() ), this, SLOT( onDesktopActivated() ) );
if ( myStudy )
disconnect( myStudy, SIGNAL( studyModified( SUIT_Study* ) ),
- this, SLOT( updateCommandsStatus() ) );
+ this, SLOT( updateCommandsStatus() ) );
if ( study )
connect( study, SIGNAL( studyModified( SUIT_Study* ) ),
- this, SLOT( updateCommandsStatus() ) );
+ this, SLOT( updateCommandsStatus() ) );
myStudy = study;
}
*/
QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon,
const QString& menu, const QString& tip, const int key,
- QObject* parent, const bool toggle, QObject* reciever, const char* member )
+ QObject* parent, const bool toggle, QObject* reciever,
+ const char* member, const QString& shortcutAction )
{
- QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle );
+ QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
a->setStatusTip( tip );
if ( reciever && member )
*/
void SUIT_Application::onHelpContextModule( const QString& /*theComponentName*/,
const QString& /*theFileName*/,
- const QString& /*theContext*/ )
+ const QString& /*theContext*/ )
{
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_APPLICATION_H
#define SUIT_APPLICATION_H
class QWidget;
class SUIT_Desktop;
-class SUIT_ViewModel;
+class SUIT_ViewManager;
class SUIT_ResourceMgr;
+class SUIT_ShortcutMgr;
class SUIT_Study;
#ifdef WIN32
SUIT_ResourceMgr* resourceMgr() const;
+ SUIT_ShortcutMgr* shortcutMgr() const;
+
//! Puts the message to the status bar
- void putInfo ( const QString&, const int = 0 );
+ void putInfo ( const QString&, const int = 0 );
//! Invokes application-specific "Open/Save File" dialog and returns the selected file name.
- virtual QString getFileName( bool open, const QString& initial, const QString& filters,
- const QString& caption, QWidget* parent ) = 0;
+ virtual QString getFileName( bool open, const QString& initial, const QString& filters,
+ const QString& caption, QWidget* parent ) = 0;
//! Invokes application-specific "Select Directory" dialog and returns the selected directory name.
- virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0;
+ virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0;
+
+
+ virtual int viewManagerId ( const SUIT_ViewManager* ) const = 0;
+ virtual void viewManagers( const QString&, QList<SUIT_ViewManager*>& ) const = 0;
+ QAction* action( const int ) const;
signals:
void applicationClosed( SUIT_Application* );
void setActionShown( const int, const bool );
static QAction* separator();
- QAction* action( const int ) const;
int actionId( const QAction* ) const;
QList<QAction*> actions() const;
int registerAction( const int, QAction* );
QAction* createAction( const int, const QString&, const QIcon&, const QString&,
const QString&, const int, QObject* = 0,
- const bool = false, QObject* = 0, const char* = 0 );
+ const bool = false, QObject* = 0, const char* = 0,
+ const QString& = QString() );
protected slots:
virtual void onDesktopActivated();
SUIT_Study* myStudy;
SUIT_Desktop* myDesktop;
QMap<int, QAction*> myActionMap;
+ SUIT_ShortcutMgr* myShortcutMgr;
QLabel* myStatusLabel;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_DataBrowser.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
m->setAutoUpdate( on );
}
+/*!
+ \brief Get 'updateModified' flag value.
+ \return 'updateModified' flag value
+*/
+bool SUIT_DataBrowser::updateModified() const
+{
+ SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+ return m ? m->updateModified() : false;
+}
+
+/*!
+ \brief Set 'updateModified' flag value.
+ \param on 'updateModified' flag value
+*/
+void SUIT_DataBrowser::setUpdateModified( const bool on )
+{
+ SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+ if ( m )
+ m->setUpdateModified( on );
+}
+
/*!
\brief Update object browser starting from the object \obj;
open all branches automatically if \a autoOpen is \c true.
}
/*!
- \brief Get current key accelerator used for the
- object browser update operation.
+ \brief Get current key accelerator by id.
\return current key accelerator
- \sa setUpdateKey(), requestUpdate()
+ \sa setShortcutKey(), requestUpdate(), requestRename()
*/
-int SUIT_DataBrowser::updateKey() const
+int SUIT_DataBrowser::shortcutKey(const int id) const
{
- return myShortcut->key();
+ return myShortcutMap.value(id)->key();
}
/*!
- \brief Assign the key accelerator to be used for the
- object browser update operation.
-
- By default, \c [F5] key is assigned for the update operation.
- To disable the accelerator, pass 0 to this method.
-
+ \brief Assign the key accelerator for the shortcut.
+
+ \param id id of the shortcut
\param key new key accelerator
- \sa updateKey(), requestUpdate()
+ \sa shortcutKey(), requestUpdate(), requestRename()
*/
-void SUIT_DataBrowser::setUpdateKey( const int key )
-{
- myShortcut->setKey( key );
+void SUIT_DataBrowser::setShortcutKey( const int id, const int key )
+{
+ ShortcutMap::iterator it = myShortcutMap.find( key );
+ if( it != myShortcutMap.end() )
+ (*it)->setKey(key);
}
/*!
foreach( idx, sel ) {
SUIT_DataObject* obj = m->object( idx );
if ( obj )
- lst.append( obj );
+ lst.append( obj );
}
}
}
}
}
+/*!
+ \brief function to sort QModelIndexList with qSort
+*/
+bool modelIndexLessThan(const QModelIndex& lhs, const QModelIndex& rhs)
+{
+ QModelIndex lhs_parent=lhs.parent();
+ QModelIndex rhs_parent=rhs.parent();
+ if(lhs_parent < rhs_parent)return true;
+ if(lhs_parent == rhs_parent) return lhs < rhs;
+ return false;
+}
+
/*!
\brief Set list of selected data objects.
\param lst list of the data object to set selected
foreach( obj, lst ) {
QModelIndex index = m->index( obj );
if ( index.isValid() )
- indexes.append( index );
+ indexes.append( index );
}
+ qSort(indexes.begin(), indexes.end(), modelIndexLessThan);
+
select( indexes, true, append ); // if !indexes.isEmpty() ???
}
}
+/*!
+ \brief Make the view item for specified data object is visible.
+ \param obj data object
+*/
+void SUIT_DataBrowser::ensureVisible( SUIT_DataObject* obj )
+{
+ if ( !obj )
+ return;
+
+ DataObjectList lst;
+ lst.append( obj );
+ ensureVisible( lst );
+}
+
+/*!
+ \brief Make the view items for specified data objects is visible.
+ \param lst data object list
+*/
+void SUIT_DataBrowser::ensureVisible( const DataObjectList& lst )
+{
+ QtxTreeView* tv = treeView();
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( model() );
+ if ( !tv || !treeModel )
+ return;
+
+ for ( DataObjectList::const_iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ QModelIndex idx = treeModel->index( *it );
+ if ( idx.isValid() )
+ tv->scrollTo( idx );
+ }
+}
+
/*!
\brief Add custom actions to the popup menu.
\param menu popup menu
setModel( m );
setItemDelegate( qobject_cast<SUIT_ProxyModel*>( model() )->delegate() );
connect( treeView(), SIGNAL( sortingEnabled( bool ) ),
- model(), SLOT( setSortingEnabled( bool ) ) );
+ model(), SLOT( setSortingEnabled( bool ) ) );
connect( treeView(), SIGNAL( clicked( const QModelIndex& ) ),
- this, SLOT( onClicked( const QModelIndex& ) ) );
+ this, SLOT( onClicked( const QModelIndex& ) ) );
connect( treeView(), SIGNAL( doubleClicked( const QModelIndex& ) ),
- this, SLOT( onDblClicked( const QModelIndex& ) ) );
+ this, SLOT( onDblClicked( const QModelIndex& ) ) );
connect( treeView(), SIGNAL( expanded( const QModelIndex& ) ),
- this, SLOT( onExpanded( const QModelIndex& ) ) );
- myShortcut = new QShortcut( Qt::Key_F5, this, SIGNAL( requestUpdate() ), SIGNAL( requestUpdate() ) );
+ this, SLOT( onExpanded( const QModelIndex& ) ) );
+ connect( this , SIGNAL( requestRename() ),
+ this , SLOT ( onStartEditing() ));
+
+ myShortcutMap.insert(UpdateShortcut , new QShortcut( Qt::Key_F5, this, SIGNAL( requestUpdate() ), SIGNAL( requestUpdate() ) ) );
+ myShortcutMap.insert(RenameShortcut , new QShortcut( Qt::Key_F2, this, SIGNAL( requestRename() ), SIGNAL( requestRename() ) ) );
myAutoSizeFirstColumn = true;
myAutoSizeColumns = false;
assigned for the update operation is pressed by the user.
By default, \c [F5] key is assigned for the update operation.
- The key accelerator can be changed with the setUpdateKey() method.
+ The key accelerator can be changed with the setShortcutKey() method.
- \sa updateKey(), setUpdateKey()
+ \sa shortcutKey(), setShortcutKey()
*/
/*!
if ( m ) {
SUIT_DataObject* obj = m->object( index );
- if ( obj ) emit( clicked( obj ) );
+ if ( obj ) {
+ emit( clicked( obj ) );
+ m->emitClicked(obj, index);
+ }
}
}
}
}
+/*!
+ \brief Make editable selected item in place.
+ \internal
+*/
+void SUIT_DataBrowser::onStartEditing() {
+ DataObjectList sel = getSelected();
+ SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+ if(treeView() && m && sel.count() == 1){
+ treeView()->edit(m->index( sel.first(), SUIT_DataObject::NameId ));
+ }
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_DataBrowser.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
SUIT_DataBrowser( QWidget* = 0 );
SUIT_DataBrowser( SUIT_DataObject*, QWidget* = 0 );
~SUIT_DataBrowser();
+
+ enum {UpdateShortcut = 0, RenameShortcut};
virtual QString popupClientType() const;
bool autoUpdate() const;
void setAutoUpdate( const bool );
+ bool updateModified() const;
+ void setUpdateModified( const bool );
+
void updateTree( SUIT_DataObject* = 0, const bool = true );
- int updateKey() const;
- void setUpdateKey( const int );
+ int shortcutKey(const int) const;
+ void setShortcutKey( const int, const int );
DataObjectList getSelected() const;
void getSelected( DataObjectList& ) const;
void setAutoSizeColumns( const bool on );
void setResizeOnExpandItem( const bool on );
+ void ensureVisible( SUIT_DataObject* );
+ void ensureVisible( const DataObjectList& );
+
protected:
virtual void contextMenuEvent( QContextMenuEvent* );
signals:
void requestUpdate();
+ void requestRename();
void clicked( SUIT_DataObject* );
void doubleClicked( SUIT_DataObject* );
void onClicked( const QModelIndex& );
void onDblClicked( const QModelIndex& );
void onExpanded( const QModelIndex& );
+ void onStartEditing();
private:
- QShortcut* myShortcut;
+ typedef QMap<int, QShortcut*> ShortcutMap;
+ ShortcutMap myShortcutMap;
bool myAutoSizeFirstColumn;
bool myAutoSizeColumns;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_DataObject.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
+#include <QVariant>
+
#include "SUIT_DataObject.h"
#include "SUIT_DataObjectKey.h"
+#include <cstdio>
SUIT_DataObject::Signal* SUIT_DataObject::mySignal = 0;
: myParent( 0 ),
myOpen( false ),
myCheck( false ),
- myAutoDel( true )
+ myAutoDel( true ),
+ _modified( false )
{
setParent( p );
signal()->emitCreated( this );
signal()->emitInserted( obj, this );
}
+/*!
+ \brief Insert new child object into the list of the children (faster version of insertChild without signal).
+ \param obj child object being added
+ \param position child position
+*/
+void SUIT_DataObject::insertChildAtPos( SUIT_DataObject* obj, int position )
+{
+ if ( !obj )return;
+ int pos = position < 0 ? myChildren.count() : position;
+ myChildren.insert( qMin( pos, (int)myChildren.count() ), obj );
+ obj->assignParent( this );
+}
+
/*!
\brief Remove the specified child object reference.
\param obj child object being removed
parent()->appendChild( this );
}
+void SUIT_DataObject::assignParent( SUIT_DataObject* p )
+{
+ if ( p == myParent )
+ return;
+
+ myParent = p;
+}
+
/*!
\brief Get data object name.
return Qt::AlignLeft;
}
+bool SUIT_DataObject::expandable() const
+{
+ return true;
+}
+
+/*!
+ \brief Check if the object is visible.
+
+ This method can be re-implemented in the subclasses.
+ Default implementation returns \c true (all objects are visible by default).
+
+ \return \c true if this object is displayable or \c false otherwise
+*/
+bool SUIT_DataObject::isVisible() const
+{
+ return true;
+}
+
/*!
\brief Check if the object is draggable.
\return \c true if it is possible to drag this object
*/
-bool SUIT_DataObject::isDragable() const
+bool SUIT_DataObject::isDraggable() const
{
return false;
}
/*!
- \brief Check if the drop operation fo this object is possible.
+ \brief Check if the drop operation for this object is possible.
This method can be re-implemented in the subclasses.
Default implementation returns \c false (drop operation is not allowed).
- \param obj object being dropped
- \return \c true if it is possible to drop an object \c obj
- to this object
+ \return \c true if it is possible to drop one or more objects (currently selected) to this object
*/
-
-bool SUIT_DataObject::isDropAccepted( SUIT_DataObject* /*obj*/ )
+bool SUIT_DataObject::isDropAccepted() const
{
return false;
}
return false;
}
+/*!
+ \brief Check if this object is can't be renamed in place
+
+ This method can be re-implemented in the subclasses.
+ Default implementation returns \c false (all objects can not be renamed).
+
+ \param id column id
+ \return \c true if the item can be renamed by the user in place (e.g. in the Object browser)
+*/
+bool SUIT_DataObject::renameAllowed( const int /*id*/ ) const
+{
+ return false;
+}
+
+/*!
+ \brief Set name of the this object.
+
+ This method can be re-implemented in the subclasses.
+ Default implementation returns \c false.
+
+ \return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool SUIT_DataObject::setName(const QString& /*name*/) {
+ return false;
+}
+
/*!
\brief Get the checked state of the object (if it is checkable)
for the specified column.
\sa customSorting()
*/
bool SUIT_DataObject::compare( const QVariant& /*left*/, const QVariant& /*right*/,
- const int /*id*/ ) const
+ const int /*id*/ ) const
{
return false;
}
SUIT_DataObject::Signal::~Signal()
{
for ( DataObjectList::Iterator it = myDelLaterObjects.begin();
- it != myDelLaterObjects.end(); ++it ) {
+ it != myDelLaterObjects.end(); ++it ) {
delete *it;
}
myDelLaterObjects.clear();
{
return 0;
}
-
+/*!
+ \brief return custom data for data object.
+ */
+QVariant SUIT_DataObject::customData(Qtx::CustomDataType /*type*/) {
+ return QVariant();
+}
/*!
\fn void SUIT_DataObject::Signal::created( SUIT_DataObject* object );
\brief Emitted when data object is created.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_DataObject.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#ifndef SUIT_DATAOBJECT_H
#define SUIT_DATAOBJECT_H
#include "SUIT.h"
+#include <Qtx.h>
+
#include <QList>
#include <QObject>
#include <QString>
#pragma warning( disable:4251 )
#endif
-class SUIT_EXPORT SUIT_DataObject
+class SUIT_EXPORT SUIT_DataObject
{
public:
class Signal;
//! Color role
- typedef enum {
+ typedef enum {
Text, //!< editor foreground (text) color
Base, //!< editor background color
Foreground, //!< foreground (text) color
//! Column id
enum
- {
- NameId //!< name column
+ {
+ NameId, //!< name column
+ VisibilityId //!< visibility state column
};
SUIT_DataObject( SUIT_DataObject* = 0 );
virtual void children( DataObjectList&, const bool = false ) const;
virtual DataObjectList children( const bool = false );
-
+
void appendChild( SUIT_DataObject* );
virtual void insertChild( SUIT_DataObject*, int );
virtual void removeChild( SUIT_DataObject*, const bool = false );
virtual SUIT_DataObject* parent() const;
virtual void setParent( SUIT_DataObject* );
+ virtual void assignParent( SUIT_DataObject* );
+ void insertChildAtPos( SUIT_DataObject* obj, int position );
+ bool modified(){return _modified;};
+ void setModified(bool modified){_modified = modified;};
virtual QString name() const;
virtual QString text( const int = NameId ) const;
virtual QFont font( const int = NameId ) const;
virtual int alignment( const int = NameId ) const;
- virtual bool isDragable() const;
- virtual bool isDropAccepted( SUIT_DataObject* obj );
+ virtual bool expandable() const;
+ virtual bool isVisible() const;
+ virtual bool isDraggable() const;
+ virtual bool isDropAccepted() const;
virtual bool isEnabled() const;
virtual bool isSelectable() const;
virtual bool isCheckable( const int = NameId ) const;
+ virtual bool renameAllowed( const int = NameId ) const;
+ virtual bool setName(const QString& name);
virtual bool isOn( const int = NameId ) const;
virtual void setOn( const bool, const int = NameId );
virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
virtual SUIT_DataObjectKey* key() const;
- virtual int groupId() const;
+ virtual int groupId() const;
+ virtual QVariant customData(Qtx::CustomDataType /*type*/);
static Signal* signal();
static bool connect( const char*, QObject*, const char* );
bool myCheck;
bool myAutoDel;
DataObjectList myChildren;
+ bool _modified;
static Signal* mySignal;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_DataObjectIterator.h"
/*!
*/
SUIT_DataObjectIterator::SUIT_DataObjectIterator( SUIT_DataObject* root, const int det, const bool fromTrueRoot )
: myRoot( root ),
-myDetourType( det ),
-myCurrentLevel( 0 )
+myDetourType( det )
{
if ( myRoot && fromTrueRoot )
myRoot = myRoot->root();
if ( myCurrent->myChildren.count() > 0 )
{
myCurrent = extreme( myCurrent->myChildren, myDetourType == DepthLeft );
- myCurrentLevel++;
+ myChildrenIndexes.append(myDetourType == DepthLeft ? 0 : myCurrent->myChildren.size() - 1);
}
else do
{
}
else
{
- int idx = aParent->myChildren.indexOf( myCurrent );
- if ( myDetourType == DepthLeft )
- myCurrent = idx < aParent->myChildren.count() - 1 ? aParent->myChildren[idx + 1] : 0;
- else
- myCurrent = idx > 0 ? aParent->myChildren[idx - 1] : 0;
- if ( !myCurrent )
+ int idx = myChildrenIndexes.last();
+ if (myDetourType == DepthLeft && idx < aParent->myChildren.count() - 1)
{
- myCurrent = aParent;
- myCurrentLevel--;
+ myChildrenIndexes.last()++;
+ myCurrent = aParent->myChildren[idx + 1];
+ exit = true;
}
- else
+ else if (myDetourType == DepthRight && idx > 0)
+ {
+ myChildrenIndexes.last()--;
+ myCurrent = aParent->myChildren[idx - 1];
exit = true;
+ } else {
+ myCurrent = aParent;
+ myChildrenIndexes.removeLast();
+ }
}
}
while ( !exit );
{
myExtremeChild = extreme( cur->myChildren, myDetourType == BreadthLeft );
myCurrent = myExtremeChild;
- myCurrentLevel++;
+ myChildrenIndexes.append(myDetourType == BreadthLeft ? 0 : myCurrent->myChildren.size() - 1);
}
}
}
*/
int SUIT_DataObjectIterator::depth() const
{
- return myCurrentLevel;
+ return myChildrenIndexes.size();
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_DATAOBJECT_ITERATOR_H
#define SUIT_DATAOBJECT_ITERATOR_H
private:
SUIT_DataObject* myExtremeChild;
- int myDetourType, myCurrentLevel;
+ int myDetourType;
+ ///! Indexes of the iterated children at each level (optimization for avoid indexOf call)
+ QList<int> myChildrenIndexes;
};
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_DataObjectKey.h"
#include <string.h>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_DATAOBJECTKEY_H
#define SUIT_DATAOBJECTKEY_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_DataOwner.h"
#ifndef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_DATAOWNER_H
#define SUIT_DATAOWNER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
break;
}
- return QMainWindow::event( e );
+ return QtxMainWindow::event( e );
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_DESKTOP_H
#define SUIT_DESKTOP_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_ExceptionHandler.h"
#include "SUIT_MessageBox.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_EXCEPTIONHANDLER_H
#define SUIT_EXCEPTIONHANDLER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_FileDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
filters << "Image files (*.bmp *.gif *.jpg )" << "All files (*)";
QString fileName = SUIT_FileDlg::getFileName( desktop(),
QString(),
- filters,
- "Dump view",
- false );
+ filters,
+ "Dump view",
+ false );
if ( !fileName.isEmpty() ) {
... writing image to the file
}
filters << "*.cpp | *.cxx | *.c++" << "*.h | *.hpp | *.hxx";
QStringList fileNames = SUIT_FileDlg::getOpenFileName( desktop(),
QString(),
- filters,
- QString() );
+ filters,
+ QString() );
if ( !fileNames.isEmpty() ) {
... open files
}
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_FileValidator.h"
+#include "Qtx.h"
#include <QDir>
#include <QEvent>
#include <QApplication>
#include <QListView>
#include <QLineEdit>
+// GDD
+#include <QUrl>
+#include <QDesktopServices>
/*!
\brief Defines extension behavior.
myQuickButton( 0 ),
myCheckPermissions( true )
{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
setModal( modal );
setSizeGripEnabled( true );
if ( parent )
setWindowIcon( parent->windowIcon() );
+ // GDD
+ myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::ApplicationsLocation)));
+ myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)));
+ setSidebarUrls(myUrls);
+
// add quick directories widgets
if ( showQuickDir ) {
myQuickLab = new QLabel( tr( "LAB_QUICK_PATH" ), this );
// retrieve directories list from the resources
QStringList dirList;
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
if ( resMgr )
- dirList = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) ).split( ';', QString::SkipEmptyParts );
+ dirList = resMgr->stringValue( "FileDlg", "QuickDirList" ).split( ';', QString::SkipEmptyParts );
if ( dirList.isEmpty() )
- dirList << QDir::homePath();
+ dirList << QDir::homePath();
+
+ // GDD
+ for ( int i = 0; i < dirList.count(); i++ ) {
+ myQuickCombo->addItem( dirList[i] );
+ myUrls.append(QUrl::fromLocalFile(dirList[i]));
+ }
- for ( int i = 0; i < dirList.count(); i++ )
- myQuickCombo->addItem( dirList[i] );
+ // GDD
+ setSidebarUrls(myUrls);
+
}
else {
delete myQuickLab; myQuickLab = 0;
setAcceptMode( open ? AcceptOpen: AcceptSave );
setWindowTitle( open ? tr( "INF_DESK_DOC_OPEN" ) : tr( "INF_DESK_DOC_SAVE" ) );
+ bool showCurrentDirInitial = resMgr ? resMgr->booleanValue( "FileDlg", "ShowCurDirInitial", false ) : false;
+
// If last visited path doesn't exist -> switch to the first preferred path
if ( !myLastVisitedPath.isEmpty() ) {
if ( !processPath( myLastVisitedPath ) && showQuickDir )
processPath( myQuickCombo->itemText( 0 ) );
}
+ else if ( showCurrentDirInitial ) {
+ processPath( QDir::currentPath() );
+ }
else if ( showQuickDir ) {
processPath( myQuickCombo->itemText( 0 ) );
}
QString f = it.next();
QFileInfo finfo( f );
if ( !finfo.isDir() )
- it.setValue( addExtension( f ) );
+ it.setValue( addExtension( f ) );
}
}
return files;
for ( int i = 0; i < editBoxes.count(); i++ ) {
int widx = grid->indexOf( editBoxes[ i ] );
if ( widx >= 0 )
- idx = qMin( idx, widx );
+ idx = qMin( idx, widx );
}
if ( grid->itemAt( idx ) )
ebox = qobject_cast<QLineEdit*>( grid->itemAt( idx )->widget() );
if ( txt == ".." ) {
QDir dir = directory();
if ( dir.cdUp() ) {
- setDirectory( dir );
- bool block = lineEdit()->blockSignals( true );
- lineEdit()->setText( ".." );
- lineEdit()->selectAll();
- lineEdit()->setFocus( Qt::OtherFocusReason );
- lineEdit()->blockSignals( block );
- return false;
+ setDirectory( dir );
+ bool block = lineEdit()->blockSignals( true );
+ lineEdit()->setText( ".." );
+ lineEdit()->selectAll();
+ lineEdit()->setFocus( Qt::OtherFocusReason );
+ lineEdit()->blockSignals( block );
+ return false;
}
}
else if ( fileMode() != DirectoryOnly ) {
QStringList fs = txt.split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < fs.count(); i++ ) {
- QString wc = fs.at( i );
- if ( wc.startsWith( "\"" ) && wc.endsWith( "\"" ) )
- wc = wc.mid( 1, wc.length()-2 );
- if ( hasWildCards( wc ) ) {
- addFilter( wc );
- lineEdit()->clear();
- return false;
- }
+ QString wc = fs.at( i );
+ if ( wc.startsWith( "\"" ) && wc.endsWith( "\"" ) )
+ wc = wc.mid( 1, wc.length()-2 );
+ if ( hasWildCards( wc ) ) {
+ addFilter( wc );
+ lineEdit()->clear();
+ return false;
+ }
}
}
}
{
QString fn = files.first();
if ( validator() ) {
- bOk = isOpenDlg() ? validator()->canReadDir( fn, checkPermissions() ) :
- validator()->canWriteDir( fn, checkPermissions() );
+ bOk = isOpenDlg() ? validator()->canReadDir( fn, checkPermissions() ) :
+ validator()->canWriteDir( fn, checkPermissions() );
}
break;
}
QString fn = files.first();
QFileInfo info( fn );
if ( info.isDir() ) {
- setDirectory( info.absoluteFilePath() );
- if ( lineEdit() ) {
- lineEdit()->selectAll();
- lineEdit()->setFocus( Qt::OtherFocusReason );
- }
- return false;
+ setDirectory( info.absoluteFilePath() );
+ if ( lineEdit() ) {
+ lineEdit()->selectAll();
+ lineEdit()->setFocus( Qt::OtherFocusReason );
+ }
+ return false;
}
// validation is not required
if ( validator() ) {
- bOk = isOpenDlg() ? validator()->canOpen( fn, checkPermissions() ) :
- validator()->canSave( fn, checkPermissions() );
+ bOk = isOpenDlg() ? validator()->canOpen( fn, checkPermissions() ) :
+ validator()->canSave( fn, checkPermissions() );
}
break;
}
case ExistingFiles:
{
for ( int i = 0; i < files.count(); ++i ) {
- QFileInfo info( files.at( i ) );
- if ( info.isDir() ) {
- setDirectory( info.absoluteFilePath() );
- if ( lineEdit() ) {
- lineEdit()->selectAll();
- lineEdit()->setFocus( Qt::OtherFocusReason );
- }
- return false;
- }
- if ( validator() ) {
- bOk = isOpenDlg() ? validator()->canOpen( files.at( i ), checkPermissions() ) :
- validator()->canSave( files.at( i ), checkPermissions() );
- if ( !bOk )
- return false;
- }
+ QFileInfo info( files.at( i ) );
+ if ( info.isDir() ) {
+ setDirectory( info.absoluteFilePath() );
+ if ( lineEdit() ) {
+ lineEdit()->selectAll();
+ lineEdit()->setFocus( Qt::OtherFocusReason );
+ }
+ return false;
+ }
+ if ( validator() ) {
+ bOk = isOpenDlg() ? validator()->canOpen( files.at( i ), checkPermissions() ) :
+ validator()->canSave( files.at( i ), checkPermissions() );
+ if ( !bOk )
+ return false;
+ }
}
break;
}
QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") );
int index = r.indexIn( selectedFilter().trimmed() );
+ if ( QFileInfo( fileName ).exists() )
+ return fileName; // if file exists return as is
+
if ( index >= 0 ) {
// Create wildcard regular expression basing on selected filter
// in order to validate a file extension.
QFileInfo fi( path );
if ( fi.exists() ) {
if ( fi.isFile() )
- selectFile( path );
+ selectFile( path );
else if ( fi.isDir() )
- setDirectory( path );
- return true;
- }
- else if ( QFileInfo( SUIT_Tools::dir( path ) ).exists() ) {
- setDirectory( SUIT_Tools::dir( path ) );
- selectFile( path );
+ setDirectory( path );
return true;
}
+ QString dirPath = SUIT_Tools::dir( path, false );
+ if ( !dirPath.isEmpty() && QFileInfo( dirPath ).exists() )
+ setDirectory( dirPath );
+ selectFile( SUIT_Tools::file( path ) );
+ return true;
}
return false;
}
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
if ( resMgr )
- dirList = resMgr->stringValue( "FileDlg", QString( "QuickDirList" ) ).split( ';', QString::SkipEmptyParts );
+ dirList = resMgr->stringValue( "FileDlg", "QuickDirList" ).split( ';', QString::SkipEmptyParts );
bool found = false;
bool emptyAndHome = false;
if ( dirList.count() > 0 ) {
for ( int i = 0; i < dirList.count() && !found; i++ ) {
- QDir aDir( dirList[i] );
- if ( aDir.canonicalPath().isNull() && dirList[i] == dir.absolutePath() ||
- !aDir.canonicalPath().isNull() && aDir.exists() &&
- aDir.canonicalPath() == dir.canonicalPath() ) {
- found = true;
- }
+ QDir aDir( dirList[i] );
+ if ( ( aDir.canonicalPath().isNull() && dirList[i] == dir.absolutePath() ) ||
+ ( !aDir.canonicalPath().isNull() && aDir.exists() &&
+ aDir.canonicalPath() == dir.canonicalPath() ) ) {
+ found = true;
+ }
}
}
else {
if ( !found ) {
dirList.append( dp );
- resMgr->setValue( "FileDlg", QString( "QuickDirList" ), dirList.join( ";" ) );
- if ( !emptyAndHome )
- myQuickCombo->addItem( dp );
+ resMgr->setValue( "FileDlg", "QuickDirList", dirList.join( ";" ) );
+ // GDD
+ if ( !emptyAndHome ) {
+ myQuickCombo->addItem( dp );
+ myUrls.append(QUrl::fromLocalFile( dp ));
+ setSidebarUrls(myUrls);
+ }
}
}
}
int maxBtnWidth = 0;
for ( QList<QPushButton*>::const_iterator it = buttons.begin();
- it != buttons.end(); ++it )
+ it != buttons.end(); ++it )
maxBtnWidth = qMax( maxBtnWidth, (*it)->sizeHint().width() );
for ( QList<QPushButton*>::const_iterator it = buttons.begin();
- it != buttons.end(); ++it ) {
+ it != buttons.end(); ++it ) {
(*it)->setDefault( false );
(*it)->setAutoDefault( false );
(*it)->setFixedWidth( maxBtnWidth );
QList<QListView*> views = findChildren<QListView*>();
for ( QList<QListView*>::const_iterator it = views.begin();
- it != views.end(); ++it ) {
+ it != views.end(); ++it ) {
(*it)->setViewMode( QListView::ListMode );
}
}
\sa getOpenFileNames(), getExistingDirectory()
*/
QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial,
- const QStringList& filters, const QString& caption,
- const bool open, const bool showQuickDir,
+ const QStringList& filters, const QString& caption,
+ const bool open, const bool showQuickDir,
SUIT_FileValidator* validator )
{
SUIT_FileDlg fd( parent, open, showQuickDir, true );
\sa getOpenFileNames(), getExistingDirectory()
*/
QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial,
- const QString& filters, const QString& caption,
- const bool open, const bool showQuickDir,
+ const QString& filters, const QString& caption,
+ const bool open, const bool showQuickDir,
SUIT_FileValidator* validator )
{
return getFileName( parent, initial, filters.split( ";;", QString::SkipEmptyParts ),
- caption, open, showQuickDir, validator );
+ caption, open, showQuickDir, validator );
}
/*!
\sa getFileName(), getExistingDirectory()
*/
QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial,
- const QStringList& filters, const QString& caption,
- const bool showQuickDir,
- SUIT_FileValidator* validator )
+ const QStringList& filters, const QString& caption,
+ const bool showQuickDir,
+ SUIT_FileValidator* validator )
{
SUIT_FileDlg fd( parent, true, showQuickDir, true );
\sa getFileName(), getExistingDirectory()
*/
QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& initial,
- const QString& filters, const QString& caption,
- const bool showQuickDir,
- SUIT_FileValidator* validator )
+ const QString& filters, const QString& caption,
+ const bool showQuickDir,
+ SUIT_FileValidator* validator )
{
return getOpenFileNames( parent, initial, filters.split( ";;", QString::SkipEmptyParts ),
- caption, showQuickDir, validator );
+ caption, showQuickDir, validator );
}
/*!
*/
QString SUIT_FileDlg::getExistingDirectory( QWidget* parent, const QString& initial,
const QString& caption, const bool showQuickDir,
- SUIT_FileValidator* validator )
+ SUIT_FileValidator* validator )
{
SUIT_FileDlg fd( parent, true, showQuickDir, true );
void SUIT_FileDlg::selectFile( const QString& f )
{
QFileDialog::selectFile( QFileInfo( f ).baseName() );
- setDirectory( QFileInfo( f ).absoluteDir() );
+ if ( !Qtx::dir( f, false ).isEmpty() )
+ setDirectory( QFileInfo( f ).absolutePath() );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_FileDlg.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
class QLineEdit;
class QComboBox;
class QPushButton;
+class QUrl;
class SUIT_FileValidator;
class SUIT_EXPORT SUIT_FileDlg : public QFileDialog
static QString getLastVisitedDirectory();
static QString getFileName( QWidget*,
- const QString&,
- const QStringList&,
- const QString& = QString(),
- const bool = true,
- const bool = true,
+ const QString&,
+ const QStringList&,
+ const QString& = QString(),
+ const bool = true,
+ const bool = true,
SUIT_FileValidator* = 0 );
static QString getFileName( QWidget*,
- const QString&,
- const QString&,
- const QString& = QString(),
- const bool = true,
- const bool = true,
+ const QString&,
+ const QString&,
+ const QString& = QString(),
+ const bool = true,
+ const bool = true,
SUIT_FileValidator* = 0 );
static QStringList getOpenFileNames( QWidget*,
- const QString&,
- const QStringList&,
- const QString& = QString(),
- const bool = true,
- SUIT_FileValidator* = 0 );
+ const QString&,
+ const QStringList&,
+ const QString& = QString(),
+ const bool = true,
+ SUIT_FileValidator* = 0 );
static QStringList getOpenFileNames( QWidget*,
- const QString&,
- const QString&,
- const QString& = QString(),
- const bool = true,
- SUIT_FileValidator* = 0 );
+ const QString&,
+ const QString&,
+ const QString& = QString(),
+ const bool = true,
+ SUIT_FileValidator* = 0 );
static QString getExistingDirectory( QWidget*,
- const QString&,
+ const QString&,
const QString& = QString(),
- const bool = true,
- SUIT_FileValidator* = 0 );
+ const bool = true,
+ SUIT_FileValidator* = 0 );
static QString getLastVisitedPath();
SUIT_FileValidator* myValidator; //!< file validator
QLabel* myQuickLab; //!< quick dir combo box
QComboBox* myQuickCombo; //!< quick dir combo box
+ QList<QUrl> myUrls; //!< quick dir Sidebar Urls
QPushButton* myQuickButton; //!< quick dir add button
bool myCheckPermissions; //!< check permissions option
static QString myLastVisitedPath; //!< last visited path
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_FileValidator.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
if ( !QFile::exists( fileName ) ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( fileName ) );
+ QObject::tr( "ERR_FILE_NOT_EXIST" ).arg( fileName ) );
return false;
}
if ( checkPermission && !QFileInfo( fileName ).isReadable() ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
+ QObject::tr( "ERR_OPEN_PERMISSION_DENIED" ).arg( fileName ) );
return false;
}
return true;
if ( QFile::exists( fileName ) ) {
if ( parent() )
if ( SUIT_MessageBox::question( parent(), QObject::tr( "WRN_WARNING" ),
- QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( fileName ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
- return false;
+ QObject::tr( "QUE_DOC_FILEEXISTS" ).arg( fileName ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
+ return false;
if ( checkPermission && !QFileInfo( fileName ).isWritable() ) {
if ( parent() )
- SUIT_MessageBox::critical( myParent, QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
+ SUIT_MessageBox::critical( myParent, QObject::tr( "ERR_ERROR" ),
+ QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
return false;
}
}
else {
QString dirName = SUIT_Tools::dir( fileName );
+ if ( !QFile::exists( dirName ) ) {
+ SUIT_MessageBox::critical( parent(), QObject::tr( "WRN_WARNING" ),
+ QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+ return false;
+ }
if ( checkPermission && !QFileInfo( dirName ).isWritable() ) {
if ( parent() )
- SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
+ SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
+ QObject::tr( "ERR_PERMISSION_DENIED" ).arg( fileName ) );
return false;
}
}
if ( !info.exists() ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+ QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
return false;
}
if ( !info.isDir() ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
+ QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
return false;
}
if ( checkPermission && !info.isReadable() ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_PERMISSION_DENIED" ).arg( dirName ) );
+ QObject::tr( "ERR_DIR_READ_PERMISSION_DENIED" ).arg( dirName ) );
return false;
}
return true;
if ( !info.exists() ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
+ QObject::tr( "ERR_DIR_NOT_EXIST" ).arg( dirName ) );
return false;
}
if ( !info.isDir() ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
+ QObject::tr( "ERR_FILE_NOT_DIR" ).arg( dirName ) );
return false;
}
if ( checkPermission && !info.isWritable() ) {
if ( parent() )
SUIT_MessageBox::critical( parent(), QObject::tr( "ERR_ERROR" ),
- QObject::tr( "ERR_PERMISSION_DENIED" ).arg( dirName ) );
+ QObject::tr( "ERR_DIR_WRITE_PERMISSION_DENIED" ).arg( dirName ) );
return false;
}
return true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_FileValidator.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_LicenseDlg.h"
#include <QApplication>
setObjectName( name );
setModal( modal );
QString env;
- if ( ::getenv( "TRIPOLI_ROOT_DIR" ) )
- env = ::getenv( "TRIPOLI_ROOT_DIR" );
+ if ( ::getenv( "SALOME_LICENSE_FILE" ) )
+ env = ::getenv( "SALOME_LICENSE_FILE" );
- QFile file( env + "/share/salome/resources/License.txt" ); // Read the text from a file
+ QFile file( env ); // Read the text from a file
if ( !file.exists() || !file.open( QIODevice::ReadOnly ) )
return;
}
/*!
- Name: ~SUIT_LicenseDlg [public]
- Desc: Destructor
+ Name: ~SUIT_LicenseDlg [public]
+ Desc: Destructor
*/
SUIT_LicenseDlg::~SUIT_LicenseDlg()
// convert text to rich text format
QString aFormattedText = Qt::convertFromPlainText( myTextEdit->toPlainText() );
-
+
QTextDocument aRichText( aFormattedText );
aRichText.setDefaultFont( aBodyFont );
/*QSimpleRichText aRichText( aFormattedText,
- aBodyFont,
- myTextEdit->context(),
- myTextEdit->styleSheet(),
- myTextEdit->mimeSourceFactory(),
- aBody.height() );
+ aBodyFont,
+ myTextEdit->context(),
+ myTextEdit->styleSheet(),
+ myTextEdit->mimeSourceFactory(),
+ aBody.height() );
*/
aRichText.setPageSize( QSize( aBody.width(), aRichText.pageSize().height() ) );
- //aRichText.setWidth( &aPainter, aBody.width() );
+ //aRichText.setWidth( &aPainter, aBody.width() );
QRect aView( aBody );
do {
// print page text
aRichText.drawContents( &aPainter, aView );
- //aRichText.draw( &aPainter, aBody.left(), aBody.top(), aView, colorGroup() );
+ //aRichText.draw( &aPainter, aBody.left(), aBody.top(), aView, colorGroup() );
aView.translate( 0, aBody.height() );
aPainter.translate( 0 , -aBody.height() );
aPainter.setFont(aFooterFont);
QString aFooter = QString("Page ") + QString::number(aPageIndex);
aPainter.drawText( aView.right() - aPainter.fontMetrics().width( aFooter ),
- aView.bottom() + aPainter.fontMetrics().ascent() + 5, aFooter );
+ aView.bottom() + aPainter.fontMetrics().ascent() + 5, aFooter );
if ( aView.top() >= aRichText.size().height() )
- break;
+ break;
aPrinter.newPage();
aPageIndex++;
} while (true);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_LICENSEDLG_H
#define SUIT_LICENSEDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_MessageBox.h"
#include "SUIT_OverrideCursor.h"
// show question message box with two standard buttons
int result = SUIT_MessageBox::question(desktop(), "Error",
"File already exists? Overwrite?",
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::No );
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::No );
if ( result == SUIT_MessageBox::Yes )
overwriteFileFunction();
// default is second button and escape is third button
int result = SUIT_MessageBox::critical(desktop(), "Hazard!",
"The situation is critical! What to do?",
- "Hide", "Run Away", "Stand still", 1, 2);
+ "Hide", "Run Away", "Stand still", 1, 2);
switch ( result )
{
case 0:
// both default and escape buttons are set to first button ("Zero")
int result = SUIT_MessageBox::information(desktop(), "Question",
"Select your favourite number",
- 0, 0,
- "Zero", "One", "Two", "Three", "Four", "Five");
+ 0, 0,
+ "Zero", "One", "Two", "Three", "Four", "Five");
useMyFavouriteNumberSomewhere( result );
\endcode
*/
\return button id clicked by the user (QMessageBox::StandardButton)
*/
int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button )
+ const QString& button )
{
ButtonInfos lst;
lst.append( ButtonInfo( 0, button ) );
\return button id clicked by the user (QMessageBox::StandardButton)
*/
int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button )
+ const QString& button )
{
ButtonInfos lst;
lst.append( ButtonInfo( 0, button ) );
\return button id clicked by the user (QMessageBox::StandardButton)
*/
int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
- const QString& button )
+ const QString& button )
{
ButtonInfos lst;
lst.append( ButtonInfo( 0, button ) );
\return button id clicked by the user (QMessageBox::StandardButton)
*/
int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
- const QString& button )
+ const QString& button )
{
ButtonInfos lst;
lst.append( ButtonInfo( 0, button ) );
\return button used button id
*/
int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button1 ) );
lst.append( ButtonInfo( id++, button2 ) );
return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button1 ) );
lst.append( ButtonInfo( id++, button2 ) );
return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button1 ) );
lst.append( ButtonInfo( id++, button2 ) );
return messageBox( SUIT_MessageBox::Information, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button1 ) );
lst.append( ButtonInfo( id++, button2 ) );
return messageBox( SUIT_MessageBox::Question, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button2 ) );
lst.append( ButtonInfo( id++, button3 ) );
return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button2 ) );
lst.append( ButtonInfo( id++, button3 ) );
return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button2 ) );
lst.append( ButtonInfo( id++, button3 ) );
return messageBox( SUIT_MessageBox::Information, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button2 ) );
lst.append( ButtonInfo( id++, button3 ) );
return messageBox( SUIT_MessageBox::Question, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button3 ) );
lst.append( ButtonInfo( id++, button4 ) );
return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button3 ) );
lst.append( ButtonInfo( id++, button4 ) );
return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button3 ) );
lst.append( ButtonInfo( id++, button4 ) );
return messageBox( SUIT_MessageBox::Information, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton, const int escapeButton )
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton, const int escapeButton )
{
ButtonInfos lst;
int id = 0;
lst.append( ButtonInfo( id++, button3 ) );
lst.append( ButtonInfo( id++, button4 ) );
return messageBox( SUIT_MessageBox::Question, parent, title, text, lst,
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char* btn, ... )
+ const int defaultButton, const int escapeButton,
+ char* btn, ... )
{
va_list args;
va_start( args, btn );
return messageBox( SUIT_MessageBox::Critical, parent, title, text,
messageList( btn, args ),
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char* btn, ... )
+ const int defaultButton, const int escapeButton,
+ char* btn, ... )
{
va_list args;
va_start( args, btn );
return messageBox( SUIT_MessageBox::Warning, parent, title, text,
messageList( btn, args ),
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char* btn, ... )
+ const int defaultButton, const int escapeButton,
+ char* btn, ... )
{
va_list args;
va_start( args, btn );
return messageBox( SUIT_MessageBox::Information, parent, title, text,
messageList( btn, args ),
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char* btn, ... )
+ const int defaultButton, const int escapeButton,
+ char* btn, ... )
{
va_list args;
va_start( args, btn );
return messageBox( SUIT_MessageBox::Question, parent, title, text,
messageList( btn, args ),
- defaultButton, escapeButton );
+ defaultButton, escapeButton );
}
/*!
\return button used button id
*/
int SUIT_MessageBox::messageBox( Icon icon, QWidget* parent,
- const QString& title, const QString& text,
- const ButtonInfos& lst,
- const int defaultButton,
- const int escapeButton )
+ const QString& title, const QString& text,
+ const ButtonInfos& lst,
+ const int defaultButton,
+ const int escapeButton )
{
SUIT_MessageBox msgBox( icon, title, text, NoButton, parent );
QPushButton* pb = msgBox.addButton( txt, role );
bm.insert( pb, btn );
- if ( defaultButton == -1 && i == 0 || btn == defaultButton )
+ if ( ( defaultButton == -1 && i == 0 ) || btn == defaultButton )
msgBox.setDefaultButton( pb );
- if ( escapeButton == -1 && i == lst.count() - 1 || btn == escapeButton )
+ if ( ( escapeButton == -1 && i == lst.count() - 1 ) || btn == escapeButton )
msgBox.setEscapeButton( pb );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_MESSAGEBOX_H
#define SUIT_MESSAGEBOX_H
// message boxes with one custom button
static int critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button );
+ const QString& button );
static int warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button );
+ const QString& button );
static int information( QWidget* parent, const QString& title, const QString& text,
- const QString& button );
+ const QString& button );
static int question( QWidget* parent, const QString& title, const QString& text,
- const QString& button );
+ const QString& button );
// message boxes with two custom buttons
static int critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int information( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int question( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const int defaultButton = -1, const int escapeButton = -1 );
// message boxes with three custom buttons
static int critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2, const QString& button3,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2, const QString& button3,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2, const QString& button3,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2, const QString& button3,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int information( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2, const QString& button3,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2, const QString& button3,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int question( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2, const QString& button3,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2, const QString& button3,
+ const int defaultButton = -1, const int escapeButton = -1 );
// message boxes with four custom buttons
static int critical( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int warning( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int information( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton = -1, const int escapeButton = -1 );
static int question( QWidget* parent, const QString& title, const QString& text,
- const QString& button1, const QString& button2,
- const QString& button3, const QString& button4,
- const int defaultButton = -1, const int escapeButton = -1 );
+ const QString& button1, const QString& button2,
+ const QString& button3, const QString& button4,
+ const int defaultButton = -1, const int escapeButton = -1 );
// message boxes with arbitrary number of buttons
static int critical( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char*, ... );
+ const int defaultButton, const int escapeButton,
+ char*, ... );
static int warning( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char*, ... );
+ const int defaultButton, const int escapeButton,
+ char*, ... );
static int information( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char*, ... );
+ const int defaultButton, const int escapeButton,
+ char*, ... );
static int question( QWidget* parent, const QString& title, const QString& text,
- const int defaultButton, const int escapeButton,
- char*, ... );
+ const int defaultButton, const int escapeButton,
+ char*, ... );
private:
class ButtonInfo
{
public:
ButtonInfo( const int id,
- const QString& text,
- const ButtonRole role = ActionRole )
+ const QString& text,
+ const ButtonRole role = ActionRole )
: myId( id ), myText( text ), myRole( role ) {}
int id() const { return myId; }
QString text() const { return myText; }
private:
static int messageBox( SUIT_MessageBox::Icon icon, QWidget* parent,
- const QString& title, const QString& text,
- const ButtonInfos& lst,
- const int defaultButton = -1,
- const int escapeButton = -1 );
+ const QString& title, const QString& text,
+ const ButtonInfos& lst,
+ const int defaultButton = -1,
+ const int escapeButton = -1 );
static ButtonInfos messageList( char*, va_list& );
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_Operation.h"
#include "SUIT_Study.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_OPERATION_H
#define SUIT_OPERATION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_OverrideCursor.h"
#include <QApplication>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_OVERRIDECURSOR_H
#define SUIT_OVERRIDECURSOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_PopupClient.h"
/*! constructor. initialize mySignal.*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_POPUPCLIENT_H
#define SUIT_POPUPCLIENT_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SUIT_PreferenceMgr.cxx
// Author: Sergey TELKOV
//
case Integer:
item = new QtxPagePrefEditItem( QtxPagePrefEditItem::Integer, title, parent, sect, param );
break;
+ case Slider:
+ item = new QtxPagePrefSliderItem( title, parent, sect, param );
+ break;
case GroupBox:
item = new QtxPagePrefGroupItem( title, parent, sect, param );
break;
case DirList:
item = new QtxPagePrefPathListItem( Qtx::PT_Directory, title, parent, sect, param );
break;
+ case Shortcut:
+ item = new QtxPagePrefShortcutBtnsItem( title, parent, sect, param );
+ break;
+ case ShortcutTree:
+ item = new QtxPagePrefShortcutTreeItem( title, parent, sect, param );
+ break;
+ case BiColor:
+ item = new QtxPagePrefBiColorItem( title, parent, sect, param );
+ break;
+ case Background:
+ item = new QtxPagePrefBackgroundItem( title, parent, sect, param );
+ break;
+ case UserDefined:
+ item = new QtxUserDefinedItem(parent);
+ break;
}
return item ? item->id() : -1;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SUIT_PreferenceMgr.h
// Author: Sergey TELKOV
//
public:
typedef enum { Auto, Space, Bool, Color, String, Selector,
DblSpin, IntSpin, Double, Integer,
- GroupBox, Tab, Frame, Font, DirList, File } PrefItemType;
+ GroupBox, Tab, Frame, Font, DirList, File,
+ Slider, Shortcut, ShortcutTree, BiColor, Background,
+ UserDefined = 1000 } PrefItemType;
public:
SUIT_PreferenceMgr( QtxResourceMgr*, QWidget* = 0 );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_ResourceMgr.h"
#include <QDir>
*/
QString SUIT_ResourceMgr::findAppropriateUserFile( const QString& fname ) const
{
- QDir d( QFileInfo( fname ).dir() );
- d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
- QStringList l = d.entryList();
QString appr_file;
- int id0 = userFileId( fname ), id, appr=-1;
- if( id0<0 )
+
+ // calculate default file id from user file name
+ long id0 = userFileId( fname );
+ if ( id0 < 0 ) // can't calculate file id from user file name, no further processing
return appr_file;
- for( QStringList::const_iterator anIt = l.begin(), aLast = l.end(); anIt!=aLast; anIt++ )
- {
- id = userFileId( *anIt );
- if( id<0 )
- continue;
+ long id, appr = -1;
+
+ // 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 );
+ }
+ }
+ }
+
+ // 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();
- if( appr < 0 || abs( id-id0 ) < abs( appr-id0 ) )
+ for( QStringList::const_iterator anIt = l.begin(), aLast = l.end(); anIt!=aLast; anIt++ )
{
- appr = id;
- appr_file = d.absoluteFilePath( *anIt );
+ id = userFileId( *anIt );
+ if ( id < 0 )
+ continue;
+ if( appr < 0 || qAbs( id-id0 ) < qAbs( appr-id0 ) )
+ {
+ appr = id;
+ appr_file = home.absoluteFilePath( *anIt );
+ }
}
}
+
return appr_file;
}
/*!
Calculates integer extended version number by user file name for comparing
*/
-int SUIT_ResourceMgr::userFileId( const QString& ) const
+long SUIT_ResourceMgr::userFileId( const QString& ) const
{
return -1;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_RESOURCEMGR_H
#define SUIT_RESOURCEMGR_H
protected:
virtual QString userFileName( const QString&, const bool = true ) const;
virtual QString findAppropriateUserFile( const QString& ) const;
- virtual int userFileId( const QString& ) const;
+ virtual long userFileId( const QString& ) const;
private:
QString myVersion;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_SelectionFilter.h"
/*! constructor. do nothing*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_SELECTIONFILTER_H
#define SUIT_SELECTIONFILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_SelectionMgr.h"
#include "SUIT_Selector.h"
for ( SelectorList::const_iterator it = mySelectors.begin(); it != mySelectors.end(); ++it )
{
+ if ( !(*it)->isEnabled() )
+ continue;
if ( !type.isEmpty() && (*it)->type() != type )
continue;
{
// Temporary action(to avoid selection of the objects which don't pass the filters):
//if ( *it != sel )
- (*it)->setSelected( newOwners );
+ (*it)->setSelected( newOwners );
}
}
myIsSelChangeEnabled = true;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_SELECTIONMGR_H
#define SUIT_SELECTIONMGR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_Selector.h"
#include "SUIT_SelectionMgr.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_SELECTOR_H
#define SUIT_SELECTOR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_Session.h"
#include "SUIT_Study.h"
connect( app, SIGNAL( applicationClosed( SUIT_Application* ) ),
this, SLOT( onApplicationClosed( SUIT_Application* ) ) );
connect( app, SIGNAL( activated( SUIT_Application* ) ),
- this, SLOT( onApplicationActivated( SUIT_Application* ) ) );
+ this, SLOT( onApplicationActivated( SUIT_Application* ) ) );
}
/*!
{
SUIT_Study* study = app->activeStudy();
if ( study->isModified() && study->isSaved() )
- study->saveDocument();
+ study->saveDocument();
}
else if ( mode == DONT_SAVE )
{
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_SESSION_H
#define SUIT_SESSION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#if !defined(__SUIT_SMARTPTR_H)
#define __SUIT_SMARTPTR_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_Study.h"
#include "SUIT_Desktop.h"
{
int anAnsw = SUIT_MessageBox::question( application()->desktop(),
tr( "OPERATION_LAUNCH" ), tr( "PREVIOUS_NOT_FINISHED" ),
- tr( "CONTINUE" ), tr( "CANCEL" ) );
+ tr( "CONTINUE" ), tr( "CANCEL" ) );
if ( anAnsw == 1 )
return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_STUDY_H
#define SUIT_STUDY_H
virtual int id() const;
SUIT_DataObject* root() const;
- QString studyName() const;
+ virtual QString studyName() const;
SUIT_Application* application() const;
virtual bool isSaved() const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_Tools.h"
#include <QDir>
tmpPath += QString( "Salome_trace" );
- FILE* pStream;
+ FILE* pStream;
pStream = fopen( lpszLog ? lpszLog : (const char*)tmpPath.toLatin1(), "a" );
if ( pStream )
- {
+ {
va_list argptr;
va_start( argptr, lpszFormat );
fprintf( pStream, "- Trace %s [%d] : %s", __FILE__, __LINE__, lpszFormat );
/*!
Creates a rect with TopLeft = ( min(x1,x2), min(y1,y2) )
and BottomRight = ( TopLeft + (x2-x1)(y2-y1) )
-*/
+*/
QRect SUIT_Tools::makeRect( const int x1, const int y1, const int x2, const int y2 )
{
return QRect( qMin( x1, x2 ), qMin( y1, y2 ), qAbs( x2 - x1 ), qAbs( y2 - y1 ) );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_TOOLS_H
#define SUIT_TOOLS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SUIT_TreeModel.cxx
// Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
+#include "SUIT_Session.h"
#include "SUIT_TreeModel.h"
#include "SUIT_TreeSync.h"
#include "SUIT_DataObject.h"
+#include "SUIT_ResourceMgr.h"
#include <QApplication>
#include <QHash>
+#include <QMimeData>
-SUIT_AbstractModel::SUIT_AbstractModel()
+SUIT_AbstractModel::SUIT_AbstractModel() : mySearcher( 0 )
{
}
return dynamic_cast<const QObject*>( this );
}
+SUIT_DataSearcher* SUIT_AbstractModel::searcher() const
+{
+ return mySearcher;
+}
-
-
+void SUIT_AbstractModel::setSearcher( SUIT_DataSearcher* s )
+{
+ mySearcher = s;
+}
/*!
SUIT_DataObject* dataObject() const;
TreeItem* parent() const;
int position() const;
+ void setPosition(int position) {_position=position;};
int childCount() const;
TreeItem* child( const int i );
QList<TreeItem*> children() const;
TreeItem* myParent;
QList<TreeItem*> myChildren;
SUIT_DataObject* myObj;
+ int _position;
};
/*!
\param after tree item after each this one should be inserted
*/
SUIT_TreeModel::TreeItem::TreeItem( SUIT_DataObject* obj,
- SUIT_TreeModel::TreeItem* parent,
- SUIT_TreeModel::TreeItem* after )
+ SUIT_TreeModel::TreeItem* parent,
+ SUIT_TreeModel::TreeItem* after )
: myParent( parent ),
- myObj( obj )
+ myObj( obj ),
+ _position(-1)
{
// Add <this> to the parent's children list
if ( myParent )
\param after tree item after each \a child should be inserted
*/
void SUIT_TreeModel::TreeItem::insertChild( SUIT_TreeModel::TreeItem* child,
- SUIT_TreeModel::TreeItem* after )
+ SUIT_TreeModel::TreeItem* after )
{
if ( !child )
return;
- int index = after ? myChildren.indexOf( after ) + 1 : 0;
+ int index = after ? after->position() + 1 : 0;
myChildren.insert( index, child );
}
*/
int SUIT_TreeModel::TreeItem::position() const
{
- return myParent ? myParent->myChildren.indexOf( (TreeItem*)this ) : -1;
+ return _position;
}
/*!
\return created item
*/
SUIT_TreeModel::ItemPtr SUIT_TreeModel::TreeSync::createItem( const ObjPtr& obj,
- const ItemPtr& parent,
- const ItemPtr& after ) const
+ const ItemPtr& parent,
+ const ItemPtr& after ) const
{
ItemPtr item = myModel ? myModel->createItem( obj, parent, after ) : 0;
if( obj )
obj->update();
if ( item && needUpdate( item ) )
- myModel->updateItem( item );
+ myModel->updateItem( item, false );
}
/*!
/* update = ( item->text( 0 ) != obj->name() ) || myBrowser->needToUpdateTexts( item );
if ( !update ) {
- // 2. check pixmap (compare serialNumber()-s)
- QPixmap objPix = obj->icon();
- const QPixmap* itemPix = item->pixmap( 0 );
- update = ( objPix.isNull() && ( itemPix && !itemPix->isNull() ) ) ||
- ( !objPix.isNull() && ( !itemPix || itemPix->isNull() ) );
- if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) {
- int aIconW = objPix.width();
- if( aIconW > 20 ) {
- QWMatrix aM;
- double aScale = 20.0 / aIconW;
- aM.scale( aScale, aScale );
- objPix = objPix.xForm( aM );
- }
- update = ( objPix.serialNumber() != itemPix->serialNumber() );
- }
+ // 2. check pixmap (compare serialNumber()-s)
+ QPixmap objPix = obj->icon();
+ const QPixmap* itemPix = item->pixmap( 0 );
+ update = ( objPix.isNull() && ( itemPix && !itemPix->isNull() ) ) ||
+ ( !objPix.isNull() && ( !itemPix || itemPix->isNull() ) );
+ if ( !update && !objPix.isNull() && itemPix && !itemPix->isNull() ) {
+ int aIconW = objPix.width();
+ if( aIconW > 20 ) {
+ QWMatrix aM;
+ double aScale = 20.0 / aIconW;
+ aM.scale( aScale, aScale );
+ objPix = objPix.xForm( aM );
+ }
+ update = ( objPix.serialNumber() != itemPix->serialNumber() );
+ }
}*/
}
}
myRoot( 0 ),
myRootItem( 0 ),
myAutoDeleteTree( false ),
- myAutoUpdate( true )
+ myAutoUpdate( true ),
+ myUpdateModified( false )
{
initialize();
}
myRoot( root ),
myRootItem( 0 ),
myAutoDeleteTree( false ),
- myAutoUpdate( true )
+ myAutoUpdate( true ),
+ myUpdateModified( false )
{
initialize();
}
{
if ( autoDeleteTree() ) {
SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
delete myRoot;
}
void SUIT_TreeModel::registerColumn( const int group_id, const QString& name, const int custom_id )
{
bool found = false;
- for( int i=0, n=myColumns.size(); i<n && !found; i++ )
- if( name==myColumns[i].myName )
- {
- myColumns[i].myIds.insert( group_id, custom_id );
- found = true;
- }
- if( !found )
- {
- ColumnInfo inf;
- inf.myName = name;
- inf.myIds.insert( group_id, custom_id );
- inf.myAppropriate = Qtx::Shown;
- int n = myColumns.size();
- myColumns.resize( n+1 );
- myColumns[n] = inf;
- reset();
+ for ( int i=0, n=myColumns.size(); i<n && !found; i++ ) {
+ if ( name == myColumns[i].myName ) {
+ myColumns[i].myIds.insert( group_id, custom_id );
+ found = true;
+ }
+ }
+ if ( !found ) {
+ ColumnInfo inf;
+ inf.myName = name;
+ inf.myIds.insert( group_id, custom_id );
+ inf.myAppropriate = Qtx::Shown;
+ inf.myHeaderFlags = Qtx::ShowAll;
+ int n = myColumns.size();
+ myColumns.resize( n+1 );
+ myColumns[n] = inf;
+ reset();
}
}
*/
void SUIT_TreeModel::unregisterColumn( const int group_id, const QString& name )
{
- for( int i=0, n=myColumns.size(); i<n; i++ )
- if( myColumns[i].myName==name )
- {
- myColumns[i].myIds.remove( group_id );
- if( myColumns[i].myIds.isEmpty() )
- {
- myColumns.remove( i );
- reset();
- }
- break;
+ for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+ if ( myColumns[i].myName == name ) {
+ myColumns[i].myIds.remove( group_id );
+ if ( myColumns[i].myIds.isEmpty() ) {
+ myColumns.remove( i );
+ reset();
+ }
+ break;
}
+ }
}
/*!
*/
void SUIT_TreeModel::setColumnIcon( const QString& name, const QPixmap& icon )
{
- for( int i=0, n=myColumns.size(); i<n; i++ )
- if( myColumns[i].myName==name )
- {
- myColumns[i].myIcon = icon;
- break;
- }
+ for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+ if ( myColumns[i].myName == name ) {
+ myColumns[i].myIcon = icon;
+ break;
+ }
+ }
}
/*!
QPixmap SUIT_TreeModel::columnIcon( const QString& name ) const
{
QPixmap res;
- for( int i=0, n=myColumns.size(); i<n; i++ )
- if( myColumns[i].myName==name )
- {
- res = myColumns[i].myIcon;
- break;
- }
+ for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+ if ( myColumns[i].myName == name ) {
+ res = myColumns[i].myIcon;
+ break;
+ }
+ }
return res;
}
*/
void SUIT_TreeModel::setAppropriate( const QString& name, const Qtx::Appropriate appr )
{
- for( int i=0, n=myColumns.size(); i<n; i++ )
- if( myColumns[i].myName==name )
- {
- myColumns[i].myAppropriate = appr;
- emit headerDataChanged( Qt::Horizontal, i, i );
- break;
- }
+ for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+ if ( myColumns[i].myName == name && myColumns[i].myAppropriate != appr ) {
+ myColumns[i].myAppropriate = appr;
+ emit headerDataChanged( Qt::Horizontal, i, i );
+ break;
+ }
+ }
}
/*!
Qtx::Appropriate SUIT_TreeModel::appropriate( const QString& name ) const
{
Qtx::Appropriate appr = Qtx::Shown;
- for( int i=0, n=myColumns.size(); i<n; i++ )
- if( myColumns[i].myName==name )
- {
- appr = myColumns[i].myAppropriate;
- break;
- }
+ for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+ if ( myColumns[i].myName == name ) {
+ appr = myColumns[i].myAppropriate;
+ break;
+ }
+ }
return appr;
}
+/*!
+ \brief Set header flags.
+
+ These flags allow show in the header of the column text (name of the column),
+ icon or both text and icon.
+
+ \param name - column name
+ \param flags - header flags
+
+*/
+void SUIT_TreeModel::setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags )
+{
+ for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+ if ( myColumns[i].myName == name && myColumns[i].myHeaderFlags != flags ) {
+ myColumns[i].myHeaderFlags = flags;
+ emit headerDataChanged( Qt::Horizontal, i, i );
+ break;
+ }
+ }
+}
+
+/*!
+ \brief Get the header flags.
+
+ These flags allow show in the header of the column text (name of the column),
+ icon or both text and icon.
+
+ \param name - column name
+ \return header flags
+*/
+Qtx::HeaderViewFlags SUIT_TreeModel::headerFlags( const QString& name ) const
+{
+ Qtx::HeaderViewFlags flags;
+ for ( int i = 0, n = myColumns.size(); i < n; i++ ) {
+ if ( myColumns[i].myName == name ) {
+ flags = myColumns[i].myHeaderFlags;
+ break;
+ }
+ }
+ return flags;
+}
+
+/*!
+ \brief Set visibility state of the object.
+
+ \param id - column name
+ \param state - visible state
+*/
+void SUIT_TreeModel::setVisibilityState( const QString& id, Qtx::VisibilityState state )
+{
+ VisibilityMap::const_iterator it = myVisibilityMap.find( id );
+ if ( it != myVisibilityMap.end() && it.value() == state )
+ return;
+
+ bool needSignal = false;
+ if ( state != Qtx::UnpresentableState ) {
+ myVisibilityMap.insert( id, state );
+ needSignal = true;
+ }
+ else {
+ needSignal = myVisibilityMap.remove( id ) > 0;
+ }
+ if ( needSignal ) {
+ QModelIndexList lst;
+ if ( searcher() ) {
+ SUIT_DataObject* o = searcher()->findObject( id );
+ if ( o ) lst << index( o );
+ }
+ else {
+ lst = match( index( 0, root()->customData( Qtx::IdType ).toInt() ), DisplayRole, id, 1, Qt::MatchExactly | Qt::MatchRecursive );
+ }
+ if ( !lst.isEmpty() ) {
+ QModelIndex idx = index( lst.first().row(), SUIT_DataObject::VisibilityId, lst.first().parent() );
+ emit dataChanged( idx, idx );
+ }
+ }
+}
+
+/*!
+ \brief Set visibility state for all objects.
+
+ \param id - column name
+ \param state - visible state
+*/
+void SUIT_TreeModel::setVisibilityStateForAll( Qtx::VisibilityState state )
+{
+ if ( state != Qtx::UnpresentableState ) {
+ VisibilityMap::ConstIterator it = myVisibilityMap.begin();
+ while ( it != myVisibilityMap.end() ) {
+ if ( it.value() != state )
+ setVisibilityState( it.key(), state );
+ it++;
+ }
+ }
+ else {
+ QList<QString> anIds = myVisibilityMap.keys();
+ myVisibilityMap.clear();
+ QList<QString>::ConstIterator it = anIds.begin();
+ while ( it != anIds.end() ) {
+ QModelIndexList lst;
+ if ( searcher() ) {
+ SUIT_DataObject* o = searcher()->findObject( *it );
+ if ( o ) lst << index( o );
+ }
+ else {
+ lst = match( index( 0, root()->customData( Qtx::IdType ).toInt() ), DisplayRole, (*it), 1, Qt::MatchExactly | Qt::MatchRecursive );
+ }
+ if ( !lst.isEmpty() ) {
+ QModelIndex idx = index( lst.first().row(), SUIT_DataObject::VisibilityId ,lst.first().parent() );
+ emit dataChanged( idx, idx );
+ }
+ it++;
+ }
+ }
+}
+
+/*!
+ \brief Get visibility state of the object.
+
+ \param id - column name
+ \return visible state
+*/
+Qtx::VisibilityState SUIT_TreeModel::visibilityState( const QString& id ) const
+{
+ VisibilityMap::const_iterator it = myVisibilityMap.find( id );
+ return it != myVisibilityMap.end() ? it.value() : Qtx::UnpresentableState;
+}
+
/*!
\brief Get data tree root object.
\return data tree root
if ( autoDeleteTree() ) {
SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
delete myRoot;
}
return QVariant();
SUIT_DataObject* obj = object( index );
+ if ( !obj )
+ return QVariant();
QColor c;
QVariant val;
if ( obj )
{
switch ( role )
- {
+ {
case DisplayRole:
// data object text for the specified column
- val = obj->text( id );
+ val = obj->text( id );
break;
- case DecorationRole:
- // data object icon for the specified column
- val = obj->icon( id );
+ case EditRole:
+ // data object text for the specified column (for editor)
+ val = obj->text( id );
break;
+ case DecorationRole: {
+ // icon
+ if ( id == SUIT_DataObject::VisibilityId ) {
+ // for visibility column, icon is defined specifically (using data object id)
+ QString objId = objectId( index );
+ if ( myVisibilityMap.contains( objId ) ) {
+ // visibility status is defined -> return proper icon
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ val = ( myVisibilityMap.value( objId ) == Qtx::ShownState ) ?
+ resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) :
+ resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) );
+ }
+ else {
+ // visibility status is undefined -> no icon
+ val = QIcon();
+ }
+ }
+ else {
+ // for other columns get icon from the object
+ val = obj->icon( id );
+ }
+ break;
+ }
case ToolTipRole:
// data object tooltip for the specified column
val = obj->toolTip( id );
// data background color for the specified column
c = obj->color( SUIT_DataObject::Background, id );
if( !c.isValid() ) // default value
- c = QApplication::palette().color( QPalette::Base );
+ c = QApplication::palette().color( QPalette::Base );
c.setAlpha( 0 );
val = c;
break;
// data foreground (text) color for the specified column
c = obj->color( SUIT_DataObject::Foreground, id );
if( !c.isValid() ) // default value
- c = QApplication::palette().color( QPalette::Foreground );
+ c = QApplication::palette().color( QPalette::Foreground );
val = c;
break;
case BaseColorRole:
// editor background color for the specified column
c = obj->color( SUIT_DataObject::Base, id );
if( !c.isValid() ) // default value
- c = QApplication::palette().color( QPalette::Base );
+ c = QApplication::palette().color( QPalette::Base );
val = c;
break;
case TextColorRole:
// editor foreground (text) color for the specified column
c = obj->color( SUIT_DataObject::Text, id );
if( !c.isValid() ) // default value
- c = QApplication::palette().color( QPalette::Text );
+ c = QApplication::palette().color( QPalette::Text );
val = c;
break;
case HighlightRole:
// adta object highlighted background color for the specified column
c = obj->color( SUIT_DataObject::Highlight, id );
if( !c.isValid() ) // default value
- c = QApplication::palette().color( QPalette::Highlight );
+ c = QApplication::palette().color( QPalette::Highlight );
val = c;
break;
case HighlightedTextRole:
// data object highlighted foreground (text) color for the specified column
c = obj->color( SUIT_DataObject::HighlightedText, id );
if( !c.isValid() ) // default value
- c = QApplication::palette().color( QPalette::HighlightedText );
+ c = QApplication::palette().color( QPalette::HighlightedText );
val = c;
break;
case CheckStateRole:
// data object checked state for the specified column
// NOTE! three-state check is not supported currently
if( obj->isCheckable( id ) )
- val = obj->isOn( id ) ? Qt::Checked : Qt::Unchecked;
+ val = obj->isOn( id ) ? Qt::Checked : Qt::Unchecked;
break;
case SizeHintRole:
// data size hint
\sa data()
*/
bool SUIT_TreeModel::setData( const QModelIndex& index,
- const QVariant& value, int role )
+ const QVariant& value, int role )
{
if ( index.isValid() && value.isValid() ) {
SUIT_DataObject* obj = object( index );
// NOTE! only 'check state' data is supported by default
switch ( role ) {
case CheckStateRole:
- // checked state
- if ( obj->isCheckable( index.column() ) ) {
- obj->setOn( value.toBool(), index.column() );
- emit( dataChanged( index, index ) );
+ // checked state
+ if ( obj->isCheckable( index.column() ) ) {
+ obj->setOn( value.toBool(), index.column() );
+ emit( dataChanged( index, index ) );
+ return true;
+ }
+ break;
+ case EditRole: {
+ QString val = value.toString();
+ if ( !val.isEmpty() && obj->setName(val) ) {
+ emit( dataChanged( index, index ) );
return true;
}
- break;
+ return false;
+ break;
+ }
default:
- break;
+ break;
}
}
}
*/
Qt::ItemFlags SUIT_TreeModel::flags( const QModelIndex& index ) const
{
- if ( !index.isValid() )
- return 0;
-
- SUIT_DataObject* obj = object( index );
Qt::ItemFlags f = 0;
- if ( obj ) {
+ if (!index.isValid())
+ //return Qt::ItemIsDropEnabled; // items can be dropped into the top level of the model
+ return f;
+
+ SUIT_DataObject* obj = object(index);
+
+ if (obj) {
// data object is enabled
- if ( obj->isEnabled() )
+ if (obj->isEnabled())
f = f | Qt::ItemIsEnabled;
// data object is selectable
- if ( obj->isSelectable() )
+ if (obj->isSelectable())
f = f | Qt::ItemIsSelectable;
// data object is checkable
- if ( obj->isCheckable( index.column() ) )
+ if (obj->isCheckable(index.column()))
f = f | Qt::ItemIsUserCheckable;
+
+ // data object can be renamed
+ if (obj->renameAllowed(index.column()))
+ f = f | Qt::ItemIsEditable;
+
+ // data object can be dragged
+ if (obj->isDraggable())
+ f = f | Qt::ItemIsDragEnabled;
+
+ // another data object(s) can be dropped on this one
+ if (obj->isDropAccepted())
+ f = f | Qt::ItemIsDropEnabled;
}
+
return f;
}
+Qt::DropActions SUIT_TreeModel::supportedDropActions() const
+{
+ return Qt::CopyAction | Qt::MoveAction;
+}
+
/*!
\brief Get header data (can be used in any data view).
\param column column number
if ( root() && orientation == Qt::Horizontal )
{
switch ( role )
- {
+ {
case DisplayRole:
// column title
- d = myColumns[column].myName;
+ if((myColumns[column].myHeaderFlags & Qtx::ShowText) ||
+ (myColumns[column].myHeaderFlags == Qtx::ShowAll))
+ d = myColumns[column].myName;
+ else
+ d = QString();
break;
case DecorationRole:
// column icon
- d = myColumns[column].myIcon;
+ if((myColumns[column].myHeaderFlags & Qtx::ShowIcon) ||
+ (myColumns[column].myHeaderFlags == Qtx::ShowAll))
+ d = myColumns[column].myIcon;
+ else
+ d = QIcon();
break;
case AppropriateRole:
// appropriate flag (can column be hidden via context popup menu)
\return model index
*/
QModelIndex SUIT_TreeModel::index( int row, int column,
- const QModelIndex& parent ) const
+ const QModelIndex& parent ) const
{
if( hasIndex( row, column, parent ) )
{
{
TreeItem* childItem = parentItem->child( row );
if( childItem )
- return createIndex( row, column, childItem );
+ return createIndex( row, column, childItem );
}
}
return QModelIndex();
*/
int SUIT_TreeModel::rowCount( const QModelIndex& parent ) const
{
- if ( parent.column() > 0 )
- return 0;
+ // Commented by rnv in the frame of the
+ // "20830: EDF 1357 GUI : Hide/Show Icon" imp
+ // if ( parent.column() > 0 )
+ // return 0;
TreeItem* parentItem = treeItem( parent );
return;
SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
myAutoUpdate = on;
if ( myAutoUpdate ) {
SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
updateTree();
}
}
+/*!
+ \brief Get 'updateModified' flag value.
+ \return 'updateModified' flag value
+*/
+bool SUIT_TreeModel::updateModified() const
+{
+ return myUpdateModified;
+}
+/*!
+ \brief Set 'updateModified' flag value.
+ \param on 'updateModified' flag value
+*/
+void SUIT_TreeModel::setUpdateModified(const bool on)
+{
+ myUpdateModified=on;
+}
/*!
\brief Check if the specified column supports custom sorting.
return root() ? root()->customSorting( column ) : false;
}
+void SUIT_TreeModel::forgetObject( const SUIT_DataObject* obj )
+{
+ removeItem( treeItem( obj ) );
+}
+
/*!
\brief Compares two model indexes for the sorting purposes.
return new SUIT_ItemDelegate( const_cast<SUIT_TreeModel*>( this ) );
}
+
+void SUIT_TreeModel::emitClicked( SUIT_DataObject* obj, const QModelIndex& index) {
+ int obj_group_id = obj->groupId();
+ const ColumnInfo& inf = myColumns[index.column()];
+
+ int id = -1;
+ if( inf.myIds.contains( 0 ) )
+ id = inf.myIds[0];
+ if( inf.myIds.contains( obj_group_id ) )
+ id = inf.myIds[obj_group_id];
+ emit clicked(obj, id);
+}
+
/*!
\brief Update tree model.
updateTree( object( index ) );
}
+
+void SUIT_TreeModel::updateTreeModel(SUIT_DataObject* obj,TreeItem* item)
+{
+ int kobj=0;
+ int kitem=0;
+ int nobjchild=obj->childCount();
+ SUIT_DataObject* sobj=obj->childObject(kobj);
+ TreeItem* sitem = item->child(kitem);
+
+ while(kobj < nobjchild)
+ {
+ if(sitem==0)
+ {
+ //end of item list
+ if(kitem==0)
+ sitem=createItemAtPos(sobj,item,0);
+ else
+ sitem=createItemAtPos(sobj,item,kitem);
+ updateTreeModel(sobj,sitem);
+ kobj++;
+ kitem++;
+ sobj=obj->childObject(kobj);
+ sitem = item->child(kitem);
+ }
+ else if(sitem->dataObject() != sobj)
+ {
+ if(treeItem(sobj))
+ {
+ // item : to remove
+ removeItem(sitem);
+ sitem = item->child(kitem);
+ }
+ else
+ {
+ // obj : new object
+ createItemAtPos(sobj,item,kitem);
+ kobj++;
+ kitem++;
+ sobj=obj->childObject(kobj);
+ sitem = item->child(kitem);
+ }
+ }
+ else
+ {
+ //obj and item are synchronised : go to next ones
+ updateTreeModel(sobj,sitem);
+ if(sobj->modified()) updateItem(sitem, true);
+ if( sobj ) sobj->update();
+ kobj++;
+ kitem++;
+ sobj=obj->childObject(kobj);
+ sitem = item->child(kitem);
+ }
+ }
+ //remove remaining items
+ for(int i = item->childCount(); i > kitem;i--)
+ {
+ sitem = item->child(i-1);
+ removeItem(sitem);
+ }
+}
+
/*!
\brief Update tree model.
else if ( obj->root() != root() )
return;
- synchronize<ObjPtr,ItemPtr,SUIT_TreeModel::TreeSync>( obj,
- treeItem( obj ),
- SUIT_TreeModel::TreeSync( this ) );
+ if(updateModified())
+ {
+ updateTreeModel(obj,treeItem( obj ));
+ }
+ else
+ {
+ synchronize<ObjPtr,ItemPtr,SUIT_TreeModel::TreeSync>( obj,
+ treeItem( obj ),
+ SUIT_TreeModel::TreeSync( this ) );
+ }
emit modelUpdated();
}
void SUIT_TreeModel::initialize()
{
SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
if ( autoUpdate() ) {
SUIT_DataObject::connect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) );
SUIT_DataObject::connect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
- this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
+ this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
}
myItems.clear(); // ????? is it really necessary
myRootItem = new TreeItem( 0 );
registerColumn( 0, QObject::tr( "NAME_COLUMN" ), SUIT_DataObject::NameId );
+
+ QString visCol = QObject::tr( "VISIBILITY_COLUMN" );
+ registerColumn( 0, visCol, SUIT_DataObject::VisibilityId );
+
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ setColumnIcon( visCol, resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ));
+ setHeaderFlags( visCol, Qtx::ShowIcon);
+
updateTree();
}
return myItems.contains( obj ) ? obj : 0;
}
+/*!
+ \brief Get unique object identifier
+
+ Object identifier is customized via the Qtx::IdType custom data
+
+ \param index model index
+ \return object identifier or null string if it isn't specified
+ \sa SUIT_DataObject::customData()
+*/
+QString SUIT_TreeModel::objectId( const QModelIndex& index ) const
+{
+ QString objId;
+ if ( index.isValid() ) {
+ SUIT_DataObject* obj = object( index );
+ if ( obj ) {
+ int anId = obj->customData( Qtx::IdType ).toInt();
+ objId = data( createIndex( index.row(), anId, index.internalPointer() ) ).toString();
+ }
+ }
+ return objId;
+}
+
/*!
\brief Create an item corresponding to the data object.
\param obj source data object
\return created tree item or 0 if item could not be created
*/
SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItem( SUIT_DataObject* obj,
- SUIT_TreeModel::TreeItem* parent,
- SUIT_TreeModel::TreeItem* after )
+ SUIT_TreeModel::TreeItem* parent,
+ SUIT_TreeModel::TreeItem* after )
{
if ( !obj )
return 0;
myItems[ obj ] = new TreeItem( obj, parent, after );
+ for(int pos=row;pos < parent->childCount();pos++)
+ parent->child(pos)->setPosition(pos);
+
endInsertRows();
+ obj->setModified(false);
+
return myItems[ obj ];
}
+/*!
+ \brief Create an item corresponding to the data object.
+ \param obj source data object
+ \param parent parent tree item
+ \param pos tree item position into which new item should be inserted
+ \return created tree item or 0 if item could not be created
+*/
+SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItemAtPos( SUIT_DataObject* obj,
+ SUIT_TreeModel::TreeItem* parent,
+ int pos )
+{
+ if ( !obj )
+ return 0;
+
+ SUIT_DataObject* parentObj = object( parent );
+ QModelIndex parentIdx = index( parentObj );
+
+ int row = pos ;
+ SUIT_TreeModel::TreeItem* after = pos>0 ? parent->child(pos-1) : 0 ;
+
+ beginInsertRows( parentIdx, row, row );
+
+ 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);
+
+ endInsertRows();
+
+ obj->setModified(false);
+
+ return item;
+}
+
/*!
\brief Update tree item.
\param item tree item to be updated
+ \param emitLayoutChanged if signal about changed layout should be emitted
*/
-void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item )
+void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item, bool emitLayoutChanged )
{
if ( !item )
return;
return;
// update all columns corresponding to the given data object
+ //emit layoutAboutToBeChanged(); // VSR 25/04/2011: fix crash on delete objects
QModelIndex firstIdx = index( obj, 0 );
QModelIndex lastIdx = index( obj, columnCount() - 1 );
emit dataChanged( firstIdx, lastIdx );
+ obj->setModified(false);
+ if( emitLayoutChanged )
+ emit layoutChanged();
}
/*!
// Warning! obj can be deleted at this point!
- SUIT_DataObject* parentObj = object( item->parent() );
+ TreeItem* parent=item->parent();
+ SUIT_DataObject* parentObj = object( parent );
QModelIndex parentIdx = index( parentObj, 0 );
int row = item->position();
if ( obj == root() )
setRoot( 0 );
- else if ( item->parent() )
- item->parent()->removeChild( item );
+ else if ( parent )
+ {
+ parent->removeChild( item );
+ for(int pos=row;pos < parent->childCount();pos++)
+ parent->child(pos)->setPosition(pos);
+ }
delete item;
updateTree( parent );
}
+/*!
+ \brief Drag and Drop support.
+*/
+QStringList SUIT_TreeModel::mimeTypes() const
+{
+ QStringList types;
+ types << "application/vnd.text.list";
+ return types;
+}
+
+/*!
+ \brief Called when the data objects are exported(dragged) from the tree.
+ \param indexes the list of exported objects
+*/
+QMimeData* SUIT_TreeModel::mimeData( const QModelIndexList& indexes ) const
+{
+ QMimeData* mimeData = new QMimeData();
+ QByteArray encodedData;
+
+ QDataStream stream( &encodedData, QIODevice::WriteOnly );
+
+ foreach ( QModelIndex index, indexes ) {
+ QString id = objectId( index );
+ // we have to check only 0 column in order to avoid repeating items in the drag object
+ // - QTreeView tries to drag indices for all visible columns
+ if ( index.isValid() && index.column() == 0 && !id.isEmpty() )
+ stream << id;
+ }
+
+ mimeData->setData( "application/vnd.text.list", encodedData );
+ return mimeData;
+}
+
+bool SUIT_TreeModel::dropMimeData( const QMimeData* data, Qt::DropAction action,
+ int row, int column, const QModelIndex& parent )
+{
+ if ( action == Qt::IgnoreAction )
+ // do nothing with data
+ return false;
+
+ if ( !data->hasFormat( "application/vnd.text.list" ) )
+ // not supported data dropped
+ return false;
+
+ if ( !parent.isValid() )
+ // dropping into the top level of the model is not allowed
+ return false;
+
+ // get parent object
+ SUIT_DataObject* pobj = object( parent );
+ if ( !pobj )
+ // invalid parent
+ return false;
+
+ // decode mime data and collect data objects being dropped
+ QByteArray encodedData = data->data( "application/vnd.text.list" );
+ QDataStream stream( &encodedData, QIODevice::ReadOnly );
+
+ DataObjectList objects;
+
+ while ( !stream.atEnd() ) {
+ QString id;
+ stream >> id;
+ if ( !id.isEmpty() && searcher() ) {
+ SUIT_DataObject* obj = searcher()->findObject( id );
+ if ( obj ) objects << obj;
+ }
+ }
+
+ // emit signal
+ emit dropped( objects, pobj, row, action );
+
+ // return true if there's any to drop
+ return !objects.isEmpty();
+}
+
/*!
\class SUIT_ProxyModel
- \brief Proxy model which can be used above the SUIT_TreeMovel class
+ \brief Proxy model which can be used above the SUIT_TreeModel class
to enable custom sorting/filtering of the data.
The SUIT_TreeModel class does not support custom sorting/filtering of the data.
{
SUIT_TreeModel* model = new SUIT_TreeModel( this );
connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+ connect( model, SIGNAL( clicked( SUIT_DataObject*, int ) ), this, SIGNAL(clicked( SUIT_DataObject*, int ) ) );
+ connect( model, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+ this, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
setSourceModel( model );
+ setDynamicSortFilter( true );
}
/*!
{
SUIT_TreeModel* model = new SUIT_TreeModel( root, this );
connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+ connect( model, SIGNAL( clicked( SUIT_DataObject*, int ) ), this, SIGNAL( clicked( SUIT_DataObject*, int ) ) );
+ connect( model, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+ this, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
setSourceModel( model );
+ setDynamicSortFilter( true );
}
/*!
mySortingEnabled( true )
{
connect( *model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) );
+ connect( *model, SIGNAL( clicked( SUIT_DataObject*, int ) ), this, SIGNAL( clicked( SUIT_DataObject*, int ) ) );
+ connect( *model, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+ this, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
setSourceModel( *model );
+ setDynamicSortFilter( true );
}
/*!
return treeModel() ? treeModel()->autoUpdate() : false;
}
+/*!
+ \brief Get 'updateModified' flag value.
+ \return 'updateModified' flag value
+*/
+bool SUIT_ProxyModel::updateModified() const
+{
+ return treeModel() ? treeModel()->updateModified() : false;
+}
+/*!
+ \brief Set 'updateModified' flag value.
+
+ If this flag is set to \c true (default=false), the model is updated by updateTreeModel that
+ uses the isModified flag to update only modified objects
+
+ \param on 'updateModified' flag value
+*/
+void SUIT_ProxyModel::setUpdateModified( const bool on )
+{
+ if ( treeModel() )
+ treeModel()->setUpdateModified( on );
+}
+
/*!
\brief Set 'auto-update tree' flag value.
return mySortingEnabled;
}
+SUIT_DataSearcher* SUIT_ProxyModel::searcher() const
+{
+ return treeModel() ? treeModel()->searcher() : 0;
+}
+
+void SUIT_ProxyModel::setSearcher( SUIT_DataSearcher* s )
+{
+ if ( treeModel() ) treeModel()->setSearcher( s );
+}
+
/*!
\brief Get item delegate for the model.
\return new item delegate
treeModel()->updateTree( obj );
}
+void SUIT_ProxyModel::forgetObject( const SUIT_DataObject* obj )
+{
+ if ( treeModel() )
+ treeModel()->forgetObject( obj );
+}
+
/*!
\brief Compares two model indexes for the sorting purposes.
\param left first index to compare
return dynamic_cast<SUIT_AbstractModel*>( sourceModel() );
}
+/*!
+ \brief Filter rows
+ \param sourceRow row index of the source data model
+ \param sourceParent parent model index of the source data model
+ \return \c true if the specified row should be filtered out (i.e. not displayed) or \c false otherwise
+*/
+bool SUIT_ProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const
+{
+ SUIT_DataObject* o = treeModel()->object( sourceModel()->index( sourceRow, 0, sourceParent ) );
+ SUIT_DataObject* p = o ? o->parent() : 0;
+ return ( !p || p->expandable() ) && o && o->isVisible();
+}
+
/*!
\brief Register new column in the model
\param group_id - unique data object identificator allowing the classification of objects
return treeModel() ? treeModel()->appropriate( name ) : Qtx::Shown;
}
+/*!
+ \brief Set header flags.
+
+ These flags allow show in the header of the column text (name of the column),
+ icon or both text and icon.
+
+ \param name - column name
+ \param flags - header flags
+
+*/
+void SUIT_ProxyModel::setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags )
+{
+ if(treeModel())
+ treeModel()->setHeaderFlags(name, flags);
+}
+
+/*!
+ \brief Get the header flags.
+
+ These flags allow show in the header of the column text (name of the column),
+ icon or both text and icon.
+
+ \param name - column name
+ \return header flags
+*/
+Qtx::HeaderViewFlags SUIT_ProxyModel::headerFlags( const QString& name ) const
+{
+ return treeModel() ? treeModel()->headerFlags( name ) : Qtx::ShowAll;
+}
+/*!
+ \brief Set visibility state of the object.
+
+ \param id - column name
+ \param state - visible state
+*/
+void SUIT_ProxyModel::setVisibilityState(const QString& id, Qtx::VisibilityState state)
+{
+ if(treeModel())
+ treeModel()->setVisibilityState(id,state);
+}
+/*!
+ \brief Set visibility state for all objects.
+
+ \param id - column name
+ \param state - visible state
+*/
+void SUIT_ProxyModel::setVisibilityStateForAll(Qtx::VisibilityState state)
+{
+ if(treeModel())
+ treeModel()->setVisibilityStateForAll(state);
+}
+/*!
+ \brief Get visibility state of the object.
+
+ \param id - column name
+ \return visible state
+*/
+Qtx::VisibilityState SUIT_ProxyModel::visibilityState(const QString& id) const
+{
+ return treeModel() ? treeModel()->visibilityState(id) : Qtx::UnpresentableState;
+}
+void SUIT_ProxyModel::emitClicked( SUIT_DataObject* obj, const QModelIndex& index)
+{
+ if(treeModel())
+ treeModel()->emitClicked(obj,index);
+}
/*!
\class SUIT_ItemDelegate
\param index model index being rendered
*/
void SUIT_ItemDelegate::paint( QPainter* painter,
- const QStyleOptionViewItem& option,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
{
QStyleOptionViewItem opt = option;
if ( index.isValid() ) {
opt.palette.setBrush( QPalette::Highlight, val.value<QColor>() );
val = index.data( SUIT_TreeModel::HighlightedTextRole );
if ( val.isValid() && val.value<QColor>().isValid() )
- opt.palette.setBrush( QPalette::HighlightedText, val.value<QColor>() );
+ opt.palette.setBrush( QPalette::HighlightedText, val.value<QColor>() );
}
QItemDelegate::paint( painter, opt, index );
}
+
+QSize SUIT_ItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
+{
+ QSize size = QItemDelegate::sizeHint ( option, index );
+#if QT_VERSION >= 0x040500
+ size.setHeight( size.height() + 1 );
+#endif
+ return size;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SUIT_TreeModel.h
// Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#ifndef SUIT_TREEMODEL_H
#define SUIT_TREEMODEL_H
#include <QModelIndex>
#include <QItemDelegate>
#include <QVariant>
+#include <QMap>
#ifdef WIN32
#pragma warning( disable:4251 )
class SUIT_DataObject;
class SUIT_TreeModel;
+class QMimeData;
+
+class SUIT_EXPORT SUIT_DataSearcher
+{
+public:
+ virtual SUIT_DataObject* findObject( const QString& ) const = 0;
+};
class SUIT_EXPORT SUIT_AbstractModel
{
+ SUIT_DataSearcher* mySearcher;
+
public:
SUIT_AbstractModel();
operator QAbstractItemModel*();
operator const QObject*() const;
- virtual SUIT_DataObject* root() const = 0;
- virtual void setRoot( SUIT_DataObject* ) = 0;
- virtual SUIT_DataObject* object( const QModelIndex& = QModelIndex() ) const = 0;
- virtual QModelIndex index( const SUIT_DataObject*, int = 0 ) const = 0;
- virtual bool autoDeleteTree() const = 0;
- virtual void setAutoDeleteTree( const bool ) = 0;
- virtual bool autoUpdate() const = 0;
- virtual void setAutoUpdate( const bool ) = 0;
+ virtual SUIT_DataObject* root() const = 0;
+ virtual void setRoot( SUIT_DataObject* ) = 0;
+ virtual SUIT_DataObject* object( const QModelIndex& = QModelIndex() ) const = 0;
+ virtual QModelIndex index( const SUIT_DataObject*, int = 0 ) const = 0;
+ virtual bool autoDeleteTree() const = 0;
+ virtual void setAutoDeleteTree( const bool ) = 0;
+ virtual bool autoUpdate() const = 0;
+ virtual void setAutoUpdate( const bool ) = 0;
+ virtual bool updateModified() const = 0;
+ virtual void setUpdateModified( const bool ) = 0;
virtual QAbstractItemDelegate* delegate() const = 0;
- virtual bool customSorting( const int ) const = 0;
- virtual bool lessThan( const QModelIndex& left, const QModelIndex& right ) const = 0;
-
- virtual void updateTree( const QModelIndex& ) = 0;
- virtual void updateTree( SUIT_DataObject* = 0 ) = 0;
-
- virtual void registerColumn( const int group_id, const QString& name, const int custom_id ) = 0;
- virtual void unregisterColumn( const int group_id, const QString& name ) = 0;
- virtual void setColumnIcon( const QString& name, const QPixmap& icon ) = 0;
- virtual QPixmap columnIcon( const QString& name ) const = 0;
- virtual void setAppropriate( const QString& name, const Qtx::Appropriate appr ) = 0;
- virtual Qtx::Appropriate appropriate( const QString& name ) const = 0;
+ virtual bool customSorting( const int ) const = 0;
+ virtual bool lessThan( const QModelIndex& left, const QModelIndex& right ) const = 0;
+ virtual void forgetObject( const SUIT_DataObject* ) = 0;
+
+ virtual void updateTree( const QModelIndex& ) = 0;
+ virtual void updateTree( SUIT_DataObject* = 0 ) = 0;
+
+ virtual void registerColumn( const int group_id, const QString& name, const int custom_id ) = 0;
+ virtual void unregisterColumn( const int group_id, const QString& name ) = 0;
+ virtual void setColumnIcon( const QString& name, const QPixmap& icon ) = 0;
+ virtual QPixmap columnIcon( const QString& name ) const = 0;
+ virtual void setAppropriate( const QString& name, const Qtx::Appropriate appr ) = 0;
+ virtual Qtx::Appropriate appropriate( const QString& name ) const = 0;
+ virtual void setVisibilityState(const QString& id, Qtx::VisibilityState state) = 0;
+ virtual void setVisibilityStateForAll(Qtx::VisibilityState state) = 0;
+ virtual Qtx::VisibilityState visibilityState(const QString& id) const = 0;
+ virtual void setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags ) = 0;
+ virtual Qtx::HeaderViewFlags headerFlags( const QString& name ) const = 0;
+ virtual void emitClicked( SUIT_DataObject* obj, const QModelIndex& index) = 0;
+
+ virtual SUIT_DataSearcher* searcher() const;
+ virtual void setSearcher( SUIT_DataSearcher* );
};
virtual Qt::ItemFlags flags( const QModelIndex& ) const;
virtual QVariant headerData( int, Qt::Orientation, int = Qt::DisplayRole ) const;
+ virtual Qt::DropActions supportedDropActions() const;
+
virtual QModelIndex index( int, int, const QModelIndex& = QModelIndex() ) const;
virtual QModelIndex parent( const QModelIndex& ) const;
virtual QPixmap columnIcon( const QString& name ) const;
virtual void setAppropriate( const QString& name, const Qtx::Appropriate appr );
virtual Qtx::Appropriate appropriate( const QString& name ) const;
+ virtual void setVisibilityState(const QString& id, Qtx::VisibilityState state);
+ virtual void setVisibilityStateForAll(Qtx::VisibilityState state);
+ virtual Qtx::VisibilityState visibilityState(const QString& id) const;
+ virtual void setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags );
+ virtual Qtx::HeaderViewFlags headerFlags( const QString& name ) const;
+ virtual void emitClicked( SUIT_DataObject* obj, const QModelIndex& index);
+
SUIT_DataObject* object( const QModelIndex& = QModelIndex() ) const;
QModelIndex index( const SUIT_DataObject*, int = 0 ) const;
bool autoUpdate() const;
void setAutoUpdate( const bool );
+ bool updateModified() const;
+ void setUpdateModified( const bool );
+
virtual bool customSorting( const int ) const;
virtual bool lessThan( const QModelIndex& left, const QModelIndex& right ) const;
+ virtual void forgetObject( const SUIT_DataObject* );
QAbstractItemDelegate* delegate() const;
+
+ virtual void updateTreeModel(SUIT_DataObject*,TreeItem*);
+
+ virtual QStringList mimeTypes() const;
+ virtual QMimeData* mimeData (const QModelIndexList& indexes) const;
+ virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action,
+ int row, int column, const QModelIndex &parent);
+
public slots:
virtual void updateTree( const QModelIndex& );
virtual void updateTree( SUIT_DataObject* = 0 );
signals:
void modelUpdated();
+ void clicked( SUIT_DataObject*, int );
+ void dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction );
private:
void initialize();
TreeItem* treeItem( const QModelIndex& ) const;
TreeItem* treeItem( const SUIT_DataObject* ) const;
SUIT_DataObject* object( const TreeItem* ) const;
+ QString objectId( const QModelIndex& = QModelIndex() ) const;
TreeItem* createItem( SUIT_DataObject*, TreeItem* = 0, TreeItem* = 0 );
- void updateItem( TreeItem* );
+ TreeItem* createItemAtPos( SUIT_DataObject*, TreeItem* = 0, int pos=0 );
+ void updateItem( TreeItem*, bool emitLayoutChanged );
void removeItem( TreeItem* );
private slots:
typedef struct
{
QString myName;
- QMap<int,int> myIds;
- QPixmap myIcon;
- Qtx::Appropriate myAppropriate;
+ QMap<int,int> myIds;
+ QPixmap myIcon;
+ Qtx::HeaderViewFlags myHeaderFlags;
+ Qtx::Appropriate myAppropriate;
} ColumnInfo;
+
+ typedef QMap<QString,Qtx::VisibilityState> VisibilityMap;
SUIT_DataObject* myRoot;
TreeItem* myRootItem;
ItemMap myItems;
+ VisibilityMap myVisibilityMap;
bool myAutoDeleteTree;
bool myAutoUpdate;
+ bool myUpdateModified;
QVector<ColumnInfo> myColumns;
friend class SUIT_TreeModel::TreeSync;
bool autoUpdate() const;
void setAutoUpdate( const bool );
-
+
+ bool updateModified() const;
+ void setUpdateModified( const bool );
+
bool isSortingEnabled() const;
bool customSorting( const int ) const;
+ virtual void forgetObject( const SUIT_DataObject* );
virtual bool lessThan( const QModelIndex&, const QModelIndex& ) const;
virtual void registerColumn( const int group_id, const QString& name, const int custom_id );
virtual void unregisterColumn( const int group_id, const QString& name );
virtual QPixmap columnIcon( const QString& name ) const;
virtual void setAppropriate( const QString& name, const Qtx::Appropriate appr );
virtual Qtx::Appropriate appropriate( const QString& name ) const;
+ virtual void setVisibilityState(const QString& id, Qtx::VisibilityState state);
+ virtual void setVisibilityStateForAll(Qtx::VisibilityState state);
+ virtual Qtx::VisibilityState visibilityState(const QString& id) const;
+ virtual void setHeaderFlags( const QString& name, const Qtx::HeaderViewFlags flags );
+ virtual Qtx::HeaderViewFlags headerFlags( const QString& name ) const;
+ virtual void emitClicked( SUIT_DataObject* obj, const QModelIndex& index);
+
+ virtual SUIT_DataSearcher* searcher() const;
+ virtual void setSearcher( SUIT_DataSearcher* );
QAbstractItemDelegate* delegate() const;
signals:
void modelUpdated();
+ void clicked( SUIT_DataObject*, int );
+ void dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction );
protected:
SUIT_AbstractModel* treeModel() const;
+ virtual bool filterAcceptsRow( int, const QModelIndex& ) const;
private:
bool mySortingEnabled;
SUIT_ItemDelegate( QObject* = 0 );
virtual void paint( QPainter*, const QStyleOptionViewItem&,
- const QModelIndex& ) const;
+ const QModelIndex& ) const;
+
+ virtual QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_TreeSync.h
// Author : Alexander SOLOVYOV
//
template <class SrcItem, class TrgItem, class TreeData>
QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem&,
- const TrgItem&,
- const TreeData& );
+ const TrgItem&,
+ const TreeData& );
template <class SrcItem, class TrgItem, class TreeData>
TrgItem createSubTree( const SrcItem&, const TrgItem&, const TrgItem&, const TreeData& );
template <class SrcItem, class TrgItem, class TreeData>
const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
- const typename QList<TrgItem>::const_iterator& first,
- const typename QList<TrgItem>::const_iterator& last,
- const TreeData& td );
+ const typename QList<TrgItem>::const_iterator& first,
+ const typename QList<TrgItem>::const_iterator& last,
+ const TreeData& td );
//
for ( ; anIt != aLast; anIt++ ) {
const DiffItem<SrcItem,TrgItem>& item = *anIt;
if ( item.mySrc == td.nullSrc() ) {
- if ( item.myTrg == td.nullTrg() )
- qDebug( "error: both null" );
+ if ( item.myTrg == td.nullTrg() )
+ qDebug( "error: both null" );
else
- // delete item
- td.deleteItemWithChildren( item.myTrg );
+ // delete item
+ td.deleteItemWithChildren( item.myTrg );
}
else {
- if ( item.myTrg == td.nullTrg() ) {
- // add item (recursively)
- TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td );
- if ( nitem != td.nullTrg() )
- lastItem = nitem;
- }
+ if ( item.myTrg == td.nullTrg() ) {
+ // add item (recursively)
+ TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td );
+ if ( nitem != td.nullTrg() )
+ lastItem = nitem;
+ }
else {
- // update item
- synchronize( item.mySrc, item.myTrg, td );
- lastItem = item.myTrg;
- }
+ // update item
+ synchronize( item.mySrc, item.myTrg, td );
+ lastItem = item.myTrg;
+ }
}
}
return r2;
*/
template <class SrcItem, class TrgItem, class TreeData>
const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
- const typename QList<TrgItem>::const_iterator& first,
- const typename QList<TrgItem>::const_iterator& last,
- const TreeData& td )
+ const typename QList<TrgItem>::const_iterator& first,
+ const typename QList<TrgItem>::const_iterator& last,
+ const TreeData& td )
{
typename QList<TrgItem>::const_iterator cur = first;
for ( ; cur != last; cur++ ) {
*/
template <class SrcItem, class TrgItem, class TreeData>
QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem& src, const TrgItem& trg,
- const TreeData& td )
+ const TreeData& td )
{
//if( src==td.nullSrc() || trg==td.nullTrg() )
// return;
// target is found
// mark all items before found one as "to be deleted"
for ( typename QList<TrgItem>::const_iterator it = cur; it != f; it++ ) {
- DiffItem<SrcItem,TrgItem> ndiff;
- ndiff.mySrc = td.nullSrc();
- ndiff.myTrg = *it; // delete item
- d.append( ndiff );
+ DiffItem<SrcItem,TrgItem> ndiff;
+ ndiff.mySrc = td.nullSrc();
+ ndiff.myTrg = *it; // delete item
+ d.append( ndiff );
}
cur = f;
DiffItem<SrcItem,TrgItem> ndiff;
*/
template <class SrcItem, class TrgItem, class TreeData>
TrgItem createSubTree( const SrcItem& src, const TrgItem& parent,
- const TrgItem& after, const TreeData& td )
+ const TrgItem& after, const TreeData& td )
{
if ( src == td.nullSrc() )
return td.nullTrg();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUIT_ViewManager.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewModel.h"
#include "SUIT_ViewWindow.h"
#include "SUIT_Study.h"
+#include "SUIT_Session.h"
#include <QMap>
#include <QRegExp>
SUIT_Desktop* theDesktop,
SUIT_ViewModel* theViewModel )
: QObject( 0 ),
-myDesktop( theDesktop ),
-myTitle( "Default: %M - viewer %V" ),
-myStudy( NULL )
+ myDesktop( theDesktop ),
+ myTitle( "Default: %M - viewer %V" ),
+ myStudy( NULL )
{
myViewModel = 0;
myActiveView = 0;
return id;
}
+
+int SUIT_ViewManager::getGlobalId() const {
+ int id = -1;
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if(app) {
+ id = app->viewManagerId(this);
+ }
+ return id;
+}
+
void SUIT_ViewManager::setTitle( const QString& theTitle )
{
if ( myTitle == theTitle )
connect(theView, SIGNAL(closing(SUIT_ViewWindow*)),
this, SLOT(onClosingView(SUIT_ViewWindow*)));
+ connect(theView, SIGNAL(tryClosing(SUIT_ViewWindow*)),
+ this, SIGNAL(tryCloseView(SUIT_ViewWindow*)));
+
connect(theView, SIGNAL(mousePressed(SUIT_ViewWindow*, QMouseEvent*)),
this, SLOT(onMousePressed(SUIT_ViewWindow*, QMouseEvent*)));
QPointer<SUIT_ViewWindow> view( theView );
+ view->setClosable( false );
view->hide();
if ( !view->testAttribute( Qt::WA_DeleteOnClose ) )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_VIEWMANAGER_H
#define SUIT_VIEWMANAGER_H
int getId() const;
+ int getGlobalId() const;
+
public slots:
void createView();
void closeAllViews();
signals:
void lastViewClosed(SUIT_ViewManager*);
+ void tryCloseView(SUIT_ViewWindow*);
void deleteView(SUIT_ViewWindow*);
void viewCreated(SUIT_ViewWindow*);
void mousePress(SUIT_ViewWindow*, QMouseEvent*);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SUIT_ViewModel.cxx: implementation of the SUIT_ViewModel class.
//
#include "SUIT_ViewModel.h"
#include "SUIT_ViewWindow.h"
-SUIT_ViewModel::StatesMap SUIT_ViewModel::myStateMap;
-SUIT_ViewModel::ButtonsMap SUIT_ViewModel::myButtonMap;
+SUIT_ViewModel::InteractionStyle2StatesMap SUIT_ViewModel::myStateMap;
+SUIT_ViewModel::InteractionStyle2ButtonsMap SUIT_ViewModel::myButtonMap;
static bool isInitialized = false;
{
isInitialized = true;
- SUIT_ViewModel::myStateMap[ZOOM] = Qt::ControlModifier;
- SUIT_ViewModel::myButtonMap[ZOOM] = Qt::LeftButton;
+ // standard interaction style
+ SUIT_ViewModel::myStateMap[STANDARD][ZOOM] = Qt::ControlModifier;
+ SUIT_ViewModel::myButtonMap[STANDARD][ZOOM] = Qt::LeftButton;
+
+ SUIT_ViewModel::myStateMap[STANDARD][PAN] = Qt::ControlModifier;
+ SUIT_ViewModel::myButtonMap[STANDARD][PAN] = Qt::MidButton;
+
+ SUIT_ViewModel::myStateMap[STANDARD][ROTATE] = Qt::ControlModifier;
+ SUIT_ViewModel::myButtonMap[STANDARD][ROTATE] = Qt::RightButton;
+
+ SUIT_ViewModel::myStateMap[STANDARD][FIT_AREA] = Qt::ControlModifier;
+ SUIT_ViewModel::myButtonMap[STANDARD][FIT_AREA] = Qt::RightButton;
+
+ // "key free" interaction style
+ SUIT_ViewModel::myStateMap[KEY_FREE][ZOOM] = Qt::NoModifier;
+ SUIT_ViewModel::myButtonMap[KEY_FREE][ZOOM] = Qt::LeftButton | Qt::MidButton;
- SUIT_ViewModel::myStateMap[PAN] = Qt::ControlModifier;
- SUIT_ViewModel::myButtonMap[PAN] = Qt::MidButton;
+ SUIT_ViewModel::myStateMap[KEY_FREE][PAN] = Qt::NoModifier;
+ SUIT_ViewModel::myButtonMap[KEY_FREE][PAN] = Qt::MidButton;
- SUIT_ViewModel::myStateMap[ROTATE] = Qt::ControlModifier;
- SUIT_ViewModel::myButtonMap[ROTATE] = Qt::RightButton;
+ SUIT_ViewModel::myStateMap[KEY_FREE][ROTATE] = Qt::NoModifier;
+ SUIT_ViewModel::myButtonMap[KEY_FREE][ROTATE] = Qt::LeftButton;
- SUIT_ViewModel::myStateMap[FIT_AREA] = Qt::ControlModifier;
- SUIT_ViewModel::myButtonMap[FIT_AREA] = Qt::RightButton;
+ SUIT_ViewModel::myStateMap[KEY_FREE][FIT_AREA] = Qt::NoModifier; // unused
+ SUIT_ViewModel::myButtonMap[KEY_FREE][FIT_AREA] = Qt::NoButton; // unused
}
myViewManager = 0;
}
*\param theState - adding state to state map operations.
*\param theButton - adding state to button map operations.
*/
-void SUIT_ViewModel::setHotButton( HotOperation theOper, Qt::KeyboardModifier theState, Qt::MouseButton theButton )
+void SUIT_ViewModel::setHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+ Qt::KeyboardModifiers theState, Qt::MouseButtons theButton )
{
- myStateMap[theOper] = theState;
- myButtonMap[theOper] = theButton;
+ myStateMap[theInteractionStyle][theOper] = theState;
+ myButtonMap[theInteractionStyle][theOper] = theButton;
}
/*! Gets hot button for operation \a theOper.
*\param theState - output state from state map operations.
*\param theButton - output state from button map operations.
*/
-void SUIT_ViewModel::getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState, Qt::MouseButton& theButton )
+void SUIT_ViewModel::getHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+ Qt::KeyboardModifiers& theState, Qt::MouseButtons& theButton )
{
- theState = myStateMap[theOper];
- theButton = myButtonMap[theOper];
+ theState = myStateMap[theInteractionStyle][theOper];
+ theButton = myButtonMap[theInteractionStyle][theOper];
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUIT_VIEWMODEL_H
#define SUIT_VIEWMODEL_H
*/
class SUIT_EXPORT SUIT_ViewModel : public QObject
{
- Q_OBJECT
+ Q_OBJECT
public:
enum HotOperation { PAN, ZOOM, ROTATE, FIT_AREA };
+ enum InteractionStyle { STANDARD, KEY_FREE };
+
+ typedef QMap<HotOperation, Qt::KeyboardModifiers> StatesMap;
+ typedef QMap<HotOperation, Qt::MouseButtons> ButtonsMap;
- typedef QMap<HotOperation, Qt::KeyboardModifier> StatesMap;
- typedef QMap<HotOperation, Qt::MouseButton> ButtonsMap;
+ typedef QMap<InteractionStyle, StatesMap> InteractionStyle2StatesMap;
+ typedef QMap<InteractionStyle, ButtonsMap> InteractionStyle2ButtonsMap;
SUIT_ViewModel();
virtual ~SUIT_ViewModel();
virtual void contextMenuPopup( QMenu* ) {}
- static void setHotButton( HotOperation theOper, Qt::KeyboardModifier theState,
- Qt::MouseButton theButton );
- static void getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState,
- Qt::MouseButton& theButton );
+ static void setHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+ Qt::KeyboardModifiers theState, Qt::MouseButtons theButton );
+ static void getHotButton( InteractionStyle theInteractionStyle, HotOperation theOper,
+ Qt::KeyboardModifiers& theState, Qt::MouseButtons& theButton );
protected:
SUIT_ViewManager* myViewManager;
public:
- static StatesMap myStateMap;
- static ButtonsMap myButtonMap;
+ static InteractionStyle2StatesMap myStateMap;
+ static InteractionStyle2ButtonsMap myButtonMap;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SUIT_ViewWindow.cxx: implementation of the SUIT_ViewWindow class.
//
#include "SUIT_ViewWindow.h"
#include "SUIT_Application.h"
#include "SUIT_ViewManager.h"
#include "QtxActionToolMgr.h"
+#include "QtxMultiAction.h"
#include <QEvent>
#include <QIcon>
/*! Constructor.*/
SUIT_ViewWindow::SUIT_ViewWindow( SUIT_Desktop* theDesktop )
-: QMainWindow( theDesktop )
+ : QMainWindow( theDesktop ), myManager( 0 ), myIsDropDown( true )
{
myDesktop = theDesktop;
- setWindowIcon( myDesktop->windowIcon() );
+ setWindowIcon( myDesktop ? myDesktop->windowIcon() : QApplication::windowIcon() );
setAttribute( Qt::WA_DeleteOnClose );
myToolMgr = new QtxActionToolMgr( this );
+
+ setProperty( "VectorsMode", false );
}
/*! Destructor.*/
*/
bool SUIT_ViewWindow::dumpViewToFormat( const QString& fileName, const QString& format )
{
+ Qtx::Localizer loc;
return dumpViewToFormat( dumpView(), fileName, format );
}
void SUIT_ViewWindow::closeEvent( QCloseEvent* e )
{
e->ignore();
- emit closing( this );
+ emit tryClosing( this );
+ if ( closable() ) emit closing( this );
}
/*! Context menu requested for event \a e.
*/
void SUIT_ViewWindow::onDumpView()
{
- QApplication::postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ) ) );
+ // VSV (TRIPOLI dev): next line commented: causes error messages
+ //QApplication::postEvent( this, new QPaintEvent( QRect( 0, 0, width(), height() ) ) );
QApplication::postEvent( this, new QEvent( (QEvent::Type)DUMP_EVENT ) );
}
bool bOk = false;
if ( myManager && myManager->study() && myManager->study()->application() )
{
- QImage im = dumpView();
-
// get file name
SUIT_Application* app = myManager->study()->application();
QString fileName = app->getFileName( false, QString(), filter(), tr( "TLT_DUMP_VIEW" ), 0 );
if ( !fileName.isEmpty() )
{
- QString fmt = SUIT_Tools::extension( fileName ).toUpper();
- bOk = dumpViewToFormat( im, fileName, fmt );
+ QImage im = dumpView();
+ QString fmt = SUIT_Tools::extension( fileName ).toUpper();
+ Qtx::Localizer loc;
+ bOk = dumpViewToFormat( im, fileName, fmt );
}
else
- bOk = true; // cancelled
+ bOk = true; // cancelled
}
if ( !bOk )
SUIT_MessageBox::critical( this, tr( "ERROR" ), tr( "ERR_CANT_DUMP_VIEW" ) );
return true;
}
+/*! Returns \c true if view window can be closed by the user
+*/
+bool SUIT_ViewWindow::closable() const
+{
+ QVariant val = property( "closable" );
+ return !val.isValid() || val.toBool();
+}
+
+/*! Set / reset "closable" option of the view window
+*/
+bool SUIT_ViewWindow::setClosable( const bool on )
+{
+ bool prev = closable();
+ setProperty( "closable", on );
+ return prev;
+}
+
/*!
\return string containing visual parameters of window
*/
-QString SUIT_ViewWindow::getVisualParameters()
+QString SUIT_ViewWindow::getVisualParameters()
{
return "empty";
}
return myToolMgr;
}
+/*!
+ \brief Set buttons mode to drop-down (\a on = \c true) or ligned (\a on = \c false)
+ \param on new buttons mode
+ \sa dropDownButtons()
+*/
+void SUIT_ViewWindow::setDropDownButtons( bool on )
+{
+ if ( myIsDropDown != on ) {
+ myIsDropDown = on;
+ if ( myIsDropDown ) {
+ ActionsMap::const_iterator it;
+ for( it = myMultiActions.constBegin(); it != myMultiActions.constEnd(); ++it )
+ {
+ int tid = it.key();
+ const QList<QtxMultiAction*>& mlist = it.value();
+ QList<QtxMultiAction*>::const_iterator mit;
+ for ( mit = mlist.constBegin(); mit != mlist.constEnd(); ++mit )
+ {
+ QtxMultiAction* ma = *mit;
+ const QList<QAction*> alist = ma->actions();
+ if ( alist.isEmpty() ) continue;
+ int idx = toolMgr()->index( toolMgr()->actionId( alist[0] ), tid );
+ if ( idx == -1 ) continue;
+ foreach ( QAction* a, alist ) toolMgr()->remove( toolMgr()->actionId( a ), tid );
+ toolMgr()->insert( ma, tid, idx );
+ }
+ }
+ myMultiActions.clear();
+ }
+ else {
+ QIntList tblist = toolMgr()->toolBarsIds();
+ QIntList alist = toolMgr()->idList();
+ foreach( int aid, alist )
+ {
+ QtxMultiAction* ma = qobject_cast<QtxMultiAction*>( toolMgr()->action( aid ) );
+ if ( !ma ) continue;
+ foreach( int tid, tblist )
+ {
+ int idx = toolMgr()->index( aid, tid );
+ if ( idx >= 0 )
+ {
+ myMultiActions[ tid ].append( ma );
+ toolMgr()->remove( aid, tid );
+ foreach( QAction* a, ma->actions() ) toolMgr()->insert( a, tid, idx++ );
+ }
+ }
+ }
+ }
+ }
+}
+
+/*!
+ \brief Get current buttons mode
+ \return current buttons mode
+ \sa setDropDownButtons()
+*/
+bool SUIT_ViewWindow::dropDownButtons() const
+{
+ return myIsDropDown;
+}
+
/*!
\return window unique identifier
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SUIT_ViewWindow.h: interface for the SUIT_ViewWindow class.
//
#ifndef SUIT_VIEWWINDOW_H
#include "SUIT.h"
#include <QMainWindow>
+#include <QList>
+#include <QMap>
class SUIT_Desktop;
class SUIT_ViewManager;
class QtxActionToolMgr;
+class QtxMultiAction;
class QImage;
class SUIT_EXPORT SUIT_ViewWindow: public QMainWindow
{
Q_OBJECT
+
public:
+
SUIT_ViewWindow( SUIT_Desktop* );
virtual ~SUIT_ViewWindow();
- void setViewManager( SUIT_ViewManager* );
+ virtual void setViewManager( SUIT_ViewManager* );
SUIT_ViewManager* getViewManager() const;
bool event(QEvent*);
bool onAccelAction( int );
+ bool closable() const;
+ bool setClosable( const bool );
+
virtual QString getVisualParameters();
virtual void setVisualParameters( const QString& parameters );
QtxActionToolMgr* toolMgr() const;
+ virtual void setDropDownButtons( bool );
+ bool dropDownButtons() const;
+
public slots:
virtual void onDumpView();
signals:
+ void tryClosing( SUIT_ViewWindow* );
void closing( SUIT_ViewWindow* );
void mousePressed( SUIT_ViewWindow*, QMouseEvent* );
void mouseReleased( SUIT_ViewWindow*, QMouseEvent* );
SUIT_ViewManager* myManager;
private:
+ typedef QMap< int, QList<QtxMultiAction*> > ActionsMap;
+
QtxActionToolMgr* myToolMgr;
+ bool myIsDropDown;
+ ActionsMap myMultiActions;
};
-#endif // !defined(AFX_SUIT_VIEWWINDOW_H__82C3D51A_6F10_45B0_BCFE_3CB3EF596A4D__INCLUDED_)
+#endif // SUIT_VIEWWINDOW_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_DESK_WINDOW_CASCADE"
-msgstr "cascade.png"
-
-msgid "ICON_DESK_WINDOW_VTILE"
-msgstr "vtile.png"
-
-msgid "ICON_DESK_WINDOW_TILE"
-msgstr "htile.png"
-
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "MEN_DESK_WINDOW"
-msgstr "&Window"
-
-msgid "MEN_DESK_WINDOW_CASCADE"
-msgstr "&Cascade"
-
-msgid "PRP_DESK_WINDOW_CASCADE"
-msgstr "Arranges the windows as overlapping tiles"
-
-msgid "MEN_DESK_WINDOW_TILE"
-msgstr "&Tile"
-
-msgid "PRP_DESK_WINDOW_TILE"
-msgstr "Arranges the windows as nonoverlapping tiles"
-
-msgid "MEN_DESK_WINDOW_VTILE"
-msgstr "Tile &Vertically"
-
-msgid "PRP_DESK_WINDOW_VTILE"
-msgstr "Arranges the windows as nonoverlapping vertical tiles"
-
-msgid "PRP_DESK_WINDOW_ACTIVATE"
-msgstr "Activates this window"
-
-msgid "LAB_QUICK_PATH"
-msgstr "Quick path:"
-
-msgid "BUT_ADD_PATH"
-msgstr "Add path"
-
-msgid "INF_DESK_DOC_OPEN"
-msgstr "Open File"
-
-msgid "INF_DESK_DOC_SAVE"
-msgstr "Save File"
-
-msgid "ERR_ERROR"
-msgstr "Error"
-
-msgid "WRN_WARNING"
-msgstr "Warning"
-
-msgid "ERR_DIR_NOT_EXIST"
-msgstr "The directory \"%1\" does not exist!"
-
-msgid "ERR_FILE_NOT_EXIST"
-msgstr "The file \"%1\" does not exist!"
-
-msgid "ERR_PERMISSION_DENIED"
-msgstr "Can't save file \"%1\".\nPermission denied."
-
-msgid "INF_DIRECTORIES_FILTER"
-msgstr "Directories"
-
-msgid "QUE_FILE_EXISTS"
-msgstr "The file \"%1\" already exists.\nDo you want to overwrite it?"
-
-msgid "TLT_DUMP_VIEW"
-msgstr "Dump View to File"
-
-msgid "TLT_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)""
-
-msgid "ERR_CANT_DUMP_VIEW"
-msgstr "Can't dump view contents to the file."
-
-msgid "CONTINUE"
-msgstr "Continue"
-
-msgid "CANCEL"
-msgstr "Cancel"
-
-#======================================================================
-
-msgid "SUIT_Study::OPERATION_LAUNCH"
-msgstr "Operation launch"
-
-msgid "SUIT_Study::PREVIOUS_NOT_FINISHED"
-msgstr "Previous operation is not finished and will be aborted"
-
-#======================================================================
-
-
-
-
-
-
-
-
\ No newline at end of file
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<message>
<source>ERR_PERMISSION_DENIED</source>
<translation>Can't save file "%1".
+Permission denied.</translation>
+ </message>
+ <message>
+ <source>ERR_OPEN_PERMISSION_DENIED</source>
+ <translation>Can't open file "%1".
+Permission denied.</translation>
+ </message>
+ <message>
+ <source>ERR_DIR_READ_PERMISSION_DENIED</source>
+ <translation>Can't read directory "%1".
+Permission denied.</translation>
+ </message>
+ <message>
+ <source>ERR_DIR_WRITE_PERMISSION_DENIED</source>
+ <translation>Can't write directory "%1".
Permission denied.</translation>
</message>
<message>
</message>
<message>
<source>QUE_FILE_EXISTS</source>
- <translation>The file "%1" already exists.
+ <translation>The file %1 already exists.
Do you want to overwrite it?</translation>
</message>
<message>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : suitApp
dist_libSUITApp_la_SOURCES = \
SUITApp.cxx \
- SUITApp_Application.cxx
+ SUITApp_Application.cxx
+
+if ENABLE_PYCONSOLE
+ salomeinclude_HEADERS += SUITApp_init_python.hxx
+ dist_libSUITApp_la_SOURCES += SUITApp_init_python.cxx
+endif
MOC_FILES = \
SUITApp_Application_moc.cxx
nodist_libSUITApp_la_SOURCES = $(MOC_FILES)
-nodist_salomeres_DATA = SUITApp_msg_en.qm
+nodist_salomeres_DATA = SUITApp_msg_en.qm SUITApp_msg_fr.qm
libSUITApp_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) \
-I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../Style
libSUITApp_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
if ENABLE_PYCONSOLE
-libSUITApp_la_LDFLAGS += -Xlinker -export-dynamic $(PYTHON_LIBS)
+ libSUITApp_la_LDFLAGS += -Xlinker -export-dynamic $(PYTHON_LIBS)
endif
# Executable
SUITApp_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
endif
-SUITApp_LDADD = libSUITApp.la ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
+SUITApp_LDADD = libSUITApp.la ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la ${QT_LIBS}
+if ENABLE_PYCONSOLE
+ SUITApp_LDADD += $(PYTHON_LIBS)
+endif
if ENABLE_TESTRECORDER
SUITApp_LDADD+= $(TESTRECORDER_LIBS)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#if defined WIN32
-#ifdef SUIT_ENABLE_PYTHON
-#undef SUIT_ENABLE_PYTHON
-#endif
-
-#else //#if defined WIN32
-
-#ifndef SUIT_ENABLE_PYTHON
+//#if defined WIN32
+//#ifdef SUIT_ENABLE_PYTHON
+//#undef SUIT_ENABLE_PYTHON
+//#endif
+//#else //#if defined WIN32
+//#ifndef SUIT_ENABLE_PYTHON
// NOTE: DO NOT DELETE THIS DEFINITION ON LINUX
// or make sure Python is initialized in main() in any case
// Otherwise, application based on light SALOME and using Python
// are unlikely to work properly.
-#define SUIT_ENABLE_PYTHON
-#include <Python.h>
+//#define SUIT_ENABLE_PYTHON
+//#include <Python.h>
+//#endif
+//
+#ifdef SUIT_ENABLE_PYTHON
+#include "SUITApp_init_python.hxx"
#endif
-#endif //#if defined WIN32
+//#endif //#if defined WIN32
+#include "GUI_version.h"
#include "SUITApp_Application.h"
-
-#include <SUIT_Session.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_ResourceMgr.h>
-#include <Style_Salome.h>
-#include <QtxSplash.h>
-
-#include <SUIT_LicenseDlg.h>
+#include "SUIT_Desktop.h"
+#include "SUIT_LicenseDlg.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "Style_Salome.h"
+#include "QtxSplash.h"
#include <QDir>
#include <QFile>
static QString salomeVersion()
{
- QString path( ::getenv( "GUI_ROOT_DIR" ) );
- if ( !path.isEmpty() )
- path += QDir::separator();
-
- path += QString( "bin/salome/VERSION" );
-
- QFile vf( path );
- if ( !vf.open( QFile::ReadOnly ) )
- return QString();
-
- QString line = vf.readLine( 1024 );
- vf.close();
-
- if ( line.isEmpty() )
- return QString();
-
- while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
- line.remove( line.length() - 1, 1 );
-
- QString ver;
- int idx = line.lastIndexOf( ":" );
- if ( idx != -1 )
- ver = line.mid( idx + 1 ).trimmed();
-
- return ver;
+ return GUI_VERSION_STR;
}
-static void MessageOutput( QtMsgType type, const char* msg )
+static QString getAppName( const QString& libName )
{
- switch ( type )
- {
- case QtDebugMsg:
-#ifdef _DEBUG_
- printf( "Debug: %s\n", msg );
-#endif
- break;
- case QtWarningMsg:
-#ifdef _DEBUG_
- printf( "Warning: %s\n", msg );
-#endif
- break;
- case QtFatalMsg:
-#ifdef _DEBUG_
- printf( "Fatal: %s\n", msg );
-#endif
- break;
- default:
- break;
- }
+ QString appName = QFileInfo( libName ).baseName();
+ if ( appName.startsWith( "lib" ) ) appName = appName.mid( 3 );
+ return appName;
}
+// static void MessageOutput( QtMsgType type, const char* msg )
+// {
+// switch ( type )
+// {
+// case QtDebugMsg:
+// #ifdef _DEBUG_
+// printf( "Debug: %s\n", msg );
+// #endif
+// break;
+// case QtWarningMsg:
+// #ifdef _DEBUG_
+// printf( "Warning: %s\n", msg );
+// #endif
+// break;
+// case QtFatalMsg:
+// #ifdef _DEBUG_
+// printf( "Fatal: %s\n", msg );
+// #endif
+// break;
+// default:
+// break;
+// }
+// }
+
/* XPM */
static const char* pixmap_not_found_xpm[] = {
"16 16 3 1",
int main( int argc, char* argv[] )
{
-#ifdef SUIT_ENABLE_PYTHON
- // First of all initialize Python, as in complex multi-component applications
- // someone else might initialize it some way unsuitable for light SALOME!
- Py_SetProgramName( argv[0] );
- Py_Initialize(); // Initialize the interpreter
- PySys_SetArgv( argc, argv );
- PyEval_InitThreads(); // Create (and acquire) the interpreter lock
- PyEval_ReleaseLock(); // Let the others use Python API until we need it again
-#endif
+ //#ifdef SUIT_ENABLE_PYTHON
+ // // First of all initialize Python, as in complex multi-component applications
+ // // someone else might initialize it some way unsuitable for light SALOME!
+ // Py_SetProgramName( argv[0] );
+ // Py_Initialize(); // Initialize the interpreter
+ // PySys_SetArgv( argc, argv );
+ // PyEval_InitThreads(); // Create (and acquire) the interpreter lock
+ // PyEval_ReleaseLock(); // Let the others use Python API until we need it again
+ //#endif
//qInstallMsgHandler( MessageOutput );
bool iniFormat = false;
bool noSplash = false;
bool useLicense = false;
- for ( int i = 1; i < argc /*&& !noExceptHandling*/; i++ )
+ for ( int i = 1; i < argc; i++ )
{
if ( !strcmp( argv[i], "--noexcepthandling" ) )
noExceptHandling = true;
iniFormat = true;
else if ( !strcmp( argv[i], "--nosplash") )
noSplash = true;
- else if ( !strcmp( argv[i], "--uselicense" ) )
+ else if ( !strcmp( argv[i], "--uselicense" ) )
useLicense = true;
- else
+ else
argList.append( QString( argv[i] ) );
}
+ // add $QTDIR/plugins to the pluins search path for image plugins
+ QString qtdir( ::getenv( "QTDIR" ) );
+ if ( !qtdir.isEmpty() )
+ QApplication::addLibraryPath( QDir( qtdir ).absoluteFilePath( "plugins" ) );
+
SUITApp_Application app( argc, argv );
+ QString cfgAppName = getAppName( argList.isEmpty() ? QString() : argList.first() );
+ // hard-coding for LightApp :( no other way to this for the moment
+ if ( cfgAppName == "LightApp" ) {
+ app.setOrganizationName( "salome" );
+ app.setApplicationName( "salome" );
+ app.setApplicationVersion( salomeVersion() );
+ }
int result = -1;
{
if ( resMgr )
{
- resMgr->loadLanguage( false );
-
- splash = QtxSplash::splash( QPixmap() );
- splash->readSettings( resMgr );
- if ( splash->pixmap().isNull() ) {
- delete splash;
- splash = 0;
- }
- else {
- QString appName = QObject::tr( "APP_NAME" ).trimmed();
- QString appVersion = QObject::tr( "APP_VERSION" ).trimmed();
- if ( appVersion == "APP_VERSION" )
- {
- if ( appName == "APP_NAME" || appName.toLower() == "salome" )
- appVersion = salomeVersion();
- else
- appVersion = "";
- }
- splash->setOption( "%A", appName );
- splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
- splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) );
- splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) );
- splash->show();
- QApplication::instance()->processEvents();
- }
+ resMgr->loadLanguage();
+
+ splash = QtxSplash::splash( QPixmap() );
+ splash->readSettings( resMgr );
+ if ( splash->pixmap().isNull() ) {
+ delete splash;
+ splash = 0;
+ }
+ else {
+ QString appName = QObject::tr( "APP_NAME" ).trimmed();
+ QString appVersion = QObject::tr( "APP_VERSION" ).trimmed();
+ if ( appVersion == "APP_VERSION" )
+ {
+ if ( appName == "APP_NAME" || appName.toLower() == "salome" )
+ appVersion = salomeVersion();
+ else
+ appVersion = "";
+ }
+ splash->setOption( "%A", appName );
+ splash->setOption( "%V", QObject::tr( "ABOUT_VERSION" ).arg( appVersion ) );
+ splash->setOption( "%L", QObject::tr( "ABOUT_LICENSE" ) );
+ splash->setOption( "%C", QObject::tr( "ABOUT_COPYRIGHT" ) );
+ splash->show();
+ QApplication::instance()->processEvents();
+ }
}
}
+#ifdef SUIT_ENABLE_PYTHON
+ //...Initialize python
+ int _argc = 1;
+ char* _argv[] = {(char*)""};
+ SUIT_PYTHON::init_python(_argc,_argv);
+
+ PyEval_RestoreThread( SUIT_PYTHON::_gtstate );
+
+ if ( !SUIT_PYTHON::salome_shared_modules_module ) // import only once
+ SUIT_PYTHON::salome_shared_modules_module = PyImport_ImportModule( (char*)"salome_shared_modules" );
+ if ( !SUIT_PYTHON::salome_shared_modules_module )
+ PyErr_Print();
+
+ PyEval_ReleaseThread( SUIT_PYTHON::_gtstate );
+
+#endif
+
SUIT_Application* theApp = aSession->startApplication( argList.first() );
if ( theApp )
{
Style_Salome::initialize( theApp->resourceMgr() );
if ( theApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
- Style_Salome::apply();
+ Style_Salome::apply();
if ( !noExceptHandling )
app.setHandler( aSession->handler() );
if ( splash )
- splash->finish( theApp->desktop() );
+ splash->finish( theApp->desktop() );
result = app.exec();
}
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = app
-TARGET = SUITApp
-DESTDIR = ../../bin
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-INCLUDEPATH += ../../include ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-
-HEADERS = SUITApp_Application.h
-
-SOURCES = SUITApp.cxx
-SOURCES += SUITApp_Application.cxx
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUITApp_Application.h"
#include <SUIT_Tools.h>
#include <SUIT_ExceptionHandler.h>
+#include <Qtx.h>
+
#include <QDir>
#include <QTranslator>
#ifdef ENABLE_TESTRECORDER
: TestApplication( argc, argv ),
#else
- : QApplication( argc, argv ),
+#ifndef WIN32
+ // san: Opening an X display and choosing a visual most suitable for 3D visualization
+ // in order to make SALOME viewers work with non-native X servers
+ : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
+#else
+ : QApplication( argc, argv ),
+#endif
#endif
myExceptHandler( hand )
{
*/
void SUITApp_Application::setHandler( SUIT_ExceptionHandler* hand )
{
- myExceptHandler = hand;
+ myExceptHandler = hand;
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUITAPP_APPLICATION_H
#define SUITAPP_APPLICATION_H
class SUIT_ExceptionHandler;
#ifdef WNT
-# ifdef SUITAPP_EXPORTS
+# if defined SUITAPP_EXPORTS || defined SUITApp_EXPORTS
# define SUITAPP_EXPORT __declspec(dllexport)
# else
# define SUITAPP_EXPORT __declspec(dllimport)
virtual bool notify( QObject* receiver, QEvent* e );
- SUIT_ExceptionHandler* handler() const;
- void setHandler( SUIT_ExceptionHandler* );
+ SUIT_ExceptionHandler* handler() const;
+ void setHandler( SUIT_ExceptionHandler* );
private:
SUIT_ExceptionHandler* myExceptHandler;
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-msgid "APP_ERROR"
-msgstr "Error"
-
-msgid "APP_OK"
-msgstr "Ok"
-
-msgid "APP_UNK_EXCEPTION"
-msgstr "Unknown exception"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libSUPERVGraph.la
nodist_salomeres_DATA = \
SUPERVGraph_images.qm \
- SUPERVGraph_msg_en.qm
+ SUPERVGraph_msg_en.qm \
+ SUPERVGraph_msg_fr.qm
libSUPERVGraph_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SUPERVGraph : build Supervisor viewer into desktop
// File : SUPERVGraph.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#include "SUPERVGraph.h"
#include "SUPERVGraph_ViewFrame.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
-using namespace std;
-
/*!
Creates view
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SUPERVGraph : build Supervisor viewer into desktop
// File : SUPERVGraph.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef SUPERVGraph_HeaderFile
#define SUPERVGraph_HeaderFile
#ifdef WIN32
-#ifdef SUPERVGRAPH_EXPORTS
+#if defined SUPERVGRAPH_EXPORTS || defined SUPERVGraph_EXPORTS
#define SUPERVGRAPH_EXPORT __declspec(dllexport)
#else
#define SUPERVGRAPH_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = SUPERVGraph
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT
-
-LIBS += $${QT_MT_LIBS} -L../../lib -lsuit
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SUPERVGRAPH_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = SUPERVGraph_ViewFrame.h
-HEADERS += SUPERVGraph_ViewManager.h
-HEADERS += SUPERVGraph_ViewModel.h
-HEADERS += SUPERVGraph.h
-
-SOURCES = SUPERVGraph.cxx
-SOURCES += SUPERVGraph_ViewFrame.cxx
-SOURCES += SUPERVGraph_ViewManager.cxx
-SOURCES += SUPERVGraph_ViewModel.cxx
-
-TRANSLATIONS = resources/SUPERVGraph_images.ts \
- resources/SUPERVGraph_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SUPERVGraph : build Supervisor viewer into desktop
// File : SUPERVGraph_ViewFrame.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#include "SUPERVGraph_ViewFrame.h"
#include <SUIT_ResourceMgr.h>
#include <QVBoxLayout>
#include <QToolBar>
-using namespace std;
-
-
/*!
Constructor
*/
setBackgroundColor(QColor(R,G,B));*/
myToolBar = new QToolBar(this);
+ myToolBar->setFloatable(false);
//myToolBar->setCloseMode(QDockWindow::Undocked);
myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
createActions();
// Panning
aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
- tr( "MNU_PAN_VIEW" ), 0, this);
+ tr( "MNU_PAN_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_PAN_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
myActionsMap[ PanId ] = aAction;
// Reset
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
- tr( "MNU_RESET_VIEW" ), 0, this);
+ tr( "MNU_RESET_VIEW" ), 0, this);
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
myActionsMap[ ResetId ] = aAction;
\param name - new name
*/
void SUPERVGraph_ViewFrame::rename( const Handle(SALOME_InteractiveObject)& IObject,
- QString newName )
+ QString newName )
{
// MESSAGE ( "SUPERVGraph_ViewFrame::rename" )
}
\param update - update current viewer
*/
void SUPERVGraph_ViewFrame::highlight( const Handle(SALOME_InteractiveObject)& IObject,
- bool highlight, bool immediatly )
+ bool highlight, bool immediatly )
{
// MESSAGE ( "SUPERVGraph_ViewFrame::highlight" )
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SUPERVGraph : build Supervisor viewer into desktop
// File : SUPERVGraph_ViewFrame.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef SUPERVGraph_ViewFrame_H
#define SUPERVGraph_ViewFrame_H
/* interactive object management */
void highlight( const Handle(SALOME_InteractiveObject)& IObject,
- bool highlight, bool immediatly = true );
+ bool highlight, bool immediatly = true );
void unHighlightAll();
void rename( const Handle(SALOME_InteractiveObject)& IObject,
- QString newName );
+ QString newName );
bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
/* selection */
Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { Handle(SALOME_InteractiveObject) o; return o; };
- /* display */
+ /* display */
void Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
void DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject){};
void Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUPERVGraph_ViewManager.h"
#include "SUIT_ViewWindow.h"
Constructor
*/
SUPERVGraph_ViewManager::SUPERVGraph_ViewManager( SUIT_Study* theStudy,
- SUIT_Desktop* theDesktop,
- SUIT_ViewModel* theViewModel )
+ SUIT_Desktop* theDesktop,
+ SUIT_ViewModel* theViewModel )
: SUIT_ViewManager( theStudy, theDesktop, theViewModel )
{
myId = ++myMaxId;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUPERVGRAPH_VIEWMANAGER_H
#define SUPERVGRAPH_VIEWMANAGER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SUPERVGraph_ViewModel.h"
#include "SUPERVGraph_ViewFrame.h"
#include "SUIT_Desktop.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SUPERVGRAPH_VIEWMODEL_H
#define SUPERVGRAPH_VIEWMODEL_H
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: SUPERVGraph_images.po
-# Created: 11/22/2005 10:52:37 PM
-# Author: Margarita Karpunina
-
-msgid "ICON_SUPERVGraph_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_SUPERVGraph_RESET"
-msgstr "view_reset.png"
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# File: SUPERVGraph_msg_en.po
-# Created: 11/22/2005 10:55:36 PM
-# Author: Margarita Karpunina
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Alexander Solovyov(OCN)
# Module : SVTK
-# $Header:
+# $Header$
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SALOME_Actor.h \
SVTK_RectPicker.h \
SVTK_DeviceActor.h \
- SVTK_DialogBase.h \
SVTK_FontWidget.h \
SVTK_CubeAxesActor2D.h \
SVTK_Functor.h \
SVTK_SetRotationPointDlg.h \
SVTK_ViewParameterDlg.h \
SVTK_ComboAction.h \
- SVTK_Extension.h \
SVTK_Recorder.h \
SVTK_RecorderDlg.h \
SVTK_ImageWriter.h \
SVTK_NonIsometricDlg.cxx \
SVTK_UpdateRateDlg.cxx \
SVTK_CubeAxesDlg.cxx \
- SVTK_DialogBase.cxx \
SVTK_FontWidget.cxx \
SVTK_Trihedron.cxx \
SVTK_View.cxx \
SVTK_SetRotationPointDlg.cxx \
SVTK_ViewParameterDlg.cxx \
SVTK_ComboAction.cxx \
- SVTK_Extension.cxx \
SVTK_Recorder.cxx \
SVTK_RecorderDlg.cxx \
SVTK_ImageWriter.cxx \
- SVTK_ImageWriterMgr.cxx
+ SVTK_ImageWriterMgr.cxx \
+ vtkPVAxesActor.h \
+ vtkPVAxesActor.cxx \
+ vtkPVAxesWidget.h \
+ vtkPVAxesWidget.cxx
# internal headers
SVTK_UpdateRateDlg_moc.cxx \
SVTK_CubeAxesDlg_moc.cxx \
SVTK_FontWidget_moc.cxx \
- SVTK_DialogBase_moc.cxx \
SVTK_ViewModelBase_moc.cxx \
SVTK_ViewManager_moc.cxx \
SVTK_ViewWindow_moc.cxx \
resources/vtk_view_perspective.png \
resources/vtk_view_parameters.png \
resources/vtk_view_style_switch.png \
+ resources/vtk_view_zooming_style_switch.png \
resources/vtk_view_recording_start.png \
resources/vtk_view_recording_play.png \
resources/vtk_view_recording_pause.png \
- resources/vtk_view_recording_stop.png
+ resources/vtk_view_recording_stop.png \
+ resources/vtk_view_sync.png \
+ resources/vtk_view_highlight.png
nodist_salomeres_DATA = \
SVTK_msg_en.qm \
+ SVTK_msg_fr.qm \
SVTK_images.qm
libSVTK_la_CPPFLAGS = \
$(BOOST_CPPFLAGS) \
-I$(srcdir)/../Qtx \
-I$(srcdir)/../SUIT \
+ -I$(srcdir)/../ViewerTools \
-I$(srcdir)/../OBJECT \
-I$(srcdir)/../Prs \
- -I$(srcdir)/../VTKViewer
+ -I$(srcdir)/../VTKViewer \
+ -I$(srcdir)/../OpenGLUtils
libSVTK_la_LDFLAGS = \
+ $(VTK_LIBS) $(OGL_LIBS) \
$(QT_MT_LIBS) \
- $(CAS_KERNEL) $(CAS_VIEWER) \
- $(VTK_LIBS) $(OGL_LIBS)
+ $(CAS_KERNEL) $(CAS_VIEWER) \
+ $(KERNEL_LDFLAGS)
+
-libSVTK_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
- ../Prs/libSalomePrs.la ../VTKViewer/libVTKViewer.la
+libSVTK_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../ViewerTools/libViewerTools.la \
+ ../OBJECT/libSalomeObject.la ../Prs/libSalomePrs.la \
+ ../VTKViewer/libVTKViewer.la ../OpenGLUtils/libOpenGLUtils.la \
+ -lSALOMELocalTrace -lOpUtil
# Executable
bin_PROGRAMS = SVTK
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_Actor.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
/*!
\class SALOME_Actor SALOME_Actor.h
\brief Abstract class of SALOME Objects in VTK.
#include "SALOME_Actor.h"
#include "SALOME_InteractiveObject.hxx"
+#include "VTKViewer_Algorithm.h"
#include "VTKViewer_Transform.h"
#include "VTKViewer_TransformFilter.h"
#include "VTKViewer_GeometryFilter.h"
+#include "VTKViewer_FramedTextActor.h"
#include "SVTK_RectPicker.h"
#include "SVTK_Actor.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
// VTK Includes
#include <vtkCell.h>
#include <vtkLine.h>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
-using namespace std;
-
#if defined __GNUC__
#if __GNUC__ == 2
#define __GNUC_2__
{
int
GetEdgeId(SALOME_Actor* theActor,
- vtkPicker* thePicker,
- int theObjId)
+ vtkPicker* thePicker,
+ int theObjId)
{
int anEdgeId = 0;
if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) {
thePicker->GetPickPosition(aPickPosition);
vtkFloatingPointType aMinDist = 1000000.0, aDist = 0;
for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){
- if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){
- int subId;
- vtkFloatingPointType pcoords[3], closestPoint[3], weights[3];
- aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
- if (aDist < aMinDist) {
- aMinDist = aDist;
- anEdgeId = -1 - i;
- }
- }
+ if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){
+ int subId;
+ vtkFloatingPointType pcoords[3], closestPoint[3], weights[3];
+ aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
+ if (aDist < aMinDist) {
+ aMinDist = aDist;
+ anEdgeId = -1 - i;
+ }
+ }
}
}
return anEdgeId;
inline
bool
CheckDimensionId(Selection_Mode theMode,
- SALOME_Actor *theActor,
- vtkIdType theObjId)
+ SALOME_Actor *theActor,
+ vtkIdType theObjId)
{
switch(theMode){
case CellSelection:
};
return false;
}
+}
+namespace SVTK
+{
+ /*!
+ Make picker work with this actor only
+ */
+ TPickLimiter::TPickLimiter(vtkAbstractPicker* picker, SALOME_Actor* actor):myPicker(picker)
+ {
+ myPicker->InitializePickList();
+ myPicker->AddPickList( actor );
+ myPicker->SetPickFromList( true );
+ }
+ /*!
+ Unlimit picking
+ */
+ TPickLimiter::~TPickLimiter()
+ {
+ myPicker->SetPickFromList( false );
+ myPicker->InitializePickList();
+ }
}
myPreHighlightActor(SVTK_Actor::New()),
myHighlightActor(SVTK_Actor::New()),
myOutline(vtkOutlineSource::New()),
- myOutlineActor(VTKViewer_Actor::New())
+ myOutlineActor(VTKViewer_Actor::New()),
+ myIsDisplayNameActor(false),
+ myNameActor(VTKViewer_FramedTextActor::New())
{
myPreHighlightActor->Delete();
myPreHighlightActor->Initialize();
myPreHighlightActor->PickableOff();
myPreHighlightActor->SetVisibility( false );
+ myPreHighlightActor->SetCoincident3DAllowed(true);
myHighlightActor->Delete();
myHighlightActor->Initialize();
myHighlightActor->PickableOff();
myHighlightActor->SetVisibility( false );
+ myHighlightActor->SetCoincident3DAllowed(true);
myOutline->Delete();
myOutlineActor->GetProperty()->SetAmbient(1.0);
myOutlineActor->GetProperty()->SetDiffuse(0.0);
myOutlineActor->SetVisibility( false );
+
+ // Name actor
+ myNameActor->Delete();
+ myNameActor->SetVisibility(false);
+ myNameActor->SetPickable(false);
+ myNameActor->SetModePosition(VTKViewer_FramedTextActor::TopRight);
+ myNameActor->SetLayoutType(VTKViewer_FramedTextActor::Vertical);
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ QColor aForegroundColor = aResourceMgr->colorValue( "VTKViewer", "group_names_text_color", Qt::white );
+ myNameActor->SetForegroundColor(aForegroundColor.redF(),
+ aForegroundColor.greenF(),
+ aForegroundColor.blueF());
+
+ vtkFloatingPointType aGroupNamesTransparency = 0.5;
+ aGroupNamesTransparency = aResourceMgr->doubleValue( "VTKViewer", "group_names_transparency", aGroupNamesTransparency );
+ myNameActor->SetTransparency(aGroupNamesTransparency);
}
/*!
SALOME_Actor
::setName(const char* theName)
{
- if(hasIO())
+ if(hasIO())
myIO->setName(theName);
+ myNameActor->SetText(theName);
Superclass::setName(theName);
}
theRenderer->AddActor( myPreHighlightActor.GetPointer() );
theRenderer->AddActor( myHighlightActor.GetPointer() );
theRenderer->AddActor( myOutlineActor.GetPointer() );
+ theRenderer->AddActor( myNameActor.GetPointer() );
}
/*!
theRenderer->RemoveActor( myPreHighlightActor.GetPointer() );
theRenderer->RemoveActor( myHighlightActor.GetPointer() );
theRenderer->RemoveActor( myOutlineActor.GetPointer() );
+ theRenderer->RemoveActor( myNameActor.GetPointer() );
}
/*!
void
SALOME_Actor
::SetPosition(vtkFloatingPointType _arg1,
- vtkFloatingPointType _arg2,
- vtkFloatingPointType _arg3)
+ vtkFloatingPointType _arg2,
+ vtkFloatingPointType _arg3)
{
Superclass::SetPosition(_arg1,_arg2,_arg3);
myHighlightActor->SetVisibility( theVisibility && isHighlighted() && aHasIndex);
}
}
+
+ UpdateNameActors();
+}
+
+/*!
+ Gets know whether the actor should be displayed or not
+*/
+bool
+SALOME_Actor
+::ShouldBeDisplayed()
+{
+ return true;
}
/*!
mySelector->GetIndex( getIO(), aMapIndex );
switch( mySelectionMode ){
case NodeSelection:
- myHighlightActor->GetProperty()->SetRepresentationToPoints();
- myHighlightActor->MapPoints( this, aMapIndex );
- break;
+ myHighlightActor->GetProperty()->SetRepresentationToPoints();
+ myHighlightActor->MapPoints( this, aMapIndex );
+ break;
case EdgeOfCellSelection:
- myHighlightActor->GetProperty()->SetRepresentationToWireframe();
- myHighlightActor->MapEdge( this, aMapIndex );
- break;
+ myHighlightActor->GetProperty()->SetRepresentationToWireframe();
+ myHighlightActor->MapEdge( this, aMapIndex );
+ break;
case CellSelection:
case EdgeSelection:
case FaceSelection:
case VolumeSelection:
- myHighlightActor->GetProperty()->SetRepresentationToSurface();
- myHighlightActor->MapCells( this, aMapIndex );
- break;
+ myHighlightActor->GetProperty()->SetRepresentationToSurface();
+ myHighlightActor->MapCells( this, aMapIndex );
+ break;
}
myHighlightActor->SetVisibility( GetVisibility() && theIsHighlight );
}
::highlight(bool theIsHighlight)
{
vtkFloatingPointType aBounds[6];
- GetInput()->GetBounds(aBounds);
+ vtkDataSet * aDataSet = GetHighlightedDataSet();
+ aDataSet->GetBounds(aBounds);
myOutline->SetBounds(aBounds);
myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight );
bool
SALOME_Actor
::PreHighlight(vtkInteractorStyle *theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
if ( !GetPickable() )
return false;
//
myPreHighlightActor->SetVisibility( false );
bool anIsPreselected = myIsPreselected;
-
+ SetPreSelected( false );
+
Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
bool anIsChanged = (mySelectionMode != aSelectionMode);
+ myPreHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
+
vtkFloatingPointType x = theSelectionEvent->myX;
vtkFloatingPointType y = theSelectionEvent->myY;
vtkFloatingPointType z = 0.0;
if( !theIsHighlight ) {
- SetPreSelected( false );
- vtkActorCollection* theActors = aRenderer->GetActors();
- theActors->InitTraversal();
- while( vtkActor *ac = theActors->GetNextActor() )
- if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) )
- if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
- anActor->SetPreSelected( false );
-
+ if ( hasIO() ) {
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* theActors = aCopy.GetActors();
+ theActors->InitTraversal();
+ while( vtkActor *ac = theActors->GetNextActor() )
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) )
+ if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
+ anActor->SetPreSelected( false );
+ }
}else{
- switch(aSelectionMode){
+ switch(aSelectionMode) {
case NodeSelection:
{
+ SVTK::TPickLimiter aPickLimiter( myPointPicker, this );
myPointPicker->Pick( x, y, z, aRenderer );
int aVtkId = myPointPicker->GetPointId();
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
- int anObjId = GetNodeObjId( aVtkId );
- myIsPreselected = (anObjId >= 0);
- if(myIsPreselected){
- const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
- int anExtent = aMapIndex.Extent();
- anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1));
- if(anIsChanged){
- TColStd_IndexedMapOfInteger aMapIndex;
- aMapIndex.Add( anObjId );
-
- myPreHighlightActor->GetProperty()->SetRepresentationToPoints();
- myPreHighlightActor->MapPoints( this, aMapIndex );
- }
- myPreHighlightActor->SetVisibility( true );
- }
+ int anObjId = GetNodeObjId( aVtkId );
+ myIsPreselected = (anObjId >= 0);
+ if(myIsPreselected){
+ const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
+ int anExtent = aMapIndex.Extent();
+ anIsChanged |= (anExtent == 0 || (anExtent > 0 && anObjId != aMapIndex(1)));
+ if(anIsChanged){
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aMapIndex.Add( anObjId );
+
+ myPreHighlightActor->GetProperty()->SetRepresentationToPoints();
+ myPreHighlightActor->MapPoints( this, aMapIndex );
+ }
+ myPreHighlightActor->SetVisibility( true );
+ }
}
break;
}
case FaceSelection:
case VolumeSelection:
{
+ SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) && hasIO() ) {
- int anObjId = GetElemObjId (aVtkId );
- if ( anObjId >= 0 ) {
- myIsPreselected = CheckDimensionId(aSelectionMode,this,anObjId);
- if(myIsPreselected){
- const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
- int anExtent = aMapIndex.Extent();
- anIsChanged |= (anExtent == 0 || anExtent > 0 && anObjId != aMapIndex(1));
- if(anIsChanged){
- TColStd_IndexedMapOfInteger aMapIndex;
- aMapIndex.Add( anObjId );
-
- myPreHighlightActor->GetProperty()->SetRepresentationToSurface();
- myPreHighlightActor->MapCells( this, aMapIndex );
- }
- myPreHighlightActor->SetVisibility( true );
- }
- }
+ int anObjId = GetElemObjId (aVtkId );
+ if ( anObjId >= 0 ) {
+ myIsPreselected = CheckDimensionId(aSelectionMode,this,anObjId);
+ if(myIsPreselected){
+ const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
+ int anExtent = aMapIndex.Extent();
+ anIsChanged |= (anExtent == 0 || (anExtent > 0 && anObjId != aMapIndex(1)));
+ if(anIsChanged){
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aMapIndex.Add( anObjId );
+
+ myPreHighlightActor->GetProperty()->SetRepresentationToSurface();
+ myPreHighlightActor->MapCells( this, aMapIndex );
+ }
+ myPreHighlightActor->SetVisibility( true );
+ }
+ }
}
break;
}
case EdgeOfCellSelection:
{
+ SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId )) {
- int anObjId = GetElemObjId( aVtkId );
- if ( anObjId >= 0 ) {
- int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
- myIsPreselected = anEdgeId < 0;
- if(myIsPreselected){
- const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
- int anExtent = aMapIndex.Extent();
- anIsChanged |= (anExtent == 0 || anExtent == 1);
- anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2)));
- if(anIsChanged){
- TColStd_IndexedMapOfInteger aMapIndex;
- aMapIndex.Add( anObjId );
- aMapIndex.Add( anEdgeId );
-
- myPreHighlightActor->GetProperty()->SetRepresentationToWireframe();
- myPreHighlightActor->MapEdge( this, aMapIndex );
- }
- myPreHighlightActor->SetVisibility( true );
- }
- }
+ int anObjId = GetElemObjId( aVtkId );
+ if ( anObjId >= 0 ) {
+ int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
+ myIsPreselected = anEdgeId < 0;
+ if(myIsPreselected){
+ const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
+ int anExtent = aMapIndex.Extent();
+ anIsChanged |= (anExtent == 0 || anExtent == 1);
+ anIsChanged |= (anExtent == 2 && (anObjId != aMapIndex(1) || anEdgeId != aMapIndex(2)));
+ if(anIsChanged){
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aMapIndex.Add( anObjId );
+ aMapIndex.Add( anEdgeId );
+
+ myPreHighlightActor->GetProperty()->SetRepresentationToWireframe();
+ myPreHighlightActor->MapEdge( this, aMapIndex );
+ }
+ myPreHighlightActor->SetVisibility( true );
+ }
+ }
}
break;
}
case ActorSelection :
{
if( !mySelector->IsSelected( myIO ) ) {
- SetPreSelected( true );
-
- vtkActorCollection* theActors = aRenderer->GetActors();
- theActors->InitTraversal();
- while( vtkActor *anAct = theActors->GetNextActor() ) {
- if( anAct != this )
- if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) )
- if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
- anActor->SetPreSelected( true );
+ SetPreSelected( true );
+
+ if ( hasIO() ) {
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* theActors = aCopy.GetActors();
+ theActors->InitTraversal();
+ while( vtkActor *anAct = theActors->GetNextActor() ) {
+ if( anAct != this )
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( anAct ) )
+ if( anActor->hasIO() && myIO->isSame( anActor->getIO() ) )
+ anActor->SetPreSelected( true );
+ }
}
}
}
bool
SALOME_Actor
::Highlight(vtkInteractorStyle *theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight)
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
{
- if ( !GetPickable() )
+ if ( !GetPickable() || !mySelector )
return false;
myOutlineActor->SetVisibility( false );
if ( !theIsHighlight )
return true;
+ myHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
+
vtkFloatingPointType x = theSelectionEvent->myX;
vtkFloatingPointType y = theSelectionEvent->myY;
vtkFloatingPointType z = 0.0;
if( !theSelectionEvent->myIsRectangle ) {
switch(aSelectionMode){
case NodeSelection: {
+ SVTK::TPickLimiter aPickLimiter( myPointPicker, this );
myPointPicker->Pick( x, y, z, aRenderer );
int aVtkId = myPointPicker->GetPointId();
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
- int anObjId = GetNodeObjId( aVtkId );
- if( anObjId >= 0 ) {
- mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
- mySelector->AddIObject( this );
- }
+ int anObjId = GetNodeObjId( aVtkId );
+ if( hasIO() && anObjId >= 0 ) {
+ mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
+ mySelector->AddIObject( this );
+ }
}
break;
}
case FaceSelection:
case VolumeSelection:
{
+ SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
- int anObjId = GetElemObjId( aVtkId );
- if( anObjId >= 0 ) {
- if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
- mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
- mySelector->AddIObject( this );
- }
- }
+ int anObjId = GetElemObjId( aVtkId );
+ if( anObjId >= 0 ) {
+ if ( hasIO() && CheckDimensionId(aSelectionMode,this,anObjId) ) {
+ mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
+ mySelector->AddIObject( this );
+ }
+ }
}
break;
}
case EdgeOfCellSelection:
{
+ SVTK::TPickLimiter aPickLimiter( myCellPicker, this );
myCellPicker->Pick( x, y, z, aRenderer );
int aVtkId = myCellPicker->GetCellId();
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
- int anObjId = GetElemObjId( aVtkId );
- if( anObjId >= 0 ) {
- int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
- if( anEdgeId < 0 ) {
- mySelector->AddOrRemoveIndex( myIO, anObjId, false );
- mySelector->AddOrRemoveIndex( myIO, anEdgeId, true );
- mySelector->AddIObject( this );
- }
- }
+ int anObjId = GetElemObjId( aVtkId );
+ if( anObjId >= 0 ) {
+ int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
+ if( hasIO() && anEdgeId < 0 ) {
+ mySelector->AddOrRemoveIndex( myIO, anObjId, false );
+ mySelector->AddOrRemoveIndex( myIO, anEdgeId, true );
+ mySelector->AddIObject( this );
+ }
+ }
}
break;
}
case ActorSelection :
{
- if( mySelector->IsSelected( myIO ) && anIsShift )
- mySelector->RemoveIObject( this );
- else {
- mySelector->AddIObject( this );
+ if ( hasIO() ) {
+ if( mySelector->IsSelected( myIO ) && anIsShift )
+ mySelector->RemoveIObject( this );
+ else {
+ mySelector->AddIObject( this );
+ }
}
break;
}
switch(aSelectionMode){
case NodeSelection: {
- myPointRectPicker->InitializePickList();
- myPointRectPicker->AddPickList(this);
+
+ SVTK::TPickLimiter aPickLimiter( myPointRectPicker, this );
myPointRectPicker->Pick( x1, y1, z1, x2, y2, z2, aRenderer );
const SVTK_RectPicker::TVectorIdsMap& aVectorIdsMap = myPointRectPicker->GetPointIdsMap();
SVTK_RectPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
TColStd_MapOfInteger anIndexes;
if(aMapIter != aVectorIdsMap.end()){
- const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
- vtkIdType anEnd = aVectorIds.size();
- for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
- int aPointId = aVectorIds[anId];
- if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) {
- int anObjId = GetNodeObjId( aPointId );
- anIndexes.Add( anObjId );
- }
- }
+ const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
+ vtkIdType anEnd = aVectorIds.size();
+ for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
+ int aPointId = aVectorIds[anId];
+ if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) {
+ int anObjId = GetNodeObjId( aPointId );
+ anIndexes.Add( anObjId );
+ }
+ }
}
- if( !anIndexes.IsEmpty() ) {
- mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
- mySelector->AddIObject( this );
- anIndexes.Clear();
+ if ( hasIO() ) {
+ if( !anIndexes.IsEmpty() ) {
+ mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
+ mySelector->AddIObject( this );
+ anIndexes.Clear();
+ }
+ else if ( !anIsShift )
+ mySelector->RemoveIObject( this );
}
- else
- mySelector->RemoveIObject( this );
-
break;
}
case ActorSelection :
bool anIsPicked = true;
for( int i = 0; i <= 1; i++ ) {
- for( int j = 2; j <= 3; j++ ) {
- for( int k = 4; k <= 5; k++ ) {
- aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 );
- aRenderer->WorldToDisplay();
- aRenderer->GetDisplayPoint( aPnt );
-
- if( aPnt[0] < x1 || aPnt[0] > x2 || aPnt[1] < y1 || aPnt[1] > y2 ) {
- anIsPicked = false;
- break;
- }
- }
- }
+ for( int j = 2; j <= 3; j++ ) {
+ for( int k = 4; k <= 5; k++ ) {
+ aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 );
+ aRenderer->WorldToDisplay();
+ aRenderer->GetDisplayPoint( aPnt );
+
+ if( aPnt[0] < x1 || aPnt[0] > x2 || aPnt[1] < y1 || aPnt[1] > y2 ) {
+ anIsPicked = false;
+ break;
+ }
+ }
+ }
}
if( anIsPicked )
- mySelector->AddIObject(this);
+ mySelector->AddIObject(this);
break;
}
case FaceSelection:
case VolumeSelection:
{
- myCellRectPicker->InitializePickList();
- myCellRectPicker->AddPickList(this);
+ SVTK::TPickLimiter aPickLimiter( myCellRectPicker, this );
myCellRectPicker->Pick( x1, y1, z1, x2, y2, z2, aRenderer );
const SVTK_RectPicker::TVectorIdsMap& aVectorIdsMap = myCellRectPicker->GetCellIdsMap();
SVTK_RectPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
TColStd_MapOfInteger anIndexes;
if(aMapIter != aVectorIdsMap.end()){
- const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
- vtkIdType anEnd = aVectorIds.size();
- for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
- int aCellId = aVectorIds[anId];
- if ( !mySelector->IsValid( this, aCellId ) )
- continue;
-
- int anObjId = GetElemObjId( aCellId );
- if( anObjId != -1 )
- if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
- anIndexes.Add(anObjId);
- }
+ const SVTK_RectPicker::TVectorIds& aVectorIds = aMapIter->second;
+ vtkIdType anEnd = aVectorIds.size();
+ for(vtkIdType anId = 0; anId < anEnd; anId++ ) {
+ int aCellId = aVectorIds[anId];
+ if ( !mySelector->IsValid( this, aCellId ) )
+ continue;
+
+ int anObjId = GetElemObjId( aCellId );
+ if( anObjId != -1 )
+ if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
+ anIndexes.Add(anObjId);
+ }
+ }
+ }
+
+ if ( hasIO() ) {
+ if( !anIndexes.IsEmpty() ) {
+ mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
+ mySelector->AddIObject( this );
+ anIndexes.Clear();
}
+ else if ( !anIsShift )
+ mySelector->RemoveIObject( this );
}
- mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
- mySelector->AddIObject( this );
}
default:
break;
return true;
}
+/*!
+ To get flag of displaying of name actor
+ \return flag to display or not to display name actor
+*/
+bool
+SALOME_Actor
+::IsDisplayNameActor() const
+{
+ return myIsDisplayNameActor;
+}
+
+/*!
+ To set flag of displaying of name actor
+ \param theIsDisplayNameActor flag to display or not to display name actor
+*/
+void
+SALOME_Actor
+::SetIsDisplayNameActor(bool theIsDisplayNameActor)
+{
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+ bool isShowGroupNames = aResourceMgr->booleanValue("VTKViewer", "show_group_names", false);
+ myIsDisplayNameActor = theIsDisplayNameActor && isShowGroupNames;
+ UpdateNameActors();
+}
+
+/*!
+ To set text of name actor
+ \param theText - text of name actor
+*/
+void
+SALOME_Actor
+::SetNameActorText(const char* theText)
+{
+ myNameActor->SetText(theText);
+}
+
+/*!
+ To set offset of name actor
+ \param theOffset - offset of name actor
+*/
+void
+SALOME_Actor
+::SetNameActorOffset(int theOffset[2])
+{
+ myNameActor->SetOffset(theOffset);
+}
+
+/*!
+ To get size of name actor
+ \param theRenderer - renderer
+ \param theSize - size of name actor
+*/
+void
+SALOME_Actor
+::GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const
+{
+ myNameActor->GetSize(theRenderer, theSize);
+}
+
+/*!
+ Update visibility of name actors
+*/
+void
+SALOME_Actor
+::UpdateNameActors()
+{
+ if( vtkRenderer* aRenderer = GetRenderer() )
+ {
+ int anOffset[2] = { 0, 0 };
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* aCollection = aCopy.GetActors();
+ for( int anIndex = 0, aNbItems = aCollection->GetNumberOfItems(); anIndex < aNbItems; anIndex++ )
+ {
+ if( SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>( aCollection->GetItemAsObject( anIndex ) ) )
+ {
+ if( anActor->IsDisplayNameActor() )
+ {
+ anActor->SetNameActorOffset( anOffset );
+ if( anActor->GetVisibility() )
+ {
+ int aSize[2];
+ anActor->GetNameActorSize( aRenderer, aSize );
+ anOffset[0] = anOffset[0] + aSize[0];
+ anOffset[1] = anOffset[1] + aSize[1];
+ }
+ }
+ }
+ }
+ }
+ myNameActor->SetVisibility( GetVisibility() && IsDisplayNameActor() );
+}
+
/*!
To set up a picker for nodal selection (initialized by SVTK_Renderer::AddActor)
\param thePointPicker - new picker
{
myHighlightActor->SetProperty(theProperty);
}
+
+/*!
+ Set standard point marker
+ \param theMarkerType type of the marker
+ \param theMarkerScale scale of the marker
+*/
+void
+SALOME_Actor
+::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ myPreHighlightActor->SetMarkerStd( theMarkerType, theMarkerScale );
+ myHighlightActor->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+/*!
+ Set custom point marker
+ \param theMarkerId id of the marker texture
+ \param theMarkerTexture marker texture
+*/
+void
+SALOME_Actor
+::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+ myPreHighlightActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+ myHighlightActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
+
+/*!
+ Get type of the point marker
+ \return type of the point marker
+*/
+VTK::MarkerType
+SALOME_Actor
+::GetMarkerType()
+{
+ return myPreHighlightActor->GetMarkerType();
+}
+
+/*!
+ Get scale of the point marker
+ \return scale of the point marker
+*/
+VTK::MarkerScale
+SALOME_Actor
+::GetMarkerScale()
+{
+ return myPreHighlightActor->GetMarkerScale();
+}
+
+/*!
+ Get texture identifier of the point marker
+ \return texture identifier of the point marker
+ */
+int
+SALOME_Actor
+::GetMarkerTexture()
+{
+ return myPreHighlightActor->GetMarkerTexture();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_Actor.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef SALOME_ACTOR_H
#define SALOME_ACTOR_H
#undef min
#undef max
-#include "VTKViewer_Actor.h"
+#include <VTKViewer_Actor.h>
+#include <VTKViewer_MarkerDef.h>
#include <vtkSmartPointer.h>
+class vtkAbstractPicker;
class vtkPointPicker;
class vtkCellPicker;
class vtkOutlineSource;
class vtkInteractorStyle;
class vtkRenderWindowInteractor;
+class VTKViewer_FramedTextActor;
+
class SVTK_Actor;
class SVTK_RectPicker;
class SVTK_InteractorStyle;
virtual
void
SetPosition(vtkFloatingPointType _arg1,
- vtkFloatingPointType _arg2,
- vtkFloatingPointType _arg3);
+ vtkFloatingPointType _arg2,
+ vtkFloatingPointType _arg3);
//! Apply additional position
virtual
void
SetVisibility( int );
+ //! Gets know whether the actor should be displayed or not
+ virtual
+ bool
+ ShouldBeDisplayed();
+
//----------------------------------------------------------------------------
//! To publish the actor an all its internal devices
virtual
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! To process highlight (called from #SVTK_InteractorStyle)
virtual
bool
Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
+
+ //----------------------------------------------------------------------------
+ //! To get flag of displaying of name actor
+ virtual
+ bool
+ IsDisplayNameActor() const;
+
+ //! To set flag of displaying of name actor
+ virtual
+ void
+ SetIsDisplayNameActor(bool theIsDisplayNameActor);
+
+ //! To set text of name actor
+ virtual
+ void
+ SetNameActorText(const char* theText);
+
+ //! To set offset of name actor
+ virtual
+ void
+ SetNameActorOffset(int theOffset[2]);
+
+ //! To get size of name actor
+ virtual
+ void
+ GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const;
+
+ //! To update visibility of name actors
+ virtual
+ void
+ UpdateNameActors();
+
+ //----------------------------------------------------------------------------
+ //! Set standard point marker
+ virtual
+ void
+ SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+
+ //! Set custom point marker
+ virtual
+ void
+ SetMarkerTexture( int, VTK::MarkerTexture );
+
+ //! Get type of the point marker
+ virtual
+ VTK::MarkerType
+ GetMarkerType();
+
+ //! Get scale of the point marker
+ virtual
+ VTK::MarkerScale
+ GetMarkerScale();
+
+ //! Get texture identifier of the point marker
+ virtual
+ int
+ GetMarkerTexture();
//----------------------------------------------------------------------------
//! To set up a picker for nodal selection (initialized by #SVTK_Renderer::AddActor)
vtkSmartPointer<VTKViewer_Actor> myOutlineActor;
vtkSmartPointer<vtkOutlineSource> myOutline;
+
+ bool myIsDisplayNameActor;
+ vtkSmartPointer<VTKViewer_FramedTextActor> myNameActor;
};
+namespace SVTK
+{
+ class SVTK_EXPORT TPickLimiter
+ {
+ vtkAbstractPicker* myPicker;
+ public:
+ TPickLimiter(vtkAbstractPicker*, SALOME_Actor*);
+ ~TPickLimiter();
+ };
+}
+
#ifdef WIN32
#pragma warning ( default:4251 )
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module :
-// $Header$
-//
+
#include "SVTK.h"
#include "SVTK_Prs.h"
#include "SVTK_Actor.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_H
#define SVTK_H
#include "VTKViewer.h"
#ifdef WIN32
-# ifdef SVTK_EXPORTS
+# if defined SVTK_EXPORTS
# define SVTK_EXPORT __declspec(dllexport)
# else
# define SVTK_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = SVTK
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-VTKHOME = $$(VTKHOME)
-VTK_INCLUDES = $${VTKHOME}/include/vtk
-
-VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-OCC_LIBS =
-
-INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $${VTK_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../OBJECT ../Prs ../VTKViewer
-LIBS += -L../../lib -lqtx -lsuit -lSalomeObject -lSalomePrs -lVTKViewer $${OCC_LIBS} $${VTK_LIBS}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SVTK_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = SVTK.h
-HEADERS += SVTK_Prs.h
-HEADERS += SVTK_Actor.h
-HEADERS += SALOME_Actor.h
-HEADERS += SVTK_RectPicker.h
-HEADERS += SVTK_DeviceActor.h
-HEADERS += SVTK_DialogBase.h
-HEADERS += SVTK_FontWidget.h
-HEADERS += SVTK_CubeAxesActor2D.h
-HEADERS += SVTK_Functor.h
-HEADERS += SVTK_View.h
-HEADERS += SVTK_ViewManager.h
-HEADERS += SVTK_ViewModel.h
-HEADERS += SVTK_ViewWindow.h
-HEADERS += SVTK_Renderer.h
-HEADERS += SVTK_InteractorStyle.h
-HEADERS += SVTK_KeyFreeInteractorStyle.h
-HEADERS += SVTK_RenderWindowInteractor.h
-HEADERS += SVTK_GenericRenderWindowInteractor.h
-HEADERS += SVTK_Selector.h
-HEADERS += SVTK_Selection.h
-HEADERS += SVTK_SelectionEvent.h
-HEADERS += SVTK_SpaceMouse.h
-HEADERS += SVTK_Event.h
-HEADERS += SVTK_ViewModelBase.h
-HEADERS += SVTK_SetRotationPointDlg.h
-HEADERS += SVTK_ViewParametersDlg.h
-HEADERS += SVTK_ComboAction.h
-HEADERS += SVTK_Extension.h
-
-SOURCES = SVTK_Prs.cxx
-SOURCES += SVTK_Actor.cxx
-SOURCES += SALOME_Actor.cxx
-SOURCES += SVTK_RectPicker.cxx
-SOURCES += SVTK_DeviceActor.cxx
-SOURCES += SVTK_CubeAxesActor2D.cxx
-SOURCES += SVTK_NonIsometricDlg.cxx
-SOURCES += SVTK_UpdateRateDlg.cxx
-SOURCES += SVTK_CubeAxesDlg.cxx
-SOURCES += SVTK_DialogBase.cxx
-SOURCES += SVTK_FontWidget.cxx
-SOURCES += SVTK_Trihedron.cxx
-SOURCES += SVTK_View.cxx
-SOURCES += SVTK_ViewManager.cxx
-SOURCES += SVTK_ViewModel.cxx
-SOURCES += SVTK_Renderer.cxx
-SOURCES += SVTK_ViewWindow.cxx
-SOURCES += SVTK_InteractorStyle.cxx
-SOURCES += SVTK_KeyFreeInteractorStyle.cxx
-SOURCES += SVTK_RenderWindowInteractor.cxx
-SOURCES += SVTK_GenericRenderWindowInteractor.cxx
-SOURCES += SVTK_SpaceMouse.cxx
-SOURCES += SVTK_Selector.cxx
-SOURCES += SVTK_SetRotationPointDlg.cxx
-SOURCES += SVTK_ViewParametersDlg.cxx
-SOURCES += SVTK_ComboAction.cxx
-SOURCES += SVTK_Extension.cxx
-
-TRANSLATIONS = resources/SVTK_images.ts \
- resources/SVTK_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_Actor.h"
#include "SALOME_Actor.h"
#include <vtkRenderer.h>
#include <vtkCell.h>
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+#if VTK_XVERSION > 50700
+#include <vtkPolyhedron.h>
+#endif
#include <vtkPolyData.h>
-using namespace std;
-
+#include "Utils_SALOME_Exception.hxx"
+#include "utilities.h"
static
void
void
SVTK_Actor
::MapCells(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex)
+ const TColStd_IndexedMapOfInteger& theMapIndex)
{
myUnstructuredGrid->Initialize();
myUnstructuredGrid->Allocate();
for(int ind = 1; ind <= aNbOfParts; ind++){
int aPartId = theMapIndex( ind );
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
- myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+ {
+#if VTK_XVERSION > 50700
+ if (aCell->GetCellType() != VTK_POLYHEDRON)
+#endif
+ myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+#if VTK_XVERSION > 50700
+ else
+ {
+ vtkPolyhedron *polyhedron = dynamic_cast<vtkPolyhedron*>(aCell);
+ if (!polyhedron)
+ throw SALOME_Exception(LOCALIZED ("not a polyhedron"));
+ vtkIdType *pts = polyhedron->GetFaces();
+ myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),pts[0], pts+1);
+ }
+#endif
+ }
}
UnShrink();
void
SVTK_Actor
::MapPoints(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex)
+ const TColStd_IndexedMapOfInteger& theMapIndex)
{
myUnstructuredGrid->Initialize();
myUnstructuredGrid->Allocate();
for(vtkIdType i = 0; i < aNbOfParts; i++){
int aPartId = theMapIndex( i+1 );
if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){
- aPoints->SetPoint(i,aCoord);
- // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
- // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
- myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i);
+ aPoints->SetPoint(i,aCoord);
+ // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
+ // from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
+ myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i);
}
}
myUnstructuredGrid->SetPoints(aPoints);
void
SVTK_Actor
::MapEdge(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex)
+ const TColStd_IndexedMapOfInteger& theMapIndex)
{
myUnstructuredGrid->Initialize();
myUnstructuredGrid->Allocate();
if(aCellId > 0){
if(vtkCell* aCell = theMapActor->GetElemCell(aCellId)){
- if(anEdgeId < 0){
- anEdgeId = -anEdgeId - 1;
- int aNbOfEdges = aCell->GetNumberOfEdges();
- if(0 <= anEdgeId || anEdgeId < aNbOfEdges){
- if(vtkCell* anEdge = aCell->GetEdge(anEdgeId))
- myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds());
- }
- }
+ if(anEdgeId < 0){
+ anEdgeId = -anEdgeId - 1;
+ int aNbOfEdges = aCell->GetNumberOfEdges();
+ if(0 <= anEdgeId || anEdgeId < aNbOfEdges){
+ if(vtkCell* anEdge = aCell->GetEdge(anEdgeId))
+ myUnstructuredGrid->InsertNextCell(VTK_LINE,anEdge->GetPointIds());
+ }
+ }
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_ACTOR_H
#define SVTK_ACTOR_H
//! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
void
MapCells(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex);
+ const TColStd_IndexedMapOfInteger& theMapIndex);
//! Allow to recostruct selected points from source SALOME_Actor and map of subindexes
void
MapPoints(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex);
+ const TColStd_IndexedMapOfInteger& theMapIndex);
//! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes
void
MapEdge(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex);
+ const TColStd_IndexedMapOfInteger& theMapIndex);
const TColStd_IndexedMapOfInteger&
GetMapIndex() const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header:
-//
+
#include "SVTK_ComboAction.h"
#include <QComboBox>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header:
-//
+
#ifndef SVTK_COMBOACTION_H
#define SVTK_COMBOACTION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OBJECT : kernel of SALOME component
// File : SVTK_CubeAxesActor2D.cxx
// Author : Eugeny Nikolaev
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_CubeAxesActor2D.h"
#include "VTKViewer_Transform.h"
}
static void ChangeValues(vtkFloatingPointType* aArray1,
- vtkFloatingPointType* aArray2,
- vtkFloatingPointType *aRange1,
- vtkFloatingPointType* aRange2,
- bool theY)
+ vtkFloatingPointType* aArray2,
+ vtkFloatingPointType *aRange1,
+ vtkFloatingPointType* aRange2,
+ bool theY)
{
vtkFloatingPointType tmp=-1000;
if (!theY){
}
static void ChangeArrays(vtkFloatingPointType* xCoords,
- vtkFloatingPointType* yCoords,
- vtkFloatingPointType* zCoords,
- vtkFloatingPointType* xRange,
- vtkFloatingPointType* yRange,
- vtkFloatingPointType* zRange,
- const int xAxes,
- const int yAxes,
- const int zAxes)
+ vtkFloatingPointType* yCoords,
+ vtkFloatingPointType* zCoords,
+ vtkFloatingPointType* xRange,
+ vtkFloatingPointType* yRange,
+ vtkFloatingPointType* zRange,
+ const int xAxes,
+ const int yAxes,
+ const int zAxes)
{
if ( xAxes == 0 && yAxes == 2 && zAxes == 1)
ChangeValues(yCoords,zCoords,yRange,zRange,true);
// if xAxes=0 yAxes=1 zAxes=2 - good situation
if (!(xAxes == 0 && yAxes == 1 && zAxes == 2))
ChangeArrays(xCoords,yCoords,zCoords,
- xRange,yRange,zRange,
- xAxes,yAxes,zAxes);
+ xRange,yRange,zRange,
+ xAxes,yAxes,zAxes);
double aTScale[3];
if(m_Transform.GetPointer() != NULL)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OBJECT : kernel of SALOME component
// File : SVTK_CubeAxesActor2D.h
// Author : Eugeny Nikolaev
-// Module : SALOME
-// $Header$
-//
+
#ifndef __SVTK_CubeAxesActor2D_h
#define __SVTK_CubeAxesActor2D_h
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI for SMESH component
// File : SVTK_CubeAxesDlg.cxx
// Author : Sergey LITONIN
#include "QtxAction.h"
#include "QtxIntSpinBox.h"
-#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QPushButton>
-#include <QTabWidget>
#include <QCheckBox>
#include <QGroupBox>
#include <QLineEdit>
-#include <QLabel>
#include <vtkAxisActor2D.h>
#include <vtkTextProperty.h>
\internal
*/
-class SVTK_CubeAxesDlg::AxisWidget : public QFrame
-{
-public:
- AxisWidget( QWidget* );
- ~AxisWidget();
-
- void UseName( const bool );
- void SetName( const QString& );
- void SetNameFont( const QColor&, const int, const bool, const bool, const bool );
- bool ReadData( vtkAxisActor2D* );
- bool Apply( vtkAxisActor2D* );
-
-private:
- // name
- QGroupBox* myNameGrp;
- QLineEdit* myAxisName;
- SVTK_FontWidget* myNameFont;
-
- // labels
- QGroupBox* myLabelsGrp;
- QtxIntSpinBox* myLabelNumber;
- QtxIntSpinBox* myLabelOffset;
- SVTK_FontWidget* myLabelsFont;
-
- // tick marks
- QGroupBox* myTicksGrp;
- QtxIntSpinBox* myTickLength;
-
- friend class SVTK_CubeAxesDlg;
-};
-
/*!
Constructor
*/
-SVTK_CubeAxesDlg::AxisWidget::AxisWidget (QWidget* theParent)
-: QFrame(theParent)
+SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
+: ViewerTools_AxisWidgetBase(theParent)
{
- QList< QLabel* > aLabels;
-
- // "Name" grp
-
- myNameGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("AXIS_NAME"), this);
- myNameGrp->setCheckable( true );
-
- QVBoxLayout* aVBox = new QVBoxLayout;
-
- QHBoxLayout* aHBox = new QHBoxLayout;
- aHBox->setSpacing(5);
- QLabel* aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NAME"));
- aHBox->addWidget(aLabel);
- myAxisName = new QLineEdit;
- aHBox->addWidget(myAxisName);
- aLabels.append(aLabel);
- aVBox->addLayout(aHBox);
-
- aHBox = new QHBoxLayout;
- aHBox->setSpacing(5);
- aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
- aHBox->addWidget(aLabel);
- myNameFont = new SVTK_FontWidget(myNameGrp);
- aHBox->addWidget(myNameFont);
- aLabels.append(aLabel);
- aVBox->addLayout(aHBox);
-
- myNameGrp->setLayout(aVBox);
-
- // "Labels" grp
-
- myLabelsGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("LABELS"), this);
- myLabelsGrp->setCheckable( true );
-
- aVBox = new QVBoxLayout;
-
- aHBox = new QHBoxLayout;
- aHBox->setSpacing(5);
- aLabel = new QLabel(SVTK_CubeAxesDlg::tr("NUMBER"));
- aHBox->addWidget(aLabel);
- myLabelNumber = new QtxIntSpinBox(0,25,1,myLabelsGrp);
- aHBox->addWidget(myLabelNumber);
- aLabels.append(aLabel);
- aVBox->addLayout(aHBox);
-
- aHBox = new QHBoxLayout;
- aHBox->setSpacing(5);
- aLabel = new QLabel(SVTK_CubeAxesDlg::tr("OFFSET"));
- aHBox->addWidget(aLabel);
- myLabelOffset = new QtxIntSpinBox(0,100,1,myLabelsGrp);
- aHBox->addWidget(myLabelOffset);
- aLabels.append(aLabel);
- aVBox->addLayout(aHBox);
-
- aHBox = new QHBoxLayout;
- aHBox->setSpacing(5);
- aLabel = new QLabel(SVTK_CubeAxesDlg::tr("FONT"));
- aHBox->addWidget(aLabel);
- myLabelsFont = new SVTK_FontWidget(myLabelsGrp);
- aHBox->addWidget(myLabelsFont);
- aLabels.append(aLabel);
- aVBox->addLayout(aHBox);
-
- myLabelsGrp->setLayout(aVBox);
-
- // "Tick marks" grp
-
- myTicksGrp = new QGroupBox(SVTK_CubeAxesDlg::tr("TICK_MARKS"), this);
- myTicksGrp->setCheckable( true );
-
- aVBox = new QVBoxLayout;
-
- aHBox = new QHBoxLayout;
- aHBox->setSpacing(5);
- aLabel = new QLabel(SVTK_CubeAxesDlg::tr("LENGTH"));
- aHBox->addWidget(aLabel);
- myTickLength = new QtxIntSpinBox(0,100,1,myTicksGrp);
- aHBox->addWidget(myTickLength);
- aLabels.append(aLabel);
- aVBox->addLayout(aHBox);
-
- myTicksGrp->setLayout(aVBox);
-
- // Layout
-
- QVBoxLayout* aLay = new QVBoxLayout(this);
- aLay->setMargin(5);
- aLay->setSpacing(5);
- aLay->addWidget(myNameGrp);
- aLay->addWidget(myLabelsGrp);
- aLay->addWidget(myTicksGrp);
-
- // init
- myNameGrp->setChecked( true );
- myLabelsGrp->setChecked( true );
- myTicksGrp->setChecked( true );
-
- // Adjust label widths
- QList< QLabel* >::iterator anIter;
- int aMaxWidth = 0;
- for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
- aMaxWidth = qMax(aMaxWidth, (*anIter)->sizeHint().width());
- for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
- (*anIter)->setFixedWidth(aMaxWidth);
}
/*!
Destructor
*/
-SVTK_CubeAxesDlg::AxisWidget::~AxisWidget()
+SVTK_AxisWidget::~SVTK_AxisWidget()
{
}
-void SVTK_CubeAxesDlg::AxisWidget::UseName(const bool toUse)
+ViewerTools_FontWidgetBase* SVTK_AxisWidget::createFontWidget( QWidget* theParent )
{
- myNameGrp->setChecked(toUse);
+ SVTK_FontWidget* aFontWidget = new SVTK_FontWidget( theParent );
+ aFontWidget->Initialize();
+ return aFontWidget;
}
-void SVTK_CubeAxesDlg::AxisWidget::SetName(const QString& theName)
-{
- myAxisName->setText(theName);
-}
-
-void SVTK_CubeAxesDlg::AxisWidget::SetNameFont(const QColor& theColor,
- const int theFont,
- const bool theIsBold,
- const bool theIsItalic,
- const bool theIsShadow)
-{
- myNameFont->SetData(theColor, theFont, theIsBold, theIsItalic, theIsShadow);
-}
-
-bool SVTK_CubeAxesDlg::AxisWidget::ReadData(vtkAxisActor2D* theActor)
+bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor)
{
if (theActor == 0)
return false;
return true;
}
-bool SVTK_CubeAxesDlg::AxisWidget::Apply(vtkAxisActor2D* theActor)
+bool SVTK_AxisWidget::Apply(vtkAxisActor2D* theActor)
{
if (theActor == 0)
return false;
Constructor
*/
SVTK_CubeAxesDlg::SVTK_CubeAxesDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName):
- SVTK_DialogBase(theAction,
- theParent,
- theName),
+ SVTK_ViewWindow* theParent,
+ const char* theName):
+ ViewerTools_CubeAxesDlgBase(theAction,
+ theParent,
+ theName),
myMainWindow(theParent)
{
- setWindowTitle(tr("CAPTION"));
-
- QVBoxLayout* aLay = new QVBoxLayout(this);
- aLay->setMargin(5);
- aLay->setSpacing(5);
- aLay->addWidget(createMainFrame(this));
- aLay->addWidget(createButtonFrame(this));
-
- connect(theParent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
- connect(theParent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
}
/*!
- Create frame containing dialog's input fields
+ Destructor
*/
-QWidget* SVTK_CubeAxesDlg::createMainFrame(QWidget* theParent)
+SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg()
{
- QFrame* aFrame = new QFrame(theParent);
-
- myTabWg = new QTabWidget(aFrame);
-
- myAxes[ 0 ] = new AxisWidget(myTabWg);
- myAxes[ 1 ] = new AxisWidget(myTabWg);
- myAxes[ 2 ] = new AxisWidget(myTabWg);
-
- myTabWg->addTab(myAxes[ 0 ], tr("X_AXIS"));
- myTabWg->addTab(myAxes[ 1 ], tr("Y_AXIS"));
- myTabWg->addTab(myAxes[ 2 ], tr("Z_AXIS"));
-
- myIsVisible = new QCheckBox(tr("IS_VISIBLE"), aFrame);
-
- QVBoxLayout* aLay = new QVBoxLayout(aFrame);
- aLay->setMargin(0);
- aLay->setSpacing(5);
- aLay->addWidget(myTabWg);
- aLay->addWidget(myIsVisible);
-
- return aFrame;
}
/*!
- Create frame containing buttons
+ Create axis widget
*/
-QWidget* SVTK_CubeAxesDlg::createButtonFrame(QWidget* theParent)
-{
- QFrame* aFrame = new QFrame(theParent);
- aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
-
- myOkBtn = new QPushButton(tr("BUT_OK"), aFrame);
- myApplyBtn = new QPushButton(tr("BUT_APPLY"), aFrame);
- myCloseBtn = new QPushButton(tr("BUT_CLOSE"), aFrame);
-
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QHBoxLayout* aLay = new QHBoxLayout(aFrame);
- aLay->setMargin(5);
- aLay->setSpacing(5);
-
- aLay->addWidget(myOkBtn);
- aLay->addWidget(myApplyBtn);
- aLay->addItem(aSpacer);
- aLay->addWidget(myCloseBtn);
-
- connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
- connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
-
- return aFrame;
-}
-
-/*!
- Destructor
-*/
-SVTK_CubeAxesDlg::~SVTK_CubeAxesDlg()
+ViewerTools_AxisWidgetBase* SVTK_CubeAxesDlg::createAxisWidget( QWidget* theParent )
{
+ SVTK_AxisWidget* anAxisWidget = new SVTK_AxisWidget( theParent );
+ anAxisWidget->initialize();
+ return anAxisWidget;
}
/*!
*/
void SVTK_CubeAxesDlg::Update()
{
+ ViewerTools_CubeAxesDlgBase::Update();
+
myActor = myMainWindow->GetCubeAxes();
- myAxes[ 0 ]->ReadData(myActor->GetXAxisActor2D());
- myAxes[ 1 ]->ReadData(myActor->GetYAxisActor2D());
- myAxes[ 2 ]->ReadData(myActor->GetZAxisActor2D());
+ ((SVTK_AxisWidget*)myAxes[ 0 ])->ReadData(myActor->GetXAxisActor2D());
+ ((SVTK_AxisWidget*)myAxes[ 1 ])->ReadData(myActor->GetYAxisActor2D());
+ ((SVTK_AxisWidget*)myAxes[ 2 ])->ReadData(myActor->GetZAxisActor2D());
myIsVisible->setChecked(myActor->GetVisibility() ? true : false);
}
-/*!
- Verify validity of entry data
-*/
-bool SVTK_CubeAxesDlg::isValid() const
-{
- return true;
-}
-
/*!
Verify validity of entry data
*/
bool SVTK_CubeAxesDlg::onApply()
{
- bool isOk = true;
+ bool isOk = ViewerTools_CubeAxesDlgBase::onApply();
try
{
aCurrWid->clearFocus();
aCurrWid->setFocus();
- isOk = isOk && myAxes[ 0 ]->Apply(myActor->GetXAxisActor2D());
- isOk = isOk && myAxes[ 1 ]->Apply(myActor->GetYAxisActor2D());
- isOk = isOk && myAxes[ 2 ]->Apply(myActor->GetZAxisActor2D());
-
+ isOk = isOk && ((SVTK_AxisWidget*)myAxes[ 0 ])->Apply(myActor->GetXAxisActor2D());
+ isOk = isOk && ((SVTK_AxisWidget*)myAxes[ 1 ])->Apply(myActor->GetYAxisActor2D());
+ isOk = isOk && ((SVTK_AxisWidget*)myAxes[ 2 ])->Apply(myActor->GetZAxisActor2D());
- //myActor->SetXLabel(myAxes[ 0 ]->myAxisName->text());
- //myActor->SetYLabel(myAxes[ 1 ]->myAxisName->text());
- //myActor->SetZLabel(myAxes[ 2 ]->myAxisName->text());
+ //myActor->SetXLabel(myAxes[ 0 ]->myAxisName->text()); // to remove?
+ //myActor->SetYLabel(myAxes[ 1 ]->myAxisName->text()); // to remove?
+ //myActor->SetZLabel(myAxes[ 2 ]->myAxisName->text()); // to remove?
- //myActor->SetNumberOfLabels(myActor->GetXAxisActor2D()->GetNumberOfLabels());
+ //myActor->SetNumberOfLabels(myActor->GetXAxisActor2D()->GetNumberOfLabels()); // to remove?
if (myIsVisible->isChecked())
myActor->VisibilityOn();
else
return isOk;
}
-
-/*!
- SLOT called when "Ok" button pressed.
-*/
-void SVTK_CubeAxesDlg::onOk()
-{
- if (onApply())
- onClose();
-}
-
-/*!
- SLOT: called when "Close" button pressed. Close dialog
-*/
-void SVTK_CubeAxesDlg::onClose()
-{
- reject();
-}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SVTK_CubeAxesDlg.h
// Author : Sergey LITONIN
// Module : VISU
#ifndef SVTK_CubeAxesDlg_H
#define SVTK_CubeAxesDlg_H
-#include "SVTK_DialogBase.h"
+#include "SVTK.h"
-class QWidget;
-class QPushButton;
-class QTabWidget;
-class QCheckBox;
+#include <ViewerTools_CubeAxesDlgBase.h>
-class QtxAction;
+class SVTK_ViewWindow;
class SVTK_CubeAxesActor2D;
-class SVTK_FontWidget;
-class SVTK_AxisWidget;
-class SVTK_ViewWindow;
+class vtkAxisActor2D;
+
+/*!
+ * Class : SVTK_AxisWidget
+ * Description : Axis tab widget of the "Graduated axis" dialog box
+*/
+class SVTK_EXPORT SVTK_AxisWidget : public ViewerTools_AxisWidgetBase
+{
+public:
+ SVTK_AxisWidget( QWidget* );
+ ~SVTK_AxisWidget();
+
+public:
+ bool ReadData( vtkAxisActor2D* );
+ bool Apply( vtkAxisActor2D* );
+
+protected:
+ virtual ViewerTools_FontWidgetBase* createFontWidget( QWidget* );
+};
/*!
* Class : SVTK_CubeAxesDlg
* Description : Dialog for specifynig cube axes properties
*/
-class SVTK_CubeAxesDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_CubeAxesDlg : public ViewerTools_CubeAxesDlgBase
{
Q_OBJECT
- class AxisWidget;
-
public:
SVTK_CubeAxesDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName);
+ SVTK_ViewWindow* theParent,
+ const char* theName);
virtual ~SVTK_CubeAxesDlg();
- void Update();
+ virtual void Update();
private slots:
- void onOk();
- bool onApply();
- void onClose();
+ virtual bool onApply();
private:
- QWidget* createButtonFrame( QWidget* );
- QWidget* createMainFrame ( QWidget* );
- bool isValid() const;
+ virtual ViewerTools_AxisWidgetBase* createAxisWidget( QWidget* );
private:
- SVTK_ViewWindow *myMainWindow;
+ SVTK_ViewWindow* myMainWindow;
SVTK_CubeAxesActor2D* myActor;
-
- QTabWidget* myTabWg;
- QCheckBox* myIsVisible;
-
- QPushButton* myOkBtn;
- QPushButton* myApplyBtn;
- QPushButton* myCloseBtn;
- AxisWidget* myAxes[ 3 ];
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SVTK OBJECT : interactive object for SVTK visualization
// File : SVTK_DeviceActor.cxx
// Author :
-// Module :
-// $Header$
-//
+
#include "SVTK_DeviceActor.h"
#include "VTKViewer_Transform.h"
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkDataSetMapper.h>
+#include <VTKViewer_PolyDataMapper.h>
+#include <VTKViewer_DataSetMapper.h>
#include <vtkPassThroughFilter.h>
-using namespace std;
-
vtkStandardNewMacro(SVTK_DeviceActor);
/*!
myIsShaded = true;
myProperty = vtkProperty::New();
- myRepresentation = SVTK::Representation::Surface;
+ myRepresentation = VTKViewer::Representation::Surface;
myIsResolveCoincidentTopology = true;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ myPolygonOffsetUnits);
- myMapper = vtkDataSetMapper::New();
+ myMapper = VTKViewer_DataSetMapper::New();
myShrinkFilter = vtkShrinkFilter::New();
myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
anId++; // 5
- if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper)){
+ if(VTKViewer_DataSetMapper* aMapper = dynamic_cast<VTKViewer_DataSetMapper*>(theMapper)){
aMapper->SetInput(myPassFilter[anId]->GetOutput());
- }else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper)){
+ }else if(VTKViewer_PolyDataMapper* aMapper = dynamic_cast<VTKViewer_PolyDataMapper*>(theMapper)){
aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
}
}
{
unsigned long mTime = this->Superclass::GetMTime();
- mTime = max(mTime,myGeomFilter->GetMTime());
+ mTime = std::max(mTime,myGeomFilter->GetMTime());
- mTime = max(mTime,myTransformFilter->GetMTime());
+ mTime = std::max(mTime,myTransformFilter->GetMTime());
if(myIsShrunk)
- mTime = max(mTime,myShrinkFilter->GetMTime());
+ mTime = std::max(mTime,myShrinkFilter->GetMTime());
if(myIsFeatureEdgesEnabled)
- mTime = max(mTime,myFeatureEdges->GetMTime());
+ mTime = std::max(mTime,myFeatureEdges->GetMTime());
for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
- max(mTime,myPassFilter[i]->GetMTime());
+ std::max(mTime,myPassFilter[i]->GetMTime());
return mTime;
}
int numPts = aDataSet->GetNumberOfPoints();
//It's impossible to use to apply "shrink" for "empty" dataset
if (numCells < 1 || numPts < 1)
- return;
+ return;
myShrinkFilter->SetInput( aDataSet );
myPassFilter[ 1 ]->SetInput( myShrinkFilter->GetOutput() );
myIsShrunk = true;
void
SVTK_DeviceActor
::GetFeatureEdgesFlags(bool& theIsFeatureEdges,
- bool& theIsBoundaryEdges,
- bool& theIsManifoldEdges,
- bool& theIsNonManifoldEdges)
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges)
{
theIsFeatureEdges = myFeatureEdges->GetFeatureEdges();
theIsBoundaryEdges = myFeatureEdges->GetBoundaryEdges();
void
SVTK_DeviceActor
::SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges)
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
{
myFeatureEdges->SetFeatureEdges(theIsFeatureEdges);
myFeatureEdges->SetBoundaryEdges(theIsBoundaryEdges);
*/
void
SVTK_DeviceActor
-::SetRepresentation(SVTK::Representation::Type theMode)
+::SetRepresentation(VTKViewer::Representation::Type theMode)
{
- using namespace SVTK::Representation;
+ using namespace VTKViewer::Representation;
if(IsShaded()){
switch(myRepresentation){
case Points :
case Surface :
+ case SurfaceWithEdges :
myProperty->SetAmbient(GetProperty()->GetAmbient());
myProperty->SetDiffuse(GetProperty()->GetDiffuse());
myProperty->SetSpecular(GetProperty()->GetSpecular());
switch(theMode){
case Points :
case Surface :
+ case SurfaceWithEdges :
GetProperty()->SetAmbient(myProperty->GetAmbient());
GetProperty()->SetDiffuse(myProperty->GetDiffuse());
GetProperty()->SetSpecular(myProperty->GetSpecular());
myGeomFilter->SetInside(false);
break;
case Surface :
+ case SurfaceWithEdges :
GetProperty()->SetRepresentation(VTK_SURFACE);
myGeomFilter->SetWireframeMode(false);
myGeomFilter->SetInside(false);
break;
}
+ SetMarkerEnabled( theMode == Points );
+
myRepresentation = theMode;
}
/*!
\return current representation mode
*/
-SVTK::Representation::Type
+VTKViewer::Representation::Type
SVTK_DeviceActor
::GetRepresentation()
{
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ myPolygonOffsetUnits);
Superclass::Render(ren,m);
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
void
SVTK_DeviceActor
::SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units)
+ vtkFloatingPointType units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
void
SVTK_DeviceActor
::GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units)
+ vtkFloatingPointType& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
}
-vtkDataSetMapper* SVTK_DeviceActor::GetDataSetMapper()
+VTKViewer_DataSetMapper* SVTK_DeviceActor::GetDataSetMapper()
{
return myMapper;
}
+
+/*!
+ * On/Off representation 2D quadratic element as arked polygon
+ */
+void SVTK_DeviceActor::SetQuadraticArcMode(bool theFlag){
+ myGeomFilter->SetQuadraticArcMode(theFlag);
+}
+
+/*!
+ * Return true if 2D quadratic element displayed as arked polygon
+ */
+bool SVTK_DeviceActor::GetQuadraticArcMode(){
+ return myGeomFilter->GetQuadraticArcMode();
+}
+/*!
+ * Set Max angle for representation 2D quadratic element as arked polygon
+ */
+void SVTK_DeviceActor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
+ myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
+}
+
+/*!
+ * Return Max angle of the representation 2D quadratic element as arked polygon
+ */
+vtkFloatingPointType SVTK_DeviceActor::GetQuadraticArcAngle(){
+ return myGeomFilter->GetQuadraticArcAngle();
+}
+
+/*!
+ * Set point marker enabled
+ * \param theMarkerEnabled flag to enable/disable point marker
+ */
+void SVTK_DeviceActor::SetMarkerEnabled( bool theMarkerEnabled )
+{
+ myMapper->SetMarkerEnabled( theMarkerEnabled );
+}
+
+/*!
+ * Set standard point marker
+ * \param theMarkerType type of the marker
+ * \param theMarkerScale scale of the marker
+ */
+void SVTK_DeviceActor::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
+{
+ myMapper->SetMarkerStd( theMarkerType, theMarkerScale );
+}
+
+/*!
+ * Set custom point marker
+ * \param theMarkerId id of the marker texture
+ * \param theMarkerTexture marker texture
+ */
+void SVTK_DeviceActor::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
+{
+ myMapper->SetMarkerTexture( theMarkerId, theMarkerTexture );
+}
+
+/*!
+ * Get type of the point marker
+ * \return type of the point marker
+ */
+VTK::MarkerType SVTK_DeviceActor::GetMarkerType()
+{
+ return myMapper->GetMarkerType();
+}
+
+/*!
+ Get scale of the point marker
+ \return scale of the point marker
+*/
+VTK::MarkerScale SVTK_DeviceActor::GetMarkerScale()
+{
+ return myMapper->GetMarkerScale();
+}
+
+/*!
+ * Get texture identifier of the point marker
+ * \return texture identifier of the point marker
+ */
+int SVTK_DeviceActor::GetMarkerTexture()
+{
+ return myMapper->GetMarkerTexture();
+}
+
+void SVTK_DeviceActor::SetCoincident3DAllowed(bool theFlag) {
+ myGeomFilter->SetAppendCoincident3D(theFlag);
+}
+
+bool SVTK_DeviceActor::IsCoincident3DAllowed() const {
+ return myGeomFilter->GetAppendCoincident3D();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SVTK OBJECT : interactive object for SVTK visualization
// File : SVTK_DeviceActor.h
// Author :
-// Module :
-// $Header$
-//
+
#ifndef SVTK_DEVICE_ACTOR_H
#define SVTK_DEVICE_ACTOR_H
#include "SVTK.h"
#include "VTKViewer.h"
+#include "VTKViewer_Actor.h"
+#include "VTKViewer_MarkerDef.h"
#include <vector>
class vtkDataSet;
class vtkShrinkFilter;
class vtkFeatureEdges;
-class vtkDataSetMapper;
+class VTKViewer_DataSetMapper;
class vtkPassThroughFilter;
-namespace SVTK
-{
- namespace Representation
- {
- typedef int Type;
- const Type Points = VTK_POINTS;
- const Type Wireframe = VTK_WIREFRAME;
- const Type Surface = VTK_SURFACE;
- const Type Insideframe = Surface + 1;
- }
-}
-
#ifdef WIN32
#pragma warning ( disable:4251 )
#endif
virtual
void
GetFeatureEdgesFlags(bool& theIsFeatureEdges,
- bool& theIsBoundaryEdges,
- bool& theIsManifoldEdges,
- bool& theIsNonManifoldEdges);
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges);
virtual
void
SetFeatureEdgesFlags(bool theIsFeatureEdges,
- bool theIsBoundaryEdges,
- bool theIsManifoldEdges,
- bool theIsNonManifoldEdges);
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
virtual
bool
/** @name For representation mamnagement purpose */
virtual
void
- SetRepresentation(SVTK::Representation::Type theMode);
+ SetRepresentation(VTKViewer::Representation::Type theMode);
- SVTK::Representation::Type
+ VTKViewer::Representation::Type
GetRepresentation();
virtual
SetShaded(bool theShaded);
//@}
+ /** @name For marker management purpose */
+ void
+ SetMarkerEnabled( bool );
+
+ void
+ SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+
+ void
+ SetMarkerTexture( int, VTK::MarkerTexture );
+
+ VTK::MarkerType
+ GetMarkerType();
+
+ VTK::MarkerScale
+ GetMarkerScale();
+
+ int
+ GetMarkerTexture();
+ //@}
+
virtual
void
Render(vtkRenderer *, vtkMapper *);
- vtkDataSetMapper* GetDataSetMapper();
+ VTKViewer_DataSetMapper* GetDataSetMapper();
+
+ //----------------------------------------------------------------------------
+ //! Setting for displaying quadratic elements
+ virtual void SetQuadraticArcMode(bool theFlag);
+ virtual bool GetQuadraticArcMode();
+
+ virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
+ virtual vtkFloatingPointType GetQuadraticArcAngle();
+
+ virtual
+ void
+ SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
+
+ virtual
+ bool
+ IsCoincident3DAllowed() const;
+
protected:
- SVTK::Representation::Type myRepresentation;
+ VTKViewer::Representation::Type myRepresentation;
vtkProperty *myProperty;
bool myIsShaded;
std::vector<vtkPassThroughFilter*> myPassFilter;
vtkShrinkFilter* myShrinkFilter;
vtkFeatureEdges* myFeatureEdges;
- vtkDataSetMapper* myMapper;
+ VTKViewer_DataSetMapper* myMapper;
bool myIsShrinkable;
bool myIsShrunk;
vtkFloatingPointType myPolygonOffsetUnits;
void SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units);
+ vtkFloatingPointType units);
void GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units);
+ vtkFloatingPointType& units);
SVTK_DeviceActor();
~SVTK_DeviceActor();
+++ /dev/null
-// Copyright (C) 2007-2008 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 VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module : SALOME
-// $Header$
-//
-#include "SVTK_DialogBase.h"
-
-#include "QtxAction.h"
-
-/*!
- Constructor
-*/
-SVTK_DialogBase
-::SVTK_DialogBase(QtxAction* theAction,
- QWidget* theParent,
- const char* theName,
- bool theModal,
- Qt::WindowFlags theWFalgs):
- QDialog(theParent,
- theWFalgs | Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- myAction(theAction)
-{
- setObjectName(theName);
- setModal(theModal);
-
- connect(theParent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
- connect(theParent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-SVTK_DialogBase
-::~SVTK_DialogBase()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-void
-SVTK_DialogBase
-::onParentShow()
-{
- if(myAction->isChecked())
- show();
- else
- hide();
-}
-
-void
-SVTK_DialogBase
-::onParentHide()
-{
- hide();
-}
-
-void
-SVTK_DialogBase
-::done( int r )
-{
- myAction->setChecked( false );
- QDialog::done( r );
-}
+++ /dev/null
-// Copyright (C) 2007-2008 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 VTKViewer : build VTK viewer into Salome desktop
-// File :
-// Author :
-// Module : SALOME
-// $Header$
-//
-#ifndef SVTK_DIALOGBASE_H
-#define SVTK_DIALOGBASE_H
-
-#include "SVTK.h"
-
-#include <QDialog>
-
-class QtxAction;
-
-class SVTK_EXPORT SVTK_DialogBase : public QDialog
-{
- Q_OBJECT;
-
-public:
- SVTK_DialogBase(QtxAction* theAction,
- QWidget* theParent,
- const char* theName = "",
- bool theModal = FALSE,
- Qt::WindowFlags theWFalgs = 0);
-
- ~SVTK_DialogBase();
-
-protected slots:
- void onParentShow();
- void onParentHide();
- virtual void done( int );
-
-protected:
- QtxAction* myAction;
-};
-
-#endif // SVTK_DIALOGBASE_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author : Alexander SLADKOV
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_Event_h
#define SVTK_Event_h
SetFocalPointSelected,
StartFocalPointSelection,
FocalPointChanged,
+
+ OperationFinished, // rnv: invoked then SpinXY, RotateXY, DollyXY or PanXY operation is finished.
LastEvent
};
+++ /dev/null
-// Copyright (C) 2007-2008 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 VTKViewer : build VTK viewer into Salome desktop
-// File : SVTK_Extension.cxx
-// Author : Sergey ANIKIN
-// Module : SALOME
-//
-#include "SVTK_Extension.h"
-
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#endif
-
-void* SVTK::getOpenGLExtension( const char* theExtension )
-{
-#ifdef WIN32
- return wglGetProcAddress( theExtension );
-#else
- void* OpenGLLibrary = dlopen( "libGL.so", RTLD_LAZY );
- return dlsym( OpenGLLibrary, theExtension );
-#endif
-}
+++ /dev/null
-// Copyright (C) 2007-2008 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 SVTK_Extension_H
-#define SVTK_Extension_H
-
-/*!
- \file SVTK_Extension.h
- Functions of loading OpenGL extensions.
-*/
-
-#include "SVTK.h"
-
-namespace SVTK
-{
- SVTK_EXPORT void* getOpenGLExtension( const char* theExtension );
-}
-
-
-#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI for SMESH component
// File :
// Author : Sergey LITONIN
//
#include "SVTK_FontWidget.h"
-#include <QToolButton>
#include <QComboBox>
-#include <QColorDialog>
-#include <QCheckBox>
-#include <QHBoxLayout>
#include <vtkTextProperty.h>
Constructor
*/
SVTK_FontWidget::SVTK_FontWidget( QWidget* theParent )
-: QWidget( theParent )
+: ViewerTools_FontWidgetBase( theParent )
{
- myColorBtn = new QToolButton( this );
- myColorBtn->setMinimumWidth( 20 );
-
- myFamily = new QComboBox( this );
- myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
- myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
- myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
-
- myBold = new QCheckBox( tr( "BOLD" ), this );
- myItalic = new QCheckBox( tr( "ITALIC" ), this );
- myShadow = new QCheckBox( tr( "SHADOW" ), this );
-
- QHBoxLayout* aHBLayout = new QHBoxLayout;
- aHBLayout->setSpacing( 5 );
- aHBLayout->addWidget(myColorBtn);
- aHBLayout->addWidget(myFamily);
- aHBLayout->addWidget(myBold);
- aHBLayout->addWidget(myItalic);
- aHBLayout->addWidget(myShadow);
- this->setLayout(aHBLayout);
-
- connect( myColorBtn, SIGNAL( clicked() ), SLOT( onColor() ) );
}
/*!
{
}
-void SVTK_FontWidget::SetColor( const QColor& theColor )
+void SVTK_FontWidget::InitializeFamilies()
{
- QPalette palette;
- palette.setColor(myColorBtn->backgroundRole(), theColor);
- myColorBtn->setPalette(palette);
-}
-
-QColor SVTK_FontWidget::GetColor() const
-{
- return myColorBtn->palette().color( myColorBtn->backgroundRole() );
-}
-
-void SVTK_FontWidget::onColor()
-{
- QColor aColor = QColorDialog::getColor( GetColor(), this );
- if ( aColor.isValid() )
- SetColor( aColor );
+ myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
+ myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
+ myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
}
void SVTK_FontWidget::SetData( const QColor& theColor,
- const int theFamily,
- const bool theBold,
- const bool theItalic,
- const bool theShadow )
+ const int theFamily,
+ const bool theBold,
+ const bool theItalic,
+ const bool theShadow )
{
- SetColor( theColor );
+ ViewerTools_FontWidgetBase::SetData( theColor,
+ theFamily,
+ theBold,
+ theItalic,
+ theShadow );
if ( theFamily == VTK_ARIAL )
myFamily->setCurrentIndex( 0 );
myFamily->setCurrentIndex( 1 );
else
myFamily->setCurrentIndex( 2 );
-
- myBold->setChecked( theBold );
- myItalic->setChecked( theItalic );
- myShadow->setChecked( theShadow );
}
void SVTK_FontWidget::GetData( QColor& theColor,
- int& theFamily,
- bool& theBold,
- bool& theItalic,
- bool& theShadow ) const
+ int& theFamily,
+ bool& theBold,
+ bool& theItalic,
+ bool& theShadow ) const
{
- theColor = GetColor();
+ ViewerTools_FontWidgetBase::GetData( theColor,
+ theFamily,
+ theBold,
+ theItalic,
+ theShadow );
- int anItem =myFamily->currentIndex();
+ int anItem = myFamily->currentIndex();
if ( anItem == 0 )
theFamily = VTK_ARIAL;
else if ( anItem == 1 )
theFamily = VTK_COURIER;
else
theFamily = VTK_TIMES;
-
- theBold = myBold->isChecked();
- theItalic = myItalic->isChecked();
- theShadow = myShadow->isChecked();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File :
// Author : Sergey LITONIN
// Module :
#include "SVTK.h"
-#include <QWidget>
-
-class QToolButton;
-class QComboBox;
-class QCheckBox;
-class QColor;
-
+#include <ViewerTools_FontWidgetBase.h>
/*!
* Class : SVTK_FontWidget
* Description : Dialog for specifynig font
*/
-class SVTK_EXPORT SVTK_FontWidget : public QWidget
+class SVTK_EXPORT SVTK_FontWidget : public ViewerTools_FontWidgetBase
{
Q_OBJECT
SVTK_FontWidget( QWidget* );
virtual ~SVTK_FontWidget();
- void SetColor( const QColor& );
- QColor GetColor() const;
-
- void SetData( const QColor&, const int, const bool, const bool, const bool );
-
- void GetData( QColor&, int&, bool&, bool&, bool& ) const;
+ virtual void SetData( const QColor&, const int, const bool, const bool, const bool );
-private slots:
- void onColor();
+ virtual void GetData( QColor&, int&, bool&, bool&, bool& ) const;
-private:
- QToolButton* myColorBtn;
- QComboBox* myFamily;
- QCheckBox* myBold;
- QCheckBox* myItalic;
- QCheckBox* myShadow;
+protected:
+ virtual void InitializeFamilies();
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_Functor_H
#define SVTK_Functor_H
#include <VTKViewer_Functor.h>
-#include "SALOME_InteractiveObject.hxx"
-
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
/*!
\file SVTK_Functor.h
This file contains numbers of functors that allows user to perform corresponding operations with existing presentations.
{
if ( theActor->hasIO() )
{
- Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
- if ( anIO->hasEntry() )
- return myEntry == anIO->getEntry();
+ Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
+ if ( anIO->hasEntry() )
+ return myEntry == anIO->getEntry();
}
return false;
}
{
if(theActor->hasIO())
{
- Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
- return myIObject->isSame(anIO);
+ Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
+ return myIObject->isSame(anIO);
}
return false;
}
void operator()(TActor* theActor)
{
if(theActor->GetVisibility() && theActor->GetMapper())
- theActor->highlight( myIsHighlight );
+ theActor->highlight( myIsHighlight );
}
};
+
+ //----------------------------------------------------------------
+ /*!
+ This collect visible IO in list
+ */
+ template<class TActor>
+ struct TCollectIfVisible
+ {
+ SALOME_ListIO& myList;
+ //! To construct the functor
+ TCollectIfVisible (SALOME_ListIO& theList) : myList(theList)
+ {}
+ //! To calculate the functor
+ void operator()(TActor* theActor)
+ {
+ if(theActor->GetVisibility() && theActor->hasIO())
+ myList.Append( theActor->getIO() );
+ }
+ };
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_GenericRenderWindowInteractor.h"
#include "SVTK_Selector.h"
#include <QTimer>
-using namespace std;
-
vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor);
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_GenericRenderWindowInteractor_h
#define SVTK_GenericRenderWindowInteractor_h
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_ImageWriter.h"
#include <QSemaphore>
//----------------------------------------------------------------------------
SVTK_ImageWriter
::SVTK_ImageWriter(QSemaphore* theSemaphore,
- vtkImageData* theImageData,
- const std::string& theName,
- int theProgressive,
- int theQuality):
+ vtkImageData* theImageData,
+ const std::string& theName,
+ int theProgressive,
+ int theQuality):
mySemaphore(theSemaphore),
myImageData(theImageData),
myName(theName),
myImageData->Delete();
if(MYDEBUG) cout<<"SVTK_ImageWriter::run "<<
- "- this = "<<this<<
- //"; total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available()<<endl;
+ "- this = "<<this<<
+ //"; total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available()<<endl;
mySemaphore->release();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_IMAGEWRITER_H
#define SVTK_IMAGEWRITER_H
{
public:
SVTK_ImageWriter(QSemaphore* theSemaphore,
- vtkImageData* theImageData,
- const std::string& theName,
- int theProgressive,
- int theQuality);
+ vtkImageData* theImageData,
+ const std::string& theName,
+ int theProgressive,
+ int theQuality);
~SVTK_ImageWriter();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_ImageWriterMgr.h"
#include "SVTK_ImageWriter.h"
mySemaphore = new QSemaphore(aMax);
mySemaphore->acquire( aMax );
if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::SVTK_ImageWriterMgr "<<
- //"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available()<<endl;
+ //"- total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available()<<endl;
}
void
SVTK_ImageWriterMgr
::StartImageWriter(vtkImageData *theImageData,
- const std::string& theName,
- const int theProgressive,
- const int theQuality)
+ const std::string& theName,
+ const int theProgressive,
+ const int theQuality)
{
SVTK_ImageWriter *anImageWriter =
new SVTK_ImageWriter(mySemaphore,
- theImageData,
- theName,
- theProgressive,
- theQuality);
+ theImageData,
+ theName,
+ theProgressive,
+ theQuality);
myThreads.push_back(anImageWriter);
anImageWriter->start();
::Stop()
{
if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop "<<
- //"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available()<<endl;
+ //"- total = "<<mySemaphore->total()<<
+ "; available = "<<mySemaphore->available()<<endl;
if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
mySemaphore->acquire( myThreads.size() );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_IMAGEWRITERMGR_H
#define SVTK_IMAGEWRITERMGR_H
void
StartImageWriter(vtkImageData *theImageData,
- const std::string& theName,
- const int theProgressive,
- const int theQuality);
+ const std::string& theName,
+ const int theProgressive,
+ const int theQuality);
void
Stop();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_InteractorStyle.h"
+#include "VTKViewer_Algorithm.h"
#include "VTKViewer_Utilities.h"
#include "SVTK_GenericRenderWindowInteractor.h"
#include <algorithm>
#include <iostream>
-using namespace std;
-
namespace
{
inline void GetEventPosition(vtkRenderWindowInteractor* theInteractor,
- int& theX,
- int& theY)
+ int& theX,
+ int& theY)
{
theInteractor->GetEventPosition(theX,theY);
theY = theInteractor->GetSize()[1] - theY - 1;
myControllerIncrement(SVTK_ControllerIncrement::New()),
myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
myHighlightSelectionPointActor(SVTK_Actor::New()),
- myRectBand(0)
+ myRectBand(0),
+ myIsAdvancedZoomingEnabled(false)
{
myPointPicker->Delete();
double ryf = double(dy) * aDeltaElevation * this->MotionFactor;
vtkMatrix4x4* aMatrix = cam->GetViewTransformMatrix();
const double anAxis[3] = {-aMatrix->GetElement(0,0), // mkr : 27.11.2006 : PAL14011 - Strange behaviour in rotation in VTK Viewer.
- -aMatrix->GetElement(0,1),
- -aMatrix->GetElement(0,2)};
+ -aMatrix->GetElement(0,1),
+ -aMatrix->GetElement(0,2)};
aTransform->RotateWXYZ(ryf, anAxis);
GetCurrentRenderer()->ResetCameraClippingRange();
this->Render();
+ this->InvokeEvent(SVTK::OperationFinished,NULL);
}
void SVTK_InteractorStyle::PanXY(int x, int y, int oldX, int oldY)
{
TranslateView(x, y, oldX, oldY);
this->Render();
+ this->InvokeEvent(SVTK::OperationFinished,NULL);
}
void SVTK_InteractorStyle::DollyXY(int dx, int dy)
double zoomFactor = pow((double)1.1, dxf + dyf);
vtkCamera *aCam = GetCurrentRenderer()->GetActiveCamera();
- if (aCam->GetParallelProjection())
+ if (aCam->GetParallelProjection()) {
+ int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
+ if( IsAdvancedZoomingEnabled() ) { // zoom relatively to the cursor
+ int* aSize = GetCurrentRenderer()->GetRenderWindow()->GetSize();
+ int w = aSize[0];
+ int h = aSize[1];
+ x0 = w / 2;
+ y0 = h / 2;
+ x1 = myOtherPoint.x();
+ y1 = h - myOtherPoint.y();
+ TranslateView( x0, y0, x1, y1 );
+ }
aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
+ if( IsAdvancedZoomingEnabled() )
+ TranslateView( x1, y1, x0, y0 );
+ }
else{
aCam->Dolly(zoomFactor); // Move camera in/out along projection direction
GetCurrentRenderer()->ResetCameraClippingRange();
}
this->Render();
+ this->InvokeEvent(SVTK::OperationFinished,NULL);
}
void SVTK_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
return;
double newAngle = atan2((double)(y - GetCurrentRenderer()->GetCenter()[1]),
- (double)(x - GetCurrentRenderer()->GetCenter()[0]));
+ (double)(x - GetCurrentRenderer()->GetCenter()[0]));
double oldAngle = atan2((double)(oldY -GetCurrentRenderer()->GetCenter()[1]),
- (double)(oldX - GetCurrentRenderer()->GetCenter()[0]));
+ (double)(oldX - GetCurrentRenderer()->GetCenter()[0]));
newAngle *= this->RadianToDegree;
oldAngle *= this->RadianToDegree;
cam->OrthogonalizeViewUp();
this->Render();
+ this->InvokeEvent(SVTK::OperationFinished,NULL);
}
int x, y;
GetEventPosition( this->Interactor, x, y );
this->OnMouseMove( this->Interactor->GetControlKey(),
- this->Interactor->GetShiftKey(),
- x, y );
+ this->Interactor->GetShiftKey(),
+ x, y );
}
/*!
int x, y;
GetEventPosition( this->Interactor, x, y );
this->OnLeftButtonDown( this->Interactor->GetControlKey(),
- this->Interactor->GetShiftKey(),
- x, y );
+ this->Interactor->GetShiftKey(),
+ x, y );
}
/*!
int x, y;
GetEventPosition( this->Interactor, x, y );
this->OnLeftButtonUp( this->Interactor->GetControlKey(),
- this->Interactor->GetShiftKey(),
- x, y );
+ this->Interactor->GetShiftKey(),
+ x, y );
}
/*!
int x, y;
GetEventPosition( this->Interactor, x, y );
this->OnMiddleButtonDown( this->Interactor->GetControlKey(),
- this->Interactor->GetShiftKey(),
- x, y );
+ this->Interactor->GetShiftKey(),
+ x, y );
}
/*!
int x, y;
GetEventPosition( this->Interactor, x, y );
this->OnMiddleButtonUp( this->Interactor->GetControlKey(),
- this->Interactor->GetShiftKey(),
- x, y );
+ this->Interactor->GetShiftKey(),
+ x, y );
}
/*!
int x, y;
GetEventPosition( this->Interactor, x, y );
this->OnRightButtonDown( this->Interactor->GetControlKey(),
- this->Interactor->GetShiftKey(),
- x, y );
+ this->Interactor->GetShiftKey(),
+ x, y );
}
/*!
int x, y;
GetEventPosition( this->Interactor, x, y );
this->OnRightButtonUp( this->Interactor->GetControlKey(),
- this->Interactor->GetShiftKey(),
- x, y );
+ this->Interactor->GetShiftKey(),
+ x, y );
+}
+
+/*!
+ To handle mouse wheel forward event (reimplemented from #vtkInteractorStyle)
+*/
+void SVTK_InteractorStyle::OnMouseWheelForward()
+{
+ int x, y;
+ GetEventPosition( this->Interactor, x, y );
+ myOtherPoint = QPoint(x, y);
+}
+
+/*!
+ To handle mouse wheel backward event (reimplemented from #vtkInteractorStyle)
+*/
+void SVTK_InteractorStyle::OnMouseWheelBackward()
+{
+ int x, y;
+ GetEventPosition( this->Interactor, x, y );
+ myOtherPoint = QPoint(x, y);
}
/*!
To handle mouse move event
*/
void SVTK_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl),
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
myShiftState = shift;
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
To handle left mouse button down event (reimplemented from vtkInteractorStyle)
*/
void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift,
- int x, int y)
+ int x, int y)
{
this->FindPokedRenderer(x, y);
if(GetCurrentRenderer() == NULL)
if (ctrl)
startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
else if ( myCurrRotationPointType == SVTK::StartPointSelection ||
- myCurrFocalPointType == SVTK::StartFocalPointSelection )
+ myCurrFocalPointType == SVTK::StartFocalPointSelection )
{
SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
- SALOME_Actor* anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
+ bool isPicked = false;
+ vtkActorCollection* anActorCollection = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
- if ( anActor )
+ if( anActorCollection )
{
- myPointPicker->Pick( aSelectionEvent->myX,
- aSelectionEvent->myY,
- 0.0,
- GetCurrentRenderer() );
- int aVtkId = myPointPicker->GetPointId();
- if ( aVtkId >= 0 )
- {
- int anObjId = anActor->GetNodeObjId( aVtkId );
- vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId);
-
- if (myCurrRotationPointType == SVTK::StartPointSelection) {
- myCurrRotationPointType = SVTK::SetRotateSelected;
-
- // invoke event for update coordinates in SVTK_SetRotationPointDlg
- InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
- }
- else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
- myCurrFocalPointType = SVTK::SetFocalPointSelected;
-
- // invoke event for update coordinates in SVTK_ViewParameterDlg
- InvokeEvent(SVTK::FocalPointChanged,(void*)aCoords);
- }
- }
- else
- {
- if (myCurrRotationPointType == SVTK::StartPointSelection) {
- // invoke event with no data (for SVTK_SetRotationPointDlg)
- InvokeEvent(SVTK::RotationPointChanged,0);
- myCurrRotationPointType = myPrevRotationPointType;
- }
- else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
- // invoke event with no data (for SVTK_ViewParameterDlg)
- InvokeEvent(SVTK::FocalPointChanged,0);
- myCurrFocalPointType = myPrevFocalPointType;
- }
- }
+ anActorCollection->InitTraversal();
+ while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+ {
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+ {
+ SVTK::TPickLimiter aPickLimiter( myPointPicker, anActor );
+ myPointPicker->Pick( aSelectionEvent->myX,
+ aSelectionEvent->myY,
+ 0.0,
+ GetCurrentRenderer() );
+ int aVtkId = myPointPicker->GetPointId();
+ if ( aVtkId >= 0 )
+ {
+ int anObjId = anActor->GetNodeObjId( aVtkId );
+ vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId);
+
+ if (myCurrRotationPointType == SVTK::StartPointSelection) {
+ myCurrRotationPointType = SVTK::SetRotateSelected;
+
+ // invoke event for update coordinates in SVTK_SetRotationPointDlg
+ InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
+ }
+ else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+ myCurrFocalPointType = SVTK::SetFocalPointSelected;
+
+ // invoke event for update coordinates in SVTK_ViewParameterDlg
+ InvokeEvent(SVTK::FocalPointChanged,(void*)aCoords);
+ }
+
+ isPicked = true;
+ break;
+ }
+ }
+ }
}
- else
+
+ if( !isPicked )
{
- if (myCurrRotationPointType == SVTK::StartPointSelection) {
- // invoke event with no data (for SVTK_SetRotationPointDlg)
- InvokeEvent(SVTK::RotationPointChanged,0);
- myCurrRotationPointType = myPrevRotationPointType;
- }
- else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
- // invoke event with no data (for SVTK_ViewParameterDlg)
- InvokeEvent(SVTK::FocalPointChanged,0);
- myCurrFocalPointType = myPrevFocalPointType;
- }
+ if (myCurrRotationPointType == SVTK::StartPointSelection) {
+ // invoke event with no data (for SVTK_SetRotationPointDlg)
+ InvokeEvent(SVTK::RotationPointChanged,0);
+ myCurrRotationPointType = myPrevRotationPointType;
+ }
+ else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+ // invoke event with no data (for SVTK_ViewParameterDlg)
+ InvokeEvent(SVTK::FocalPointChanged,0);
+ myCurrFocalPointType = myPrevFocalPointType;
+ }
}
myHighlightSelectionPointActor->SetVisibility( false );
if(GetCurrentRenderer() != NULL)
- GetCurrentRenderer()->RemoveActor( myHighlightSelectionPointActor.GetPointer() );
+ GetCurrentRenderer()->RemoveActor( myHighlightSelectionPointActor.GetPointer() );
GetRenderWidget()->setCursor(myDefCursor);
}
To handle left mouse button up event (reimplemented from vtkInteractorStyle)
*/
void SVTK_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
*/
void SVTK_InteractorStyle::OnMiddleButtonDown(int ctrl,
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
this->FindPokedRenderer(x, y);
if(GetCurrentRenderer() == NULL)
To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
*/
void SVTK_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
To handle right mouse button down event (reimplemented from vtkInteractorStyle)
*/
void SVTK_InteractorStyle::OnRightButtonDown(int ctrl,
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
this->FindPokedRenderer(x, y);
if(GetCurrentRenderer() == NULL)
To handle right mouse button up event (reimplemented from vtkInteractorStyle)
*/
void SVTK_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
vtkFloatingPointType aColor[3];
GetCurrentRenderer()->GetBackground( aColor );
myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
- 1. - aColor[1],
- 1. - aColor[2]);
+ 1. - aColor[1],
+ 1. - aColor[2]);
}
setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
vtkFloatingPointType aColor[3];
GetCurrentRenderer()->GetBackground( aColor );
myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
- 1. - aColor[1],
- 1. - aColor[2]);
+ 1. - aColor[1],
+ 1. - aColor[2]);
}
setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
Fits viewer contents to rect
*/
void SVTK_InteractorStyle::fitRect(const int left,
- const int top,
- const int right,
- const int bottom)
+ const int top,
+ const int right,
+ const int bottom)
{
if (GetCurrentRenderer() == NULL)
return;
case VTK_INTERACTOR_STYLE_CAMERA_NONE:
default:
if ( myCurrRotationPointType == SVTK::StartPointSelection ||
- myCurrFocalPointType == SVTK::StartFocalPointSelection )
- GetRenderWidget()->setCursor(myHandCursor);
+ myCurrFocalPointType == SVTK::StartFocalPointSelection )
+ GetRenderWidget()->setCursor(myHandCursor);
else
- GetRenderWidget()->setCursor(myDefCursor);
+ GetRenderWidget()->setCursor(myDefCursor);
myCursorState = false;
break;
}
}
else {
if (myPoint == myOtherPoint)
- {
- // process point selection
- this->FindPokedRenderer(aSelectionEvent->myX, aSelectionEvent->myY);
- Interactor->StartPickCallback();
-
- SALOME_Actor* anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
-
- aSelectionEvent->myIsRectangle = false;
-
- if(!myShiftState)
- GetSelector()->ClearIObjects();
-
- if(anActor)
- {
- anActor->Highlight( this, aSelectionEvent, true );
- }
- else
- {
- if(myLastHighlitedActor.GetPointer() && myLastHighlitedActor.GetPointer() != anActor)
- myLastHighlitedActor->Highlight( this, aSelectionEvent, false );
- }
- myLastHighlitedActor = anActor;
- }
- else
- {
- //processing rectangle selection
- Interactor->StartPickCallback();
- GetSelector()->StartPickCallback();
- aSelectionEvent->myIsRectangle = true;
-
- if(!myShiftState)
- GetSelector()->ClearIObjects();
-
- vtkActorCollection* aListActors = GetCurrentRenderer()->GetActors();
- aListActors->InitTraversal();
- while(vtkActor* aActor = aListActors->GetNextActor())
- {
- if(aActor->GetVisibility())
- {
- if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
- {
- if(aSActor->hasIO())
- aSActor->Highlight( this, aSelectionEvent, true );
- }
- }
- }
- }
- Interactor->EndPickCallback();
- GetSelector()->EndPickCallback();
+ {
+ // process point selection
+ this->FindPokedRenderer(aSelectionEvent->myX, aSelectionEvent->myY);
+ Interactor->StartPickCallback();
+
+ SALOME_Actor* aHighlightedActor = NULL;
+ vtkActorCollection* anActorCollection = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
+
+ aSelectionEvent->myIsRectangle = false;
+
+ if(!myShiftState)
+ GetSelector()->ClearIObjects();
+
+ if( anActorCollection )
+ {
+ anActorCollection->InitTraversal();
+ while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+ {
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+ {
+ if( anActor->Highlight( this, aSelectionEvent, true ) )
+ {
+ aHighlightedActor = anActor;
+ break;
+ }
+ }
+ }
+ }
+
+ if( !aHighlightedActor )
+ {
+ if(myLastHighlitedActor.GetPointer() && myLastHighlitedActor.GetPointer() != aHighlightedActor)
+ myLastHighlitedActor->Highlight( this, aSelectionEvent, false );
+ }
+ myLastHighlitedActor = aHighlightedActor;
+ }
+ else
+ {
+ //processing rectangle selection
+ Interactor->StartPickCallback();
+ GetSelector()->StartPickCallback();
+ aSelectionEvent->myIsRectangle = true;
+
+ if(!myShiftState)
+ GetSelector()->ClearIObjects();
+
+ VTK::ActorCollectionCopy aCopy(GetCurrentRenderer()->GetActors());
+ vtkActorCollection* aListActors = aCopy.GetActors();
+ aListActors->InitTraversal();
+ while(vtkActor* aActor = aListActors->GetNextActor())
+ {
+ if(aActor->GetVisibility())
+ {
+ if(SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor))
+ {
+ if(aSActor->hasIO())
+ aSActor->Highlight( this, aSelectionEvent, true );
+ }
+ }
+ }
+ }
+ Interactor->EndPickCallback();
+ GetSelector()->EndPickCallback();
}
}
break;
bool anIsChanged = false;
- SALOME_Actor *anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
+ SALOME_Actor* aPreHighlightedActor = NULL;
+ vtkActorCollection* anActorCollection = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
if ( myCurrRotationPointType == SVTK::StartPointSelection ||
myCurrFocalPointType == SVTK::StartFocalPointSelection )
{
myHighlightSelectionPointActor->SetVisibility( false );
- if ( anActor )
+ if( anActorCollection )
{
- myPointPicker->Pick( aSelectionEvent->myX, aSelectionEvent->myY, 0.0, GetCurrentRenderer() );
- int aVtkId = myPointPicker->GetPointId();
- if ( aVtkId >= 0 ) {
- int anObjId = anActor->GetNodeObjId( aVtkId );
-
- TColStd_IndexedMapOfInteger aMapIndex;
- aMapIndex.Add( anObjId );
- myHighlightSelectionPointActor->MapPoints( anActor, aMapIndex );
-
- myHighlightSelectionPointActor->SetVisibility( true );
- anIsChanged = true;
+ anActorCollection->InitTraversal();
+ while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+ {
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+ {
+ SVTK::TPickLimiter aPickLimiter( myPointPicker, anActor );
+ myPointPicker->Pick( aSelectionEvent->myX, aSelectionEvent->myY, 0.0, GetCurrentRenderer() );
+ int aVtkId = myPointPicker->GetPointId();
+ if ( aVtkId >= 0 ) {
+ int anObjId = anActor->GetNodeObjId( aVtkId );
+
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aMapIndex.Add( anObjId );
+ myHighlightSelectionPointActor->MapPoints( anActor, aMapIndex );
+
+ myHighlightSelectionPointActor->SetVisibility( true );
+ anIsChanged = true;
+ break;
+ }
+ }
}
}
}
else {
- if (anActor){
- anIsChanged |= anActor->PreHighlight( this, aSelectionEvent, true );
+ if( anActorCollection )
+ {
+ anActorCollection->InitTraversal();
+ while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
+ {
+ if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) )
+ {
+ anIsChanged = anActor->PreHighlight( this, aSelectionEvent, true );
+ if( anActor->isPreselected() )
+ {
+ aPreHighlightedActor = anActor;
+ break;
+ }
+ }
+ }
}
- if(myLastPreHighlitedActor.GetPointer() && myLastPreHighlitedActor.GetPointer() != anActor)
+ if(myLastPreHighlitedActor.GetPointer() && myLastPreHighlitedActor.GetPointer() != aPreHighlightedActor)
anIsChanged |= myLastPreHighlitedActor->PreHighlight( this, aSelectionEvent, false );
}
- myLastPreHighlitedActor = anActor;
+ myLastPreHighlitedActor = aPreHighlightedActor;
if(anIsChanged)
this->Render();
*/
void SVTK_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY)
{
+ if (GetCurrentRenderer() == NULL)
+ return;
+
vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera();
double viewFocus[4], focalDepth, viewPoint[3];
vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3];
cam->GetFocalPoint(viewFocus);
this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
- viewFocus[2], viewFocus);
+ viewFocus[2], viewFocus);
focalDepth = viewFocus[2];
this->ComputeDisplayToWorld(double(toX), double(toY),
- focalDepth, newPickPoint);
+ focalDepth, newPickPoint);
this->ComputeDisplayToWorld(double(fromX),double(fromY),
- focalDepth, oldPickPoint);
+ focalDepth, oldPickPoint);
// camera motion is reversed
motionVector[0] = oldPickPoint[0] - newPickPoint[0];
cam->GetFocalPoint(viewFocus);
cam->GetPosition(viewPoint);
cam->SetFocalPoint(motionVector[0] + viewFocus[0],
- motionVector[1] + viewFocus[1],
- motionVector[2] + viewFocus[2]);
+ motionVector[1] + viewFocus[1],
+ motionVector[2] + viewFocus[2]);
cam->SetPosition(motionVector[0] + viewPoint[0],
- motionVector[1] + viewPoint[1],
- motionVector[2] + viewPoint[2]);
+ motionVector[1] + viewPoint[1],
+ motionVector[2] + viewPoint[2]);
}
void SVTK_InteractorStyle::IncrementalPan( const int incrX, const int incrY )
{
if ( !myBBFirstCheck )
{
- if ( fabs(aCurrBBCenter[0]-myBBCenter[0]) > 1e-38 ||
- fabs(aCurrBBCenter[1]-myBBCenter[1]) > 1e-38 ||
- fabs(aCurrBBCenter[2]-myBBCenter[2]) > 1e-38 ) {
- // bounding box was changed => send SVTK::RotationPointChanged event
- // invoke event for update coordinates in SVTK_SetRotationPointDlg
- InvokeEvent(SVTK::BBCenterChanged,(void*)aCurrBBCenter);
- for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
- }
+ if ( fabs(aCurrBBCenter[0]-myBBCenter[0]) > 1e-38 ||
+ fabs(aCurrBBCenter[1]-myBBCenter[1]) > 1e-38 ||
+ fabs(aCurrBBCenter[2]-myBBCenter[2]) > 1e-38 ) {
+ // bounding box was changed => send SVTK::RotationPointChanged event
+ // invoke event for update coordinates in SVTK_SetRotationPointDlg
+ InvokeEvent(SVTK::BBCenterChanged,(void*)aCurrBBCenter);
+ for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
+ }
}
else
{
- for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
- myBBFirstCheck = false;
+ for ( int i =0; i < 3; i++) myBBCenter[i] = aCurrBBCenter[i];
+ myBBFirstCheck = false;
}
}
}
Main process event method (reimplemented from #vtkInteractorStyle)
*/
void SVTK_InteractorStyle::ProcessEvents( vtkObject* object,
- unsigned long event,
- void* clientData,
- void* callData )
+ unsigned long event,
+ void* clientData,
+ void* callData )
{
if ( clientData ) {
vtkObject* anObject = reinterpret_cast<vtkObject*>( clientData );
if ( self ) {
switch ( event ) {
case SVTK::SpaceMouseMoveEvent :
- self->onSpaceMouseMove( (double*)callData );
- return;
+ self->onSpaceMouseMove( (double*)callData );
+ return;
case SVTK::SpaceMouseButtonEvent :
- self->onSpaceMouseButton( *((int*)callData) );
- return;
+ self->onSpaceMouseButton( *((int*)callData) );
+ return;
case SVTK::PanLeftEvent:
- self->IncrementalPan(-aSpeedIncrement, 0);
- return;
+ self->IncrementalPan(-aSpeedIncrement, 0);
+ return;
case SVTK::PanRightEvent:
- self->IncrementalPan(aSpeedIncrement, 0);
- return;
+ self->IncrementalPan(aSpeedIncrement, 0);
+ return;
case SVTK::PanUpEvent:
- self->IncrementalPan(0, aSpeedIncrement);
- return;
+ self->IncrementalPan(0, aSpeedIncrement);
+ return;
case SVTK::PanDownEvent:
- self->IncrementalPan(0, -aSpeedIncrement);
- return;
+ self->IncrementalPan(0, -aSpeedIncrement);
+ return;
case SVTK::ZoomInEvent:
- self->IncrementalZoom(aSpeedIncrement);
- return;
+ self->IncrementalZoom(aSpeedIncrement);
+ return;
case SVTK::ZoomOutEvent:
- self->IncrementalZoom(-aSpeedIncrement);
- return;
+ self->IncrementalZoom(-aSpeedIncrement);
+ return;
case SVTK::RotateLeftEvent:
- self->IncrementalRotate(-aSpeedIncrement, 0);
- return;
+ self->IncrementalRotate(-aSpeedIncrement, 0);
+ return;
case SVTK::RotateRightEvent:
- self->IncrementalRotate(aSpeedIncrement, 0);
- return;
+ self->IncrementalRotate(aSpeedIncrement, 0);
+ return;
case SVTK::RotateUpEvent:
- self->IncrementalRotate(0, -aSpeedIncrement);
- return;
+ self->IncrementalRotate(0, -aSpeedIncrement);
+ return;
case SVTK::RotateDownEvent:
- self->IncrementalRotate(0, aSpeedIncrement);
- return;
+ self->IncrementalRotate(0, aSpeedIncrement);
+ return;
case SVTK::PlusSpeedIncrementEvent:
- self->ControllerIncrement()->Increase();
- return;
+ self->ControllerIncrement()->Increase();
+ return;
case SVTK::MinusSpeedIncrementEvent:
- self->ControllerIncrement()->Decrease();
- return;
+ self->ControllerIncrement()->Decrease();
+ return;
case SVTK::SetSpeedIncrementEvent:
- self->ControllerIncrement()->SetStartValue(*((int*)callData));
- return;
+ self->ControllerIncrement()->SetStartValue(*((int*)callData));
+ return;
case SVTK::SetSMDecreaseSpeedEvent:
- self->mySMDecreaseSpeedBtn = *((int*)callData);
- return;
+ self->mySMDecreaseSpeedBtn = *((int*)callData);
+ return;
case SVTK::SetSMIncreaseSpeedEvent:
- self->mySMIncreaseSpeedBtn = *((int*)callData);
- return;
+ self->mySMIncreaseSpeedBtn = *((int*)callData);
+ return;
case SVTK::SetSMDominantCombinedSwitchEvent:
- self->mySMDominantCombinedSwitchBtn = *((int*)callData);
- return;
+ self->mySMDominantCombinedSwitchBtn = *((int*)callData);
+ return;
case SVTK::StartZoom:
- self->startZoom();
- return;
+ self->startZoom();
+ return;
case SVTK::StartPan:
- self->startPan();
- return;
+ self->startPan();
+ return;
case SVTK::StartRotate:
- self->startRotate();
- return;
+ self->startRotate();
+ return;
case SVTK::StartGlobalPan:
- self->startGlobalPan();
- return;
+ self->startGlobalPan();
+ return;
case SVTK::StartFitArea:
- self->startFitArea();
- return;
+ self->startFitArea();
+ return;
case SVTK::SetRotateGravity:
- if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
- {
- self->myHighlightSelectionPointActor->SetVisibility( false );
- if( self->GetCurrentRenderer() != NULL )
- self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
- self->GetRenderWidget()->setCursor(self->myDefCursor);
- }
- self->myPrevRotationPointType = self->myCurrRotationPointType;
- self->myCurrRotationPointType = SVTK::SetRotateGravity;
- if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) )
- // invoke event for update coordinates in SVTK_SetRotationPointDlg
- self->InvokeEvent(SVTK::BBCenterChanged,(void*)aCenter);
- return;
+ if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+ {
+ self->myHighlightSelectionPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
+ self->myPrevRotationPointType = self->myCurrRotationPointType;
+ self->myCurrRotationPointType = SVTK::SetRotateGravity;
+ if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) )
+ // invoke event for update coordinates in SVTK_SetRotationPointDlg
+ self->InvokeEvent(SVTK::BBCenterChanged,(void*)aCenter);
+ return;
case SVTK::StartPointSelection:
- self->startPointSelection();
- return;
+ self->startPointSelection();
+ return;
case SVTK::ChangeRotationPoint:
- if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
- {
- self->myHighlightSelectionPointActor->SetVisibility( false );
- if( self->GetCurrentRenderer() != NULL )
- self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
- self->GetRenderWidget()->setCursor(self->myDefCursor);
- }
- self->myPrevRotationPointType = self->myCurrRotationPointType;
- self->myCurrRotationPointType = SVTK::SetRotateSelected;
- aSelectedPoint = (vtkFloatingPointType*)callData;
- self->myRotationPointX = aSelectedPoint[0];
- self->myRotationPointY = aSelectedPoint[1];
- self->myRotationPointZ = aSelectedPoint[2];
- return;
+ if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+ {
+ self->myHighlightSelectionPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
+ self->myPrevRotationPointType = self->myCurrRotationPointType;
+ self->myCurrRotationPointType = SVTK::SetRotateSelected;
+ aSelectedPoint = (vtkFloatingPointType*)callData;
+ self->myRotationPointX = aSelectedPoint[0];
+ self->myRotationPointY = aSelectedPoint[1];
+ self->myRotationPointZ = aSelectedPoint[2];
+ return;
case SVTK::SetFocalPointGravity:
- if ( self->myCurrFocalPointType == SVTK::StartPointSelection )
- {
- self->myHighlightSelectionPointActor->SetVisibility( false );
- if( self->GetCurrentRenderer() != NULL )
- self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
- self->GetRenderWidget()->setCursor(self->myDefCursor);
- }
- self->myCurrFocalPointType = SVTK::SetFocalPointGravity;
- if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) {
- // invoke event for update coordinates in SVTK_ViewParameterDlg
- self->InvokeEvent(SVTK::FocalPointChanged,(void*)aCenter);
- }
- return;
+ if ( self->myCurrFocalPointType == SVTK::StartPointSelection )
+ {
+ self->myHighlightSelectionPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
+ self->myCurrFocalPointType = SVTK::SetFocalPointGravity;
+ if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) {
+ // invoke event for update coordinates in SVTK_ViewParameterDlg
+ self->InvokeEvent(SVTK::FocalPointChanged,(void*)aCenter);
+ }
+ return;
case SVTK::StartFocalPointSelection:
- self->startFocalPointSelection();
- return;
+ self->startFocalPointSelection();
+ return;
case SVTK::SetFocalPointSelected:
- if ( self->myCurrFocalPointType == SVTK::StartFocalPointSelection )
- {
- self->myHighlightSelectionPointActor->SetVisibility( false );
- if( self->GetCurrentRenderer() != NULL )
- self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
- self->GetRenderWidget()->setCursor(self->myDefCursor);
- }
- self->myPrevFocalPointType = self->myCurrFocalPointType;
- self->myCurrFocalPointType = SVTK::SetFocalPointSelected;
- return;
+ if ( self->myCurrFocalPointType == SVTK::StartFocalPointSelection )
+ {
+ self->myHighlightSelectionPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
+ self->myPrevFocalPointType = self->myCurrFocalPointType;
+ self->myCurrFocalPointType = SVTK::SetFocalPointSelected;
+ return;
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_InteractorStyle.h
// Author : Christophe ATTANASIO
-// Module : SALOME
-// $Header$
-//
+
#ifndef __SVTK_InteractorStyle_h
#define __SVTK_InteractorStyle_h
};
class vtkPointPicker;
+class vtkTDxInteractorStyle;
class SALOME_Actor;
typedef boost::shared_ptr<SVTK_SelectionEvent> PSelectionEvent;
-
+ void SetTDxStyle(vtkTDxInteractorStyle*){}
//! Generate special #SVTK_SelectionEvent
virtual SVTK_SelectionEvent* GetSelectionEvent();
//! To handle right mouse button up event (reimplemented from #vtkInteractorStyle)
virtual void OnRightButtonUp();
+ //! To handle mouse wheel forward event (reimplemented from #vtkInteractorStyle)
+ virtual void OnMouseWheelForward();
+
+ //! To handle mouse wheel backward event (reimplemented from #vtkInteractorStyle)
+ virtual void OnMouseWheelBackward();
+
//! To handle keyboard event (reimplemented from #vtkInteractorStyle)
virtual void OnChar();
int CurrentState() const { return State; }
+ void SetAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
+ bool IsAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
+
protected:
SVTK_InteractorStyle();
~SVTK_InteractorStyle();
static
void
ProcessEvents(vtkObject* object,
- unsigned long event,
- void* clientData,
- void* callData );
+ unsigned long event,
+ void* clientData,
+ void* callData );
float MotionFactor;
float RadianToDegree; // constant: for conv from deg to rad
bool myBBFirstCheck;
QRubberBand* myRectBand; //!< selection rectangle rubber band
+
+ bool myIsAdvancedZoomingEnabled;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_KeyFreeInteractorStyle.cxx
// Author : Christophe ATTANASIO
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_KeyFreeInteractorStyle.h"
#include "SVTK_Selector.h"
//----------------------------------------------------------------------------
void SVTK_KeyFreeInteractorStyle::OnLeftButtonDown(int ctrl, int shift,
- int x, int y)
+ int x, int y)
{
myIsLeftButtonDown = true;
else {
if (!(ctrl||shift)){
if (myIsMidButtonDown){
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
}
else{
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE);
}
}
}
//----------------------------------------------------------------------------
void SVTK_KeyFreeInteractorStyle::OnMiddleButtonDown(int ctrl,
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
myIsMidButtonDown = true;
else {
if (!(ctrl||shift)){
if ( myIsLeftButtonDown ){
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
}
else{
- startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
+ startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN);
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_KeyFreeInteractorStyle.h
// Author : Christophe ATTANASIO
-// Module : SALOME
-// $Header$
-//
+
#ifndef __SVTK_KeyFreeInteractorStyle_h
#define __SVTK_KeyFreeInteractorStyle_h
-
#include "SVTK.h"
#include "SVTK_InteractorStyle.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_NonIsometricDlg.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_Renderer.h"
#include <QPushButton>
#include <QGridLayout>
-using namespace std;
-
/*!
Constructor
*/
SVTK_NonIsometricDlg
::SVTK_NonIsometricDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName):
- SVTK_DialogBase(theAction,
- theParent,
- theName),
+ SVTK_ViewWindow* theParent,
+ const char* theName):
+ ViewerTools_DialogBase(theAction,
+ theParent,
+ theName),
m_MainWindow(theParent)
{
setWindowTitle(tr("DLG_TITLE"));
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_NONISOMETRICDLG_H
#define SVTK_NONISOMETRICDLG_H
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
class SVTK_ViewWindow;
class QPushButton;
-class SVTK_NonIsometricDlg : public SVTK_DialogBase
+class SVTK_NonIsometricDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
public:
SVTK_NonIsometricDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName);
+ SVTK_ViewWindow* theParent,
+ const char* theName);
~SVTK_NonIsometricDlg();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_Prs.cxx
// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_Prs.h"
#include <vtkActorCollection.h>
-using namespace std;
-
/*!
Default constructor
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_Prs.h
// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_Prs_H
#define SVTK_Prs_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_Recorder.h"
#include "SVTK_ImageWriter.h"
inline
void
GetNameJPEG(const std::string& thePreffix,
- const int theIndex,
- std::string& theName)
+ const int theIndex,
+ std::string& theName)
{
- using namespace std;
- ostringstream aStream;
+ std::ostringstream aStream;
aStream<<thePreffix<<"_"<<setw(6)<<setfill('0')<<theIndex<<".jpeg";
theName = aStream.str();
}
::CheckExistAVIMaker()
{
myErrorStatus = 0;
- using namespace std;
- ostringstream aStream;
- aStream<<"which "<<myNameAVIMaker<<" >& /dev/null";
+ std::ostringstream aStream;
+#ifndef WIN32
+ aStream<<"which "<<myNameAVIMaker<<" 2> /dev/null";
+#else
+ aStream<<"setlocal & set P2=.;%PATH% & (for %e in (%PATHEXT%) do @for %i in ("<<myNameAVIMaker<<"%e) do @if NOT \"%~$P2:i\"==\"\" exit /b 0) & exit /b 1";
+#endif
std::string anAVIMakeCheck = aStream.str();
int iErr = system(anAVIMakeCheck.c_str());
if(iErr != 0)
void
SVTK_Recorder
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
if(vtkObject* anObj = reinterpret_cast<vtkObject*>(theClientData)){
if(SVTK_Recorder* aSelf = dynamic_cast<SVTK_Recorder*>(anObj)){
if(theEvent==vtkCommand::EndEvent){
- if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){
- aSelf->DoRecord();
- }
+ if(aSelf->State() == SVTK_Recorder::SVTK_Recorder_Record){
+ aSelf->DoRecord();
+ }
}
}
}
inline
int
GetFrameIndex(double theStartTime,
- double theFPS)
+ double theFPS)
{
- double aTimeNow = vtkTimerLog::GetCurrentTime();
+ double aTimeNow = vtkTimerLog::GetUniversalTime();
double aDelta = aTimeNow - theStartTime;
return int(aDelta*theFPS);
}
if(myFrameIndex < 0){
myFrameIndex = 0;
- myTimeStart = vtkTimerLog::GetCurrentTime();
+ myTimeStart = vtkTimerLog::GetUniversalTime();
}else{
int aFrameIndex = GetFrameIndex(myTimeStart,myNbFPS);
if(aFrameIndex <= myFrameIndex)
myFrameIndexes.back() = abs(myFrameIndexes.back());
double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
if(MYDEBUG)
- cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
- "; aPauseTime = "<<aPauseTime<<endl;
+ cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+ "; aPauseTime = "<<aPauseTime<<endl;
myTimeStart += aPauseTime;
}
anImageData->UpdateInformation();
int *anExtent = anImageData->GetWholeExtent();
anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
- anExtent[2], anExtent[3],
- 0,0);
+ anExtent[2], anExtent[3],
+ 0,0);
anImageData->UpdateData();
}
myNbWrittenFrames++;
std::string anCurrentName;
GetNameJPEG(myName,anIndex,anCurrentName);
+ #ifndef WIN32
aStream<<"ln -s "<< anInitialName<<" "<<anCurrentName<<";";
+ #else
+ aStream<<"COPY /Y "<<QString::fromStdString(anInitialName).replace("/","\\\\").toStdString()<<
+ " "<<QString::fromStdString(anCurrentName).replace("/","\\\\").toStdString()<<" > NUL";
+ #endif
if(anIndex + 1 < aFinishIndex)
- aStream<<" \\";
- aStream<<endl;
+ #ifndef WIN32
+ aStream<<" \\";
+ aStream<<endl;
+ #else
+ aStream<<" & ";
+ #endif
}
std::string aString(aStream.str());
system(aString.c_str());
//" -f "<<int(myNbFPS)<<" "<<
" -f "<<myNbFPS<<" "<<
" -n "<<myNbWrittenFrames<<" "<<
- " -j "<<myName<<"_\%06d.jpeg "<<
- "| yuv2lav"<<
- " -o "<<myName;
-
+ " -j \""<<myName<<"_\%06d.jpeg\" "<<
+ "| yuv2lav"<<" -o \""<<myName<<"\"";
+#ifdef WIN32
+ aStream<<" -f aA";
+#endif
std::string aString(aStream.str());
myErrorStatus = system(aString.c_str());
QFileInfo aFileInfo(myName.c_str());
QString aDirPath = aFileInfo.absoluteDir().path();
QString aBaseName = aFileInfo.fileName();
- QString aCommand =
- QString("(cd ") + aDirPath +
+ QString aCommand;
+#ifndef WIN32
+ aCommand = QString("(cd ") + aDirPath +
"; ls " +
" | egrep '" + aBaseName + "_[0-9]*.jpeg'" +
" | xargs rm " +
")";
+#else
+ QString tmpFile = QString("_") + aBaseName + "_tempfile";
+ QString diskName = aDirPath.split("/")[0];
+ aCommand = diskName + " && (cd " + aDirPath.replace("/","\\\\") +
+ " && ((dir /b | findstr " + aBaseName + "_[0-9]*.jpeg > " + tmpFile +
+ ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
+#endif
if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<<endl;
system((const char*)aCommand.toLatin1());
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_RECORDER_H
#define SVTK_RECORDER_H
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
protected :
int myState;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_RecorderDlg.h"
#include "SVTK_Recorder.h"
if (app)
app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
}
*/
}
aFilter.append( tr( "FLT_ALL_FILES" ) );
QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter,
- tr( "FILE_NAME" ), false );
+ tr( "FILE_NAME" ), false );
if( aFileName.isNull() )
return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_RECORDERDLG_H
#define SVTK_RECORDERDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_RectPicker.cxx
// Author :
inline
int
Check(float* theZPtr,
- int theSelection[4],
- vtkFloatingPointType theTolerance,
- vtkFloatingPointType theDZ,
- int theDX,
- int theDY)
+ int theSelection[4],
+ vtkFloatingPointType theTolerance,
+ vtkFloatingPointType theDZ,
+ int theDX,
+ int theDY)
{
int aRet = 0;
vtkFloatingPointType aZ = -1.0;
// the selection window.
aZ = GetZ(theZPtr,theSelection,theDX,theDY);
if(aZ > theTolerance && aZ < 1.0 - theTolerance){
- aRet = fabs(aZ - theDZ) <= theTolerance;
+ aRet = fabs(aZ - theDZ) <= theTolerance;
}
}
//----------------------------------------------------------------------------
void
SelectVisiblePoints(int theSelection[4],
- vtkRenderer *theRenderer,
- vtkDataSet *theInput,
- SVTK_RectPicker::TVectorIds& theVisibleIds,
- SVTK_RectPicker::TVectorIds& theInVisibleIds,
- vtkFloatingPointType theTolerance)
+ vtkRenderer *theRenderer,
+ vtkDataSet *theInput,
+ SVTK_RectPicker::TVectorIds& theVisibleIds,
+ SVTK_RectPicker::TVectorIds& theInVisibleIds,
+ vtkFloatingPointType theTolerance)
{
theVisibleIds.clear();
theInVisibleIds.clear();
// and handle the transformation ourselves.
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
aMatrix->DeepCopy( theRenderer->GetActiveCamera()->
- GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
+ GetCompositeProjectionTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
// We grab the z-buffer for the selection region all at once and probe the resulting array.
float *aZPtr = theRenderer->GetRenderWindow()->
for(int iY = theSelection[1]; iY <= theSelection[3]; iY++){
//cout<<iY<<"\t";
for(int iX = theSelection[0]; iX <= theSelection[2]; iX++){
- //cout<<std::setprecision(4)<<GetZ(aZPtr,theSelection,iX,iY)<<"\t";
+ //cout<<std::setprecision(4)<<GetZ(aZPtr,theSelection,iX,iY)<<"\t";
}
//cout<<endl;
}
vtkFloatingPointType aView[4];
aMatrix->MultiplyPoint(aX,aView);
if(aView[3] == 0.0)
- continue;
+ continue;
theRenderer->SetViewPoint(aView[0]/aView[3],
- aView[1]/aView[3],
- aView[2]/aView[3]);
+ aView[1]/aView[3],
+ aView[2]/aView[3]);
theRenderer->ViewToDisplay();
vtkFloatingPointType aDX[3];
if(aDX[0] >= theSelection[0] && aDX[0] <= theSelection[2] &&
aDX[1] >= theSelection[1] && aDX[1] <= theSelection[3])
{
- //cout<<"aPntId "<<aPntId<<"; aDX = {"<<aDX[0]<<", "<<aDX[1]<<", "<<aDX[2]<<"}\n";
- int aDX0 = int(aDX[0]);
- int aDX1 = int(aDX[1]);
-
- int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aDX0,aDX1);
- if(aRet > 0)
- goto ADD_VISIBLE;
- if(aRet < 0)
- goto ADD_INVISIBLE;
-
- static int aMaxRadius = 5;
- for(int aRadius = 1; aRadius < aMaxRadius; aRadius++){
- int aStartDX[2] = {aDX0 - aRadius, aDX1 - aRadius};
- for(int i = 0; i <= aRadius; i++){
- int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]++,aStartDX[1]);
- if(aRet > 0)
- goto ADD_VISIBLE;
- if(aRet < 0)
- goto ADD_INVISIBLE;
- }
- for(int i = 0; i <= aRadius; i++){
- int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]++);
- if(aRet > 0)
- goto ADD_VISIBLE;
- if(aRet < 0)
- goto ADD_INVISIBLE;
- }
- for(int i = 0; i <= aRadius; i++){
- int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]--,aStartDX[1]);
- if(aRet > 0)
- goto ADD_VISIBLE;
- if(aRet < 0)
- goto ADD_INVISIBLE;
- }
- for(int i = 0; i <= aRadius; i++){
- int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]--);
- if(aRet > 0)
- goto ADD_VISIBLE;
- if(aRet < 0)
- goto ADD_INVISIBLE;
- }
- }
- if(false)
- ADD_VISIBLE : theVisibleIds.push_back(aPntId);
- if(false)
- ADD_INVISIBLE : theInVisibleIds.push_back(aPntId);
+ //cout<<"aPntId "<<aPntId<<"; aDX = {"<<aDX[0]<<", "<<aDX[1]<<", "<<aDX[2]<<"}\n";
+ int aDX0 = int(aDX[0]);
+ int aDX1 = int(aDX[1]);
+
+ int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aDX0,aDX1);
+ if(aRet > 0)
+ goto ADD_VISIBLE;
+ if(aRet < 0)
+ goto ADD_INVISIBLE;
+
+ static int aMaxRadius = 5;
+ for(int aRadius = 1; aRadius < aMaxRadius; aRadius++){
+ int aStartDX[2] = {aDX0 - aRadius, aDX1 - aRadius};
+ for(int i = 0; i <= aRadius; i++){
+ int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]++,aStartDX[1]);
+ if(aRet > 0)
+ goto ADD_VISIBLE;
+ if(aRet < 0)
+ goto ADD_INVISIBLE;
+ }
+ for(int i = 0; i <= aRadius; i++){
+ int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]++);
+ if(aRet > 0)
+ goto ADD_VISIBLE;
+ if(aRet < 0)
+ goto ADD_INVISIBLE;
+ }
+ for(int i = 0; i <= aRadius; i++){
+ int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0]--,aStartDX[1]);
+ if(aRet > 0)
+ goto ADD_VISIBLE;
+ if(aRet < 0)
+ goto ADD_INVISIBLE;
+ }
+ for(int i = 0; i <= aRadius; i++){
+ int aRet = Check(aZPtr,theSelection,theTolerance,aDX[2],aStartDX[0],aStartDX[1]--);
+ if(aRet > 0)
+ goto ADD_VISIBLE;
+ if(aRet < 0)
+ goto ADD_INVISIBLE;
+ }
+ }
+ if(false)
+ ADD_VISIBLE : theVisibleIds.push_back(aPntId);
+ if(false)
+ ADD_INVISIBLE : theInVisibleIds.push_back(aPntId);
}
}//for all points
inline
void
GetCenter(const vtkFloatingPointType theBounds[6],
- vtkFloatingPointType theCenter[3])
+ vtkFloatingPointType theCenter[3])
{
theCenter[0] = (theBounds[1] + theBounds[0]) / 2.0;
theCenter[1] = (theBounds[3] + theBounds[2]) / 2.0;
void
SelectVisibleCells(int theSelection[4],
- vtkRenderer *theRenderer,
- vtkDataSet *theInput,
- SVTK_RectPicker::TVectorIds& theVectorIds,
- vtkFloatingPointType theTolerance)
+ vtkRenderer *theRenderer,
+ vtkDataSet *theInput,
+ SVTK_RectPicker::TVectorIds& theVectorIds,
+ vtkFloatingPointType theTolerance)
{
theVectorIds.clear();
SVTK_RectPicker::TVectorIds aVisiblePntIds;
SVTK_RectPicker::TVectorIds anInVisiblePntIds;
SelectVisiblePoints(theSelection,
- theRenderer,
- theInput,
- aVisiblePntIds,
- anInVisiblePntIds,
- theTolerance);
+ theRenderer,
+ theInput,
+ aVisiblePntIds,
+ anInVisiblePntIds,
+ theTolerance);
typedef std::set<vtkIdType> TIdsSet;
TIdsSet aVisibleIds(aVisiblePntIds.begin(),aVisiblePntIds.end());
// and handle the transformation ourselves.
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
aMatrix->DeepCopy(theRenderer->GetActiveCamera()->
- GetCompositePerspectiveTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
+ GetCompositeProjectionTransformMatrix( theRenderer->GetTiledAspectRatio(), 0, 1 ) );
for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){
vtkCell* aCell = theInput->GetCell(aCellId);
aMatrix->MultiplyPoint(aX,aView);
if(aView[3] == 0.0)
- continue;
+ continue;
theRenderer->SetViewPoint(aView[0]/aView[3],
- aView[1]/aView[3],
- aView[2]/aView[3]);
+ aView[1]/aView[3],
+ aView[2]/aView[3]);
theRenderer->ViewToDisplay();
vtkFloatingPointType aDX[3];
aDX[1] >= theSelection[1] && aDX[1] <= theSelection[3])
{
- //cout<<"aCellId = "<<aCellId<<": ";
- vtkIdType aNumPts = aCell->GetNumberOfPoints();
- bool anIsVisible = true;
- for(vtkIdType anId = 0; anId < aNumPts; anId++){
- vtkIdType aPntId = aCell->GetPointId(anId);
- //cout<<aPntId<<"; ";
- anIsVisible = aVisibleIds.find(aPntId) != aVisibleIds.end();
- if(!anIsVisible)
- break;
- }
- //cout<<"\t"<<anIsVisible<<"\n";
- if(anIsVisible)
- theVectorIds.push_back(aCellId);
+ //cout<<"aCellId = "<<aCellId<<": ";
+ vtkIdType aNumPts = aCell->GetNumberOfPoints();
+ bool anIsVisible = true;
+ for(vtkIdType anId = 0; anId < aNumPts; anId++){
+ vtkIdType aPntId = aCell->GetPointId(anId);
+ //cout<<aPntId<<"; ";
+ anIsVisible = aVisibleIds.find(aPntId) != aVisibleIds.end();
+ if(!anIsVisible)
+ break;
+ }
+ //cout<<"\t"<<anIsVisible<<"\n";
+ if(anIsVisible)
+ theVectorIds.push_back(aCellId);
}
}//for all parts
}
//----------------------------------------------------------------------------
void
CalculatePickPosition(vtkRenderer *theRenderer,
- vtkFloatingPointType theSelectionX,
- vtkFloatingPointType theSelectionY,
- vtkFloatingPointType theSelectionZ,
- vtkFloatingPointType thePickPosition[3])
+ vtkFloatingPointType theSelectionX,
+ vtkFloatingPointType theSelectionY,
+ vtkFloatingPointType theSelectionZ,
+ vtkFloatingPointType thePickPosition[3])
{
// Convert the selection point into world coordinates.
//
vtkFloatingPointType* aWorldCoords = theRenderer->GetWorldPoint();
if ( aWorldCoords[3] != 0.0 ) {
for (int i=0; i < 3; i++) {
- thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3];
+ thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3];
}
}
}
vtkRenderer *theRenderer)
{
return Pick(theSelection[0], theSelection[1], theSelection[2],
- theSelection2[0], theSelection2[1], theSelection2[2],
- theRenderer);
+ theSelection2[0], theSelection2[1], theSelection2[2],
+ theRenderer);
}
int
// Convert the selection point into world coordinates.
//
CalculatePickPosition(theRenderer,
- theSelectionX,
- theSelectionY,
- aSelectionZ,
- this->PickPosition);
+ theSelectionX,
+ theSelectionY,
+ aSelectionZ,
+ this->PickPosition);
this->SelectionPoint2[0] = theSelectionX2;
this->SelectionPoint2[1] = theSelectionY2;
// Convert the selection point into world coordinates.
//
CalculatePickPosition(theRenderer,
- theSelectionX2,
- theSelectionY2,
- aSelectionZ,
- this->PickPosition2);
+ theSelectionX2,
+ theSelectionY2,
+ aSelectionZ,
+ this->PickPosition2);
// Invoke start pick method if defined
this->InvokeEvent(vtkCommand::StartPickEvent,NULL);
if ( this->PickFromList )
aProps = this->GetPickList();
else
- aProps = theRenderer->GetProps();
+ aProps = theRenderer->GetViewProps();
aProps->InitTraversal();
while ( vtkProp* aProp = aProps->GetNextProp() ) {
vtkMapper *aMapper = NULL;
bool anIsPickable = false;
vtkActor* anActor = NULL;
- vtkProp *aPropCandidate = aPath->GetLastNode()->GetProp();
+ vtkProp *aPropCandidate = aPath->GetLastNode()->GetViewProp();
if ( aPropCandidate->GetPickable() && aPropCandidate->GetVisibility() ) {
anIsPickable = true;
- anActor = vtkActor::SafeDownCast(aPropCandidate);
- if ( anActor ) {
+ anActor = vtkActor::SafeDownCast(aPropCandidate);
+ if ( anActor ) {
aMapper = anActor->GetMapper();
if ( anActor->GetProperty()->GetOpacity() <= 0.0 )
- anIsPickable = false;
- }
+ anIsPickable = false;
+ }
}
if ( anIsPickable && aMapper && aMapper->GetInput()) {
- int aSelectionPoint[4] = {int(theSelectionX),
- int(theSelectionY),
- int(theSelectionX2),
- int(theSelectionY2)};
- if ( this->PickPoints ) {
- TVectorIds& aVisibleIds = myPointIdsMap[anActor];
- TVectorIds anInVisibleIds;
- SelectVisiblePoints(aSelectionPoint,
- theRenderer,
- aMapper->GetInput(),
- aVisibleIds,
- anInVisibleIds,
- this->Tolerance);
- if ( aVisibleIds.empty() ) {
- myPointIdsMap.erase(myPointIdsMap.find(anActor));
- }
- } else {
- TVectorIds& aVectorIds = myCellIdsMap[anActor];
- SelectVisibleCells(aSelectionPoint,
- theRenderer,
- aMapper->GetInput(),
- aVectorIds,
- this->Tolerance);
- if ( aVectorIds.empty() ) {
- myCellIdsMap.erase(myCellIdsMap.find(anActor));
- }
- }
+ int aSelectionPoint[4] = {int(theSelectionX),
+ int(theSelectionY),
+ int(theSelectionX2),
+ int(theSelectionY2)};
+ if ( this->PickPoints ) {
+ TVectorIds& aVisibleIds = myPointIdsMap[anActor];
+ TVectorIds anInVisibleIds;
+ SelectVisiblePoints(aSelectionPoint,
+ theRenderer,
+ aMapper->GetInput(),
+ aVisibleIds,
+ anInVisibleIds,
+ this->Tolerance);
+ if ( aVisibleIds.empty() ) {
+ myPointIdsMap.erase(myPointIdsMap.find(anActor));
+ }
+ } else {
+ TVectorIds& aVectorIds = myCellIdsMap[anActor];
+ SelectVisibleCells(aSelectionPoint,
+ theRenderer,
+ aMapper->GetInput(),
+ aVectorIds,
+ this->Tolerance);
+ if ( aVectorIds.empty() ) {
+ myCellIdsMap.erase(myCellIdsMap.find(anActor));
+ }
+ }
}
}
}
{
return myCellIdsMap;
}
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_RectPicker.h
// Author :
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_RenderWindowInteractor.h"
-//#include "SVTK_GenericRenderWindowInteractor.h"
#include "SVTK_InteractorStyle.h"
#include "SVTK_Renderer.h"
#include <vtkPicker.h>
#include <vtkCamera.h>
-using namespace std;
-
-static bool GENERATE_SUIT_EVENTS = false;
+static bool GENERATE_SUIT_EVENTS = true;
static bool FOCUS_UNDER_MOUSE = false;
*/
QVTK_RenderWindowInteractor
::QVTK_RenderWindowInteractor(QWidget* theParent,
- const char* theName):
+ const char* theName):
QWidget(theParent),
myRenderWindow(vtkRenderWindow::New())
{
GetDevice()->InvokeEvent(theEvent,theCallData);
}
+/*!
+ Get paint engine for the scene
+*/
+QPaintEngine* QVTK_RenderWindowInteractor::paintEngine() const
+{
+ return 0;
+}
+
/*!
Need for initial contents display on Win32
*/
aRenderers->InitTraversal();
double aCoeff = 1.0;
if(vtkRenderer *aRenderer = aRenderers->GetNextItem()) {
- vtkCamera *aCamera = aRenderer->GetActiveCamera();
- double aScale = aCamera->GetParallelScale();
- if((aWidth - width())*(aHeight - height()) > 0)
- aCoeff = sqrt(double(aWidth)/double(width())*double(height())/double(aHeight));
- else
- aCoeff = double(aWidth)/double(width());
- aCamera->SetParallelScale(aScale*aCoeff);
+ vtkCamera *aCamera = aRenderer->GetActiveCamera();
+ double aScale = aCamera->GetParallelScale();
+ if((aWidth - width())*(aHeight - height()) > 0)
+ aCoeff = sqrt(double(aWidth)/double(width())*double(height())/double(aHeight));
+ else
+ aCoeff = double(aWidth)/double(width());
+ aCamera->SetParallelScale(aScale*aCoeff);
}
}
}
::mouseMoveEvent( QMouseEvent* event )
{
GetDevice()->SetEventInformationFlipY(event->x(),
- event->y(),
- event->modifiers() & Qt::ControlModifier,
- event->modifiers() & Qt::ShiftModifier);
+ event->y(),
+ event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier);
GetDevice()->MouseMoveEvent();
}
::mousePressEvent( QMouseEvent* event )
{
GetDevice()->SetEventInformationFlipY(event->x(),
- event->y(),
- event->modifiers() & Qt::ControlModifier,
- event->modifiers() & Qt::ShiftModifier);
+ event->y(),
+ event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier);
if( event->button() & Qt::LeftButton )
GetDevice()->LeftButtonPressEvent();
else if( event->button() & Qt::MidButton )
::mouseReleaseEvent( QMouseEvent *event )
{
GetDevice()->SetEventInformationFlipY(event->x(),
- event->y(),
- event->modifiers() & Qt::ControlModifier,
- event->modifiers() & Qt::ShiftModifier);
+ event->y(),
+ event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier);
if( event->button() & Qt::LeftButton )
GetDevice()->LeftButtonReleaseEvent();
{
activateWindow();
setFocus();
+ GetDevice()->SetEventInformationFlipY(event->x(),
+ event->y(),
+ event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier);
+ if ( event->delta()>0)
+ GetDevice()->MouseWheelForwardEvent();
+ else
+ GetDevice()->MouseWheelBackwardEvent();
}
::keyPressEvent( QKeyEvent* event )
{
GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
- event->modifiers() & Qt::ShiftModifier,
- event->key());
+ event->modifiers() & Qt::ShiftModifier,
+ event->key());
GetDevice()->KeyPressEvent();
GetDevice()->CharEvent();
}
::keyReleaseEvent( QKeyEvent * event )
{
GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
- event->modifiers() & Qt::ShiftModifier,
- event->key());
+ event->modifiers() & Qt::ShiftModifier,
+ event->key());
GetDevice()->KeyReleaseEvent();
}
switch ( type )
{
case SVTK_SpaceMouse::SpaceMouseMove:
- GetDevice()->InvokeEvent( SVTK::SpaceMouseMoveEvent, anEvent.data );
- break;
+ GetDevice()->InvokeEvent( SVTK::SpaceMouseMoveEvent, anEvent.data );
+ break;
case SVTK_SpaceMouse::SpaceButtonPress:
- GetDevice()->InvokeEvent( SVTK::SpaceMouseButtonEvent, &anEvent.button );
- break;
+ GetDevice()->InvokeEvent( SVTK::SpaceMouseButtonEvent, &anEvent.button );
+ break;
case SVTK_SpaceMouse::SpaceButtonRelease:
- break;
+ break;
}
return true; // stop handling the event
}
*/
SVTK_RenderWindowInteractor
::SVTK_RenderWindowInteractor(QWidget* theParent,
- const char* theName):
+ const char* theName):
QVTK_RenderWindowInteractor(theParent,theName),
myEventCallbackCommand(vtkCallbackCommand::New())
{
void
SVTK_RenderWindowInteractor
::Initialize(vtkGenericRenderWindowInteractor* theDevice,
- SVTK_Renderer* theRenderer,
- SVTK_Selector* theSelector)
+ SVTK_Renderer* theRenderer,
+ SVTK_Selector* theSelector)
{
QVTK_RenderWindowInteractor::Initialize(theDevice);
SetRenderer(theRenderer);
if(mySelector.GetPointer())
mySelector->AddObserver(vtkCommand::EndPickEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
/*!
void
SVTK_RenderWindowInteractor
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
SVTK_RenderWindowInteractor* self = reinterpret_cast<SVTK_RenderWindowInteractor*>(theClientData);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_RenderWindowInteractor_h
#define SVTK_RenderWindowInteractor_h
public:
QVTK_RenderWindowInteractor(QWidget* theParent,
- const char* theName);
+ const char* theName);
~QVTK_RenderWindowInteractor();
void
InvokeEvent(unsigned long theEvent, void* theCallData);
+ //! Get paint engine for the scene
+ virtual QPaintEngine* paintEngine() const;
+
public slots:
//! Need for initial contents display on Win32
virtual void show();
public:
SVTK_RenderWindowInteractor(QWidget* theParent,
- const char* theName);
+ const char* theName);
~SVTK_RenderWindowInteractor();
virtual
void
Initialize(vtkGenericRenderWindowInteractor* theDevice,
- SVTK_Renderer* theRenderer,
- SVTK_Selector* theSelector);
+ SVTK_Renderer* theRenderer,
+ SVTK_Selector* theSelector);
//----------------------------------------------------------------------------
//! To get corresponding SVTK_Renderer instance
static
void
ProcessEvents(vtkObject* theObject,
- unsigned long theEvent,
- void* theClientData,
- void* theCallData);
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
// Used to process VTK events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module :
-// $Header$
-//
+
#include "SVTK_Renderer.h"
#include "SVTK_Trihedron.h"
#include "SALOME_Actor.h"
#include "VTKViewer_Actor.h"
+#include "VTKViewer_Algorithm.h"
#include "VTKViewer_Transform.h"
#include "VTKViewer_Utilities.h"
+#include "VTKViewer_OpenGLRenderer.h"
#include <vtkCamera.h>
-#include <vtkRenderer.h>
#include <vtkTextProperty.h>
#include <vtkObjectFactory.h>
#include <vtkCallbackCommand.h>
*/
SVTK_Renderer
::SVTK_Renderer():
- myDevice(vtkRenderer::New()),
+ myDevice(VTKViewer_OpenGLRenderer::New()),
myInteractor(NULL),
myPriority(0.0),
myEventCallbackCommand(vtkCallbackCommand::New()),
myHighlightProperty->SetLineWidth(SALOME_LINE_WIDTH+2);
myHighlightProperty->SetRepresentationToPoints();
+ // Bug 0020123, note 0005217 - Problem with zoom
+ GetDevice()->SetNearClippingPlaneTolerance( 0.00001 );
+
myTrihedron->Delete();
myCubeAxes->Delete();
myEventCallbackCommand->Delete();
myEventCallbackCommand->SetClientData(this);
myEventCallbackCommand->SetCallback(SVTK_Renderer::ProcessEvents);
GetDevice()->AddObserver(vtkCommand::ConfigureEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
GetDevice()->AddObserver(vtkCommand::ResetCameraEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
GetDevice()->AddObserver(vtkCommand::ResetCameraClippingRangeEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
/*!
SVTK_Renderer
::~SVTK_Renderer()
{
- vtkActorCollection* anActors = GetDevice()->GetActors();
+ VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
vtkActorCollection* anActors2 = vtkActorCollection::New();
anActors->InitTraversal();
void
SVTK_Renderer
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
SVTK_Renderer* self = reinterpret_cast<SVTK_Renderer*>(theClientData);
void
SVTK_Renderer
::Initialize(vtkRenderWindowInteractor* theInteractor,
- SVTK_Selector* theSelector)
+ SVTK_Selector* theSelector)
{
myInteractor = theInteractor;
mySelector = theSelector;
*/
void
SVTK_Renderer
-::AddActor(VTKViewer_Actor* theActor)
+::AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
{
if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
anActor->SetInteractor(myInteractor);
anActor->SetHighlightProperty(myHighlightProperty.GetPointer());
anActor->AddToRender(GetDevice());
- AdjustActors();
+ anActor->UpdateNameActors();
+
+ if(theIsAdjustActors)
+ AdjustActors();
}
}
*/
void
SVTK_Renderer
-::RemoveActor(VTKViewer_Actor* theActor)
+::RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors)
{
if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theActor)){
// Order of the calls are important because VTKViewer_Actor::RemoveFromRender
anActor->SetHighlightProperty(NULL);
anActor->RemoveFromRender(GetDevice());
- AdjustActors();
+
+ if(theIsAdjustActors)
+ AdjustActors();
}
}
myTransform->SetMatrixScale( theScale[0], theScale[1], theScale[2] );
AdjustActors();
- vtkActorCollection* anActors = GetDevice()->GetActors();
+ VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
anActors->InitTraversal();
while(vtkActor* anAct = anActors->GetNextActor())
if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct))
if(anActor->isHighlighted() && !anActor->IsInfinitive())
- anActor->highlight(true);
+ anActor->highlight(true);
}
/*!
void
SVTK_Renderer
::SetSelectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myHighlightProperty->SetColor( theRed, theGreen, theBlue );
myHighlightProperty->SetLineWidth( theWidth );
void
SVTK_Renderer
::SetPreselectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myPreHighlightProperty->SetColor( theRed, theGreen, theBlue );
myPreHighlightProperty->SetLineWidth( theWidth );
void
SVTK_Renderer
::SetSelectionTolerance(const double& theTolNodes,
- const double& theTolCell,
- const double& theTolObjects)
+ const double& theTolCell,
+ const double& theTolObjects)
{
myPointPicker->SetTolerance( theTolNodes );
myCellPicker->SetTolerance( theTolCell );
vtkFloatingPointType aSize = myTrihedron->GetSize();
if ( IsTrihedronRelative() )
{
- ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize);
- myTrihedron->SetSize(aSize);
+ ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize);
+ myTrihedron->SetSize(aSize);
}
else
myTrihedron->SetSize( myTrihedronSize );
// iterate through displayed objects and set size if necessary
- vtkActorCollection* anActors = GetDevice()->GetActors();
+ VTK::ActorCollectionCopy aCopy(GetDevice()->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
anActors->InitTraversal();
while(vtkActor* anAct = anActors->GetNextActor()){
if(SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(anAct)){
- if(anActor->IsResizable())
- anActor->SetSize(0.5*aSize);
+ if(anActor->IsResizable())
+ anActor->SetSize(0.5*aSize);
if(anActor->GetVisibility() && !anActor->IsInfinitive()){
- vtkFloatingPointType *aBounds = anActor->GetBounds();
+ vtkFloatingPointType *aBounds = anActor->GetBounds();
if(CheckBndBox(aBounds))
- for(int i = 0; i < 5; i = i + 2){
- if(aBounds[i] < aNewBndBox[i])
- aNewBndBox[i] = aBounds[i];
- if(aBounds[i+1] > aNewBndBox[i+1])
- aNewBndBox[i+1] = aBounds[i+1];
- }
+ for(int i = 0; i < 5; i = i + 2){
+ if(aBounds[i] < aNewBndBox[i])
+ aNewBndBox[i] = aBounds[i];
+ if(aBounds[i+1] > aNewBndBox[i+1])
+ aNewBndBox[i+1] = aBounds[i+1];
+ }
}
}
}
this->OnFitAll();
}
+
+/*!
+ To rotate view 90 degrees clockwise
+*/
+void
+SVTK_Renderer
+::onClockWiseView()
+{
+ vtkCamera* aCamera = GetDevice()->GetActiveCamera();
+ aCamera->Roll(-90);
+ aCamera->OrthogonalizeViewUp();
+}
+
+/*!
+ To rotate view 90 degrees counterclockwise
+*/
+void
+SVTK_Renderer
+::onAntiClockWiseView()
+{
+ vtkCamera* aCamera = GetDevice()->GetActiveCamera();
+ aCamera->Roll(90);
+ aCamera->OrthogonalizeViewUp();
+}
+
/*!
To reset direction of the camera to right view
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_Renderer_h
#define SVTK_Renderer_h
virtual
void
Initialize(vtkRenderWindowInteractor* theInteractor,
- SVTK_Selector* theSelector);
+ SVTK_Selector* theSelector);
//----------------------------------------------------------------------------
//! Publishes pointed actor into the renderer
virtual
void
- AddActor(VTKViewer_Actor* theActor);
+ AddActor(VTKViewer_Actor* theActor, bool theIsAdjustActors = true);
//! Removes pointed actor from the renderer
virtual
void
- RemoveActor(VTKViewer_Actor* theActor);
+ RemoveActor(VTKViewer_Actor* theActor, bool theIsAdjustActors = true);
//! Get special container that keeps scaling of the scene
VTKViewer_Transform*
//! Applies color and size (PointSize and LineWidth) of primitives in selection mode
void
SetSelectionProp(const double& theRed = 1,
- const double& theGreen = 1,
- const double& theBlue = 0,
- const int& theWidth = 5);
+ const double& theGreen = 1,
+ const double& theBlue = 0,
+ const int& theWidth = 5);
//! Applies color and size (PointSize and LineWidth) of primitives in preselection mode
void
SetPreselectionProp(const double& theRed = 0,
- const double& theGreen = 1,
- const double& theBlue = 1,
- const int& theWidth = 5);
+ const double& theGreen = 1,
+ const double& theBlue = 1,
+ const int& theWidth = 5);
//! Setup requested tolerance for the picking
void
SetSelectionTolerance(const double& theTolNodes = 0.025,
- const double& theTolCell = 0.001,
- const double& theTolObjects = 0.025);
+ const double& theTolCell = 0.001,
+ const double& theTolObjects = 0.025);
//----------------------------------------------------------------------------
//! Adjust all intenal actors (trihedron and graduated rules) to the scene
//! To reset direction of the camera to left view
void OnLeftView();
- protected:
+ //! To rotate view 90 degrees clockwise
+ void onClockWiseView();
+
+ //! To rotate view 90 degrees counterclockwise
+ void onAntiClockWiseView();
+
+protected:
SVTK_Renderer();
~SVTK_Renderer();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Selection.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_SELECTION_H
#define SVTK_SELECTION_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SVTK_SelectionEvent.h
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_SELECTIONEVENT_H
#define SVTK_SELECTIONEVENT_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Selection.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_SelectorDef.h"
#include <VTKViewer_Filter.h>
#include <vtkCellPicker.h>
-/*!
- Find first SALOME_Actor from the end of actors collection
-*/
-inline
-SALOME_Actor*
-GetLastSALOMEActor(vtkActorCollection* theCollection)
-{
- if (theCollection) {
- for (int i = theCollection->GetNumberOfItems() - 1; i >= 0; i--) {
- if (SALOME_Actor* anActor = dynamic_cast<SALOME_Actor*>(theCollection->GetItemAsObject(i)))
- if (anActor->hasIO())
- return anActor;
- }
- }
- return NULL;
-}
-
-
/*!
\return new SVTK_Selector
*/
myCellPicker(vtkCellPicker::New())
{
mySelectionMode = ActorSelection;
+ myDynamicPreselection = true;
myPicker->Delete();
myCellPicker->Delete();
void
SVTK_SelectorDef
::GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
- TColStd_IndexedMapOfInteger& theIndex)
+ TColStd_IndexedMapOfInteger& theIndex)
{
TMapIOSubIndex::const_iterator anIter = myMapIOSubIndex.find(theIO);
if(anIter != myMapIOSubIndex.end())
bool
SVTK_SelectorDef
::IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex) const
+ int theIndex) const
{
TMapIOSubIndex::const_iterator anIter = myMapIOSubIndex.find(theIO);
if(anIter != myMapIOSubIndex.end()){
bool
SVTK_SelectorDef
::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- const TColStd_IndexedMapOfInteger& theIndices,
- bool theIsModeShift)
+ const TColStd_IndexedMapOfInteger& theIndices,
+ bool theIsModeShift)
{
TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO);
if(aMapIter == myMapIOSubIndex.end()){
bool
SVTK_SelectorDef
::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- const TColStd_MapOfInteger& theIndices,
- bool theIsModeShift)
+ const TColStd_MapOfInteger& theIndices,
+ bool theIsModeShift)
{
TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO);
if(aMapIter == myMapIOSubIndex.end()){
bool
SVTK_SelectorDef
::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex,
- bool theIsModeShift)
+ int theIndex,
+ bool theIsModeShift)
{
TMapIOSubIndex::iterator anIter = myMapIOSubIndex.find(theIO);
if(anIter == myMapIOSubIndex.end()){
void
SVTK_SelectorDef
::RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex)
+ int theIndex)
{
if(IsIndexSelected(theIO,theIndex)){
TMapIOSubIndex::iterator anIter = myMapIOSubIndex.find(theIO);
bool
SVTK_SelectorDef
::IsValid(SALOME_Actor* theActor,
- const TFilterID theId,
- const bool theIsNode) const
+ const TFilterID theId,
+ const bool theIsNode) const
{
TFilters::const_iterator anIter = myFilters.begin();
for(; anIter != myFilters.end(); ++anIter){
return Handle(VTKViewer_Filter)();
}
-SALOME_Actor*
+vtkActorCollection*
SVTK_SelectorDef
::Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const
{
- bool anAdvancedSelectionAlgorithm = true;
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
- if ( aResourceMgr )
- anAdvancedSelectionAlgorithm = aResourceMgr->booleanValue( "VTKViewer", "use_advanced_selection_algorithm", true );
-
- SALOME_Actor* anActor = NULL;
vtkActorCollection* aListActors = NULL;
- if ( anAdvancedSelectionAlgorithm ) {
+
+ if ( GetDynamicPreSelection() ) {
myCellPicker->Pick(theEvent->myX,
- theEvent->myY,
- 0.0,
- theRenderer);
+ theEvent->myY,
+ 0.0,
+ theRenderer);
aListActors = myCellPicker->GetActors();
- anActor = GetLastSALOMEActor(aListActors);
}
- if ( !anActor ) {
+ if ( !aListActors || !aListActors->GetNumberOfItems() ) {
myPicker->Pick(theEvent->myX,
- theEvent->myY,
- 0.0,
- theRenderer);
+ theEvent->myY,
+ 0.0,
+ theRenderer);
aListActors = myPicker->GetActors();
- anActor = GetLastSALOMEActor(aListActors);
}
- return anActor;
+ return aListActors;
}
void
SVTK_SelectorDef
::SetTolerance(const double& theTolerance)
{
- myPicker->SetTolerance(theTolerance);
+ myPicker->SetTolerance(theTolerance);
myCellPicker->SetTolerance(theTolerance);
}
+
+void
+SVTK_SelectorDef
+::SetDynamicPreSelection( bool theIsDynPreselect )
+{
+ myDynamicPreselection = theIsDynPreselect;
+}
+
+bool
+SVTK_SelectorDef
+::GetDynamicPreSelection() const
+{
+ return myDynamicPreselection;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Selection.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_SELECTOR_H
#define SVTK_SELECTOR_H
class SALOME_Actor;
class SVTK_SelectionEvent;
+class vtkActorCollection;
class vtkRenderer;
class Handle(SALOME_InteractiveObject);
virtual
void
GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
- TColStd_IndexedMapOfInteger& theIndex ) = 0;
-
+ TColStd_IndexedMapOfInteger& theIndex ) = 0;
+
//! Change indices of subselection for given #SALOME_InteractiveObject
virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- const TColStd_IndexedMapOfInteger& theIndices,
- bool theIsModeShift) = 0;
+ const TColStd_IndexedMapOfInteger& theIndices,
+ bool theIsModeShift) = 0;
//! Change indexes of subslection for given #SALOME_InteractiveObject
virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- const TColStd_MapOfInteger& theIndices,
- bool theIsModeShift) = 0;
+ const TColStd_MapOfInteger& theIndices,
+ bool theIsModeShift) = 0;
//! Change index of subslection for given #SALOME_InteractiveObject
virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex,
- bool theIsModeShift) = 0;
+ int theIndex,
+ bool theIsModeShift) = 0;
//! Change index of subslection for given #SALOME_InteractiveObject
virtual
void
RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex) = 0;
+ int theIndex) = 0;
//! Check, if the given index is present in subselection
virtual
bool
IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex) const = 0;
+ int theIndex) const = 0;
//! Clear subselection
virtual
virtual
bool
IsValid(SALOME_Actor* theActor,
- const int theId,
- const bool theIsNode = false) const = 0;
+ const int theId,
+ const bool theIsNode = false) const = 0;
//----------------------------------------------------------------------------
virtual
//----------------------------------------------------------------------------
virtual
- SALOME_Actor*
+ vtkActorCollection*
Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const = 0;
virtual
void
SetTolerance(const double& theTolerance) = 0;
+
+ virtual
+ void
+ SetDynamicPreSelection( bool theIsDynPreselect ) = 0;
+
+ virtual
+ bool
+ GetDynamicPreSelection() const = 0;
};
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOME_Selection.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_SELECTORDEF_H
#define SVTK_SELECTORDEF_H
virtual
void
GetIndex( const Handle(SALOME_InteractiveObject)& theIO,
- TColStd_IndexedMapOfInteger& theIndex );
-
+ TColStd_IndexedMapOfInteger& theIndex );
+
virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- const TColStd_IndexedMapOfInteger& theIndices,
- bool theIsModeShift);
+ const TColStd_IndexedMapOfInteger& theIndices,
+ bool theIsModeShift);
virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- const TColStd_MapOfInteger& theIndices,
- bool theIsModeShift);
+ const TColStd_MapOfInteger& theIndices,
+ bool theIsModeShift);
virtual
bool
AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex,
- bool theIsModeShift);
+ int theIndex,
+ bool theIsModeShift);
virtual
void
RemoveIndex( const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex);
+ int theIndex);
virtual
bool
IsIndexSelected(const Handle(SALOME_InteractiveObject)& theIO,
- int theIndex) const;
+ int theIndex) const;
virtual
void
ClearIndex();
virtual
bool
IsValid(SALOME_Actor* theActor,
- const TFilterID theId,
- const bool theIsNode = false) const;
+ const TFilterID theId,
+ const bool theIsNode = false) const;
//----------------------------------------------------------------------------
virtual
//----------------------------------------------------------------------------
virtual
- SALOME_Actor*
+ vtkActorCollection*
Pick(const SVTK_SelectionEvent* theEvent, vtkRenderer* theRenderer) const;
virtual
void
SetTolerance(const double& theTolerance);
+ virtual
+ void
+ SetDynamicPreSelection( bool theIsDynPreselect );
+
+ virtual
+ bool
+ GetDynamicPreSelection() const;
+
private:
int mySelectionMode;
+ bool myDynamicPreselection;
+
struct TIOLessThan
{
bool
operator()(const Handle(SALOME_InteractiveObject)& theRightIO,
- const Handle(SALOME_InteractiveObject)& theLeftIO) const
+ const Handle(SALOME_InteractiveObject)& theLeftIO) const
{
return strcmp(theRightIO->getEntry(),theLeftIO->getEntry()) < 0;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_SetRotationPointDlg.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_RenderWindowInteractor.h"
#include <vtkCallbackCommand.h>
-using namespace std;
-
/*!
Constructor
*/
SVTK_SetRotationPointDlg
::SVTK_SetRotationPointDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName):
- SVTK_DialogBase(theAction,
- theParent,
- theName),
+ SVTK_ViewWindow* theParent,
+ const char* theName):
+ ViewerTools_DialogBase(theAction,
+ theParent,
+ theName),
myMainWindow(theParent),
myPriority(0.0),
myEventCallbackCommand(vtkCallbackCommand::New()),
void
SVTK_SetRotationPointDlg
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* theCallData)
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
{
SVTK_SetRotationPointDlg* self = reinterpret_cast<SVTK_SetRotationPointDlg*>(theClientData);
vtkFloatingPointType* aCoord = (vtkFloatingPointType*)theCallData;
switch ( theEvent ) {
case SVTK::BBCenterChanged:
if ( self->myIsBBCenter->isChecked()
- ||
- IsBBEmpty(self->myMainWindow->getRenderer()) )
+ ||
+ IsBBEmpty(self->myMainWindow->getRenderer()) )
{
if ( aCoord )
{
- self->myX->setText( QString::number(aCoord[0]) );
- self->myY->setText( QString::number(aCoord[1]) );
- self->myZ->setText( QString::number(aCoord[2]) );
+ self->myX->setText( QString::number(aCoord[0]) );
+ self->myY->setText( QString::number(aCoord[1]) );
+ self->myZ->setText( QString::number(aCoord[2]) );
}
}
break;
{
if ( !myIsBBCenter->isChecked() ) {
if ( mySelectPoint->isChecked()
- &&
- ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+ &&
+ ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
mySelectPoint->toggle();
vtkFloatingPointType aCenter[3] = {myX->text().toDouble(),
- myY->text().toDouble(),
- myZ->text().toDouble()};
+ myY->text().toDouble(),
+ myZ->text().toDouble()};
myMainWindow->activateSetRotationSelected((void*)aCenter);
}
else
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_SETROTATIONPOINTDLG_H
#define SVTK_SETROTATIONPOINTDLG_H
#include "SVTK.h"
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
#include <vtkSmartPointer.h>
class vtkCallbackCommand;
class vtkObject;
-class SVTK_EXPORT SVTK_SetRotationPointDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_SetRotationPointDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
public:
SVTK_SetRotationPointDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName);
+ SVTK_ViewWindow* theParent,
+ const char* theName);
~SVTK_SetRotationPointDlg();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_SpaceMouse.cxx
// Author : Alexander SLADKOV
-// Module : SALOME
-// $Header$
-//
+
#include <string.h>
#include <math.h>
#include <stdio.h>
PropReturn = NULL;
XGetWindowProperty( display, root, XCommandEvent, 0,1, 0,
- AnyPropertyType, &type, &format, &NItems,
- &BytesReturn, &PropReturn );
+ AnyPropertyType, &type, &format, &NItems,
+ &BytesReturn, &PropReturn );
win = InputFocus;
if ( PropReturn != NULL ) {
Custom event handler
*/
int SVTK_SpaceMouse::translateEvent( Display* display, XEvent* xEvent, MoveEvent* spaceMouseEvent,
- double scale, double rScale )
+ double scale, double rScale )
{
if ( !spaceMouseOn )
return 0;
if ( xEvent->xclient.message_type == XMotionEvent ) {
spaceMouseEvent->type = SpaceMouseMove;
spaceMouseEvent->data[ x ] =
- xEvent->xclient.data.s[2] * scale;
+ xEvent->xclient.data.s[2] * scale;
spaceMouseEvent->data[ y ] =
- xEvent->xclient.data.s[3] * scale;
+ xEvent->xclient.data.s[3] * scale;
spaceMouseEvent->data[ z ] =
- xEvent->xclient.data.s[4] * scale;
+ xEvent->xclient.data.s[4] * scale;
spaceMouseEvent->data[ a ] =
- xEvent->xclient.data.s[5] * rScale;
+ xEvent->xclient.data.s[5] * rScale;
spaceMouseEvent->data[ b ] =
- xEvent->xclient.data.s[6] * rScale;
+ xEvent->xclient.data.s[6] * rScale;
spaceMouseEvent->data[ c ] =
- xEvent->xclient.data.s[7] * rScale;
+ xEvent->xclient.data.s[7] * rScale;
spaceMouseEvent->period = xEvent->xclient.data.s[8];
return 1;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : SVTK_SpaceMouse.h
// Author : Alexander SLADKOV
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_SpaceMouse_h
#define SVTK_SpaceMouse_h
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_Trihedron.h"
#include "SALOME_Actor.h"
+#include "VTKViewer_Algorithm.h"
+
#include <vtkObjectFactory.h>
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
SVTK_Trihedron
::GetVisibleActorCount(vtkRenderer* theRenderer)
{
- vtkActorCollection* aCollection = theRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+ vtkActorCollection* aCollection = aCopy.GetActors();
aCollection->InitTraversal();
int aCount = 0;
while(vtkActor* aProp = aCollection->GetNextActor()) {
if(aProp->GetVisibility())
+ {
if(SALOME_Actor* anActor = SALOME_Actor::SafeDownCast(aProp)) {
if(!anActor->IsInfinitive())
- aCount++;
+ aCount++;
}
- else if ( !OwnActor( anActor ) ) {
- aCount++;
+ else if ( !OwnActor( aProp ) ) {
+ aCount++;
}
+ }
}
return aCount;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_TRIHEDRON_H
#define SVTK_TRIHEDRON_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "SVTK_UpdateRateDlg.h"
#include "SVTK_ViewWindow.h"
static vtkFloatingPointType OFF_UPDATE_RATE = 0.00001;
static vtkFloatingPointType FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT;
-using namespace std;
-
namespace
{
//----------------------------------------------------------------------------
if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
vtkFloatingPointType aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds();
if(aLastRenderTimeInSeconds > FLOAT_TOLERANCE){
- std::ostringstream aStr;
- vtkFloatingPointType aFPS = 1.0 / aLastRenderTimeInSeconds;
- aStr<<aFPS;
- return QString(aStr.str().c_str());
+ std::ostringstream aStr;
+ vtkFloatingPointType aFPS = 1.0 / aLastRenderTimeInSeconds;
+ aStr<<aFPS;
+ return QString(aStr.str().c_str());
}
}
return "Inf";
operator()(vtkActor* theActor)
{
if(theActor->GetVisibility()){
- myVTKMultiplier += theActor->GetAllocatedRenderTime();
- if(dynamic_cast<SALOME_Actor*>(theActor))
- mySALOMEMultiplier += theActor->GetAllocatedRenderTime();
+ myVTKMultiplier += theActor->GetAllocatedRenderTime();
+ if(dynamic_cast<SALOME_Actor*>(theActor))
+ mySALOMEMultiplier += theActor->GetAllocatedRenderTime();
}
}
};
inline
vtkFloatingPointType
AdjustUpdateRate(SVTK_RenderWindowInteractor* theRWInteractor,
- vtkFloatingPointType theUpdateRate)
+ vtkFloatingPointType theUpdateRate)
{
if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
- if(vtkActorCollection *anActorCollection = aRenderer->GetActors()){
- TRenderTimeMultiplier aMultiplier;
- using namespace VTK;
- aMultiplier = ForEach<vtkActor>(anActorCollection,
- aMultiplier);
- if(aMultiplier.mySALOMEMultiplier > FLOAT_TOLERANCE)
- theUpdateRate *= aMultiplier.mySALOMEMultiplier / aMultiplier.myVTKMultiplier;
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ if(vtkActorCollection *anActorCollection = aCopy.GetActors()){
+ TRenderTimeMultiplier aMultiplier;
+ using namespace VTK;
+ aMultiplier = ForEach<vtkActor>(anActorCollection,
+ aMultiplier);
+ if(aMultiplier.mySALOMEMultiplier > FLOAT_TOLERANCE)
+ theUpdateRate *= aMultiplier.mySALOMEMultiplier / aMultiplier.myVTKMultiplier;
}
}
return theUpdateRate;
operator()(SALOME_Actor* theActor)
{
if(theActor->GetVisibility()){
- if(vtkMapper *aMapper = theActor->GetMapper()){
- if(vtkDataSet *aDataSet = aMapper->GetInput()){
- myCounter += aDataSet->GetNumberOfCells();
- }
- }
+ if(vtkMapper *aMapper = theActor->GetMapper()){
+ if(vtkDataSet *aDataSet = aMapper->GetInput()){
+ myCounter += aDataSet->GetNumberOfCells();
+ }
+ }
}
}
};
GetNumberOfCells(SVTK_RenderWindowInteractor* theRWInteractor)
{
if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
- if(vtkActorCollection *anActorCollection = aRenderer->GetActors()){
- TCellsCounter aCounter;
- using namespace VTK;
- aCounter = ForEach<SALOME_Actor>(anActorCollection,
- aCounter);
- return QString::number(aCounter.myCounter);
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ if(vtkActorCollection *anActorCollection = aCopy.GetActors()){
+ TCellsCounter aCounter;
+ using namespace VTK;
+ aCounter = ForEach<SALOME_Actor>(anActorCollection,
+ aCounter);
+ return QString::number(aCounter.myCounter);
}
}
*/
SVTK_UpdateRateDlg
::SVTK_UpdateRateDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName):
- SVTK_DialogBase(theAction,
- theParent,
- theName),
+ SVTK_ViewWindow* theParent,
+ const char* theName):
+ ViewerTools_DialogBase(theAction,
+ theParent,
+ theName),
myPriority(0.0),
myEventCallbackCommand(vtkCallbackCommand::New()),
myRWInteractor(theParent->GetInteractor()),
myEventCallbackCommand->SetCallback(SVTK_UpdateRateDlg::ProcessEvents);
vtkRenderer *aRenderer = myRWInteractor->getRenderer();
aRenderer->AddObserver(vtkCommand::EndEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
/*!
void
SVTK_UpdateRateDlg
::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* vtkNotUsed(theCallData))
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
{
SVTK_UpdateRateDlg* self = reinterpret_cast<SVTK_UpdateRateDlg*>(theClientData);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#ifndef SVTK_UPDATERATEDLG_H
#define SVTK_UPDATERATEDLG_H
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
#include <vtkSmartPointer.h>
class vtkObject;
-class SVTK_UpdateRateDlg : public SVTK_DialogBase
+class SVTK_UpdateRateDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
public:
SVTK_UpdateRateDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName);
+ SVTK_ViewWindow* theParent,
+ const char* theName);
~SVTK_UpdateRateDlg();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "SALOME_Actor.h"
#include "SVTK_View.h"
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
+#include <vtkProperty.h>
/*!
Constructor
SVTK_RenderWindowInteractor* anInteractor = theMainWindow->GetInteractor();
connect(anInteractor,SIGNAL(KeyPressed(QKeyEvent*)),
- this,SIGNAL(KeyPressed(QKeyEvent*)) );
+ this,SIGNAL(KeyPressed(QKeyEvent*)) );
connect(anInteractor,SIGNAL(KeyReleased(QKeyEvent*)),
- this,SIGNAL(KeyReleased(QKeyEvent*)));
+ this,SIGNAL(KeyReleased(QKeyEvent*)));
connect(anInteractor,SIGNAL(MouseButtonPressed(QMouseEvent*)),
- this,SIGNAL(MouseButtonPressed(QMouseEvent*)));
+ this,SIGNAL(MouseButtonPressed(QMouseEvent*)));
connect(anInteractor,SIGNAL(MouseButtonReleased(QMouseEvent*)),
- this,SIGNAL(MouseButtonReleased(QMouseEvent*)));
+ this,SIGNAL(MouseButtonReleased(QMouseEvent*)));
connect(anInteractor,SIGNAL(MouseDoubleClicked(QMouseEvent*)),
- this,SIGNAL(MouseDoubleClicked(QMouseEvent*)));
+ this,SIGNAL(MouseDoubleClicked(QMouseEvent*)));
connect(anInteractor,SIGNAL(MouseMove(QMouseEvent*)),
- this,SIGNAL(MouseMove(QMouseEvent*)));
+ this,SIGNAL(MouseMove(QMouseEvent*)));
connect(anInteractor,SIGNAL(contextMenuRequested(QContextMenuEvent*)),
- this,SIGNAL(contextMenuRequested(QContextMenuEvent*)));
+ this,SIGNAL(contextMenuRequested(QContextMenuEvent*)));
connect(anInteractor,SIGNAL(selectionChanged()),
- this,SIGNAL(selectionChanged()));
+ this,SIGNAL(selectionChanged()));
}
/*!
operator()( SALOME_Actor* theActor)
{
if(theActor->GetMapper() && theActor->hasIO()){
- theActor->Highlight( myIsHighlight );
+ theActor->Highlight( myIsHighlight );
}
}
};
SVTK_SignalHandler
::onSelectionChanged()
{
- vtkActorCollection* anActors = myMainWindow->getRenderer()->GetActors();
+ VTK::ActorCollectionCopy aCopy(myMainWindow->getRenderer()->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
using namespace SVTK;
ForEach<SALOME_Actor>(anActors,
- THighlightAction( false ));
+ THighlightAction( false ));
SVTK_Selector* aSelector = myMainWindow->GetSelector();
const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
SALOME_ListIteratorOfListIO anIter(aListIO);
for(; anIter.More(); anIter.Next()){
ForEachIf<SALOME_Actor>(anActors,
- TIsSameIObject<SALOME_Actor>(anIter.Value()),
- THighlightAction(true));
+ TIsSameIObject<SALOME_Actor>(anIter.Value()),
+ THighlightAction(true));
}
myMainWindow->Repaint(false);
::unHighlightAll()
{
using namespace SVTK;
- ForEach<SALOME_Actor>(getRenderer()->GetActors(),
- THighlightAction( false ));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEach<SALOME_Actor>(aCopy.GetActors(),
+ THighlightAction( false ));
Repaint();
}
void
SVTK_View
::highlight( const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight,
- bool theIsUpdate )
+ bool theIsHighlight,
+ bool theIsUpdate )
{
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>( theIO ),
- THighlightAction(theIsHighlight));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>( theIO ),
+ THighlightAction(theIsHighlight));
Repaint();
}
::FindIObject(const char* theEntry)
{
using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
SALOME_Actor* anActor =
- Find<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameEntry<SALOME_Actor>(theEntry));
+ Find<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameEntry<SALOME_Actor>(theEntry));
if(anActor != NULL)
return anActor->getIO();
void
SVTK_View
::SetSelectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
GetRenderer()->SetSelectionProp(theRed,theGreen,theBlue,theWidth);
}
void
SVTK_View
::SetPreselectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
GetRenderer()->SetPreselectionProp(theRed,theGreen,theBlue,theWidth);
}
void
SVTK_View
::SetSelectionTolerance(const double& theTolNodes,
- const double& theTolCell,
- const double& theTolObjects)
+ const double& theTolCell,
+ const double& theTolObjects)
{
GetRenderer()->SetSelectionTolerance(theTolNodes, theTolCell, theTolObjects);
}
::isInViewer(const Handle(SALOME_InteractiveObject)& theIObject)
{
using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
SALOME_Actor* anActor =
- Find<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject));
+ Find<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject));
return anActor != NULL;
}
+namespace SVTK
+{
+ struct TIsActorVisibleAction
+ {
+ bool& myResult;
+ TIsActorVisibleAction(bool& theResult):
+ myResult(theResult)
+ {
+ myResult = false;
+ }
+ void
+ operator()(SALOME_Actor* theActor)
+ {
+ if( !myResult )
+ myResult = theActor->GetVisibility();
+ }
+ };
+}
+
/*!
\return true if object is displayed in viewer
\param theIO - object to be checked
::isVisible(const Handle(SALOME_InteractiveObject)& theIObject)
{
using namespace SVTK;
- SALOME_Actor* anActor =
- Find<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject));
- return anActor != NULL && anActor->GetVisibility();
+ bool aResult;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TIsActorVisibleAction(aResult));
+ return aResult;
}
/*!
void
SVTK_View
::rename(const Handle(SALOME_InteractiveObject)& theIObject,
- const QString& theName)
+ const QString& theName)
{
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,const char*,const char*>
- (&SALOME_Actor::setName,theName.toLatin1().data()));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TSetFunction<SALOME_Actor,const char*,const char*>
+ (&SALOME_Actor::setName,theName.toLatin1().data()));
}
/*!
{
if(theMode == 0)
ChangeRepresentationToWireframe();
- else
+ else if (theMode == 1)
ChangeRepresentationToSurface();
+ else if (theMode == 2) {
+ ChangeRepresentationToSurfaceWithEdges();
+ theMode++;
+ }
myDisplayMode = theMode;
}
void
SVTK_View
::SetDisplayMode(const Handle(SALOME_InteractiveObject)& theIObject,
- int theMode)
+ int theMode)
{
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,int>
- (&SALOME_Actor::setDisplayMode,theMode));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TSetFunction<SALOME_Actor,int>
+ (&SALOME_Actor::setDisplayMode,theMode));
}
/*!
SVTK_View
::ChangeRepresentationToWireframe()
{
- ChangeRepresentationToWireframe(getRenderer()->GetActors());
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ChangeRepresentationToWireframe(aCopy.GetActors());
}
/*!
SVTK_View
::ChangeRepresentationToSurface()
{
- ChangeRepresentationToSurface(getRenderer()->GetActors());
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ChangeRepresentationToSurface(aCopy.GetActors());
+}
+
+/*!
+ Change all actors to shading with edges
+*/
+void
+SVTK_View
+::ChangeRepresentationToSurfaceWithEdges()
+{
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ChangeRepresentationToSurfaceWithEdges(aCopy.GetActors());
}
/*!
{
using namespace SVTK;
ForEach<SALOME_Actor>(theCollection,
- TSetFunction<SALOME_Actor,int>
- (&SALOME_Actor::setDisplayMode,0));
+ TSetFunction<SALOME_Actor,int>
+ (&SALOME_Actor::setDisplayMode,0));
Repaint();
}
{
using namespace SVTK;
ForEach<SALOME_Actor>(theCollection,
- TSetFunction<SALOME_Actor,int>
- (&SALOME_Actor::setDisplayMode,1));
+ TSetFunction<SALOME_Actor,int>
+ (&SALOME_Actor::setDisplayMode,1));
+ Repaint();
+}
+
+/*!
+ Change to shading with edges a list of vtkactor
+ theCollection - list of vtkactor
+*/
+void
+SVTK_View
+::ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theCollection)
+{
+ using namespace SVTK;
+ ForEach<SALOME_Actor>(theCollection,
+ TSetFunction<SALOME_Actor,int>
+ (&SALOME_Actor::setDisplayMode,3));
Repaint();
}
::EraseAll()
{
using namespace SVTK;
- ForEach<SALOME_Actor>(getRenderer()->GetActors(),
- TErase());
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEach<SALOME_Actor>(aCopy.GetActors(),
+ TErase());
Repaint();
}
::DisplayAll()
{
using namespace SVTK;
- ForEach<SALOME_Actor>(getRenderer()->GetActors(),
- TSetVisibility<SALOME_Actor>(true));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEach<SALOME_Actor>(aCopy.GetActors(),
+ TSetVisibility<SALOME_Actor>(true));
Repaint();
}
void
SVTK_View
::Erase(SALOME_Actor* theActor,
- bool theIsUpdate)
+ bool theIsUpdate)
{
SVTK::TErase()(theActor);
void
SVTK_View
::Erase(const Handle(SALOME_InteractiveObject)& theIObject,
- bool theIsUpdate)
+ bool theIsUpdate)
{
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject),
- TErase());
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TErase());
if(theIsUpdate)
Repaint();
}
void
SVTK_View
::Display(SALOME_Actor* theActor,
- bool theIsUpdate)
+ bool theIsUpdate)
{
GetRenderer()->AddActor(theActor);
theActor->SetVisibility(true);
void
SVTK_View
::Display(const Handle(SALOME_InteractiveObject)& theIObject,
- bool theIsUpdate)
+ bool theIsUpdate)
{
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject),
- TSetVisibility<SALOME_Actor>(true));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TSetVisibility<SALOME_Actor>(true));
if(theIsUpdate)
Repaint();
void
SVTK_View
::Remove(const Handle(SALOME_InteractiveObject)& theIObject,
- bool theIsUpdate)
+ bool theIsUpdate)
{
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject),
- TRemoveAction(GetRenderer()));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TRemoveAction(GetRenderer()));
if(theIsUpdate)
Repaint();
}
void
SVTK_View
::Remove(SALOME_Actor* theActor,
- bool theIsUpdate)
+ bool theIsUpdate)
{
GetRenderer()->RemoveActor(theActor);
if(theIsUpdate)
::RemoveAll(bool theIsUpdate)
{
vtkRenderer* aRenderer = getRenderer();
- if(vtkActorCollection* anActors = aRenderer->GetActors()){
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ if(vtkActorCollection* anActors = aCopy.GetActors()){
anActors->InitTraversal();
while(vtkActor *anAct = anActors->GetNextActor()){
if(SALOME_Actor* aSAct = SALOME_Actor::SafeDownCast(anAct)){
::GetTransparency(const Handle(SALOME_InteractiveObject)& theIObject)
{
using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
SALOME_Actor* anActor =
- Find<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject));
+ Find<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject));
if(anActor)
return 1.0 - anActor->GetOpacity();
return -1.0;
void
SVTK_View
::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject,
- float theTrans)
+ float theTrans)
{
vtkFloatingPointType anOpacity = 1.0 - theTrans;
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,vtkFloatingPointType>
- (&SALOME_Actor::SetOpacity,anOpacity));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TSetFunction<SALOME_Actor,vtkFloatingPointType>
+ (&SALOME_Actor::SetOpacity,anOpacity));
}
/*!
void
SVTK_View
::SetColor(const Handle(SALOME_InteractiveObject)& theIObject,
- const QColor& theColor)
+ const QColor& theColor)
{
vtkFloatingPointType aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.};
using namespace SVTK;
- ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,const vtkFloatingPointType*>
- (&SALOME_Actor::SetColor,aColor));
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TSetFunction<SALOME_Actor,const vtkFloatingPointType*>
+ (&SALOME_Actor::SetColor,aColor));
}
::GetColor(const Handle(SALOME_InteractiveObject)& theIObject)
{
using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
SALOME_Actor* anActor =
- Find<SALOME_Actor>(getRenderer()->GetActors(),
- TIsSameIObject<SALOME_Actor>(theIObject));
+ Find<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject));
if(anActor){
vtkFloatingPointType r,g,b;
anActor->GetColor(r,g,b);
return QColor(0,0,0);
}
+/*!
+ Change material
+ \param theIObject - object
+ \param thePropF - property contained new properties of material
+*/
+void
+SVTK_View
+::SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject,
+ vtkProperty* thePropF)
+{
+ using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ std::vector<vtkProperty*> aProps;
+ aProps.push_back( thePropF );
+ ForEachIf<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject),
+ TSetFunction<SALOME_Actor,std::vector<vtkProperty*> >
+ (&SALOME_Actor::SetMaterial,aProps));
+}
+
+/*!
+ Get current front material
+ \param theIObject - object
+ \return property contained material properties of the given object
+*/
+vtkProperty*
+SVTK_View
+::GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject)
+{
+ using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ SALOME_Actor* anActor =
+ Find<SALOME_Actor>(aCopy.GetActors(),
+ TIsSameIObject<SALOME_Actor>(theIObject));
+ if(anActor)
+ return anActor->GetMaterial();
+ return NULL;
+}
+
+/*!
+ \Collect objects visible in viewer
+ \param theList - visible objects collection
+*/
+void SVTK_View::GetVisible( SALOME_ListIO& theList )
+{
+ using namespace SVTK;
+ VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+ ForEach<SALOME_Actor>(aCopy.GetActors(),
+ TCollectIfVisible<SALOME_Actor>(theList));
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_VIEW_H
#define SVTK_VIEW_H
#endif
#include "SVTK.h"
-#include "SALOME_InteractiveObject.hxx"
+
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
#include <QObject>
class vtkActorCollection;
class vtkRenderer;
+class vtkProperty;
class SVTK_ViewWindow;
class SVTK_Renderer;
//! To highlight a VTK presentation with the same #SALOME_InteractiveObject
void
highlight(const Handle(SALOME_InteractiveObject)& IObject,
- bool highlight,
- bool immediatly = true);
+ bool highlight,
+ bool immediatly = true);
//! To unhighlight all VTK presentations
void
void
rename(const Handle(SALOME_InteractiveObject)& IObject,
- const QString& newName);
+ const QString& newName);
//----------------------------------------------------------------------------
// Displaymode management
//! Switch representation wireframe/shading
void
SetDisplayMode(const Handle(SALOME_InteractiveObject)& IObject,
- int theMode);
+ int theMode);
//! Change all actors to wireframe
void
void
ChangeRepresentationToSurface();
+ //! Change all actors to surface with edges
+ void
+ ChangeRepresentationToSurfaceWithEdges();
+
//! Change to wireframe a list of vtkactor
void
ChangeRepresentationToWireframe(vtkActorCollection* theListofActors);
void
ChangeRepresentationToSurface(vtkActorCollection* theListofActors);
+ //! Change to surface with edges a list of vtkactor
+ void
+ ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theListofActors);
+
//! Change transparency
void
SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject,
- float trans);
+ float trans);
//! Get current transparency
float
//! Change color
void
SetColor(const Handle(SALOME_InteractiveObject)& theIObject,
- const QColor& theColor);
+ const QColor& theColor);
//! Get current color
QColor
GetColor(const Handle(SALOME_InteractiveObject)& theIObject);
+ //! Change material
+ void
+ SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject,
+ vtkProperty* thePropF);
+
+ //! Get current material
+ vtkProperty*
+ GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject);
+
//----------------------------------------------------------------------------
// Erase Display functions
//! To erase all existing VTK presentations
//! To erase VTK presentation with defined #SALOME_InteractiveObject
void
Erase(const Handle(SALOME_InteractiveObject)& IObject,
- bool immediatly = true);
+ bool immediatly = true);
void
Remove(const Handle(SALOME_InteractiveObject)& IObject,
- bool immediatly = true);
+ bool immediatly = true);
//! To display VTK presentation with defined #SALOME_InteractiveObject
void
Display(const Handle(SALOME_InteractiveObject)& IObject,
- bool immediatly = true);
+ bool immediatly = true);
//! To display VTK presentation with defined #SALOME_InteractiveObject and erase all anothers
void
//! To display the VTK presentation
void
Display(SALOME_Actor* SActor,
- bool immediatly = true);
+ bool immediatly = true);
//! To erase the VTK presentation
void
Erase(SALOME_Actor* SActor,
- bool immediatly = true);
+ bool immediatly = true);
//! To remove the VTK presentation
void
Remove(SALOME_Actor* SActor,
- bool updateViewer = true);
+ bool updateViewer = true);
+
+ //! Collect objects visible in viewer
+ void
+ GetVisible( SALOME_ListIO& theList );
//----------------------------------------------------------------------------
//! Redirect the request to #SVTK_Renderer::SetPreselectionProp
void
SetSelectionProp(const double& theRed = 1,
- const double& theGreen = 1,
- const double& theBlue = 0,
- const int& theWidth = 5);
+ const double& theGreen = 1,
+ const double& theBlue = 0,
+ const int& theWidth = 5);
//! Redirect the request to #SVTK_Renderer::SetPreselectionProp
void
SetPreselectionProp(const double& theRed = 0,
- const double& theGreen = 1,
- const double& theBlue = 1,
- const int& theWidth = 5);
+ const double& theGreen = 1,
+ const double& theBlue = 1,
+ const int& theWidth = 5);
//! Redirect the request to #SVTK_Renderer::SetPreselectionProp
void
SetSelectionTolerance(const double& theTolNodes = 0.025,
- const double& theTolCell = 0.001,
- const double& theTolObjects = 0.025);
+ const double& theTolCell = 0.001,
+ const double& theTolObjects = 0.025);
protected:
int myDisplayMode;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_ViewManager.h"
#include "SVTK_ViewModel.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_VIEWMANAGER_H
#define SVTK_VIEWMANAGER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include <QMenu>
#include <QColorDialog>
#include <QToolBar>
//#include "SVTK_MainWindow.h"
#include "SVTK_Prs.h"
+#include "VTKViewer_Algorithm.h"
#include "VTKViewer_ViewModel.h"
#include "SUIT_ViewModel.h"
#include "SALOME_Actor.h"
-#include <QtxActionToolMgr.h>
+#include "QtxActionToolMgr.h"
+#include "QtxBackgroundTool.h"
+
+// VSR: Uncomment below line to allow texture background support in VTK viewer
+#define VTK_ENABLE_TEXTURED_BACKGROUND
+
// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
{
myTrihedronSize = 105;
myTrihedronRelative = true;
+ myIsStaticTrihedronVisible = true;
myIncrementSpeed = 10;
myIncrementMode = 0;
myProjMode = 0;
myStyle = 0;
+ myZoomingStyle = 0;
+ myDynamicPreSelection = false;
mySpaceBtn[0] = 1;
mySpaceBtn[1] = 2;
mySpaceBtn[2] = 9;
+ myDefaultBackground = Qtx::BackgroundData( Qt::black );
}
/*!
{
}
-/*!
- \return background color
-*/
+/*! Get data for supported background modes: gradient types, identifiers and supported image formats */
+QString SVTK_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList )
+{
+ gradList << tr( "GT_HORIZONTALGRADIENT" )
+ << tr( "GT_VERTICALGRADIENT" )
+ << tr( "GT_FIRSTDIAGONALGRADIENT" )
+ << tr( "GT_SECONDDIAGONALGRADIENT" )
+ << tr( "GT_FIRSTCORNERGRADIENT" )
+ << tr( "GT_SECONDCORNERGRADIENT" )
+ << tr( "GT_THIRDCORNERGRADIENT" )
+ << tr( "GT_FOURTHCORNERGRADIENT" );
+ idList << HorizontalGradient
+ << VerticalGradient
+ << FirstDiagonalGradient
+ << SecondDiagonalGradient
+ << FirstCornerGradient
+ << SecondCornerGradient
+ << ThirdCornerGradient
+ << FourthCornerGradient;
+#ifdef VTK_ENABLE_TEXTURED_BACKGROUND
+ txtList << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
+#endif
+ return tr("BG_IMAGE_FILES");
+}
+
+//! Get background color of the viewer [obsolete]
QColor SVTK_Viewer::backgroundColor() const
{
- return myBgColor;
+ return background().color();
+}
+
+//! Set background color to the viewer [obsolete]
+void SVTK_Viewer::setBackgroundColor( const QColor& c )
+{
+ Qtx::BackgroundData bg = background();
+ bg.setColor( c );
+ setBackground( bg );
}
/*!
- Changes background color
- \param theColor - new background color
+ \return background data
*/
-void SVTK_Viewer::setBackgroundColor( const QColor& theColor )
+Qtx::BackgroundData SVTK_Viewer::background() const
{
- if ( !theColor.isValid() )
- return;
+ return myDefaultBackground;
+}
+/*!
+ Changes background
+ \param theBackground - new background data
+*/
+void SVTK_Viewer::setBackground( const Qtx::BackgroundData& theBackground )
+{
+ myDefaultBackground = theBackground.isValid() ? theBackground : Qtx::BackgroundData( Qt::black );
QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
- aView->setBackgroundColor(theColor);
+ aView->setBackground(myDefaultBackground);
}
}
- }
-
- myBgColor = theColor;
+ }
}
/*!Create new instance of view window on desktop \a theDesktop.
TViewWindow* aViewWindow = new TViewWindow(theDesktop);
aViewWindow->Initialize(this);
- aViewWindow->setBackgroundColor( backgroundColor() );
+ aViewWindow->setBackground( background() );
aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() );
+ aViewWindow->SetStaticTrihedronVisible( isStaticTrihedronVisible() );
aViewWindow->SetProjectionMode( projectionMode() );
aViewWindow->SetInteractionStyle( interactionStyle() );
+ aViewWindow->SetZoomingStyle( zoomingStyle() );
+ aViewWindow->SetDynamicPreSelection( dynamicPreSelection() );
aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
connect(aViewWindow, SIGNAL( actorAdded(VTKViewer_Actor*) ),
- this, SLOT(onActorAdded(VTKViewer_Actor*)));
+ this, SLOT(onActorAdded(VTKViewer_Actor*)));
connect(aViewWindow, SIGNAL( actorRemoved(VTKViewer_Actor*) ),
- this, SLOT(onActorRemoved(VTKViewer_Actor*)));
+ this, SLOT(onActorRemoved(VTKViewer_Actor*)));
return aViewWindow;
}
for ( uint i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
- aView->SetTrihedronSize( theSize, theRelative );
+ aView->SetTrihedronSize( theSize, theRelative );
}
}
}
+/*!
+ \return visibility status of the static trihedron
+*/
+bool SVTK_Viewer::isStaticTrihedronVisible() const
+{
+ return myIsStaticTrihedronVisible;
+}
+
+/*!
+ Sets visibility status of the static trihedron
+ \param theIsVisible - new visibility status
+*/
+void SVTK_Viewer::setStaticTrihedronVisible( const bool theIsVisible )
+{
+ myIsStaticTrihedronVisible = theIsVisible;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetStaticTrihedronVisible( theIsVisible );
+ }
+ }
+}
/*!
\return projection mode
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
for ( uint i = 0; i < aViews.count(); i++ )
{
- if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
- aView->SetProjectionMode( theMode );
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetProjectionMode( theMode );
}
}
}
for ( uint i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
- aView->SetInteractionStyle( theStyle );
+ aView->SetInteractionStyle( theStyle );
+ }
+ }
+}
+
+/*!
+ \return zooming style
+*/
+int SVTK_Viewer::zoomingStyle() const
+{
+ return myZoomingStyle;
+}
+
+/*!
+ Sets zooming style: 0 - standard, 1 - advanced (at cursor)
+ \param theStyle - new zooming style
+*/
+void SVTK_Viewer::setZoomingStyle( const int theStyle )
+{
+ myZoomingStyle = theStyle;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetZoomingStyle( theStyle );
+ }
+ }
+}
+
+/*!
+ \return dynamic preselection
+*/
+bool SVTK_Viewer::dynamicPreSelection() const
+{
+ return myDynamicPreSelection;
+}
+
+/*!
+ Sets dynamic preselection
+ \param theMode - new dynamic preselection mode
+*/
+void SVTK_Viewer::setDynamicPreSelection( const bool theMode )
+{
+ myDynamicPreSelection = theMode;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetDynamicPreSelection( theMode );
}
}
}
for ( uint i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
- aView->SetIncrementalSpeed( theValue, theMode );
+ aView->SetIncrementalSpeed( theValue, theMode );
}
}
}
for ( uint i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
- aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
+ aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 );
}
}
}
void SVTK_Viewer::contextMenuPopup( QMenu* thePopup )
{
thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
- thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+ thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
thePopup->addSeparator();
/*!
SLOT: called if background color is to be changed changed, passes new color to view port
*/
-void SVTK_Viewer::onChangeBgColor()
+void SVTK_Viewer::onChangeBackground()
{
- if(SUIT_ViewWindow* aView = myViewManager->getActiveView()){
- QColor aColor = QColorDialog::getColor( backgroundColor(), aView);
- setBackgroundColor(aColor);
- }
+ SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(myViewManager->getActiveView());
+ if ( !aView )
+ return;
+
+ // get supported gradient types
+ QStringList gradList;
+ QIntList idList, txtList;
+ QString formats = backgroundData( gradList, idList, txtList );
+
+ // invoke dialog box
+ Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(), // initial background
+ aView, // parent for dialog box
+ txtList, // allowed texture modes
+ true, // enable solid color mode
+ true, // enable gradient mode
+ false, // disable custom gradient mode
+ !txtList.isEmpty(), // enable texture mode
+ gradList, // gradient names
+ idList, // gradient identifiers
+ formats ); // image formats
+
+ // set chosen background data to the viewer
+ if ( bgData.isValid() )
+ aView->setBackground( bgData );
}
/*!
// _PTR(Study) aStudy(getStudyDS());
anActorCollection->InitTraversal();
while(vtkActor* anActor = anActorCollection->GetNextActor()){
- if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
- // Set visibility flag
+ if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+ if(!anAct->ShouldBeDisplayed())
+ continue;
+ // Set visibility flag
// Temporarily commented to avoid awful dependecy on SALOMEDS
// TODO: better mechanism of storing display/erse status in a study
// should be provided...
- //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
- //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
- // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
- //}
- // just display the object
- QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
- if(SVTK_View* aView = aViewWindow->getView()){
- aView->Display(anAct,false);
- if(anAct->IsSetCamera()){
- vtkRenderer* aRenderer = aView->getRenderer();
- anAct->SetCamera( aRenderer->GetActiveCamera() );
- }
- }
- }
- }
- }
+ //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+ //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+ // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
+ //}
+ // just display the object
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+ if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
+ if(SVTK_View* aView = aViewWindow->getView()){
+ aView->Display(anAct,false);
+ if(anAct->IsSetCamera()){
+ vtkRenderer* aRenderer = aView->getRenderer();
+ anAct->SetCamera( aRenderer->GetActiveCamera() );
+ }
+ }
+ }
+ }
+ }
}
}
}
if(vtkActorCollection* anActorCollection = aPrs->GetObjects()){
// get SALOMEDS Study
// Temporarily commented to avoid awful dependecy on SALOMEDS
- // TODO: better mechanism of storing display/erse status in a study
+ // TODO: better mechanism of storing display/erase status in a study
// should be provided...
//_PTR(Study) aStudy(getStudyDS());
anActorCollection->InitTraversal();
while(vtkActor* anActor = anActorCollection->GetNextActor())
- if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
- // Set visibility flag
+ if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+ // Set visibility flag
// Temporarily commented to avoid awful dependecy on SALOMEDS
- // TODO: better mechanism of storing display/erse status in a study
+ // TODO: better mechanism of storing display/erase status in a study
// should be provided...
- //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
- //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
- // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
- //}
- // just display the object
- QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
- if(SVTK_View* aView = aViewWindow->getView())
- if ( forced )
- aView->Remove(anAct,false);
- else
- aView->Erase(anAct,forced);
- }
- }
+ //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+ //if(!anObj.IsNull() && anObj->hasEntry() && aStudy){
+ // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+ //}
+ // just display the object
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
+ if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
+ if(SVTK_View* aView = aViewWindow->getView())
+ {
+ if ( forced )
+ aView->Remove(anAct,false);
+ else
+ aView->Erase(anAct,forced);
+ }
+ }
+ }
}
}
}
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
if(SVTK_View* aView = aViewWindow->getView()){
- vtkRenderer* aRenderer = aView->getRenderer();
- vtkActorCollection* anActorCollection = aRenderer->GetActors();
- anActorCollection->InitTraversal();
- while(vtkActor* anActor = anActorCollection->GetNextActor()){
- if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
- // Set visibility flag
+ vtkRenderer* aRenderer = aView->getRenderer();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* anActorCollection = aCopy.GetActors();
+ anActorCollection->InitTraversal();
+ while(vtkActor* anActor = anActorCollection->GetNextActor()){
+ if(SALOME_Actor* anAct = SALOME_Actor::SafeDownCast(anActor)){
+ // Set visibility flag
// Temporarily commented to avoid awful dependecy on SALOMEDS
// TODO: better mechanism of storing display/erse status in a study
// should be provided...
- //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
- //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
- // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
- if(forced)
- aRenderer->RemoveActor(anAct);
- else{
- // just erase actor
- anAct->SetVisibility( false );
- // erase dependent actors
- vtkActorCollection* aCollection = vtkActorCollection::New();
- anAct->GetChildActors( aCollection );
- aCollection->InitTraversal();
- while(vtkActor* aSubAct = aCollection->GetNextActor())
- aSubAct->SetVisibility( false );
- aCollection->Delete();
- }
- }
- }
+ //Handle(SALOME_InteractiveObject) anObj = anAct->getIO();
+ //if(!anObj.IsNull() && anObj->hasEntry() && aStudy)
+ // ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
+ if(forced)
+ aRenderer->RemoveActor(anAct);
+ else{
+ // just erase actor
+ anAct->SetVisibility( false );
+ // erase dependent actors
+ vtkActorCollection* aCollection = vtkActorCollection::New();
+ anAct->GetChildActors( aCollection );
+ aCollection->InitTraversal();
+ while(vtkActor* aSubAct = aCollection->GetNextActor())
+ aSubAct->SetVisibility( false );
+ aCollection->Delete();
+ }
+ }
+ }
}
}
Repaint();
if ( entry ) {
if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(getViewManager()->getActiveView()))
if(SVTK_View* aView = aViewWindow->getView()){
- vtkRenderer* aRenderer = aView->getRenderer();
- vtkActorCollection* theActors = aRenderer->GetActors();
- theActors->InitTraversal();
- vtkActor* ac;
- while( ( ac = theActors->GetNextActor() ) ) {
- SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
- if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) {
- prs->AddObject( ac );
- }
- }
+ vtkRenderer* aRenderer = aView->getRenderer();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* theActors = aCopy.GetActors();
+ theActors->InitTraversal();
+ vtkActor* ac;
+ while( ( ac = theActors->GetNextActor() ) ) {
+ SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac );
+ if ( anActor && anActor->hasIO() && !strcmp( anActor->getIO()->getEntry(), entry ) ) {
+ prs->AddObject( ac );
+ }
+ }
}
}
return prs;
}
-/*!
- Auxiliary method called before displaying of objects
-*/
-void SVTK_Viewer::BeforeDisplay( SALOME_Displayer* d )
-{
- d->BeforeDisplay( this, SALOME_VTKViewType() );
-}
-
-/*!
- Auxiliary method called after displaying of objects
-*/
-void SVTK_Viewer::AfterDisplay( SALOME_Displayer* d )
-{
- d->AfterDisplay( this, SALOME_VTKViewType() );
-}
-
/*!
\return true if object is displayed in viewer
\param obj - object to be checked
return true;
}
+/*!
+ \Collect objects visible in viewer
+ \param theList - visible objects collection
+*/
+void SVTK_Viewer::GetVisible( SALOME_ListIO& theList )
+{
+ // here we collect object if it is disaplaed even one view
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
+ if(TViewWindow* aViewWnd = dynamic_cast<TViewWindow*>(aViewWindow))
+ if(SVTK_View* aView = aViewWnd->getView())
+ aView->GetVisible( theList );
+}
+
/*!
Updates current viewer
*/
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
if(TViewWindow* aViewWindow = dynamic_cast<TViewWindow*>(aViews.at(i)))
if(SVTK_View* aView = aViewWindow->getView())
- aView->Repaint();
+ aView->Repaint();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_VIEWMODEL_H
#define SVTK_VIEWMODEL_H
#include "SVTK.h"
#include "SVTK_ViewModelBase.h"
-#include "SALOME_Prs.h"
-#include "SALOME_InteractiveObject.hxx"
+#include "Qtx.h"
+
+#include <SALOME_Prs.h>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
#include <QColor>
#include <QMap>
Q_OBJECT;
public:
+ /*! supported gradient types */
+ enum {
+ HorizontalGradient,
+ VerticalGradient,
+ FirstDiagonalGradient,
+ SecondDiagonalGradient,
+ FirstCornerGradient,
+ SecondCornerGradient,
+ ThirdCornerGradient,
+ FourthCornerGradient,
+ LastGradient = FourthCornerGradient,
+ };
+
typedef SVTK_ViewWindow TViewWindow;
//! Define string representation of the viewer type
- static QString Type() { return "VTKViewer"; }
+ static QString Type() { return "VTKViewer"; }
+ static QString backgroundData( QStringList&, QIntList&, QIntList& );
SVTK_Viewer();
virtual ~SVTK_Viewer();
//! See #SUIT_ViewModel::getType
virtual QString getType() const { return Type(); }
- //! Get background color of the viewer
+ //! Get background color of the viewer [obsolete]
QColor backgroundColor() const;
- //! Set background color to the viewer
+ //! Set background color to the viewer [obsolete]
void setBackgroundColor( const QColor& );
+ //! Get background color of the viewer
+ Qtx::BackgroundData background() const;
+
+ //! Set background color to the viewer
+ void setBackground( const Qtx::BackgroundData& );
+
//! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
vtkFloatingPointType trihedronSize() const;
//! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
void setTrihedronSize( const vtkFloatingPointType, const bool = true );
+ //! Get visibility status of the static trihedron
+ bool isStaticTrihedronVisible() const;
+
+ //! Set visibility status of the static trihedron
+ void setStaticTrihedronVisible( const bool );
+
//! Gets projection mode
int projectionMode() const;
//! Sets interaction style
void setInteractionStyle( const int );
+ //! Gets zooming style
+ int zoomingStyle() const;
+
+ //! Sets zooming style
+ void setZoomingStyle( const int );
+
+ //! Gets dynamic preselection
+ bool dynamicPreSelection() const;
+
+ //! Sets dynamic preselection
+ void setDynamicPreSelection( const bool );
+
//! Get incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
int incrementalSpeed() const;
//! See #SALOME_View::EraseAll( const bool = false )
void EraseAll( const bool = false );
+ //! See #SALOME_View::getVisible( SALOME_ListIO& )
+ virtual void GetVisible( SALOME_ListIO& );
+
//! See #SALOME_View::CreatePrs( const char* entry = 0 )
SALOME_Prs* CreatePrs( const char* entry = 0 );
- //! See #SALOME_View::BeforeDisplay( SALOME_Displayer* d )
- virtual void BeforeDisplay( SALOME_Displayer* d );
-
- //! See #SALOME_View::AfterDisplay( SALOME_Displayer* d )
- virtual void AfterDisplay( SALOME_Displayer* d );
-
//! See #SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& )
virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
void onDumpView();
- void onChangeBgColor();
+ void onChangeBackground();
void onActorAdded(VTKViewer_Actor*);
void onActorRemoved(VTKViewer_Actor*);
private:
void updateToolBars();
-
- QColor myBgColor;
+ Qtx::BackgroundData myDefaultBackground;
vtkFloatingPointType myTrihedronSize;
- bool myTrihedronRelative;
- bool mySelectionEnabled;
- bool myMultiSelectionEnabled;
- int myIncrementSpeed;
- int myIncrementMode;
- int myProjMode;
- int myStyle;
- int mySpaceBtn[3];
+ bool myTrihedronRelative;
+ bool myIsStaticTrihedronVisible;
+ bool mySelectionEnabled;
+ bool myMultiSelectionEnabled;
+ int myIncrementSpeed;
+ int myIncrementMode;
+ int myProjMode;
+ int myStyle;
+ int myZoomingStyle;
+ bool myDynamicPreSelection;
+ int mySpaceBtn[3];
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_SELECTIONCHANGED_H
#define SVTK_SELECTIONCHANGED_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header:
-//
+
#include "SVTK_ViewParameterDlg.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_RenderWindowInteractor.h"
#include <vtkCamera.h>
#include <vtkGenericRenderWindowInteractor.h>
-using namespace std;
-
/*!
Constructor
*/
SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName):
- SVTK_DialogBase(theAction, theParent, theName),
+ SVTK_ViewWindow* theParent,
+ const char* theName):
+ ViewerTools_DialogBase(theAction, theParent, theName),
myMainWindow(theParent),
myPriority(0.0),
myEventCallbackCommand(vtkCallbackCommand::New()),
Processes events
*/
void SVTK_ViewParameterDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject),
- unsigned long theEvent,
- void* theClientData,
- void* theCallData)
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
{
SVTK_ViewParameterDlg* self = reinterpret_cast<SVTK_ViewParameterDlg*>(theClientData);
vtkFloatingPointType* aCoord;
vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
aCamera->SetFocalPoint(myFocalX->text().toDouble(),
- myFocalY->text().toDouble(),
- myFocalZ->text().toDouble());
+ myFocalY->text().toDouble(),
+ myFocalZ->text().toDouble());
aCamera->OrthogonalizeViewUp();
myRWInteractor->getRenderer()->ResetCameraClippingRange();
vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
aCamera->SetPosition(myCameraX->text().toDouble(),
- myCameraY->text().toDouble(),
- myCameraZ->text().toDouble());
+ myCameraY->text().toDouble(),
+ myCameraZ->text().toDouble());
aCamera->OrthogonalizeViewUp();
myRWInteractor->getRenderer()->ResetCameraClippingRange();
vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
aCamera->SetViewUp(myViewDirX->text().toDouble(),
- myViewDirY->text().toDouble(),
- myViewDirZ->text().toDouble());
+ myViewDirY->text().toDouble(),
+ myViewDirZ->text().toDouble());
// update view
myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
// recompute focal point
if (computePoint(pos, dir, dist, pnt)) {
if (mySelectPoint->isChecked())
- mySelectPoint->toggle();
+ mySelectPoint->toggle();
myBusy = true;
myFocalX->setText(QString::number(pnt[0]));
myFocalY->setText(QString::number(pnt[1]));
}
bool SVTK_ViewParameterDlg::computePoint(const double start[3],
- const double dir[3],
- const double dist,
- double result[3])
+ const double dir[3],
+ const double dist,
+ double result[3])
{
double d = sqrt(dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]);
if ( d < 0.0002 ) return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module : SALOME
-// $Header:
-//
+
#ifndef SVTK_VIEWPARAMETERDLG_H
#define SVTK_VIEWPARAMETERDLG_H
#include "SVTK.h"
-#include "SVTK_DialogBase.h"
+#include <ViewerTools_DialogBase.h>
#include <vtkSmartPointer.h>
#include <vtkTimeStamp.h>
class vtkCallbackCommand;
class vtkObject;
-class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase
+class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase
{
Q_OBJECT;
public:
SVTK_ViewParameterDlg(QtxAction* theAction,
- SVTK_ViewWindow* theParent,
- const char* theName);
+ SVTK_ViewWindow* theParent,
+ const char* theName);
~SVTK_ViewParameterDlg();
void setEnabled(QFrame* theWidget, const bool theState);
bool computePoint(const double start[3], const double dir[3],
- const double dist, double result[3]);
+ const double dist, double result[3]);
void updateProjection();
void updateCoordinates();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SVTK_NonIsometricDlg.h"
#include "SVTK_UpdateRateDlg.h"
#include "SVTK_CubeAxesDlg.h"
#include "SVTK_SetRotationPointDlg.h"
#include "SVTK_ViewParameterDlg.h"
+#include "SVTK_ViewModel.h"
+#include "VTKViewer_Texture.h"
+#include "VTKViewer_OpenGLRenderer.h"
#include "SALOME_Actor.h"
+#include <QMenu>
#include <QToolBar>
#include <QEvent>
+#include <QFileInfo>
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <QXmlStreamAttributes>
#include <vtkAxisActor2D.h>
#include <vtkGL2PSExporter.h>
#include <vtkInteractorStyle.h>
+#include <vtkProperty.h>
+#include <vtkCallbackCommand.h>
+#include <vtkJPEGReader.h>
+#include <vtkBMPReader.h>
+#include <vtkTIFFReader.h>
+#include <vtkPNGReader.h>
+#include <vtkMetaImageReader.h>
+#include <vtkImageMapToColors.h>
+#include <vtkTexture.h>
#include "QtxAction.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Accel.h"
#include "SUIT_OverrideCursor.h"
+#include "SUIT_ViewManager.h"
#include "QtxActionToolMgr.h"
#include "QtxMultiAction.h"
#include "SVTK_Event.h"
#include "SVTK_Renderer.h"
#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModelBase.h"
#include "SVTK_InteractorStyle.h"
#include "SVTK_RenderWindowInteractor.h"
#include "SVTK_GenericRenderWindowInteractor.h"
#include "SVTK_Recorder.h"
#include "SVTK_RecorderDlg.h"
+#include "vtkPVAxesWidget.h"
+#include "vtkPVAxesActor.h"
+
#include "SALOME_ListIteratorOfListIO.hxx"
#include "VTKViewer_Algorithm.h"
#include "SVTK_Functor.h"
+#include <OpenGLUtils_FrameBuffer.h>
+
namespace SVTK
{
SUIT_ViewWindow(theDesktop),
myView(NULL),
myDumpImage(QImage()),
- myKeyFreeInteractorStyle(SVTK_KeyFreeInteractorStyle::New())
+ myKeyFreeInteractorStyle(SVTK_KeyFreeInteractorStyle::New()),
+ myEventCallbackCommand(vtkCallbackCommand::New())
{
setWindowFlags( windowFlags() & ~Qt::Window );
// specific of vtkSmartPointer
{
myInteractor = new SVTK_RenderWindowInteractor(this,"SVTK_RenderWindowInteractor");
- SVTK_Selector* aSelector = SVTK_Selector::New();
+ SVTK_Selector* aSelector = SVTK_Selector::New();
+ aSelector->SetDynamicPreSelection( SUIT_Session::session()->resourceMgr()->
+ booleanValue( "VTKViewer", "dynamic_preselection", true ) );
SVTK_GenericRenderWindowInteractor* aDevice = SVTK_GenericRenderWindowInteractor::New();
aDevice->SetRenderWidget(myInteractor);
aRenderer->Delete();
aSelector->Delete();
- myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), -1, this );
- myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), -1, this );
+ myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false, Qt::AllToolBarAreas, -1, this );
+ myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), false, Qt::AllToolBarAreas, -1, this );
- createActions( SUIT_Session::session()->activeApplication()->resourceMgr() );
+ createActions( SUIT_Session::session()->resourceMgr() );
createToolBar();
SetEventDispatcher(myInteractor->GetDevice());
myUpdateRateDlg = new SVTK_UpdateRateDlg( getAction( UpdateRate ), this, "SVTK_UpdateRateDlg" );
myNonIsometricDlg = new SVTK_NonIsometricDlg( getAction( NonIsometric ), this, "SVTK_NonIsometricDlg" );
myCubeAxesDlg = new SVTK_CubeAxesDlg( getAction( GraduatedAxes ), this, "SVTK_CubeAxesDlg" );
+ myCubeAxesDlg->initialize();
mySetRotationPointDlg = new SVTK_SetRotationPointDlg
( getAction( ChangeRotationPointId ), this, "SVTK_SetRotationPointDlg" );
myViewParameterDlg = new SVTK_ViewParameterDlg
( getAction( ViewParametersId ), this, "SVTK_ViewParameterDlg" );
- SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
- myInteractor->PushInteractorStyle(aStyle);
- aStyle->Delete();
+ myDefaultInteractorStyle = SVTK_InteractorStyle::New();
+ myInteractor->PushInteractorStyle(myDefaultInteractorStyle);
+ myDefaultInteractorStyle->Delete();
myRecorder = SVTK_Recorder::New();
setCentralWidget(myInteractor);
+ myAxesWidget = vtkPVAxesWidget::New();
+ myAxesWidget->SetParentRenderer(aRenderer->GetDevice());
+ myAxesWidget->SetViewport(0, 0, 0.25, 0.25);
+ myAxesWidget->SetInteractor(myInteractor->GetDevice());
+ myAxesWidget->SetEnabled(1);
+ myAxesWidget->SetInteractive(0);
+
+ vtkPVAxesActor* anAxesActor = myAxesWidget->GetAxesActor();
+ anAxesActor->GetXAxisTipProperty()->SetColor( 1.0, 0.0, 0.0 );
+ anAxesActor->GetXAxisShaftProperty()->SetColor( 1.0, 0.0, 0.0 );
+ anAxesActor->GetXAxisLabelProperty()->SetColor( 1.0, 0.0, 0.0 );
+ anAxesActor->GetYAxisTipProperty()->SetColor( 0.0, 1.0, 0.0 );
+ anAxesActor->GetYAxisShaftProperty()->SetColor( 0.0, 1.0, 0.0 );
+ anAxesActor->GetYAxisLabelProperty()->SetColor( 0.0, 1.0, 0.0 );
+ anAxesActor->GetZAxisTipProperty()->SetColor( 0.0, 0.0, 1.0 );
+ anAxesActor->GetZAxisShaftProperty()->SetColor( 0.0, 0.0, 1.0 );
+ anAxesActor->GetZAxisLabelProperty()->SetColor( 0.0, 0.0, 1.0 );
+
myView = new SVTK_View(this);
Initialize(myView,theModel);
+
+
+ myEventCallbackCommand->SetClientData(this);
+ myEventCallbackCommand->SetCallback(SVTK_ViewWindow::ProcessEvents);
+ myEventCallbackCommand->Delete();
+
+ GetInteractor()->GetInteractorStyle()->AddObserver(SVTK::OperationFinished,
+ myEventCallbackCommand.GetPointer(), 0.0);
+
+
myInteractor->getRenderWindow()->Render();
+ setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
onResetView();
}
To initialize #SVTK_ViewWindow instance
*/
void SVTK_ViewWindow::Initialize(SVTK_View* theView,
- SVTK_ViewModelBase* theModel)
+ SVTK_ViewModelBase* theModel)
{
connect(theView,SIGNAL(KeyPressed(QKeyEvent*)),
this,SLOT(onKeyPressed(QKeyEvent*)) );
connect(theView,SIGNAL(contextMenuRequested(QContextMenuEvent*)),
this,SIGNAL(contextMenuRequested(QContextMenuEvent *)));
connect(theView,SIGNAL(selectionChanged()),
- theModel,SLOT(onSelectionChanged()));
+ theModel,SLOT(onSelectionChanged()));
}
/*!
Destructor
*/
SVTK_ViewWindow::~SVTK_ViewWindow()
-{}
+{
+ myRecorder->Delete();
+ myAxesWidget->Delete();
+}
/*!
{
GetRenderer()->OnFrontView();
Repaint();
+ emit transformed( this );
}
/*!
{
GetRenderer()->OnBackView();
Repaint();
+ emit transformed( this );
}
/*!
{
GetRenderer()->OnTopView();
Repaint();
+ emit transformed( this );
}
/*!
{
GetRenderer()->OnBottomView();
Repaint();
+ emit transformed( this );
}
/*!
{
GetRenderer()->OnLeftView();
Repaint();
+ emit transformed( this );
}
/*!
{
GetRenderer()->OnRightView();
Repaint();
+ emit transformed( this );
+}
+
+/*!
+ \brief Rotate view 90 degrees clockwise
+*/
+void SVTK_ViewWindow::onClockWiseView()
+{
+ GetRenderer()->onClockWiseView();
+ Repaint();
+ emit transformed( this );
+}
+
+/*!
+ \brief Rotate view 90 degrees conterclockwise
+*/
+void SVTK_ViewWindow::onAntiClockWiseView()
+{
+ GetRenderer()->onAntiClockWiseView();
+ Repaint();
+ emit transformed( this );
}
/*!
{
GetRenderer()->OnResetView();
Repaint();
+ emit transformed( this );
}
/*!
{
GetRenderer()->OnFitAll();
Repaint();
+ emit transformed( this );
}
/*!
\param theIsUpdate - update current viewer
*/
void SVTK_ViewWindow::highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight,
- bool theIsUpdate )
+ bool theIsHighlight,
+ bool theIsUpdate )
{
myView->highlight( theIO, theIsHighlight, theIsUpdate );
}
\param theImmediatly - update viewer
*/
void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO,
- bool theImmediatly)
+ bool theImmediatly)
{
myView->Display(theIO,theImmediatly);
}
\param theImmediatly - update viewer
*/
void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO,
- bool theImmediatly)
+ bool theImmediatly)
{
myView->Erase(theIO,theImmediatly);
}
}
/*!
- Sets background color
+ Sets background color [obsolete]
\param color - new background color
*/
-void SVTK_ViewWindow::setBackgroundColor( const QColor& theColor )
+void SVTK_ViewWindow::setBackgroundColor( const QColor& c )
{
- getRenderer()->SetBackground(theColor.red()/255.0,
- theColor.green()/255.0,
- theColor.blue()/255.0);
+ Qtx::BackgroundData bg = background();
+ bg.setColor( c );
+ setBackground( bg );
}
/*!
- \return background color of viewer
+ \return background color of viewer [obsolete]
*/
QColor SVTK_ViewWindow::backgroundColor() const
{
- vtkFloatingPointType aBackgroundColor[3];
- getRenderer()->GetBackground(aBackgroundColor);
- return QColor(int(aBackgroundColor[0]*255),
- int(aBackgroundColor[1]*255),
- int(aBackgroundColor[2]*255));
+ return background().color();
+}
+
+/*!
+ Sets background data
+ \param bgData - new background data
+*/
+void SVTK_ViewWindow::setBackground( const Qtx::BackgroundData& bgData )
+{
+ bool ok = false;
+
+ if ( bgData.isValid() ) {
+ switch ( bgData.mode() ) {
+ case Qtx::ColorBackground:
+ {
+ QColor c = bgData.color();
+ if ( c.isValid() ) {
+ // show solid-colored background
+ getRenderer()->SetTexturedBackground( false ); // cancel texture mode
+ getRenderer()->SetGradientBackground( false ); // cancel gradient mode
+ getRenderer()->SetBackground( c.red()/255.0,
+ c.green()/255.0,
+ c.blue()/255.0 ); // set background color
+ ok = true;
+ }
+ break;
+ }
+ case Qtx::SimpleGradientBackground:
+ {
+ QColor c1, c2;
+ int type = bgData.gradient( c1, c2 );
+ if ( c1.isValid() )
+ {
+ if ( !c2.isValid() )
+ c2 = c1;
+
+ // show two-color gradient background
+ getRenderer()->SetTexturedBackground( false ); // cancel texture mode
+ getRenderer()->SetGradientBackground( true ); // switch to gradient mode
+
+ VTKViewer_OpenGLRenderer* aRenderer =
+ VTKViewer_OpenGLRenderer::SafeDownCast( getRenderer() );
+ if( aRenderer )
+ {
+ aRenderer->SetGradientType( type );
+ aRenderer->SetBackground( c1.redF(), c1.greenF(), c1.blueF() );
+ aRenderer->SetBackground2( c2.redF(), c2.greenF(), c2.blueF() );
+ ok = true;
+ }
+ }
+ break;
+ }
+ case Qtx::CustomGradientBackground:
+ {
+ // NOT IMPLEMENTED YET
+ getRenderer()->SetTexturedBackground( false ); // cancel texture mode
+ getRenderer()->SetGradientBackground( false ); // cancel gradient mode
+ // .........
+ break;
+ }
+ default:
+ break;
+ }
+ if ( bgData.isTextureShown() ) {
+ QString fileName;
+ int textureMode = bgData.texture( fileName );
+ QFileInfo fi( fileName );
+ if ( !fileName.isEmpty() && fi.exists() ) {
+ // read texture from file
+ QString extension = fi.suffix().toLower();
+ vtkImageReader2* aReader = 0;
+ if ( extension == "jpg" || extension == "jpeg" )
+ aReader = vtkJPEGReader::New();
+ else if ( extension == "bmp" )
+ aReader = vtkBMPReader::New();
+ else if ( extension == "tif" || extension == "tiff" )
+ aReader = vtkTIFFReader::New();
+ else if ( extension == "png" )
+ aReader = vtkPNGReader::New();
+ else if ( extension == "mhd" || extension == "mha" )
+ aReader = vtkMetaImageReader::New();
+ if ( aReader ) {
+ // create texture
+ aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() );
+ aReader->Update();
+ VTKViewer_Texture* aTexture = VTKViewer_Texture::New();
+ vtkImageMapToColors* aMap = 0;
+ vtkAlgorithmOutput* anOutput;
+ /*
+ // special processing for BMP reader
+ vtkBMPReader* aBMPReader = (vtkBMPReader*)aReader;
+ if ( aBMPReader ) {
+ // Special processing for BMP file
+ aBMPReader->SetAllow8BitBMP(1);
+
+ aMap = vtkImageMapToColors::New();
+ aMap->SetInputConnection( aBMPReader->GetOutputPort() );
+ aMap->SetLookupTable( (vtkScalarsToColors*)aBMPReader->GetLookupTable() );
+ aMap->SetOutputFormatToRGB();
+
+ anOutput = aMap->GetOutputPort();
+ }
+ else {
+ }
+ */
+ anOutput = aReader->GetOutputPort( 0 );
+ aTexture->SetInputConnection( anOutput );
+ // set texture mode
+ // VSR: Currently, VTK only supports Stretch mode, so below code will give
+ // the same results for all modes
+ switch ( textureMode ) {
+ case Qtx::TileTexture:
+ aTexture->SetPosition((int)VTKViewer_Texture::Tiled);
+ break;
+ case Qtx::StretchTexture:
+ aTexture->SetPosition((int)VTKViewer_Texture::Stretched);
+ break;
+ case Qtx::CenterTexture:
+ aTexture->SetPosition((int)VTKViewer_Texture::Centered);
+ default:
+ break;
+ }
+ // show textured background
+ getRenderer()->SetTexturedBackground( true );
+ getRenderer()->SetBackgroundTexture( aTexture );
+
+ // clean-up resources
+ if ( aMap )
+ aMap->Delete();
+ aReader->Delete();
+ aTexture->Delete();
+ ok = true;
+ }
+ }
+ }
+ }
+ if ( ok )
+ myBackground = bgData;
+}
+
+/*!
+ \return background data of viewer
+*/
+Qtx::BackgroundData SVTK_ViewWindow::background() const
+{
+ return myBackground;
}
{
GetRenderer()->SetScale( theScale );
Repaint();
+ emit transformed( this );
}
/*!
onSwitchInteractionStyle( theStyle==1 );
}
+/*!
+ Sets actual zooming style
+ \param theStyle - type of zooming style ( 0 - standard, 1 - advanced (at cursor) )
+*/
+void SVTK_ViewWindow::SetZoomingStyle(const int theStyle)
+{
+ onSwitchZoomingStyle( theStyle==1 );
+}
+
+/*!
+ Switch dynamic preselection on / off
+ \param theDynPreselection - dynamic pre-selection mode
+*/
+void SVTK_ViewWindow::SetDynamicPreSelection( bool theDynPreselection )
+{
+ onSwitchDynamicPreSelection( theDynPreselection );
+}
+
/*!
Switches "keyboard free" interaction style on/off
*/
// keep the same style extensions
SVTK_InteractorStyle* aStyle = (SVTK_InteractorStyle*)GetInteractorStyle();
if ( aStyle ) {
- myKeyFreeInteractorStyle->SetControllerIncrement(aStyle->ControllerIncrement());
- myKeyFreeInteractorStyle->SetControllerOnKeyDown(aStyle->ControllerOnKeyDown());
+ myKeyFreeInteractorStyle->SetControllerIncrement(aStyle->ControllerIncrement());
+ myKeyFreeInteractorStyle->SetControllerOnKeyDown(aStyle->ControllerOnKeyDown());
}
PushInteractorStyle(myKeyFreeInteractorStyle.GetPointer());
if ( a->isChecked() != theOn ) a->setChecked( theOn );
}
+/*!
+ Toogles advanced zooming style (relatively to the cursor position) on/off
+*/
+void SVTK_ViewWindow::onSwitchZoomingStyle( bool theOn )
+{
+ if( myDefaultInteractorStyle.GetPointer() )
+ myDefaultInteractorStyle->SetAdvancedZoomingEnabled( theOn );
+ if( myKeyFreeInteractorStyle.GetPointer() )
+ myKeyFreeInteractorStyle->SetAdvancedZoomingEnabled( theOn );
+
+ // update action state if method is called outside
+ QtxAction* a = getAction( SwitchZoomingStyleId );
+ if ( a->isChecked() != theOn )
+ a->setChecked( theOn );
+}
+
+/*!
+ Toogles dynamic preselection on/off
+*/
+void SVTK_ViewWindow::onSwitchDynamicPreSelection( bool theOn )
+{
+ GetSelector()->SetDynamicPreSelection( theOn );
+
+ // update action state if method is called outside
+ QtxAction* a = getAction( SwitchDynamicPreselectionId );
+ if ( a->isChecked() != theOn )
+ a->setChecked( theOn );
+}
+
/*!
Sets incremental speed
\param theValue - new incremental speed
\param theBtn3 - spacemouse button for the "dominant combined switch"
*/
void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1,
- const int theBtn2,
- const int theBtn3)
+ const int theBtn2,
+ const int theBtn3)
{
int val = theBtn1;
myEventDispatcher->InvokeEvent(SVTK::SetSMDecreaseSpeedEvent, &val);
GetRenderer()->OnAdjustCubeAxes();
}
+void SVTK_ViewWindow::synchronize(SVTK_ViewWindow* otherViewWindow )
+{
+ if ( otherViewWindow ) {
+ bool blocked = blockSignals( true );
+ doSetVisualParameters( otherViewWindow->getVisualParameters(), true );
+ blockSignals( blocked );
+ }
+}
+
/*!
Emits key pressed
*/
Redirect the request to #SVTK_Renderer::AddActor
*/
void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor,
- bool theUpdate )
+ bool theUpdate,
+ bool theIsAdjustActors )
{
- GetRenderer()->AddActor(theActor);
+ GetRenderer()->AddActor(theActor, theIsAdjustActors);
if(theUpdate)
Repaint();
emit actorAdded(theActor);
Redirect the request to #SVTK_Renderer::RemoveActor
*/
void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor,
- bool theUpdate )
+ bool theUpdate,
+ bool theIsAdjustActors )
{
- GetRenderer()->RemoveActor(theActor);
+ GetRenderer()->RemoveActor(theActor, theIsAdjustActors);
if(theUpdate)
Repaint();
emit actorRemoved(theActor);
int aWidth = aSize[0];
int aHeight = aSize[1];
+ OpenGLUtils_FrameBuffer aFrameBuffer;
+ if( aFrameBuffer.init( aWidth, aHeight ) )
+ {
+ glPushAttrib( GL_VIEWPORT_BIT );
+ glViewport( 0, 0, aWidth, aHeight );
+ aFrameBuffer.bind();
+
+ // draw scene
+ aWindow->Render();
+
+ aFrameBuffer.unbind();
+ glPopAttrib();
+
+ QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
+
+ aFrameBuffer.bind();
+ glReadPixels( 0, 0, aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
+ aFrameBuffer.unbind();
+
+ anImage = anImage.rgbSwapped();
+ anImage = anImage.mirrored();
+ return anImage;
+ }
+
+ // if frame buffers are unsupported, use old functionality
unsigned char *aData =
aWindow->GetRGBACharPixelData( 0, 0, aWidth-1, aHeight-1, 0 );
if( myDumpImage.isNull() )
return dumpViewContent();
+ RefreshDumpImage();
return myDumpImage;
}
Redirect the request to #SVTK_Renderer::SetSelectionProp
*/
void SVTK_ViewWindow::SetSelectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myView->SetSelectionProp(theRed,theGreen,theBlue,theWidth);
}
Redirect the request to #SVTK_Renderer::SetSelectionProp
*/
void SVTK_ViewWindow::SetPreselectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myView->SetPreselectionProp(theRed,theGreen,theBlue,theWidth);
}
Redirect the request to #SVTK_Renderer::SetSelectionTolerance
*/
void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes,
- const double& theTolItems,
- const double& theTolObjects)
+ const double& theTolItems,
+ const double& theTolObjects)
{
myView->SetSelectionTolerance(theTolNodes, theTolItems, theTolObjects);
}
+/*!
+ Get visibility status of the static trihedron
+*/
+bool SVTK_ViewWindow::IsStaticTrihedronVisible() const
+{
+ return (bool)myAxesWidget->GetEnabled();
+}
+
+/*!
+ Set visibility status of the static trihedron
+*/
+void SVTK_ViewWindow::SetStaticTrihedronVisible( const bool theIsVisible )
+{
+ myAxesWidget->SetEnabled( (int)theIsVisible );
+}
+
/*!
Performs action
\param accelAction - action
writer.writeEndElement();
//params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible,
- // title.toLatin1().data(), color[0], color[1], color[2], font, bold, italic, shadow );
+ // title.toLatin1().data(), color[0], color[1], color[2], font, bold, italic, shadow );
// Labels
isVisible = actor->GetLabelVisibility();
writer.writeEndElement();
writer.writeEndElement();
// params += QString().sprintf( "* Labels *%u*%u*%u*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, labels, offset,
- // color[0], color[1], color[2], font, bold, italic, shadow );
+ // color[0], color[1], color[2], font, bold, italic, shadow );
// Tick marks
isVisible = actor->GetTickVisibility();
aWriter.writeAttribute("Size", QString::number(GetTrihedronSize()));
aWriter.writeEndElement();
+ aWriter.writeStartElement("Background");
+ aWriter.writeAttribute("Value", QString( "%1" ).arg( Qtx::backgroundToString(background()) ));
+ aWriter.writeEndElement();
+
aWriter.writeEndElement();
aWriter.writeEndDocument();
/*!
The method restores visual parameters of this view from a formated string
*/
-void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
+void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters, bool baseParamsOnly )
{
+
double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
QXmlStreamReader aReader(parameters);
if (aReader.isStartElement()) {
QXmlStreamAttributes aAttr = aReader.attributes();
//printf("### Name = %s\n", qPrintable(aReader.name().toString()));
- if (aReader.name() == "Position") {
- pos[0] = aAttr.value("X").toString().toDouble();
- pos[1] = aAttr.value("Y").toString().toDouble();
- pos[2] = aAttr.value("Z").toString().toDouble();
- //printf("#### Position %f; %f; %f\n", pos[0], pos[1], pos[2]);
- } else if (aReader.name() == "FocalPoint") {
- focalPnt[0] = aAttr.value("X").toString().toDouble();
- focalPnt[1] = aAttr.value("Y").toString().toDouble();
- focalPnt[2] = aAttr.value("Z").toString().toDouble();
- //printf("#### FocalPoint %f; %f; %f\n", focalPnt[0], focalPnt[1], focalPnt[2]);
- } else if (aReader.name() == "ViewUp") {
- viewUp[0] = aAttr.value("X").toString().toDouble();
- viewUp[1] = aAttr.value("Y").toString().toDouble();
- viewUp[2] = aAttr.value("Z").toString().toDouble();
- //printf("#### ViewUp %f; %f; %f\n", viewUp[0], viewUp[1], viewUp[2]);
- } else if (aReader.name() == "ViewScale") {
- parScale = aAttr.value("Parallel").toString().toDouble();
- scale[0] = aAttr.value("X").toString().toDouble();
- scale[1] = aAttr.value("Y").toString().toDouble();
- scale[2] = aAttr.value("Z").toString().toDouble();
- //printf("#### ViewScale %f; %f; %f\n", scale[0], scale[1], scale[2]);
- } else if (aReader.name() == "DisplayCubeAxis") {
- if (aAttr.value("Show") == "0")
- gradAxesActor->VisibilityOff();
- else
- gradAxesActor->VisibilityOn();
- } else if (aReader.name() == "GraduatedAxis") {
- if(aAttr.value("Axis") == "X")
- setGradAxisVisualParams(aReader, gradAxesActor->GetXAxisActor2D());
- else if(aAttr.value("Axis") == "Y")
- setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
- else if(aAttr.value("Axis") == "Z")
- setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
- } else if (aReader.name() == "Trihedron") {
- if (aAttr.value("isShown") == "0")
- GetTrihedron()->VisibilityOff();
- else
- GetTrihedron()->VisibilityOn();
- SetTrihedronSize(aAttr.value("Size").toString().toDouble());
+ if (aReader.name() == "Position") {
+ pos[0] = aAttr.value("X").toString().toDouble();
+ pos[1] = aAttr.value("Y").toString().toDouble();
+ pos[2] = aAttr.value("Z").toString().toDouble();
+ //printf("#### Position %f; %f; %f\n", pos[0], pos[1], pos[2]);
+ }
+ else if (aReader.name() == "FocalPoint") {
+ focalPnt[0] = aAttr.value("X").toString().toDouble();
+ focalPnt[1] = aAttr.value("Y").toString().toDouble();
+ focalPnt[2] = aAttr.value("Z").toString().toDouble();
+ //printf("#### FocalPoint %f; %f; %f\n", focalPnt[0], focalPnt[1], focalPnt[2]);
+ }
+ else if (aReader.name() == "ViewUp") {
+ viewUp[0] = aAttr.value("X").toString().toDouble();
+ viewUp[1] = aAttr.value("Y").toString().toDouble();
+ viewUp[2] = aAttr.value("Z").toString().toDouble();
+ //printf("#### ViewUp %f; %f; %f\n", viewUp[0], viewUp[1], viewUp[2]);
+ }
+ else if (aReader.name() == "ViewScale") {
+ parScale = aAttr.value("Parallel").toString().toDouble();
+ scale[0] = aAttr.value("X").toString().toDouble();
+ scale[1] = aAttr.value("Y").toString().toDouble();
+ scale[2] = aAttr.value("Z").toString().toDouble();
+ //printf("#### ViewScale %f; %f; %f\n", scale[0], scale[1], scale[2]);
+ }
+ else if (aReader.name() == "DisplayCubeAxis") {
+ if ( !baseParamsOnly ) {
+ if (aAttr.value("Show") == "0")
+ gradAxesActor->VisibilityOff();
+ else
+ gradAxesActor->VisibilityOn();
+ }
+ }
+ else if (aReader.name() == "GraduatedAxis") {
+ if ( !baseParamsOnly ) {
+ if(aAttr.value("Axis") == "X")
+ setGradAxisVisualParams(aReader, gradAxesActor->GetXAxisActor2D());
+ else if(aAttr.value("Axis") == "Y")
+ setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
+ else if(aAttr.value("Axis") == "Z")
+ setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
+ }
+ }
+ else if (aReader.name() == "Trihedron") {
+ if ( !baseParamsOnly ) {
+ if (aAttr.value("isShown") == "0")
+ GetTrihedron()->VisibilityOff();
+ else
+ GetTrihedron()->VisibilityOn();
+ SetTrihedronSize(aAttr.value("Size").toString().toDouble());
+ }
}
- }
+ else if (aReader.name() == "Background") {
+ if ( !baseParamsOnly ) {
+ setBackground( Qtx::stringToBackground( aAttr.value("Value").toString() ) );
+ }
+ }
+ }
}
if (!aReader.hasError()) {
vtkCamera* camera = getRenderer()->GetActiveCamera();
camera->SetFocalPoint( focalPnt );
camera->SetViewUp( viewUp );
camera->SetParallelScale( parScale );
- SetScale( scale );
- } else {
+ GetRenderer()->SetScale( scale );
+ //SetScale( scale );
+ }
+ else {
QStringList paramsLst = parameters.split( '*' );
if ( paramsLst.size() >= nNormalParams ) {
// 'reading' list of parameters
camera->SetFocalPoint( focalPnt );
camera->SetViewUp( viewUp );
camera->SetParallelScale( parScale );
- SetScale( scale );
+ GetRenderer()->SetScale( scale );
+ //SetScale( scale );
// apply graduated axes parameters
- SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
- if ( gradAxesActor && paramsLst.size() == nAllParams ) {
- int i = nNormalParams+1, j = i + nGradAxisParams - 1;
- ::setGradAxisVisualParams( gradAxesActor->GetXAxisActor2D(), parameters.section( '*', i, j ) );
- i = j + 1; j += nGradAxisParams;
- ::setGradAxisVisualParams( gradAxesActor->GetYAxisActor2D(), parameters.section( '*', i, j ) );
- i = j + 1; j += nGradAxisParams;
- ::setGradAxisVisualParams( gradAxesActor->GetZAxisActor2D(), parameters.section( '*', i, j ) );
-
- if ( paramsLst[13].toUShort() )
- gradAxesActor->VisibilityOn();
- else
- gradAxesActor->VisibilityOff();
- } else if ( paramsLst.size() == nAllParams ) {
- if ( paramsLst[90].toUShort() )
- GetTrihedron()->VisibilityOn();
- else
- GetTrihedron()->VisibilityOff();
-
- SetTrihedronSize(paramsLst[91].toDouble());
+ if ( !baseParamsOnly ) {
+ SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
+ if ( gradAxesActor && paramsLst.size() == nAllParams ) {
+ int i = nNormalParams+1, j = i + nGradAxisParams - 1;
+ ::setGradAxisVisualParams( gradAxesActor->GetXAxisActor2D(), parameters.section( '*', i, j ) );
+ i = j + 1; j += nGradAxisParams;
+ ::setGradAxisVisualParams( gradAxesActor->GetYAxisActor2D(), parameters.section( '*', i, j ) );
+ i = j + 1; j += nGradAxisParams;
+ ::setGradAxisVisualParams( gradAxesActor->GetZAxisActor2D(), parameters.section( '*', i, j ) );
+
+ if ( paramsLst[13].toUShort() )
+ gradAxesActor->VisibilityOn();
+ else
+ gradAxesActor->VisibilityOff();
+ }
+ else if ( paramsLst.size() == nAllParams ) {
+ if ( paramsLst[90].toUShort() )
+ GetTrihedron()->VisibilityOn();
+ else
+ GetTrihedron()->VisibilityOff();
+
+ SetTrihedronSize(paramsLst[91].toDouble());
+ }
}
}
}
+ Repaint();
}
*/
void SVTK_ViewWindow::onPerspectiveMode()
{
+ bool anIsParallelMode = toolMgr()->action( ParallelModeId )->isChecked();
+
+ // advanced zooming is not available in perspective mode
+ if( QtxAction* anAction = getAction( SwitchZoomingStyleId ) )
+ anAction->setEnabled( anIsParallelMode );
+
vtkCamera* aCamera = getRenderer()->GetActiveCamera();
- aCamera->SetParallelProjection(toolMgr()->action( ParallelModeId )->isChecked());
+ aCamera->SetParallelProjection(anIsParallelMode);
GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
}
// Dump view
anAction = new QtxAction(tr("MNU_DUMP_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
- tr( "MNU_DUMP_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
+ tr( "MNU_DUMP_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onDumpView()));
mgr->registerAction( anAction, DumpId );
// FitAll
anAction = new QtxAction(tr("MNU_FITALL"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
- tr( "MNU_FITALL" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
+ tr( "MNU_FITALL" ), 0, this);
anAction->setStatusTip(tr("DSC_FITALL"));
connect(anAction, SIGNAL(activated()), this, SLOT(onFitAll()));
mgr->registerAction( anAction, FitAllId );
// FitRect
anAction = new QtxAction(tr("MNU_FITRECT"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
- tr( "MNU_FITRECT" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
+ tr( "MNU_FITRECT" ), 0, this);
anAction->setStatusTip(tr("DSC_FITRECT"));
connect(anAction, SIGNAL(activated()), this, SLOT(activateWindowFit()));
mgr->registerAction( anAction, FitRectId );
// Zoom
anAction = new QtxAction(tr("MNU_ZOOM_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
- tr( "MNU_ZOOM_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
+ tr( "MNU_ZOOM_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(activateZoom()));
mgr->registerAction( anAction, ZoomId );
// Panning
anAction = new QtxAction(tr("MNU_PAN_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
- tr( "MNU_PAN_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
+ tr( "MNU_PAN_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_PAN_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(activatePanning()));
mgr->registerAction( anAction, PanId );
// Global Panning
anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
- tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
+ tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning()));
mgr->registerAction( anAction, GlobalPanId );
// Change rotation point
anAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ROTATION_POINT" ) ),
- tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ROTATION_POINT" ) ),
+ tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onChangeRotationPoint(bool)));
// Rotation
anAction = new QtxAction(tr("MNU_ROTATE_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
- tr( "MNU_ROTATE_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
+ tr( "MNU_ROTATE_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(activateRotation()));
mgr->registerAction( anAction, RotationId );
// Projections
anAction = new QtxAction(tr("MNU_FRONT_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
- tr( "MNU_FRONT_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
+ tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view");
anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onFrontView()));
+ this->addAction(anAction);
mgr->registerAction( anAction, FrontId );
anAction = new QtxAction(tr("MNU_BACK_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
- tr( "MNU_BACK_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
+ tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view");
anAction->setStatusTip(tr("DSC_BACK_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onBackView()));
+ this->addAction(anAction);
mgr->registerAction( anAction, BackId );
anAction = new QtxAction(tr("MNU_TOP_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
- tr( "MNU_TOP_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
+ tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view");
anAction->setStatusTip(tr("DSC_TOP_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onTopView()));
+ this->addAction(anAction);
mgr->registerAction( anAction, TopId );
anAction = new QtxAction(tr("MNU_BOTTOM_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
- tr( "MNU_BOTTOM_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
+ tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view");
anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onBottomView()));
+ this->addAction(anAction);
mgr->registerAction( anAction, BottomId );
anAction = new QtxAction(tr("MNU_LEFT_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
- tr( "MNU_LEFT_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
+ tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view");
anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onLeftView()));
+ this->addAction(anAction);
mgr->registerAction( anAction, LeftId );
anAction = new QtxAction(tr("MNU_RIGHT_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
- tr( "MNU_RIGHT_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
+ tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view");
anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onRightView()));
+ this->addAction(anAction);
mgr->registerAction( anAction, RightId );
+ // rotate anticlockwise
+ anAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ANTICLOCKWISE" ) ),
+ tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate anticlockwise");
+ anAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, AntiClockWiseId );
+
+ // rotate clockwise
+ anAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_CLOCKWISE" ) ),
+ tr( "MNU_CLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate clockwise");
+ anAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
+ this->addAction(anAction);
+ mgr->registerAction( anAction, ClockWiseId );
+
// Reset
anAction = new QtxAction(tr("MNU_RESET_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
- tr( "MNU_RESET_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
+ tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
anAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(anAction, SIGNAL(activated()), this, SLOT(onResetView()));
+ this->addAction(anAction);
mgr->registerAction( anAction, ResetId );
// onViewTrihedron: Shows - Hides Trihedron
anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
- tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
+ tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
connect(anAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
mgr->registerAction( anAction, ViewTrihedronId );
// onNonIsometric: Manage non-isometric params
anAction = new QtxAction(tr("MNU_SVTK_SCALING"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
- tr( "MNU_SVTK_SCALING" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
+ tr( "MNU_SVTK_SCALING" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool)));
// onGraduatedAxes: Manage graduated axes params
anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_GRADUATED_AXES" ) ),
- tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_GRADUATED_AXES" ) ),
+ tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool)));
// onGraduatedAxes: Manage graduated axes params
anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_UPDATE_RATE" ) ),
- tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_UPDATE_RATE" ) ),
+ tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
// Set perspective mode group
anAction = new QtxAction(tr("MNU_SVTK_PARALLEL_MODE"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
- tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
+ tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
mgr->registerAction( anAction, ParallelModeId );
anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
- tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
+ tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
// View Parameters
anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARAMETERS" ) ),
- tr( "MNU_VIEWPARAMETERS_VIEW" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARAMETERS" ) ),
+ tr( "MNU_VIEWPARAMETERS_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_VIEWPARAMETERS_VIEW"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewParameters(bool)));
mgr->registerAction( anAction, ViewParametersId );
+ // Synchronize View
+ anAction = new QtxAction(tr("MNU_SYNCHRONIZE_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SYNCHRONIZE" ) ),
+ tr( "MNU_SYNCHRONIZE_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SYNCHRONIZE_VIEW"));
+ anAction->setMenu( new QMenu( this ) );
+ anAction->setCheckable(true);
+ connect(anAction->menu(), SIGNAL(aboutToShow()), this, SLOT(updateSyncViews()));
+ connect(anAction, SIGNAL(triggered(bool)), this, SLOT(onSynchronizeView(bool)));
+ mgr->registerAction( anAction, SynchronizeId );
+
// Switch between interaction styles
anAction = new QtxAction(tr("MNU_SVTK_STYLE_SWITCH"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
- tr( "MNU_SVTK_STYLE_SWITCH" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
+ tr( "MNU_SVTK_STYLE_SWITCH" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_STYLE_SWITCH"));
anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
mgr->registerAction( anAction, SwitchInteractionStyleId );
+ // Switch between zooming styles
+ anAction = new QtxAction(tr("MNU_SVTK_ZOOMING_STYLE_SWITCH"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ZOOMING_STYLE_SWITCH" ) ),
+ tr( "MNU_SVTK_ZOOMING_STYLE_SWITCH" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_ZOOMING_STYLE_SWITCH"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchZoomingStyle(bool)));
+ mgr->registerAction( anAction, SwitchZoomingStyleId );
+
+ // Turn on/off dynamic pre-selection
+ anAction = new QtxAction(tr("MNU_SVTK_DYNAMIC_PRESLECTION_SWITCH"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_DYNAMIC_PRESLECTION_SWITCH" ) ),
+ tr( "MNU_SVTK_DYNAMIC_PRESLECTION_SWITCH" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_DYNAMIC_PRESLECTION_SWITCH"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchDynamicPreSelection(bool)));
+ mgr->registerAction( anAction, SwitchDynamicPreselectionId );
+
// Start recording
myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
- tr( "MNU_SVTK_RECORDING_START" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
+ tr( "MNU_SVTK_RECORDING_START" ), 0, this);
myStartAction->setStatusTip(tr("DSC_SVTK_RECORDING_START"));
connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStartRecording() ) );
mgr->registerAction( myStartAction, StartRecordingId );
// Play recording
myPlayAction = new QtxAction(tr("MNU_SVTK_RECORDING_PLAY"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PLAY" ) ),
- tr( "MNU_SVTK_RECORDING_PLAY" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PLAY" ) ),
+ tr( "MNU_SVTK_RECORDING_PLAY" ), 0, this);
myPlayAction->setStatusTip(tr("DSC_SVTK_RECORDING_PLAY"));
myPlayAction->setEnabled( false );
connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPlayRecording() ) );
// Pause recording
myPauseAction = new QtxAction(tr("MNU_SVTK_RECORDING_PAUSE"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PAUSE" ) ),
- tr( "MNU_SVTK_RECORDING_PAUSE" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PAUSE" ) ),
+ tr( "MNU_SVTK_RECORDING_PAUSE" ), 0, this);
myPauseAction->setStatusTip(tr("DSC_SVTK_RECORDING_PAUSE"));
myPauseAction->setEnabled( false );
connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( onPauseRecording() ) );
// Stop recording
myStopAction = new QtxAction(tr("MNU_SVTK_RECORDING_STOP"),
- theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_STOP" ) ),
- tr( "MNU_SVTK_RECORDING_STOP" ), 0, this);
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_STOP" ) ),
+ tr( "MNU_SVTK_RECORDING_STOP" ), 0, this);
myStopAction->setStatusTip(tr("DSC_SVTK_RECORDING_STOP"));
myStopAction->setEnabled( false );
connect( myStopAction, SIGNAL( triggered ( bool ) ), this, SLOT( onStopRecording() ) );
mgr->append( DumpId, myToolBar );
mgr->append( SwitchInteractionStyleId, myToolBar );
+ mgr->append( SwitchZoomingStyleId, myToolBar );
+ mgr->append( SwitchDynamicPreselectionId, myToolBar );
mgr->append( ViewTrihedronId, myToolBar );
QtxMultiAction* aScaleAction = new QtxMultiAction( this );
aViewsAction->insertAction( getAction( RightId ) );
mgr->append( aViewsAction, myToolBar );
+ mgr->append( AntiClockWiseId, myToolBar );
+ mgr->append( ClockWiseId, myToolBar );
+
mgr->append( ResetId, myToolBar );
mgr->append( UpdateRate, myToolBar );
mgr->append( GraduatedAxes, myToolBar );
mgr->append( ViewParametersId, myToolBar );
+ mgr->append( SynchronizeId, myToolBar );
+
mgr->append( toolMgr()->separator(), myToolBar );
+
mgr->append( ParallelModeId, myToolBar );
mgr->append( ProjectionModeId, myToolBar );
emit Hide( theEvent );
}
+void SVTK_ViewWindow::synchronizeView( SVTK_ViewWindow* viewWindow, int id )
+{
+ SVTK_ViewWindow* otherViewWindow = 0;
+ QList<SVTK_ViewWindow*> compatibleViews;
+
+ bool isSync = viewWindow->toolMgr()->action( SynchronizeId )->isChecked();
+
+ int vwid = viewWindow->getId();
+
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( !app ) return;
+
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( viewWindow->getViewManager()->getType(), wmlist );
+
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+
+ foreach( SUIT_ViewWindow* vw, vwlist ) {
+ SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( vw );
+ if ( !vtkVW ) continue;
+ if ( vtkVW->getId() == id )
+ otherViewWindow = vtkVW;
+ else if ( vtkVW != viewWindow )
+ compatibleViews.append( vtkVW );
+ }
+ }
+
+ if ( isSync && id ) {
+ // remove all possible disconnections
+ foreach( SVTK_ViewWindow* vw, compatibleViews ) {
+ // disconnect target view
+ vw->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), viewWindow, SLOT( synchronize( SVTK_ViewPort* ) ) );
+ viewWindow->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), vw, SLOT( synchronize( SVTK_ViewPort* ) ) );
+ if ( otherViewWindow ) {
+ // disconnect source view
+ vw->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), otherViewWindow, SLOT( synchronize( SVTK_ViewPort* ) ) );
+ otherViewWindow->disconnect( SIGNAL( transformed( SVTK_ViewPort* ) ), vw, SLOT( synchronize( SVTK_ViewPort* ) ) );
+ }
+ QAction* a = vw->toolMgr()->action( SynchronizeId );
+ if ( a ) {
+ int anid = a->data().toInt();
+ if ( a->isChecked() && ( anid == id || anid == vwid ) ) {
+ bool blocked = a->blockSignals( true );
+ a->setChecked( false );
+ a->blockSignals( blocked );
+ }
+ }
+ }
+ if ( otherViewWindow ) {
+ // reconnect source and target view
+ otherViewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), viewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+ viewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), otherViewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+ otherViewWindow->connect( viewWindow, SIGNAL( transformed( SVTK_ViewWindow* ) ), SLOT( synchronize( SVTK_ViewWindow* ) ) );
+ viewWindow->connect( otherViewWindow, SIGNAL( transformed( SVTK_ViewWindow* ) ), SLOT( synchronize( SVTK_ViewWindow* ) ) );
+ // synchronize target view with source view
+ viewWindow->doSetVisualParameters( otherViewWindow->getVisualParameters(), true );
+ viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+ otherViewWindow->toolMgr()->action( SynchronizeId )->setData( viewWindow->getId() );
+ if ( !otherViewWindow->toolMgr()->action( SynchronizeId )->isChecked() ) {
+ bool blocked = otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( true );
+ otherViewWindow->toolMgr()->action( SynchronizeId )->setChecked( true );
+ otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( blocked );
+ }
+ }
+ }
+ else if ( otherViewWindow ) {
+ // reconnect source and target view
+ otherViewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), viewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+ viewWindow->disconnect( SIGNAL( transformed( SVTK_ViewWindow* ) ), otherViewWindow, SLOT( synchronize( SVTK_ViewWindow* ) ) );
+ viewWindow->doSetVisualParameters( otherViewWindow->getVisualParameters(), true );
+ viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
+ if ( otherViewWindow->toolMgr()->action( SynchronizeId )->data().toInt() == viewWindow->getId() && otherViewWindow->toolMgr()->action( SynchronizeId )->isChecked() ) {
+ bool blocked = otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( true );
+ otherViewWindow->toolMgr()->action( SynchronizeId )->setChecked( false );
+ otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( blocked );
+ }
+ }
+}
+
+/*!
+ "Synchronize View" action slot.
+*/
+void SVTK_ViewWindow::onSynchronizeView(bool checked)
+{
+ QAction* a = qobject_cast<QAction*>( sender() );
+ if ( a ) {
+ synchronizeView( this, a->data().toInt() );
+ }
+}
+
+/*!
+ Update list of available view for the "Synchronize View" action
+*/
+void SVTK_ViewWindow::updateSyncViews()
+{
+ QAction* anAction = toolMgr()->action( SynchronizeId );
+ if ( anAction && anAction->menu() ) {
+ int currentId = anAction->data().toInt();
+ anAction->menu()->clear();
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( app ) {
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( getViewManager()->getType(), wmlist );
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist ) {
+ SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( vw );
+ if ( !vtkVW || vtkVW == this ) continue;
+ QAction* a = anAction->menu()->addAction( vtkVW->windowTitle() );
+ if ( vtkVW->getId() == currentId ) {
+ QFont f = a->font();
+ f.setBold( true );
+ a->setFont( f );
+ }
+ a->setData( vtkVW->getId() );
+ connect( a, SIGNAL( triggered(bool) ), this, SLOT( onSynchronizeView(bool) ) );
+ }
+ }
+ }
+ if ( anAction->menu()->actions().isEmpty() ) {
+ anAction->setData( 0 );
+ anAction->menu()->addAction( tr( "MNU_SYNC_NO_VIEW" ) );
+ }
+ }
+}
+
+
+/*!
+ Emit transformed signal.
+*/
+void SVTK_ViewWindow::emitTransformed() {
+ transformed(this);
+}
+
+/*!
+ Processes events
+*/
+void SVTK_ViewWindow::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
+{
+ SVTK_ViewWindow* self = reinterpret_cast<SVTK_ViewWindow*>(theClientData);
+ if(self)
+ self->emitTransformed();
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SVTK_VIEWWINDOW_H
#define SVTK_VIEWWINDOW_H
#include "SVTK.h"
#include "SVTK_Selection.h"
+#include "Qtx.h"
#include "SUIT_ViewWindow.h"
#include "SALOME_InteractiveObject.hxx"
class VTKViewer_Trihedron;
class SVTK_ViewModelBase;
-//class SVTK_MainWindow;
class SVTK_Selector;
class SVTK_View;
class vtkRenderWindow;
class vtkRenderWindowInteractor;
class vtkInteractorStyle;
+class vtkCallbackCommand;
+
class SVTK_RenderWindowInteractor;
class SVTK_Renderer;
class SVTK_NonIsometricDlg;
class SVTK_UpdateRateDlg;
class SVTK_CubeAxesDlg;
class SVTK_SetRotationPointDlg;
+class SVTK_InteractorStyle;
class SVTK_KeyFreeInteractorStyle;
class SVTK_ViewParameterDlg;
class SVTK_Recorder;
+class vtkPVAxesWidget;
+
class vtkObject;
class QtxAction;
//! Get #SVTK_View
SVTK_View* getView();
- //! Get #SVTK_MainWindow
- //SVTK_MainWindow* getMainWindow();
-
- //! Redirect the request to #SVTK_MainWindow::getRenderWindow
+ //! Get render window
vtkRenderWindow* getRenderWindow();
- //! Redirect the request to #SVTK_MainWindow::getInteractor
+ //! Get interactor
vtkRenderWindowInteractor* getInteractor() const;
- //! Redirect the request to #SVTK_MainWindow::getInteractor
+ //! Get SVTK interactor
SVTK_RenderWindowInteractor* GetInteractor() const;
+ //! Get current interactor style
vtkInteractorStyle* GetInteractorStyle() const;
- //! Redirect the request to #SVTK_RenderWindowInteractor::PushInteractorStyle
+ //! Add interactor style to the stack of styles
void PushInteractorStyle(vtkInteractorStyle* theStyle);
- //! Redirect the request to #SVTK_RenderWindowInteractor::PopInteractorStyle
+ //! Remove last interactor style from the stack of styles
void PopInteractorStyle();
- //! Redirect the request to #SVTK_MainWindow::getRenderer
+ //! Get renderer
vtkRenderer* getRenderer() const;
-
+
+ //! Get SVTK renderer
SVTK_Renderer* GetRenderer() const;
- //! Redirect the request to #SVTK_MainWindow::GetSelector
+ //! Get selector
SVTK_Selector* GetSelector() const;
- //! Redirect the request to #SVTK_Selector::SelectionMode
+ //! Set selection mode
Selection_Mode SelectionMode() const;
//! Change selection mode
virtual void SetSelectionMode(Selection_Mode theMode);
- //! Redirect the request to #SVTK_MainWindow::SetBackgroundColor
+ //! Set background color [obsolete]
virtual void setBackgroundColor( const QColor& );
- //! Redirect the request to #SVTK_MainWindow::SetBackgroundColor
+ //! Get background color [obsolete]
QColor backgroundColor() const;
- //! Redirect the request to #SVTK_Renderer::IsTrihedronDisplayed
+ //! Set background
+ virtual void setBackground( const Qtx::BackgroundData& );
+
+ //! Get background
+ Qtx::BackgroundData background() const;
+
+ //! Return \c true if "display trihedron" flag is set
bool isTrihedronDisplayed();
- //! Redirect the request to #SVTK_Renderer::IsCubeAxesDisplayed
+ //! Return \c true if "show graduated axes" flag is set
bool isCubeAxesDisplayed();
/* interactive object management */
//! Redirect the request to #SVTK_View::highlight (to support old code)
virtual void highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight = true,
- bool theIsUpdate = true);
+ bool theIsHighlight = true,
+ bool theIsUpdate = true);
//! Redirect the request to #SVTK_View::unHighlightAll (to support old code)
virtual void unHighlightAll();
//----------------------------------------------------------------------------
Handle(SALOME_InteractiveObject) FindIObject(const char* theEntry);
- /* display */
+ /* display */
//----------------------------------------------------------------------------
//! Redirect the request to #SVTK_View::Display (to support old code)
virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject,
- bool theImmediatly = true);
+ bool theImmediatly = true);
//! Redirect the request to #SVTK_View::DisplayOnly (to support old code)
virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
//! Redirect the request to #SVTK_View::Erase (to support old code)
virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject,
- bool theImmediatly = true);
+ bool theImmediatly = true);
//! Redirect the request to #SVTK_View::DisplayAll (to support old code)
virtual void DisplayAll();
//! Redirect the request to #SVTK_Renderer::AddActor
virtual void AddActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
+ bool theIsUpdate = false,
+ bool theIsAdjustActors = true);
//! Redirect the request to #SVTK_Renderer::RemoveActor
virtual void RemoveActor(VTKViewer_Actor* theActor,
- bool theIsUpdate = false);
+ bool theIsUpdate = false,
+ bool theIsAdjustActors = true);
//----------------------------------------------------------------------------
//! Redirect the request to #SVTK_Renderer::AdjustActors
//! Redirect the request to #SVTK_Renderer::SetTrihedronSize
virtual void SetTrihedronSize( const vtkFloatingPointType, const bool = true );
- //! Redirect the request to #SVTK_MainWindow::SetIncrementalSpeed
+ //! Set incremental speed
virtual void SetIncrementalSpeed( const int, const int = 0 );
- //! Redirect the request to #SVTK_MainWindow::SetProjectionMode
+ //! Set current projection mode
virtual void SetProjectionMode( const int );
- //! Redirect the request to #SVTK_MainWindow::SetInteractionStyle
+ //! Set interactive style
virtual void SetInteractionStyle( const int );
- //! Redirect the request to #SVTK_MainWindow::SetSpacemouseButtons
+ //! Set zooming style
+ virtual void SetZoomingStyle( const int );
+
+ //! Set dynamic preselection on/off
+ virtual void SetDynamicPreSelection( bool );
+
+ //! Customize space mouse buttons
virtual void SetSpacemouseButtons( const int, const int, const int );
- //! Redirect the request to #SVTK_Renderer::SetSelectionProp
+ //! Set selection properties
virtual void SetSelectionProp(const double& theRed = 1,
- const double& theGreen = 1,
- const double& theBlue = 0,
- const int& theWidth = 5);
+ const double& theGreen = 1,
+ const double& theBlue = 0,
+ const int& theWidth = 5);
//! Redirect the request to #SVTK_Renderer::SetPreselectionProp
virtual void SetPreselectionProp(const double& theRed = 0,
- const double& theGreen = 1,
- const double& theBlue = 1,
- const int& theWidth = 5);
+ const double& theGreen = 1,
+ const double& theBlue = 1,
+ const int& theWidth = 5);
//! Redirect the request to #SVTK_Renderer::SetSelectionTolerance
virtual void SetSelectionTolerance(const double& theTolNodes = 0.025,
- const double& theTolCell = 0.001,
- const double& theTolObjects = 0.025);
+ const double& theTolCell = 0.001,
+ const double& theTolObjects = 0.025);
+
+ //! Get visibility status of the static trihedron
+ bool IsStaticTrihedronVisible() const;
+
+ //! Set visibility status of the static trihedron
+ virtual void SetStaticTrihedronVisible( const bool );
//! Methods to save/restore visual parameters of a view (pan, zoom, etc.)
virtual QString getVisualParameters();
virtual void RefreshDumpImage();
+ void emitTransformed();
+
//! To invoke a VTK event on #SVTK_RenderWindowInteractor instance
void InvokeEvent(unsigned long theEvent, void* theCallData);
void onViewParameters(bool theIsActivate);
void onSwitchInteractionStyle(bool theOn);
+ void onSwitchZoomingStyle(bool theOn);
+ void onSwitchDynamicPreSelection(bool theOn);
void onStartRecording();
void onPlayRecording();
void selectionChanged();
void actorAdded(VTKViewer_Actor*);
void actorRemoved(VTKViewer_Actor*);
+ void transformed(SVTK_ViewWindow*);
public slots:
//! Redirect the request to #SVTK_Renderer::OnFrontView
//! Redirect the request to #SVTK_Renderer::OnLeftView
virtual void onLeftView();
+ //! Redirect the request to #SVTK_Renderer::onClockWiseView
+ virtual void onClockWiseView();
+
+ //! Redirect the request to #SVTK_Renderer::onAntiClockWiseView
+ virtual void onAntiClockWiseView();
+
//! Redirect the request to #SVTK_Renderer::OnResetView
virtual void onResetView();
//! Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes
virtual void onAdjustCubeAxes();
-
+
+ virtual void synchronize(SVTK_ViewWindow*);
+
protected slots:
void onKeyPressed(QKeyEvent* event);
void onKeyReleased(QKeyEvent* event);
protected:
virtual void Initialize(SVTK_View* theView,
- SVTK_ViewModelBase* theModel);
+ SVTK_ViewModelBase* theModel);
+
+ // Main process event method
+ static void ProcessEvents(vtkObject* object,
+ unsigned long event,
+ void* clientdata,
+ void* calldata);
- void doSetVisualParameters( const QString& );
+ void doSetVisualParameters( const QString&, bool = false );
void SetEventDispatcher(vtkObject* theDispatcher);
QImage dumpViewContent();
void createActions(SUIT_ResourceMgr* theResourceMgr);
enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
- ChangeRotationPointId, RotationId,
- FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId,
+ ChangeRotationPointId, RotationId,
+ FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, ResetId,
ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
- ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
- StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
-
+ ParallelModeId, ProjectionModeId, ViewParametersId, SynchronizeId, SwitchInteractionStyleId,
+ SwitchZoomingStyleId,SwitchDynamicPreselectionId,
+ StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
SVTK_View* myView;
- //SVTK_MainWindow* myMainWindow;
SVTK_ViewModelBase* myModel;
SVTK_RenderWindowInteractor* myInteractor;
+ vtkSmartPointer<SVTK_InteractorStyle> myDefaultInteractorStyle;
vtkSmartPointer<SVTK_KeyFreeInteractorStyle> myKeyFreeInteractorStyle;
QString myVisualParams; // used for delayed setting of view parameters
vtkSmartPointer<vtkObject> myEventDispatcher;
+ // Used to process events
+ vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
+
SVTK_NonIsometricDlg* myNonIsometricDlg;
SVTK_UpdateRateDlg* myUpdateRateDlg;
SVTK_CubeAxesDlg* myCubeAxesDlg;
int myToolBar;
int myRecordingToolBar;
+ vtkPVAxesWidget* myAxesWidget;
+ Qtx::BackgroundData myBackground;
+
+private slots:
+ void onSynchronizeView(bool);
+ void updateSyncViews();
+
+private:
+ static void synchronizeView( SVTK_ViewWindow*, int );
+
private:
QImage myDumpImage;
};
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-# VISU VISUGUI : GUI of VISU component
-# File :
-# Module :
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: 2005-05-10 15:20+0400\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-
-msgid "ICON_SVTK_SCALING"
-msgstr "view_scaling.png"
-
-msgid "ICON_GRADUATED_AXES"
-msgstr "view_graduated_axes.png"
-
-msgid "ICON_UPDATE_RATE"
-msgstr "view_update_rate.png"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>ICON_SVTK_STYLE_SWITCH</source>
<translation>vtk_view_style_switch.png</translation>
</message>
+ <message>
+ <source>ICON_SVTK_ZOOMING_STYLE_SWITCH</source>
+ <translation>vtk_view_zooming_style_switch.png</translation>
+ </message>
<message>
<source>ICON_SVTK_RECORDING_START</source>
<translation>vtk_view_recording_start.png</translation>
<source>ICON_SVTK_RECORDING_STOP</source>
<translation>vtk_view_recording_stop.png</translation>
</message>
+ <message>
+ <source>ICON_SVTK_SYNCHRONIZE</source>
+ <translation>vtk_view_sync.png</translation>
+ </message>
+ <message>
+ <source>ICON_SVTK_DYNAMIC_PRESLECTION_SWITCH</source>
+ <translation>vtk_view_highlight.png</translation>
+ </message>
</context>
</TS>
+++ /dev/null
-# Copyright (C) 2007-2008 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 SALOMEGUI : implementation of desktop and GUI kernel
-# File : SALOMEGUI_msg_en.po
-# Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 2005-05-31 13:25+0400\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_FRONT_VIEW"
-msgstr "Front View"
-
-msgid "MNU_FRONT_VIEW"
-msgstr "Front"
-
-msgid "DSC_BACK_VIEW"
-msgstr "Back View"
-
-msgid "MNU_BACK_VIEW"
-msgstr "Back"
-
-msgid "DSC_TOP_VIEW"
-msgstr "Top View"
-
-msgid "MNU_TOP_VIEW"
-msgstr "Top"
-
-msgid "DSC_BOTTOM_VIEW"
-msgstr "Bottom View"
-
-msgid "MNU_BOTTOM_VIEW"
-msgstr "Bottom"
-
-msgid "DSC_LEFT_VIEW"
-msgstr "Left View"
-
-msgid "MNU_LEFT_VIEW"
-msgstr "Left"
-
-msgid "DSC_RIGHT_VIEW"
-msgstr "Right View"
-
-msgid "MNU_RIGHT_VIEW"
-msgstr "Right"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_ROTATE_VIEW"
-msgstr "Rotation of the point of view around the scene center"
-
-msgid "MNU_ROTATE_VIEW"
-msgstr "Rotation"
-
-msgid "DSC_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change the point, around which the rotation is performed"
-
-msgid "MNU_CHANGINGROTATIONPOINT_VIEW"
-msgstr "Change Rotation Point"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "VTK_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "SVTK_Viewer::MEN_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "SVTK_Viewer::MEN_SHOW_TOOLBAR"
-msgstr "Show toolbar"
-
-msgid "SVTK_Viewer::MEN_CHANGE_BACKGROUD"
-msgstr "Change background..."
-
-msgid "SVTK_ViewManager::VTK_VIEW_TITLE"
-msgstr "VTK scene:%1 - viewer:%2"
-
-msgid "MNU_SHOW_TRIHEDRON"
-msgstr "Show/Hide trihedron"
-
-msgid "DSC_SHOW_TRIHEDRON"
-msgstr "Show/Hide trihedron in the current view"
-
-msgid "SVTK_NonIsometricDlg::MEN_SCALING"
-msgstr "Scaling"
-
-msgid "SVTK_NonIsometricDlg::O&K"
-msgstr ""
-
-msgid "SVTK_NonIsometricDlg::&Apply"
-msgstr ""
-
-msgid "SVTK_NonIsometricDlg::&Cancel"
-msgstr ""
-
-msgid "SVTK_NonIsometricDlg::&Reset"
-msgstr ""
-
-msgid "SVTK_NonIsometricDlg::DLG_TITLE"
-msgstr "Scaling"
-
-msgid "SVTK_NonIsometricDlg::LBL_X"
-msgstr "X :"
-
-msgid "SVTK_NonIsometricDlg::LBL_Y"
-msgstr "Y :"
-
-msgid "SVTK_NonIsometricDlg::LBL_Z"
-msgstr "Z :"
-
-msgid "SVTK_MainWindow::MNU_SVTK_SCALING"
-msgstr "Scaling"
-
-msgid "SVTK_MainWindow::DSC_SVTK_SCALING"
-msgstr "Scaling"
-
-msgid "SVTK_SetRotationPointDlg::DLG_TITLE"
-msgstr "Set Rotation Point"
-
-msgid "SVTK_SetRotationPointDlg::USE_BBCENTER"
-msgstr "Use Bounding Box Center"
-
-msgid "SVTK_SetRotationPointDlg::LBL_TOORIGIN"
-msgstr "Set to Origin"
-
-msgid "SVTK_SetRotationPointDlg::LBL_SELECTPOINT"
-msgstr "Select Point from View"
-
-msgid "SVTK_SetRotationPointDlg::LBL_CENTER_OF_BOUNDING_BOX"
-msgstr "Center of bounding box"
-
-msgid "SVTK_SetRotationPointDlg::LBL_ORIGIN"
-msgstr "Origin of the coordinate system"
-
-msgid "SVTK_SetRotationPointDlg::LBL_SELECTED_POINT"
-msgstr "Selected point"
-
-msgid "SVTK_SetRotationPointDlg::LBL_X"
-msgstr "X :"
-
-msgid "SVTK_SetRotationPointDlg::LBL_Y"
-msgstr "Y :"
-
-msgid "SVTK_SetRotationPointDlg::LBL_Z"
-msgstr "Z :"
-
-msgid "SVTK_SetRotationPointDlg::RBUTTONGROUP_TITLE"
-msgstr "The rotation point type"
-
-msgid "SVTK_FontWidget::ARIAL"
-msgstr "Arial"
-
-msgid "SVTK_FontWidget::COURIER"
-msgstr "Courier"
-
-msgid "SVTK_FontWidget::TIMES"
-msgstr "Times"
-
-msgid "SVTK_FontWidget::BOLD"
-msgstr "Bold"
-
-msgid "SVTK_FontWidget::ITALIC"
-msgstr "Italic"
-
-msgid "SVTK_FontWidget::SHADOW"
-msgstr "Shadow"
-
-msgid "SVTK_CubeAxesDlg::CAPTION"
-msgstr "Graduated axes"
-
-msgid "SVTK_CubeAxesDlg::X_AXIS"
-msgstr "X axis"
-
-msgid "SVTK_CubeAxesDlg::Y_AXIS"
-msgstr "Y axis"
-
-msgid "SVTK_CubeAxesDlg::Z_AXIS"
-msgstr "Z axis"
-
-msgid "SVTK_CubeAxesDlg::IS_VISIBLE"
-msgstr "Is visible"
-
-msgid "SVTK_AxisWidget::AXIS_NAME"
-msgstr "Axis name"
-
-msgid "SVTK_AxisWidget::IS_VISIBLE"
-msgstr "Is visible"
-
-msgid "SVTK_AxisWidget::NAME"
-msgstr "Name"
-
-msgid "SVTK_AxisWidget::FONT"
-msgstr "Font"
-
-msgid "SVTK_AxisWidget::LABELS"
-msgstr "Labels"
-
-msgid "SVTK_AxisWidget::NUMBER"
-msgstr "Number"
-
-msgid "SVTK_AxisWidget::OFFSET"
-msgstr "Offset"
-
-msgid "SVTK_AxisWidget::TICK_MARKS"
-msgstr "Tick marks"
-
-msgid "SVTK_AxisWidget::LENGTH"
-msgstr "Length"
-
-msgid "SVTK_MainWindow::MNU_SVTK_GRADUATED_AXES"
-msgstr "Graduated axes"
-
-msgid "SVTK_MainWindow::DSC_SVTK_GRADUATED_AXES"
-msgstr "Graduated axes"
-
-msgid "SVTK_MainWindow::MNU_SVTK_UPDATE_RATE"
-msgstr "Update rate"
-
-msgid "SVTK_MainWindow::DSC_SVTK_UPDATE_RATE"
-msgstr "Update rate"
-
-msgid "SVTK_UpdateRateDlg::DLG_TITLE"
-msgstr "Update Rate"
-
-msgid "SVTK_UpdateRateDlg::INPUT_FRAME_TITLE"
-msgstr "Enable"
-
-msgid "SVTK_UpdateRateDlg::DESIRED"
-msgstr "Desired Update Rate, FPS"
-
-msgid "SVTK_UpdateRateDlg::STILL"
-msgstr "Still Update Rate, FPS"
-
-msgid "SVTK_UpdateRateDlg::INFORMATION_FRAME_TITLE"
-msgstr "Rendering Metrics"
-
-msgid "SVTK_UpdateRateDlg::CURRENT_FPS"
-msgstr "Current Update Rate, FPS"
-
-msgid "SVTK_UpdateRateDlg::NUMBER_CELLS"
-msgstr "Number of Cells, -"
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
+ <message>
+ <source>DSC_ANTICLOCKWISE_VIEW</source>
+ <translation>Rotate view counterclockwise</translation>
+ </message>
+ <message>
+ <source>DSC_CLOCKWISE_VIEW</source>
+ <translation>Rotate View Clockwise</translation>
+ </message>
+ <message>
+ <source>MNU_ANTICLOCKWISE_VIEW</source>
+ <translation>Rotate counterclockwise</translation>
+ </message>
+ <message>
+ <source>MNU_CLOCKWISE_VIEW</source>
+ <translation>Rotate clockwise</translation>
+ </message>
<message>
<source>MNU_FRONT_VIEW</source>
<translation>Front</translation>
<source>DSC_VIEWPARAMETERS_VIEW</source>
<translation>Change the parameters of the view</translation>
</message>
+ <message>
+ <source>MNU_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize</translation>
+ </message>
+ <message>
+ <source>DSC_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize view</translation>
+ </message>
+ <message>
+ <source>MNU_SYNC_NO_VIEW</source>
+ <translation>[ No appropriate view ]</translation>
+ </message>
<message>
<source>MNU_SVTK_PARALLEL_MODE</source>
<translation>Orthogonal Mode</translation>
</message>
<message>
<source>DSC_SVTK_STYLE_SWITCH</source>
- <translation>Interactiion style switch</translation>
+ <translation>Interaction style switch</translation>
</message>
<message>
<source>MNU_SVTK_STYLE_SWITCH</source>
<translation>Interaction Style Switch</translation>
</message>
-</context>
-<context>
- <name>SVTK_CubeAxesDlg</name>
- <message>
- <source>X_AXIS</source>
- <translation>X axis</translation>
- </message>
- <message>
- <source>Y_AXIS</source>
- <translation>Y axis</translation>
- </message>
- <message>
- <source>Z_AXIS</source>
- <translation>Z axis</translation>
- </message>
- <message>
- <source>CAPTION</source>
- <translation>Graduated axes</translation>
- </message>
- <message>
- <source>IS_VISIBLE</source>
- <translation>Is visible</translation>
- </message>
- <message>
- <source>FONT</source>
- <translation>Font</translation>
- </message>
- <message>
- <source>NAME</source>
- <translation>Name</translation>
- </message>
<message>
- <source>TICK_MARKS</source>
- <translation>Tick marks</translation>
+ <source>DSC_SVTK_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zooming style switch</translation>
</message>
<message>
- <source>LABELS</source>
- <translation>Labels</translation>
+ <source>MNU_SVTK_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zomming style switch</translation>
</message>
<message>
- <source>LENGTH</source>
- <translation>Length</translation>
+ <source>DSC_SVTK_DYNAMIC_PRESLECTION_SWITCH</source>
+ <translation>Dynamic preselection switch</translation>
</message>
<message>
- <source>NUMBER</source>
- <translation>Number</translation>
- </message>
- <message>
- <source>OFFSET</source>
- <translation>Offset</translation>
- </message>
- <message>
- <source>AXIS_NAME</source>
- <translation>Axis name</translation>
+ <source>MNU_SVTK_DYNAMIC_PRESLECTION_SWITCH</source>
+ <translation>Dynamic preselection switch</translation>
</message>
</context>
<context>
<name>SVTK_FontWidget</name>
- <message>
- <source>BOLD</source>
- <translation>Bold</translation>
- </message>
<message>
<source>ARIAL</source>
<translation>Arial</translation>
<source>TIMES</source>
<translation>Times</translation>
</message>
- <message>
- <source>ITALIC</source>
- <translation>Italic</translation>
- </message>
- <message>
- <source>SHADOW</source>
- <translation>Shadow</translation>
- </message>
<message>
<source>COURIER</source>
<translation>Courier</translation>
</message>
<message>
<source>DSC_SVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
+ <translation>Continue recording</translation>
</message>
<message>
<source>MNU_SVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
+ <translation>Continue recording</translation>
</message>
<message>
<source>DSC_SVTK_RECORDING_PAUSE</source>
<source>LBL_TOBBCENTER</source>
<translation>Set to Bounding Box Center</translation>
</message>
- <message>
+ <message>
<source>LBL_TOORIGIN</source>
<translation>Set to Origin</translation>
</message>
- <message>
+ <message>
<source>LBL_SELECTPOINT</source>
<translation>Select Point from View</translation>
</message>
</message>
<message>
<source>WORLD_COORDINATES</source>
- <translation>World Coordinates</translation>
+ <translation>Absolute Coordinates</translation>
</message>
<message>
<source>FOCAL_RELATIVE</source>
<translation>Show toolbar</translation>
</message>
<message>
- <source>MEN_CHANGE_BACKGROUD</source>
+ <source>MEN_CHANGE_BACKGROUND</source>
<translation>Change background...</translation>
</message>
+ <message>
+ <source>GT_HORIZONTALGRADIENT</source>
+ <translation>Horizontal gradient</translation>
+ </message>
+ <message>
+ <source>GT_VERTICALGRADIENT</source>
+ <translation>Vertical gradient</translation>
+ </message>
+ <message>
+ <source>GT_FIRSTDIAGONALGRADIENT</source>
+ <translation>First diagonal gradient</translation>
+ </message>
+ <message>
+ <source>GT_SECONDDIAGONALGRADIENT</source>
+ <translation>Second diagonal gradient</translation>
+ </message>
+ <message>
+ <source>GT_FIRSTCORNERGRADIENT</source>
+ <translation>First corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_SECONDCORNERGRADIENT</source>
+ <translation>Second corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_THIRDCORNERGRADIENT</source>
+ <translation>Third corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_FOURTHCORNERGRADIENT</source>
+ <translation>Fourth corner gradient</translation>
+ </message>
+ <message>
+ <source>BG_IMAGE_FILES</source>
+ <translation>Image files (*.png *.jpg *.jpeg *.bmp *.tif *.tiff *.mhd *.mha)</translation>
+ </message>
</context>
</TS>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : SalomeApp
# $Header$
-#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
+SUBDIRS=pluginsdemo
+
if CPPUNIT_IS_OK
if GUI_ENABLE_CORBA
- SUBDIRS = Test
+ SUBDIRS += Test
endif
endif
nodist_libSalomeApp_la_SOURCES = $(MOC_FILES)
+# python modules
+salomepython_PYTHON = salome_pluginsmanager.py
+
+dist_salomescript_DATA = addvars2notebook.py
+
dist_salomeres_DATA = \
resources/SalomeApp.ini \
resources/SalomeApp.xml
nodist_salomeres_DATA = \
SalomeApp_images.qm \
- SalomeApp_msg_en.qm
+ SalomeApp_msg_en.qm \
+ SalomeApp_msg_fr.qm
libSalomeApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) \
$(CAS_CPPFLAGS) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ \
-I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../ObjBrowser \
-I$(srcdir)/../PyConsole -I$(srcdir)/../TOOLSGUI \
-I$(srcdir)/../PyInterp -I$(srcdir)/../Session -I$(top_builddir)/idl \
- -I$(srcdir)/../Event -I$(srcdir)/../CASCatch \
- -I$(top_builddir)/salome_adm/unix @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @LIBXML_INCLUDES@
+ -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 \
../SUIT/libsuit.la ../STD/libstd.la ../CAM/libCAM.la ../ObjBrowser/libObjBrowser.la \
../SVTK/libSVTK.la ../SOCC/libSOCC.la ../PyInterp/libPyInterp.la \
../PyConsole/libPyConsole.la ../LogWindow/libLogWindow.la \
../LightApp/libLightApp.la ../TOOLSGUI/libToolsGUI.la ../Session/libSalomeSession.la \
- ../Event/libEvent.la ../CASCatch/libCASCatch.la $(CAS_KERNEL)
+ ../Event/libEvent.la ../CASCatch/libCASCatch.la ../Prs/libSalomePrs.la $(CAS_KERNEL)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp.h
// Created: November, 2004
// Author: OCC team
//
#ifdef WIN32
-#ifdef SALOMEAPP_EXPORTS
+#if defined SALOMEAPP_EXPORTS || defined SalomeApp_EXPORTS
#define SALOMEAPP_EXPORT __declspec(dllexport)
#else
#define SALOMEAPP_EXPORT __declspec(dllimport)
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = SalomeApp
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-QWT_INCLUDES = $$(QWTHOME)/include
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-VTK_INCLUDES = $$(VTKHOME)/include/vtk
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
-
-HDF5_INCLUDES = $$(HDF5HOME)/include
-
-PYTHON_LIBS = -L$$(PYTHONHOME)/lib/python2.4/config -lpython2.4 -ldl -lutil
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-
-INCLUDEPATH += $${PYTHON_INCLUDES} $${QT_INCLUDES} $${QWT_INCLUDES} $${CAS_CPPFLAGS} $${VTK_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} ../LightApp ../CAM ../Qtx ../SUIT ../OBJECT ../SVTK ../STD ../VTKViewer ../PyConsole ../TOOLSGUI ../PyInterp ../Session ../../idl ../Event ../../salome_adm/unix $${CORBA_INCLUDES} #../ObjBrowser
-
-LIBS += $${QT_MT_LIBS} $${PYTHON_LIBS} $${KERNEL_LDFLAGS} -lOpUtil -lSALOMELocalTrace -lSalomeDSClient -L../../lib -lsuit -lstd -lCAM -lSalomePrs -lSPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPyConsole -lLogWindow -lLightApp -lToolsGUI $${CAS_KERNEL} #-lObjBrowser
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SALOMEAPP_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
-
-HEADERS = SalomeApp.h
-HEADERS += SalomeApp_Application.h
-HEADERS += SalomeApp_DataModel.h
-HEADERS += SalomeApp_DataObject.h
-HEADERS += SalomeApp_LoadStudiesDlg.h
-HEADERS += SalomeApp_Module.h
-HEADERS += SalomeApp_Study.h
-HEADERS += SalomeApp_ExceptionHandler.h
-HEADERS += SalomeApp_Tools.h
-HEADERS += SalomeApp_ImportOperation.h
-HEADERS += SalomeApp_Filter.h
-HEADERS += SalomeApp_TypeFilter.h
-HEADERS += SalomeApp_StudyPropertiesDlg.h
-HEADERS += SalomeApp_CheckFileDlg.h
-HEADERS += SalomeApp_VisualState.h
-
-SOURCES = SalomeApp_Module.cxx
-SOURCES += SalomeApp_Application.cxx
-SOURCES += SalomeApp_DataModel.cxx
-SOURCES += SalomeApp_DataObject.cxx
-SOURCES += SalomeApp_LoadStudiesDlg.cxx
-SOURCES += SalomeApp_Study.cxx
-SOURCES += SalomeApp_ExceptionHandler.cxx
-SOURCES += SalomeApp_PyInterp.cxx
-SOURCES += SalomeApp_Tools.cxx
-SOURCES += SalomeApp_ImportOperation.cxx
-SOURCES += SalomeApp_Filter.cxx
-SOURCES += SalomeApp_TypeFilter.cxx
-SOURCES += SalomeApp_StudyPropertiesDlg.cxx
-SOURCES += SalomeApp_ListView.cxx
-SOURCES += SalomeApp_CheckFileDlg.cxx
-SOURCES += SalomeApp_VisualState.cxx
-
-TRANSLATIONS = resources/SalomeApp_images.ts \
- resources/SalomeApp_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_Application.cxx
// Created: 10/22/2004 3:23:45 PM
// Author: Sergey LITONIN
-//
+
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
#include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_ExitDlg.h"
#include <LightApp_Application.h>
+#include <LightApp_Module.h>
#include <LightApp_Preferences.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_NameDlg.h>
#include <LightApp_DataOwner.h>
+#include <LightApp_Displayer.h>
#include <CAM_Module.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_TreeModel.h>
+#include <SUIT_ViewWindow.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewModel.h>
#include <QtxTreeView.h>
#include <QListWidget>
#include <QGridLayout>
#include <QMenu>
+#include <QtDebug>
#include <SALOMEDSClient_ClientFactory.hxx>
+#include <Basics_Utils.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_Prs.h>
+
#include <ToolsGUI_CatalogGeneratorDlg.h>
#include <ToolsGUI_RegWidget.h>
SalomeApp_Application::SalomeApp_Application()
: LightApp_Application()
{
- connect( desktop(), SIGNAL( message( const QString& ) ),
- this, SLOT( onDesktopMessage( const QString& ) ) );
+ connect( desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+ this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+
setNoteBook(0);
}
for (int i = 1; i < qApp->argc(); i++) {
QRegExp rxs ("--study-hdf=(.+)");
if ( rxs.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) {
- QString file = rxs.capturedTexts()[1];
+ QString file = rxs.capturedTexts()[1];
QFileInfo fi ( file );
QString extension = fi.suffix().toLower();
if ( extension == "hdf" && fi.exists() )
// import/execute python scripts
if ( pyfiles.count() > 0 && activeStudy() ) {
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
- if ( appStudy ) {
- _PTR(Study) aStudy = appStudy->studyDS();
- if ( !aStudy->GetProperties()->IsLocked() ) {
+ PyConsole_Console* pyConsole = pythonConsole();
+ if ( appStudy && pyConsole ) {
+ _PTR(Study) aStudy = appStudy->studyDS();
+ if ( !aStudy->GetProperties()->IsLocked() ) {
for (uint j = 0; j < pyfiles.count(); j++ ) {
QFileInfo fi ( pyfiles[j] );
- PyConsole_Console* pyConsole = pythonConsole();
- if ( pyConsole ) {
- QString extension = fi.suffix().toLower();
- if ( fi.exists() ) {
- // execute python script
- QString command = QString( "execfile(\"%1\")" ).arg( fi.absoluteFilePath() );
- pyConsole->exec( command );
+ QFileInfo fipy ( pyfiles[j] + ".py" );
+ QString command = QString( "execfile(r\"%1\")" );
+ if ( fi.isAbsolute() ) {
+ if ( fi.exists() )
+ pyConsole->exec( command.arg( fi.absoluteFilePath() ) );
+ else if ( fipy.exists() )
+ pyConsole->exec( command.arg( fipy.absoluteFilePath() ) );
+ else
+ qDebug() << "Can't execute file" << pyfiles[j];
+ }
+ else {
+ bool found = false;
+ QStringList dirs;
+ dirs << QDir::currentPath();
+ if ( ::getenv( "PYTHONPATH" ) )
+ dirs += QString( ::getenv( "PYTHONPATH" ) ).split( QRegExp( "[:|;]" ) );
+ foreach( QString dir, dirs ) {
+ qDebug() << "try" << QFileInfo( dir, pyfiles[j] ).absoluteFilePath();
+ qDebug() << "try" << QFileInfo( dir, pyfiles[j] + ".py" ).absoluteFilePath();
+ if ( QFileInfo( dir, pyfiles[j] ).exists() ) {
+ pyConsole->exec( command.arg( QFileInfo( dir, pyfiles[j] ).absoluteFilePath() ) );
+ found = true;
+ break;
+ }
+ else if ( QFileInfo( dir, pyfiles[j] + ".py" ).exists() ) {
+ pyConsole->exec( command.arg( QFileInfo( dir, pyfiles[j] + ".py" ).absoluteFilePath() ) );
+ found = true;
+ break;
+ }
}
- else {
- // import python module
- QString command = QString( "import %1" ).arg( pyfiles[j] );
- if ( extension == "py" )
- command = QString( "import %1" ).arg( fi.completeBaseName() );
- pyConsole->exec( command );
+ if ( !found ) {
+ qDebug() << "Can't execute file" << pyfiles[j];
}
}
}
- }
+ }
}
}
}
//! Save GUI state
// "Save GUI State" command is moved to VISU module
// createAction( SaveGUIStateId, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIcon(),
- // tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
- // 0, desk, false, this, SLOT( onSaveGUIState() ) );
+ // tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ),
+ // 0, desk, false, this, SLOT( onSaveGUIState() ) );
//! Dump study
createAction( DumpStudyId, tr( "TOT_DESK_FILE_DUMP_STUDY" ), QIcon(),
- tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ),
- Qt::CTRL+Qt::Key_D, desk, false, this, SLOT( onDumpStudy() ) );
+ tr( "MEN_DESK_FILE_DUMP_STUDY" ), tr( "PRP_DESK_FILE_DUMP_STUDY" ),
+ Qt::CTRL+Qt::Key_D, desk, false, this, SLOT( onDumpStudy() ) );
//! NoteBook
createAction(NoteBookId, tr( "TOT_DESK_FILE_NOTEBOOK" ), QIcon(),
//! Load script
createAction( LoadScriptId, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), QIcon(),
- tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ),
- Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onLoadScript() ) );
+ tr( "MEN_DESK_FILE_LOAD_SCRIPT" ), tr( "PRP_DESK_FILE_LOAD_SCRIPT" ),
+ Qt::CTRL+Qt::Key_T, desk, false, this, SLOT( onLoadScript() ) );
//! Properties
createAction( PropertiesId, tr( "TOT_DESK_PROPERTIES" ), QIcon(),
- tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ),
- Qt::CTRL+Qt::Key_P, desk, false, this, SLOT( onProperties() ) );
+ tr( "MEN_DESK_PROPERTIES" ), tr( "PRP_DESK_PROPERTIES" ),
+ Qt::CTRL+Qt::Key_P, desk, false, this, SLOT( onProperties() ) );
//! Catalog Generator
createAction( CatalogGenId, tr( "TOT_DESK_CATALOG_GENERATOR" ), QIcon(),
- tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ),
- Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) );
+ tr( "MEN_DESK_CATALOG_GENERATOR" ), tr( "PRP_DESK_CATALOG_GENERATOR" ),
+ Qt::ALT+Qt::SHIFT+Qt::Key_G, desk, false, this, SLOT( onCatalogGen() ) );
//! Registry Display
createAction( RegDisplayId, tr( "TOT_DESK_REGISTRY_DISPLAY" ), QIcon(),
- tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
- /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
+ tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
+ /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
//SRN: BugID IPAL9021, add an action "Load"
createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
- tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
- Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+ tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
+ Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
//SRN: BugID IPAL9021: End
createMenu( CatalogGenId, toolsMenu, 10, -1 );
createMenu( RegDisplayId, toolsMenu, 10, -1 );
createMenu( separator(), toolsMenu, -1, 15, -1 );
+
+ createExtraActions();
+
+ // import Python module that manages SALOME plugins
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
+ PyObject* res=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",0,"salome",tr("MEN_DESK_PLUGINS_TOOLS").toStdString().c_str(),tr("MEN_DESK_PLUGINS").toStdString().c_str());
+ if(res==NULL)
+ PyErr_Print();
+ Py_XDECREF(res);
+ PyGILState_Release(gstate);
+ // end of SALOME plugins loading
+
+}
+
+
+/*!Set desktop:*/
+void SalomeApp_Application::setDesktop( SUIT_Desktop* desk )
+{
+ LightApp_Application::setDesktop( desk );
+
+ if ( desk ) {
+ connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+ this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+ }
}
/*!
while ( it.hasNext() && !isAlreadyOpen ) {
SUIT_Application* aApp = it.next();
if( !aApp || !aApp->activeStudy() )
- continue;
+ continue;
if ( aApp->activeStudy()->studyName() == studyName )
- isAlreadyOpen = true;
+ isAlreadyOpen = true;
}
if ( !isAlreadyOpen )
}
}
+/*!SLOT. Create new study and load script*/
+void SalomeApp_Application::onNewWithScript()
+{
+ QStringList filtersList;
+ filtersList.append(tr("PYTHON_FILES_FILTER"));
+ filtersList.append(tr("ALL_FILES_FILTER"));
+
+ QString anInitialPath = "";
+ if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+ anInitialPath = QDir::currentPath();
+
+ QString aFile = SUIT_FileDlg::getFileName( desktop(), anInitialPath, filtersList, tr( "TOT_DESK_FILE_LOAD_SCRIPT" ), true, true );
+
+ if ( !aFile.isEmpty() )
+ {
+ onNewDoc();
+
+ QString command = QString("execfile(r\"%1\")").arg(aFile);
+
+ PyConsole_Console* pyConsole = pythonConsole();
+
+ if ( pyConsole )
+ pyConsole->exec( command );
+ }
+}
+
+
/*!SLOT. Load document with \a aName.*/
bool SalomeApp_Application::onLoadDoc( const QString& aName )
{
bool isAlreadyOpen = false;
SalomeApp_Application* aApp = 0;
for ( QList<SUIT_Application*>::iterator it = aAppList.begin();
- it != aAppList.end() && !isAlreadyOpen; ++it ) {
+ it != aAppList.end() && !isAlreadyOpen; ++it ) {
aApp = dynamic_cast<SalomeApp_Application*>( *it );
if ( aApp && aApp->activeStudy()->studyName() == aName )
isAlreadyOpen = true;
{
_PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
try {
- studyMgr()->Copy(so);
- onSelectionChanged();
+ studyMgr()->Copy(so);
+ onSelectionChanged();
}
catch(...) {
}
if ( stdDS->GetProperties()->IsLocked() ) {
SUIT_MessageBox::warning( desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED") );
return;
}
{
_PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
try {
- studyMgr()->Paste(so);
- updateObjectBrowser( true );
- updateActions(); //SRN: BugID IPAL9377, case 3
+ studyMgr()->Paste(so);
+ updateObjectBrowser( true );
+ updateActions(); //SRN: BugID IPAL9377, case 3
}
catch(...) {
}
_PTR(Study) stdDS = study->studyDS();
if(stdDS && stdDS->IsStudyLocked()) {
if ( SUIT_MessageBox::question( desktop(),
- QObject::tr( "WRN_WARNING" ),
- QObject::tr( "CLOSE_LOCKED_STUDY" ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::No) == SUIT_MessageBox::No ) return;
+ QObject::tr( "WRN_WARNING" ),
+ QObject::tr( "CLOSE_LOCKED_STUDY" ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::No) == SUIT_MessageBox::No ) return;
}
}
- LightApp_Application::onCloseDoc( ask );
if(myNoteBook && myNoteBook->isVisible())
- myNoteBook->hide();
+ myNoteBook->hide();
+
+ LightApp_Application::onCloseDoc( ask );
}
/*!Sets enable or disable some actions on selection changed.*/
{
_PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject;
while( aRefObj && aRefObj->ReferencedObject( anObj ) )
- aRefObj = anObj;
+ aRefObj = anObj;
if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() )
- aStudyBuilder->RemoveReference( aSObject );
+ aStudyBuilder->RemoveReference( aSObject );
}
updateObjectBrowser();
}
a = action(NoteBookId);
if( a )
a->setEnabled( activeStudy() );
-
+
// Load script menu
a = action( LoadScriptId );
if ( a )
{
QWidget *hB = new QWidget( this );
myPublishChk = new QCheckBox( tr("PUBLISH_IN_STUDY") );
+ myMultiFileChk = new QCheckBox( tr("MULTI_FILE_DUMP") );
mySaveGUIChk = new QCheckBox( tr("SAVE_GUI_STATE") );
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(myPublishChk);
+ layout->addWidget(myMultiFileChk);
layout->addWidget(mySaveGUIChk);
hB->setLayout(layout);
}
}
QCheckBox* myPublishChk;
+ QCheckBox* myMultiFileChk;
QCheckBox* mySaveGUIChk;
};
bool DumpStudyFileValidator::canSave(const QString& file, bool permissions)
{
QFileInfo fi( file );
- QString name = fi.fileName();
-
- if ( name.indexOf( QRegExp("[-!?#*&]") ) >= 0 ) {
+ if ( !QRegExp( "[A-Za-z_][A-Za-z0-9_]*" ).exactMatch( fi.completeBaseName() ) ) {
SUIT_MessageBox::critical( parent(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_FILE_NAME_BAD") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_FILE_NAME_BAD") );
return false;
}
return SUIT_FileValidator::canSave( file, permissions);
QStringList aFilters;
aFilters.append( tr( "PYTHON_FILES_FILTER" ) );
+ bool anIsPublish = true;
+ bool anIsMultiFile = false;
+ bool anIsSaveGUI = true;
+
+ if ( SUIT_ResourceMgr* aResourceMgr = resourceMgr() ) {
+ anIsPublish = aResourceMgr->booleanValue( "Study", "pydump_publish", anIsPublish );
+ anIsMultiFile = aResourceMgr->booleanValue( "Study", "multi_file_dump", anIsMultiFile );
+ anIsSaveGUI = aResourceMgr->booleanValue( "Study", "pydump_save_gui", anIsSaveGUI );
+ }
+
DumpStudyFileDlg fd( desktop() );
fd.setValidator( new DumpStudyFileValidator( &fd ) );
fd.setWindowTitle( tr( "TOT_DESK_FILE_DUMP_STUDY" ) );
fd.setFilters( aFilters );
- fd.myPublishChk->setChecked( true );
- fd.mySaveGUIChk->setChecked( true );
+ fd.myPublishChk->setChecked( anIsPublish );
+ fd.myMultiFileChk->setChecked( anIsMultiFile );
+ fd.mySaveGUIChk->setChecked( anIsSaveGUI );
if ( fd.exec() == QDialog::Accepted )
{
QString aFileName = fd.selectedFile();
-
+
bool toPublish = fd.myPublishChk->isChecked();
+ bool isMultiFile = fd.myMultiFileChk->isChecked();
bool toSaveGUI = fd.mySaveGUIChk->isChecked();
-
+
if ( !aFileName.isEmpty() ) {
QFileInfo aFileInfo(aFileName);
if( aFileInfo.isDir() ) // IPAL19257
- return;
-
- int savePoint;
- _PTR(AttributeParameter) ap;
- _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
- if(ip->isDumpPython(appStudy->studyDS())) ip->setDumpPython(appStudy->studyDS()); //Unset DumpPython flag.
- if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method
- ip->setDumpPython(appStudy->studyDS());
- savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point
- }
- bool res = aStudy->DumpStudy( aFileInfo.absolutePath().toStdString(),
- aFileInfo.baseName().toStdString(), toPublish);
- if ( toSaveGUI )
- appStudy->removeSavePoint(savePoint); //SRN: remove the created temporary save point.
+ return;
+
+ // Issue 21377 - dump study implementation moved to SalomeApp_Study class
+ bool res = appStudy->dump( aFileName, toPublish, isMultiFile, toSaveGUI );
+
if ( !res )
- SUIT_MessageBox::warning( desktop(),
- QObject::tr("WRN_WARNING"),
- tr("WRN_DUMP_STUDY_FAILED") );
+ SUIT_MessageBox::warning( desktop(),
+ QObject::tr("WRN_WARNING"),
+ tr("WRN_DUMP_STUDY_FAILED") );
}
}
}
if ( aStudy->GetProperties()->IsLocked() ) {
SUIT_MessageBox::warning( desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED") );
return;
}
QStringList filtersList;
filtersList.append(tr("PYTHON_FILES_FILTER"));
filtersList.append(tr("ALL_FILES_FILTER"));
-
+
QString anInitialPath = "";
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
anInitialPath = QDir::currentPath();
if ( !aFile.isEmpty() )
{
- QString command = QString("execfile(\"%1\")").arg(aFile);
+ QString command = QString("execfile(r\"%1\")").arg(aFile);
PyConsole_Console* pyConsole = pythonConsole();
if ( study ) {
SalomeApp_VisualState( this ).storeState();
updateSavePointDataObjects( study );
- // temporary commented
- //objectBrowser()->updateTree( study->root() );
+ updateObjectBrowser();
}
updateActions();
}
// temporary commented
//ob->setUpdater( new SalomeApp_Updater() );
+#ifdef WITH_SALOMEDS_OBSERVER
+ //do not activate the automatic update of Qt tree through signal/slot
+ ob->setAutoUpdate(false);
+ //activate update of modified objects only
+ ob->setUpdateModified(true);
+#endif
+
connect( ob, SIGNAL( doubleClicked( SUIT_DataObject* ) ), this, SLOT( onDblClick( SUIT_DataObject* ) ) );
QString
ob->setAutoSizeFirstColumn(autoSizeFirst);
ob->setAutoSizeColumns(autoSize);
ob->setResizeOnExpandItem(resizeOnExpandItem);
+ ob->setProperty( "shortcut", QKeySequence( "Alt+Shift+O" ) );
// temporary commented
/*
// temporary commented
/*
- ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
- ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
- ob->resize( desktop()->width()/3, ob->height() );
+ ob->setWidthMode( autoSize ? QListView::Maximum : QListView::Manual );
+ ob->listView()->setColumnWidthMode( 0, autoSizeFirst ? QListView::Maximum : QListView::Manual );
+ ob->resize( desktop()->width()/3, ob->height() );
*/
}
}
{
PyConsole_Console* pyCons = new PyConsole_Console( desktop(), new SalomeApp_PyInterp() );
pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
+ pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
+ pyCons->setIsShowBanner(resourceMgr()->booleanValue( "PyConsole", "show_banner", true ));
+ pyCons->setProperty( "shortcut", QKeySequence( "Alt+Shift+P" ) );
wid = pyCons;
- pyCons->resize( pyCons->width(), desktop()->height()/4 );
+ //pyCons->resize( pyCons->width(), desktop()->height()/4 );
pyCons->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) );
}
return wid;
int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
int defCols = pref->addPreference( tr( "PREF_GROUP_DEF_COLUMNS" ), obTab );
- for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
+ for ( int i = SalomeApp_DataObject::EntryId; i < SalomeApp_DataObject::LastId; i++ )
{
- pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i-1 ).toLatin1() ), defCols,
- LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_id_%d", i ) );
+ pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i-SalomeApp_DataObject::EntryId ).toLatin1() ), defCols,
+ LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_id_%d", i-1 ) );
}
pref->setItemProperty( "orientation", Qt::Vertical, defCols );
int genTab = pref->addPreference( LightApp_Application::tr( "PREF_TAB_GENERAL" ), salomeCat );
int studyGroup = pref->addPreference( LightApp_Application::tr( "PREF_GROUP_STUDY" ), genTab );
pref->addPreference( tr( "PREF_STORE_VISUAL_STATE" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_visual_state" );
+ pref->addPreference( "", studyGroup, LightApp_Preferences::Space );
+ pref->addPreference( tr( "PREF_PYDUMP_PUBLISH" ), studyGroup, LightApp_Preferences::Bool, "Study", "pydump_publish" );
+ pref->addPreference( tr( "PREF_PYDUMP_MULTI_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "multi_file_dump" );
+ pref->addPreference( tr( "PREF_PYDUMP_SAVE_GUI" ), studyGroup, LightApp_Preferences::Bool, "Study", "pydump_save_gui" );
+ pref->addPreference( "", studyGroup, LightApp_Preferences::Space );
+ pref->addPreference( "", studyGroup, LightApp_Preferences::Space );
}
/*!Update desktop title.*/
if ( study ) {
_PTR(Study) stdDS = study->studyDS();
if(stdDS) {
- if ( stdDS->GetProperties()->IsLocked() ) {
- aTitle += QString( " - [%1 (%2)]").arg( sName ).arg( tr( "STUDY_LOCKED" ) );
- } else {
- aTitle += QString( " - [%1]" ).arg( sName );
- }
+ if ( stdDS->GetProperties()->IsLocked() ) {
+ aTitle += QString( " - [%1 (%2)]").arg( sName ).arg( tr( "STUDY_LOCKED" ) );
+ } else {
+ aTitle += QString( " - [%1]" ).arg( sName );
+ }
}
}
}
{
int answer = SUIT_MessageBox::question( desktop(), tr( "APPCLOSE_CAPTION" ), tr( "APPCLOSE_DESCRIPTION" ).arg( docName ),
tr ("APPCLOSE_SAVE"), tr ("APPCLOSE_CLOSE"),
- tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 );
+ tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 );
int res = CloseCancel;
if ( answer == 0 )
{
int choice = LightApp_Application::openChoice( aName );
- if ( choice == OpenNew ) // The document isn't already open.
- {
- bool exist = false;
- std::vector<std::string> lst = studyMgr()->GetOpenStudies();
- for ( uint i = 0; i < lst.size() && !exist; i++ )
- {
- if ( aName == QString( lst[i].c_str() ) )
- exist = true;
- }
-
- // The document already exists in the study manager.
- // Do you want to reload it?
- if ( exist )
- {
- int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYEXIST" ).arg( aName ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No );
- if ( answer == SUIT_MessageBox::Yes )
- choice = OpenRefresh;
- else
- choice = OpenCancel;
+ if ( QFileInfo( aName ).exists() ) {
+ if ( choice == OpenNew ) { // The document isn't already open.
+ bool exist = false;
+ std::vector<std::string> lst = studyMgr()->GetOpenStudies();
+ for ( uint i = 0; i < lst.size() && !exist; i++ ) {
+ if ( aName == QString( lst[i].c_str() ) )
+ exist = true;
+ }
+ // The document already exists in the study manager.
+ // Do you want to reload it?
+ if ( exist ) {
+ int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_DOC_ALREADYEXIST" ).arg( aName ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No );
+ if ( answer == SUIT_MessageBox::Yes )
+ choice = OpenRefresh;
+ else
+ choice = OpenCancel;
+ }
}
+ } else { // file is not exist on disk
+ SUIT_MessageBox::warning( desktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_FILE_NOT_EXIST").arg(aName.toLatin1().data()));
+ return false;
}
return choice;
_PTR(Study) aStudy = studyMgr()->GetStudyByName( aName.toStdString() );
if ( aStudy )
{
- studyMgr()->Close( aStudy );
- choice = OpenNew;
+ studyMgr()->Close( aStudy );
+ choice = OpenNew;
}
}
default:
QMap<int, QString> SalomeApp_Application::activateModuleActions() const
{
QMap<int, QString> opmap = LightApp_Application::activateModuleActions();
- opmap.insert( LoadStudyId, tr( "ACTIVATE_MODULE_OP_LOAD" ) );
+ opmap.insert( LoadStudyId, tr( "ACTIVATE_MODULE_OP_LOAD" ) );
+ opmap.insert( NewAndScriptId, tr( "ACTIVATE_MODULE_OP_SCRIPT" ) );
return opmap;
}
*/
void SalomeApp_Application::moduleActionSelected( const int id )
{
- if ( id == LoadStudyId )
+ switch ( id ) {
+ case LoadStudyId:
onLoadDoc();
- else
+ break;
+ case NewAndScriptId:
+ onNewWithScript();
+ break;
+ default:
LightApp_Application::moduleActionSelected( id );
+ break;
+ }
}
/*!Gets CORBA::ORB_var*/
/*!Create and return SALOME_NamingService.*/
SALOME_NamingService* SalomeApp_Application::namingService()
{
- static SALOME_NamingService* _ns = new SALOME_NamingService( orb() );
- return _ns;
+ static SALOME_NamingService _ns(orb());
+ return &_ns;
}
/*!Create and return SALOME_LifeCycleCORBA.*/
SALOME_LifeCycleCORBA* SalomeApp_Application::lcc()
{
- static SALOME_LifeCycleCORBA* _lcc = new SALOME_LifeCycleCORBA( namingService() );
- return _lcc;
-}
-
-/*!Return default engine IOR for light modules*/
-QString SalomeApp_Application::defaultEngineIOR()
-{
- /// Look for a default module engine (needed for CORBAless modules to use SALOMEDS persistence)
- QString anIOR( "" );
- CORBA::Object_ptr anEngine = namingService()->Resolve( "/SalomeAppEngine" );
- if ( !CORBA::is_nil( anEngine ) )
- {
- CORBA::String_var objStr = orb()->object_to_string( anEngine );
- anIOR = QString( objStr.in() );
- }
- return anIOR;
+ static SALOME_LifeCycleCORBA _lcc( namingService() );
+ return &_lcc;
}
/*!Private SLOT. On preferences.*/
/*!Insert items in popup, which necessary for current application*/
void SalomeApp_Application::contextMenuPopup( const QString& type, QMenu* thePopup, QString& title )
{
+ LightApp_SelectionMgr* mgr = selectionMgr();
+ bool cacheIsOn = mgr->isSelectionCacheEnabled();
+ mgr->setSelectionCacheEnabled( true );
+
LightApp_Application::contextMenuPopup( type, thePopup, title );
// temporary commented
// Get selected objects
SALOME_ListIO aList;
- LightApp_SelectionMgr* mgr = selectionMgr();
mgr->selectedObjects( aList, QString(), false );
// add GUI state commands: restore, rename
QString( aList.First()->getEntry() ).startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) ) {
thePopup->addSeparator();
thePopup->addAction( tr( "MEN_RESTORE_VS" ), this, SLOT( onRestoreGUIState() ) );
- thePopup->addAction( tr( "MEN_RENAME_VS" ), this, SLOT( onRenameGUIState() ) );
+ thePopup->addAction( tr( "MEN_RENAME_VS" ), objectBrowser(),
+ SLOT( onStartEditing() ), objectBrowser()->shortcutKey(SUIT_DataBrowser::RenameShortcut) );
thePopup->addAction( tr( "MEN_DELETE_VS" ), this, SLOT( onDeleteGUIState() ) );
}
{
_PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() ), aRefObj = aSObject;
while( aRefObj && aRefObj->ReferencedObject( anObj ) )
- aRefObj = anObj;
+ aRefObj = anObj;
if( aRefObj && aRefObj!=aSObject && QString( aRefObj->GetName().c_str() ).isEmpty() )
- isInvalidRefs = true;
+ isInvalidRefs = true;
}
// Add "Delete reference" item to popup
return;
}
- aList.Clear();
- mgr->selectedObjects( aList );
-
// "Activate module" item should appear only if it's necessary
- if (aList.Extent() != 1)
- return;
- Handle(SALOME_InteractiveObject) aIObj = aList.First();
- // check if item is a "GUI state" item (also a first level object)
- QString entry( aIObj->getEntry() );
- if ( entry.startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) )
- return;
- QString aModuleName(aIObj->getComponentDataType());
- QString aModuleTitle = moduleTitle(aModuleName);
- CAM_Module* currentModule = activeModule();
- if (currentModule && currentModule->moduleName() == aModuleTitle)
- return;
- if ( !aModuleTitle.isEmpty() )
- thePopup->addAction( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) );
+ if ( aList.Extent() == 1 ) {
+ aList.Clear();
+ mgr->selectedObjects( aList );
+
+ Handle(SALOME_InteractiveObject) aIObj = aList.First();
+
+ // add extra popup menu (defined in XML)
+ if ( myExtActions.size() > 0 ) {
+ // Use only first selected object
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+ if ( study ) {
+ _PTR(Study) stdDS = study->studyDS();
+ if ( stdDS ) {
+ _PTR(SObject) aSO = stdDS->FindObjectID( aIObj->getEntry() );
+ if ( aSO ) {
+ _PTR( GenericAttribute ) anAttr;
+ std::string auid = "AttributeUserID";
+ auid += Kernel_Utils::GetGUID(Kernel_Utils::ObjectdID);
+ if ( aSO->FindAttribute( anAttr, auid ) ) {
+ _PTR(AttributeUserID) aAttrID = anAttr;
+ QString aId = aAttrID->Value().c_str();
+ if ( myExtActions.contains( aId ) ) {
+ thePopup->addAction(myExtActions[aId]);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // check if item is a "GUI state" item (also a first level object)
+ QString entry( aIObj->getEntry() );
+ if ( !entry.startsWith( tr( "SAVE_POINT_DEF_NAME" ) ) ) {
+ QString aModuleName( aIObj->getComponentDataType() );
+ QString aModuleTitle = moduleTitle( aModuleName );
+ CAM_Module* currentModule = activeModule();
+ if ( ( !currentModule || currentModule->moduleName() != aModuleTitle ) && !aModuleTitle.isEmpty() )
+ thePopup->addAction( tr( "MEN_OPENWITH" ).arg( aModuleTitle ), this, SLOT( onOpenWith() ) );
+ }
+ }
+
+ mgr->setSelectionCacheEnabled( cacheIsOn );
}
/*!Update obect browser:
{
for ( _PTR(SComponentIterator) it ( stdDS->NewComponentIterator() ); it->More(); it->Next() )
{
- _PTR(SComponent) aComponent ( it->Value() );
-
- if ( aComponent->ComponentDataType() == "Interface Applicative" )
- continue; // skip the magic "Interface Applicative" component
+ _PTR(SComponent) aComponent ( it->Value() );
- getWindow( WT_ObjectBrowser );
- const bool isAutoUpdate = objectBrowser()->autoUpdate();
- objectBrowser()->setAutoUpdate( false );
- SalomeApp_DataModel::synchronize( aComponent, study );
- objectBrowser()->setAutoUpdate( isAutoUpdate );
+#ifndef WITH_SALOMEDS_OBSERVER
+ // with GUI observers this check is not needed anymore
+ if ( aComponent->ComponentDataType() == study->getVisualComponentName().toLatin1().constData() )
+ continue; // skip the magic "Interface Applicative" component
+#endif
+ if ( !objectBrowser() )
+ getWindow( WT_ObjectBrowser );
+ const bool isAutoUpdate = objectBrowser()->autoUpdate();
+ objectBrowser()->setAutoUpdate( false );
+ SalomeApp_DataModel::synchronize( aComponent, study );
+ objectBrowser()->setAutoUpdate( isAutoUpdate );
}
}
}
/*!find original object by double click on item */
void SalomeApp_Application::onDblClick( SUIT_DataObject* theObj )
{
- SalomeApp_DataObject* obj = dynamic_cast<SalomeApp_DataObject*>( theObj );
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+ // Issue 21379: References are supported at LightApp_DataObject level
+ LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( theObj );
- if( study && obj )
+ if( obj && obj->isReference() )
{
- QString entry = obj->entry();
- _PTR(SObject) sobj = study->studyDS()->FindObjectID( entry.toStdString() ), ref;
+ QString entry = obj->refEntry();
- if( sobj && sobj->ReferencedObject( ref ) )
- {
- entry = ref->GetID().c_str();
-
- SUIT_DataOwnerPtrList aList;
- aList.append( new LightApp_DataOwner( entry ) );
- selectionMgr()->setSelected( aList, false );
+ SUIT_DataOwnerPtrList aList;
+ aList.append( new LightApp_DataOwner( entry ) );
+ selectionMgr()->setSelected( aList, false );
+
+ SUIT_DataBrowser* ob = objectBrowser();
- SUIT_DataBrowser* ob = objectBrowser();
-
- QModelIndexList aSelectedIndexes = ob->selectedIndexes();
- if ( !aSelectedIndexes.isEmpty() )
- ob->treeView()->scrollTo( aSelectedIndexes.first() );
- }
+ QModelIndexList aSelectedIndexes = ob->selectedIndexes();
+ if ( !aSelectedIndexes.isEmpty() )
+ ob->treeView()->scrollTo( aSelectedIndexes.first() );
}
}
{
SALOME_ListIO aList;
selMgr->selectedObjects( aList );
- Handle(SALOME_InteractiveObject) aIObj = aList.First();
- QString entry( aIObj->getEntry() );
- QString startStr = QObject::tr( "SAVE_POINT_DEF_NAME" );
- if ( !entry.startsWith( startStr ) ) // it's a "GUI state" object
- return -1;
- bool ok; // conversion to integer is ok?
- int savePoint = entry.right( entry.length() - startStr.length() ).toInt( &ok );
- return ok ? savePoint : -1;
+ if( aList.Extent() > 0 ) {
+ Handle(SALOME_InteractiveObject) aIObj = aList.First();
+ QString entry( aIObj->getEntry() );
+ QString startStr = QObject::tr( "SAVE_POINT_DEF_NAME" );
+ if ( !entry.startsWith( startStr ) ) // it's a "GUI state" object
+ return -1;
+ bool ok; // conversion to integer is ok?
+ int savePoint = entry.right( entry.length() - startStr.length() ).toInt( &ok );
+ return ok ? savePoint : -1;
+ }
+ return -1;
}
/*!Called on Restore GUI State popup command*/
SalomeApp_VisualState( this ).restoreState( savePoint );
}
-/*!Called on Rename GUI State popup command*/
-void SalomeApp_Application::onRenameGUIState()
-{
- int savePoint = ::getSelectedSavePoint( selectionMgr() );
- if ( savePoint == -1 )
- return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( activeStudy() );
- if ( !study )
- return;
-
- QString newName = LightApp_NameDlg::getName( desktop(), study->getNameOfSavePoint( savePoint ) );
- if ( !newName.isNull() && !newName.isEmpty() ) {
- study->setNameOfSavePoint( savePoint, newName );
- updateSavePointDataObjects( study );
- // temporary commented
- //objectBrowser()->updateTree( study->root() );
- }
-}
-
-
/*!Called on Delete GUI State popup command*/
void SalomeApp_Application::onDeleteGUIState()
{
{
LightApp_Application::onStudyCreated( study );
+ connect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+ this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ), Qt::UniqueConnection );
+
+
objectBrowserColumnsVisibility();
}
{
LightApp_Application::onStudyOpened( study );
+ connect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+ this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ), Qt::UniqueConnection );
+
objectBrowserColumnsVisibility();
// temporary commented
/*! updateSavePointDataObjects: syncronize data objects that correspond to save points (gui states)*/
void SalomeApp_Application::updateSavePointDataObjects( SalomeApp_Study* study )
{
- // temporary commented
- //OB_Browser* ob = objectBrowser();
- if ( !study /*|| !ob */) // temporary commented
+ SUIT_DataBrowser* ob = objectBrowser();
+ LightApp_SelectionMgr* selMgr = selectionMgr();
+
+ if ( !study || !ob || !selMgr )
return;
// find GUI states root object
std::vector<int> savePoints = study->getSavePoints();
// case 1: no more save points but they existed in study's tree
if ( savePoints.empty() && guiRootObj ) {
+ //rnv : to fix bug "IPAL22450 TC6.3.0: sigsegv loop deleting the GUI state"
+ // : set auto update to true for removing SalomeApp_SavePointRootObject from the SUIT_TreeModel
+ const bool isAutoUpdate = ob->autoUpdate();
+ selMgr->clearSelected();
+ ob->setAutoUpdate(true);
+ DataObjectList ch = guiRootObj->children();
+ for( int i = 0; i < ch.size(); i++ )
+ delete ch[i];
delete guiRootObj;
+ ob->setAutoUpdate(isAutoUpdate);
return;
}
// case 2: no more save points but root does not exist either
mapDO.remove( savePoints[i] );
// delete DataObjects that are still in the map -- their IDs were not found in data model
- for ( QMap<int,SalomeApp_SavePointObject*>::Iterator it = mapDO.begin(); it != mapDO.end(); ++it )
- delete it.value();
+ if( mapDO.size() > 0) {
+ //rnv : to fix bug "IPAL22450 TC6.3.0: sigsegv loop deleting the GUI state"
+ // : set auto update to true for removing SalomeApp_SavePointObject from the SUIT_TreeModel
+ selMgr->clearSelected();
+ const bool isAutoUpdate = ob->autoUpdate();
+ ob->setAutoUpdate(true);
+ for ( QMap<int,SalomeApp_SavePointObject*>::Iterator it = mapDO.begin(); it != mapDO.end(); ++it )
+ delete it.value();
+ ob->setAutoUpdate(isAutoUpdate);
+ }
}
/*! Check data object */
return false;
}
-/*! Process standard messages from desktop */
-void SalomeApp_Application::onDesktopMessage( const QString& message )
-{
- // update object browser
- if ( message.toLower() == "updateobjectbrowser" ||
- message.toLower() == "updateobjbrowser" )
- updateObjectBrowser();
-}
-
/*!
Opens other study into active Study. If Study is empty - creates it.
\param theName - name of study
void SalomeApp_Application::objectBrowserColumnsVisibility()
{
if ( objectBrowser() )
- for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
+ for ( int i = SalomeApp_DataObject::EntryId; i < SalomeApp_DataObject::LastId; i++ )
{
- bool shown = resourceMgr()->booleanValue( "ObjectBrowser", QString( "visibility_column_id_%1" ).arg( i ), true );
+ bool shown = resourceMgr()->booleanValue( "ObjectBrowser", QString( "visibility_column_id_%1" ).arg( i-1 ), true );
objectBrowser()->treeView()->setColumnHidden( i, !shown );
}
}
return myNoteBook;
}
+/*!
+ * Define extra actions defined in module definition XML file.
+ * Additional popup items sections can be defined by parameter "popupitems".
+ * Supported attributes:
+ * title - title of menu item,
+ * attributelocalid - AttributeLocalId defined for selected data item where menu command has to be applied,
+ * method - method which has to be called when menu item is selected
+ * Example:
+ * <section name="MODULENAME">
+ * <parameter name="popupitems" value="menuitem1:menuitem2:..."/>
+ * </section>
+ * <section name="importmed">
+ * <parameter name="title" value="My menu"/>
+ * <parameter name="objectid" value="VISU.Result"/>
+ * <parameter name="method" value="nameOfModuleMethod"/>
+ * </section>
+ */
+void SalomeApp_Application::createExtraActions()
+{
+ myExtActions.clear();
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+ QStringList aModules;
+ modules(aModules, false);
+ foreach(QString aModile, aModules) {
+ QString aModName = moduleName(aModile);
+ QString aSectionStr = resMgr->stringValue(aModName, "popupitems", QString());
+ if (!aSectionStr.isNull()) {
+ QStringList aSections = aSectionStr.split(':');
+ foreach(QString aSection, aSections) {
+ QString aTitle = resMgr->stringValue(aSection, "title", QString());
+ QString aId = resMgr->stringValue(aSection, "objectid", QString());
+ QString aSlot = resMgr->stringValue(aSection, "method", QString());
+ if (aTitle.isEmpty() || aSlot.isEmpty() || aId.isEmpty())
+ continue;
+
+ QString aModuleName = resMgr->stringValue(aSection, "module", QString());
+ if (aModuleName.isNull())
+ aModuleName = aModName;
+
+ QAction* aAction = new QAction(aTitle, this);
+ QStringList aData;
+ aData<<aModuleName<<aSlot;
+ aAction->setData(aData);
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onExtAction()));
+ myExtActions[aId] = aAction;
+ }
+ }
+ }
+}
+
+/*!
+ * Called when extra action is selected
+ */
+void SalomeApp_Application::onExtAction()
+{
+ QAction* aAction = ::qobject_cast<QAction*>(sender());
+ if (!aAction)
+ return;
+
+ QVariant aData = aAction->data();
+ QStringList aDataList = aData.value<QStringList>();
+ if (aDataList.size() != 2)
+ return;
+
+ LightApp_SelectionMgr* aSelectionMgr = selectionMgr();
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects(aListIO);
+ const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+ if (aListIO.Extent() < 1)
+ return;
+ if (!anIO->hasEntry())
+ return;
+
+ QString aEntry(anIO->getEntry());
+
+ QApplication::setOverrideCursor( Qt::WaitCursor );
+ QString aModuleTitle = moduleTitle(aDataList[0]);
+ activateModule(aModuleTitle);
+ QApplication::restoreOverrideCursor();
+
+ QCoreApplication::processEvents();
+
+ CAM_Module* aModule = activeModule();
+ if (!aModule)
+ return;
+
+ if (!QMetaObject::invokeMethod(aModule, qPrintable(aDataList[1]), Q_ARG(QString, aEntry)))
+ printf("Error: Can't Invoke method %s\n", qPrintable(aDataList[1]));
+}
+
+/*!
+ * Called when window activated
+ */
+void SalomeApp_Application::onWindowActivated( SUIT_ViewWindow* theViewWindow )
+{
+ SUIT_DataBrowser* anOB = objectBrowser();
+ if( !anOB )
+ return;
+ SUIT_DataObject* rootObj = anOB->root();
+ if( !rootObj )
+ return;
+
+ DataObjectList listObj = rootObj->children( true );
+
+ SUIT_ViewModel* vmod = 0;
+ if ( SUIT_ViewManager* vman = theViewWindow->getViewManager() )
+ vmod = vman->getViewModel();
+ updateVisibilityState( listObj, vmod );
+}
+
+/*!
+ Update visibility state of given objects
+ */
+void SalomeApp_Application::updateVisibilityState( DataObjectList& theList,
+ SUIT_ViewModel* theViewModel )
+{
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+
+ if(!theViewModel)
+ return;
+
+ SALOME_View* aView = dynamic_cast<SALOME_View*>( theViewModel );
+
+ if (theList.isEmpty() || !aView || !aStudy)
+ return;
+
+ for ( DataObjectList::iterator itr = theList.begin(); itr != theList.end(); ++itr ) {
+ LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>(*itr);
+
+ if (!obj || aStudy->isComponent(obj->entry()))
+ continue;
+
+ LightApp_Module* anObjModule = dynamic_cast<LightApp_Module*>(obj->module());
+ Qtx::VisibilityState anObjState = Qtx::UnpresentableState;
+
+ if(anObjModule) {
+ LightApp_Displayer* aDisplayer = anObjModule->displayer();
+ if(aDisplayer) {
+ if( aDisplayer->canBeDisplayed(obj->entry(), theViewModel->getType()) ) {
+ if(aDisplayer->IsDisplayed(obj->entry(),aView))
+ anObjState = Qtx::ShownState;
+ else
+ anObjState = Qtx::HiddenState;
+ }
+ }
+ aStudy->setVisibilityState( obj->entry(), anObjState );
+ }
+ }
+}
+
+/*!
+ Called then view manager removed
+*/
+void SalomeApp_Application::onViewManagerRemoved( SUIT_ViewManager* )
+{
+ ViewManagerList lst;
+ viewManagers(lst);
+ if( lst.count() == 1) { // in case if closed last view window
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(activeStudy());
+ if(aStudy)
+ aStudy->setVisibilityStateForAll(Qtx::UnpresentableState);
+ }
+}
+
+/*!
+ Checks that an object can be renamed.
+ \param entry entry of the object
+ \brief Return \c true if object can be renamed
+*/
+bool SalomeApp_Application::renameAllowed( const QString& entry) const
+{
+ return entry.startsWith( tr( "SAVE_POINT_DEF_NAME") );
+}
+
+/*!
+ Rename object by entry.
+ \param entry entry of the object
+ \param name new name of the object
+ \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool SalomeApp_Application::renameObject( const QString& entry, const QString& name )
+{
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
+
+ int savePoint = ::getSelectedSavePoint( selectionMgr() );
+
+ if(!aStudy || savePoint == -1)
+ return false;
+
+ if ( !name.isNull() && !name.isEmpty() ) {
+ aStudy->setNameOfSavePoint( savePoint, name );
+ updateSavePointDataObjects( aStudy );
+
+ //Mark study as modified
+ aStudy->Modified();
+ return true;
+ }
+ return false;
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_Application.h
// Created: 10/22/2004 3:37:25 PM
// Author: Sergey LITONIN
#include "SalomeApp.h"
#include <LightApp_Application.h>
+#include <SUIT_DataObject.h>
+
#include <CORBA.h>
//#include <SALOMEconfig.h>
class LightApp_Preferences;
class SalomeApp_Study;
class SalomeApp_NoteBookDlg;
-class SUIT_DataObject;
+class SUIT_Desktop;
+class SUIT_ViewModel;
class SALOME_LifeCycleCORBA;
protected:
enum { OpenRefresh = LightApp_Application::OpenReload + 1 };
enum { CloseUnload = LightApp_Application::CloseDiscard + 1 };
- enum { LoadStudyId = LightApp_Application::OpenStudyId + 1 };
+ enum { LoadStudyId = LightApp_Application::OpenStudyId + 1, NewAndScriptId };
public:
SalomeApp_Application();
virtual bool checkDataObject(LightApp_DataObject* theObj);
+ virtual void setDesktop( SUIT_Desktop* );
+
static CORBA::ORB_var orb();
static SALOMEDSClient_StudyManager* studyMgr();
static SALOME_NamingService* namingService();
static SALOME_LifeCycleCORBA* lcc();
- static QString defaultEngineIOR();
SUIT_ViewManager* newViewManager(const QString&);
void updateSavePointDataObjects( SalomeApp_Study* );
virtual void setNoteBook(SalomeApp_NoteBookDlg* theNoteBook);
virtual SalomeApp_NoteBookDlg* getNoteBook() const;
+ //! update visibility state of objects
+ void updateVisibilityState( DataObjectList& theList,
+ SUIT_ViewModel* theViewModel );
+
+ virtual bool renameAllowed( const QString& ) const;
+ virtual bool renameObject( const QString&, const QString& );
+
public slots:
virtual void onLoadDoc();
+ virtual void onNewWithScript();
virtual bool onLoadDoc( const QString& );
virtual void onCloseDoc( bool ask = true);
void onStudyCreated( SUIT_Study* );
void onStudySaved( SUIT_Study* );
void onStudyOpened( SUIT_Study* );
- void onDesktopMessage( const QString& );
+ void onStudyClosed( SUIT_Study* );
+
+ void onViewManagerRemoved( SUIT_ViewManager* );
protected:
virtual void createActions();
void onDeleteGUIState();
void onRestoreGUIState();
- void onRenameGUIState();
void onCatalogGen();
void onRegDisplay();
void onOpenWith();
+ void onExtAction();
+
+ void onWindowActivated( SUIT_ViewWindow* theViewWindow );
+
+private:
+ void createExtraActions();
- private:
- SalomeApp_NoteBookDlg* myNoteBook;
+private:
+ SalomeApp_NoteBookDlg* myNoteBook;
+ QMap<QString, QAction*> myExtActions; // Map <AttributeUserID, QAction>
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_CheckFileDlg.h"
#include <QCheckBox>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_CHECKFILEDIALOG_H
#define SALOMEAPP_CHECKFILEDIALOG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_DataModel.cxx
// Created: 10/25/2004 10:36:06 AM
// Author: Sergey LITONIN
-//
+
#include "SalomeApp_DataModel.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_DataObject.h"
*/
bool SalomeApp_DataModelSync::isCorrect( const kerPtr& so ) const
{
+#ifdef WITH_SALOMEDS_OBSERVER
+ // with GUI observers this function is not needed anymore
+ return true;
+#endif
kerPtr refObj;
QString name = so->GetName().c_str();
_PTR( GenericAttribute ) anAttr;
\param prepend - SUIT object must be added to start of children list
*/
suitPtr SalomeApp_DataModelSync::createItem( const kerPtr& so,
- const suitPtr& parent,
- const suitPtr& after ) const
+ const suitPtr& parent,
+ const suitPtr& after ) const
{
if( !isCorrect( so ) )
return 0;
_PTR(SComponent) aSComp( so );
suitPtr nitem = aSComp ? new SalomeApp_ModuleObject( aSComp, 0 ) :
new SalomeApp_DataObject( so, 0 );
+
if( parent ) {
int pos = after ? parent->childPos( after ) : 0;
parent->insertChild( nitem, pos+1 );
_PTR( SComponent ) aComp( p );
bool res = ( !p && !q ) ||
( lobj && !sobj && aComp ) ||
- ( sobj && isCorrect( p ) && p->GetID().c_str()==sobj->entry() );
+ ( sobj && isCorrect( p ) && p->GetID().c_str()==sobj->entry() );
return res;
}
{
QList<kerPtr> ch;
- _PTR(ChildIterator) it ( myStudy->NewChildIterator( obj ) );
- for( ; it->More(); it->Next() )
- ch.append( it->Value() );
+ _PTR( GenericAttribute ) anAttr;
+ bool expandable = true;
+ if ( obj && obj->FindAttribute( anAttr, "AttributeExpandable" ) ) {
+ _PTR(AttributeExpandable) aAttrExp = anAttr;
+ expandable = aAttrExp->IsExpandable();
+ }
+
+ if ( expandable ) {
+ // tmp??
+ _PTR(UseCaseBuilder) aUseCaseBuilder = myStudy->GetUseCaseBuilder();
+ if (aUseCaseBuilder->HasChildren(obj)) {
+ _PTR(UseCaseIterator) it ( aUseCaseBuilder->GetUseCaseIterator( obj ) );
+ for ( ; it->More(); it->Next() )
+ ch.append( it->Value() );
+ }
+ else {
+ _PTR(ChildIterator) it ( myStudy->NewChildIterator( obj ) );
+ for ( ; it->More(); it->Next() )
+ ch.append( it->Value() );
+ }
+ }
+
return ch;
}
studyRoot = dynamic_cast<LightApp_RootObject*>( aSStudy->root() );
QString anId = getRootEntry( aSStudy );
if ( !anId.isEmpty() ){ // if nothing is published in the study for this module -> do nothing
- _PTR(Study) aStudy ( aSStudy->studyDS() );
- sobj = aStudy->FindComponentID( std::string( anId.toLatin1() ) );
+ _PTR(Study) aStudy ( aSStudy->studyDS() );
+ sobj = aStudy->FindComponentID( std::string( anId.toLatin1() ) );
}
}
}
}
}
+#ifdef WITH_SALOMEDS_OBSERVER
+ SalomeApp_RootObject* root=dynamic_cast<SalomeApp_RootObject*>(study->root());
+ if(!(root->toSynchronize()))
+ return suitObj;
+#endif
+
SalomeApp_DataModelSync sync( study->studyDS(), study->root() );
if( !suitObj || dynamic_cast<SalomeApp_DataObject*>( suitObj ) )
- return ::synchronize<kerPtr,suitPtr,SalomeApp_DataModelSync>( sobj, suitObj, sync );
+ suitObj= ::synchronize<kerPtr,suitPtr,SalomeApp_DataModelSync>( sobj, suitObj, sync );
else
- return 0;
+ suitObj= 0;
+
+ return suitObj;
}
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_DataModel.h
// Created: 10/25/2004 10:32:33 AM
// Author: Sergey LITONIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SalomeApp_DataObject.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#include "SalomeApp_DataObject.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
\param parent parent data object
*/
SalomeApp_DataObject::SalomeApp_DataObject( const _PTR(SObject)& sobj,
- SUIT_DataObject* parent )
+ SUIT_DataObject* parent )
: CAM_DataObject( parent ),
LightApp_DataObject( parent )
{
{
QString txt;
- // add "Value", "IOR", and "Reference Entry" columns
+ // Text for "Value" and "IOR" columns
switch ( id )
{
case ValueId:
#endif
txt = value( object() );
if ( txt.isEmpty() )
- txt = value( referencedObject() );
+ txt = value( referencedObject() );
break;
case IORId:
txt = ior( referencedObject() );
break;
- case RefEntryId :
- if ( isReference() )
- txt = entry( referencedObject() );
- break;
default:
+ // Issue 21379: LightApp_DataObject::text() treats "Entry"
+ // and "Reference Entry" columns
txt = LightApp_DataObject::text( id );
break;
}
if ( myObject && myObject->FindAttribute( anAttr, "AttributePixMap" ) ){
_PTR(AttributePixMap) aPixAttr ( anAttr );
if ( aPixAttr->HasPixMap() ) {
- QString componentType = componentDataType();
- QString pixmapID = aPixAttr->GetPixMap().c_str();
- // select a plugin within a component
- QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts );
- if ( plugin_pixmap.size() == 2 ) {
- componentType = plugin_pixmap.front();
- pixmapID = plugin_pixmap.back();
- }
- QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() );
- LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
- if ( aRoot && aRoot->study() ) {
- SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr();
- return mgr->loadPixmap( componentType, pixmapName, false );
- }
+ QString componentType = componentDataType();
+ QString pixmapID = aPixAttr->GetPixMap().c_str();
+ // select a plugin within a component
+ QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts );
+ if ( plugin_pixmap.size() == 2 ) {
+ componentType = plugin_pixmap.front();
+ pixmapID = plugin_pixmap.back();
+ }
+ QString pixmapName = QObject::tr( pixmapID.toLatin1().constData() );
+ LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
+ if ( aRoot && aRoot->study() ) {
+ SUIT_ResourceMgr* mgr = aRoot->study()->application()->resourceMgr();
+ return mgr->loadPixmap( componentType, pixmapName, false );
+ }
}
}
}
case Foreground:
// text color (not selected item)
if ( isReference() ) {
- if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
- c = QColor( 255, 0, 0 ); // valid reference (red)
- else
- c = QColor( 200, 200, 200 ); // invalid reference (grayed)
+ if ( QString(referencedObject()->GetName().c_str()).isEmpty() )
+ c = QColor( 200, 200, 200 ); // invalid reference (grayed)
}
else if ( myObject ) {
// get color atrtribute value
_PTR(GenericAttribute) anAttr;
if ( myObject->FindAttribute( anAttr, "AttributeTextColor" ) ) {
- _PTR(AttributeTextColor) aColAttr = anAttr;
- c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
+ _PTR(AttributeTextColor) aColAttr = anAttr;
+ c = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
}
}
break;
+
case Highlight:
// background color for the highlighted item
if ( isReference() ) {
- if ( !(QString(referencedObject()->GetName().c_str()).isEmpty()) )
- c = QColor( 255, 0, 0 ); // valid reference (red)
- else
- c = QColor( 200, 200, 200 ); // invalid reference (grayed)
+ if ( QString(referencedObject()->GetName().c_str()).isEmpty() )
+ c = QColor( 200, 200, 200 ); // invalid reference (grayed)
}
else if ( myObject ) {
// get color atrtribute value
_PTR(GenericAttribute) anAttr;
if( myObject->FindAttribute ( anAttr, "AttributeTextHighlightColor") ) {
_PTR(AttributeTextHighlightColor) aHighColAttr = anAttr;
- c = QColor( (int)(aHighColAttr->TextHighlightColor().R),
- (int)(aHighColAttr->TextHighlightColor().G),
- (int)(aHighColAttr->TextHighlightColor().B));
+ c = QColor( (int)(aHighColAttr->TextHighlightColor().R),
+ (int)(aHighColAttr->TextHighlightColor().G),
+ (int)(aHighColAttr->TextHighlightColor().B));
}
}
break;
- case HighlightedText:
- // text color for the highlighted item
- if ( isReference() )
- c = QColor( 255, 255, 255 ); // white
+ default:
break;
}
+
+ // Issue 21379: LightApp_DataObject::color() defines colors for valid references
if ( !c.isValid() )
c = LightApp_DataObject::color( role, id );
+
return c;
}
// with any container name, on every machine available
Engines::MachineParameters params;
app->lcc()->preSet(params); // --- any container name, anywhere
- Engines::Component_var aComponent =
+ Engines::EngineComponent_var aComponent =
app->lcc()->FindComponent(params, componentDataType().toLatin1().constData() );
if ( !CORBA::is_nil(aComponent) && aComponent->hasObjectInfo() ) {
- LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
- if ( aRoot && aRoot->study() )
- return QString( aComponent->getObjectInfo( aRoot->study()->id(), entry().toLatin1().constData()) );
+ LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() );
+ if ( aRoot && aRoot->study() )
+ return QString( (CORBA::String_var)aComponent->getObjectInfo( aRoot->study()->id(), entry().toLatin1().constData()) );
}
}
}
return QString( "Object \'%1\', module \'%2\', ID=%3" ).arg( name() ).arg( componentDataType() ).arg( entry() );
}
+/*!
+ \brief Get font to be used for data object rendering in the item views
+ \param id column id
+ \return font to be used for the item rendering
+*/
+QFont SalomeApp_DataObject::font( const int id ) const
+{
+ QFont f = LightApp_DataObject::font( id );
+ if ( id == NameId ) {
+ if ( !expandable() && hasChildren() ) {
+ // set bold font to highlight the item which is non-expandable but has children
+ f.setBold( true );
+ }
+ }
+ return f;
+}
+
/*!
\brief Get component type.
\return component type
return myObject;
}
+/*!
+ \brief Returns the string identifier of the data objects referenced by this one.
+
+ Re-implemented from LightApp_DataObject using SALOMEDS API.
+
+ \return ID string of the referenced SObject
+*/
+QString SalomeApp_DataObject::refEntry() const
+{
+ return entry( referencedObject() );
+}
+
/*!
\brief Check if the data object is a reference.
+
+ Re-implemented from LightApp_DataObject using SALOMEDS API.
+
\return \c true if this data object actually refers to another one
*/
bool SalomeApp_DataObject::isReference() const
return obj;
}
+/*!
+ \brief Check if object has children
+ \return \c true if object has at least one child sub-object and \c false otherwise
+*/
+bool SalomeApp_DataObject::hasChildren() const
+{
+ bool ok = false;
+
+ // tmp??
+ _PTR(UseCaseBuilder) aUseCaseBuilder = myObject->GetStudy()->GetUseCaseBuilder();
+ if (aUseCaseBuilder->IsUseCaseNode(myObject)) {
+ ok = aUseCaseBuilder->HasChildren(myObject);
+ // TODO: check name as below?
+ }
+ else {
+ _PTR(ChildIterator) it ( myObject->GetStudy()->NewChildIterator( myObject ) );
+ for ( ; it->More() && !ok; it->Next() ) {
+ _PTR(SObject) obj = it->Value();
+ if ( obj ) {
+ _PTR(SObject) refObj;
+ //if ( obj->ReferencedObject( refObj ) ) continue; // omit references
+ if ( obj->GetName() != "" ) ok = true;
+ }
+ }
+ }
+ return ok;
+}
+
+/*!
+ \brief Check if the object is expandable (e.g. in the data tree view)
+ \return \c true if object is expandable and \c false otherwise
+*/
+bool SalomeApp_DataObject::expandable() const
+{
+ bool exp = true;
+ _PTR(GenericAttribute) anAttr;
+ if ( myObject && myObject->FindAttribute( anAttr, "AttributeExpandable" ) ) {
+ _PTR(AttributeExpandable) aAttrExp = anAttr;
+ exp = aAttrExp->IsExpandable();
+ }
+ return exp;
+}
+
+/*!
+ \brief Check if the object is visible.
+ \return \c true if this object is displayable or \c false otherwise
+*/
+bool SalomeApp_DataObject::isVisible() const
+{
+ bool isDraw = true;
+ _PTR(GenericAttribute) anAttr;
+ if ( myObject && myObject->FindAttribute(anAttr, "AttributeDrawable") )
+ {
+ _PTR(AttributeDrawable) aAttrDraw = anAttr;
+ isDraw = aAttrDraw->IsDrawable();
+ }
+ return isDraw && LightApp_DataObject::isVisible() && ( !name().isEmpty() || isReference() );
+}
+
/*!
\brief Check if the specified column supports custom sorting.
\param id column id
_PTR(AttributeIOR) iorAttr = attr;
if ( iorAttr )
{
- std::string str = iorAttr->Value();
- txt = QString( str.c_str() );
+ std::string str = iorAttr->Value();
+ txt = QString( str.c_str() );
}
}
}
{
_PTR(Study) studyDS( aStudy->studyDS() );
- bool ok = false;
- QStringList aSectionList = aStrings.split( "|" );
- if ( !aSectionList.isEmpty() )
- {
- QString aLastSection = aSectionList.last();
- QStringList aStringList = aLastSection.split( ":" );
- if ( !aStringList.isEmpty() )
- {
- ok = true;
- for ( int i = 0, n = aStringList.size(); i < n; i++ )
- {
- QString aStr = aStringList[i];
- if ( studyDS->IsVariable( aStr.toStdString() ) )
- val.append( aStr + ", " );
- }
-
- if ( !val.isEmpty() )
- val.remove( val.length() - 2, 2 );
- }
- }
- if( !ok )
- val = aStrings;
+ bool ok = false;
+ QStringList aSectionList = aStrings.split( "|" );
+ if ( !aSectionList.isEmpty() )
+ {
+ QString aLastSection = aSectionList.last();
+ QStringList aStringList = aLastSection.split( ":" );
+ if ( !aStringList.isEmpty() )
+ {
+ ok = true;
+ for ( int i = 0, n = aStringList.size(); i < n; i++ )
+ {
+ QString aStr = aStringList[i];
+ if ( studyDS->IsVariable( aStr.toStdString() ) )
+ val.append( aStr + ", " );
+ }
+
+ if ( !val.isEmpty() )
+ val.remove( val.length() - 2, 2 );
+ }
+ }
+ if( !ok )
+ val = aStrings;
}
}
}
return val;
}
+void SalomeApp_DataObject::insertChildAtTag( SalomeApp_DataObject* obj, int tag )
+{
+ int pos = 0;
+ int npos = qMin( tag-1,childCount() );
+ for ( int i = npos; i > 0; i-- )
+ {
+ if ( (dynamic_cast<SalomeApp_DataObject*>( childObject( i-1 ) ) )->object()->Tag() < tag )
+ {
+ pos = i;
+ break;
+ }
+ }
+ insertChildAtPos( obj, pos );
+}
+
+void SalomeApp_DataObject::updateItem()
+{
+ if ( modified() ) return;
+ setModified( true );
+}
+
/*!
\class SalomeApp_ModuleObject
\brief This class is used for optimized access to the SALOMEDS-based
\param parent parent data object
*/
SalomeApp_ModuleObject::SalomeApp_ModuleObject( const _PTR(SObject)& sobj,
- SUIT_DataObject* parent )
+ SUIT_DataObject* parent )
: CAM_DataObject( parent ),
LightApp_DataObject( parent ),
SalomeApp_DataObject( sobj, parent ),
\param parent parent data object
*/
SalomeApp_ModuleObject::SalomeApp_ModuleObject( CAM_DataModel* dm,
- const _PTR(SObject)& sobj,
- SUIT_DataObject* parent )
+ const _PTR(SObject)& sobj,
+ SUIT_DataObject* parent )
: CAM_DataObject( parent ),
LightApp_DataObject( parent ),
SalomeApp_DataObject( sobj, parent ),
\brief Get data object icon for the specified column.
\param id column id
\return object icon for the specified column
+ \sa CAM_ModuleObject class
*/
QPixmap SalomeApp_ModuleObject::icon( const int id ) const
{
- return SalomeApp_DataObject::icon( id );
+ QPixmap p = SalomeApp_DataObject::icon( id );
+ // The module might not provide a separate small icon
+ // for Obj. Browser representation -> always try to scale it
+ // See CAM_ModuleObject::icon()
+ if ( !p.isNull() )
+ p = Qtx::scaleIcon( p, 16 );
+ return p;
}
/*!
: CAM_DataObject( 0 ),
LightApp_DataObject( 0 ),
SalomeApp_DataObject( 0 ),
- LightApp_RootObject( study )
+ LightApp_RootObject( study ),
+ _toSynchronize(true)
{
}
\param study study
*/
SalomeApp_SavePointObject::SalomeApp_SavePointObject( SUIT_DataObject* parent,
- const int id,
- SalomeApp_Study* study )
+ const int id,
+ SalomeApp_Study* study )
: LightApp_DataObject( parent ),
CAM_DataObject( parent ),
myId( id ),
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SalomeApp_DataObject.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#ifndef SALOMEAPP_DATAOBJECT_H
#define SALOMEAPP_DATAOBJECT_H
public:
//! Column id
enum {
- ValueId = EntryId + 1, //!< value column
- IORId, //!< IOR column
- RefEntryId //!< reference entry column
+ ValueId = RefEntryId + 1, //!< value column
+ IORId, //!< IOR column
+ LastId //!< indicates last Id value
};
public:
virtual QPixmap icon( const int = NameId ) const;
virtual QColor color( const ColorRole, const int = NameId ) const;
virtual QString toolTip( const int = NameId ) const;
+ virtual QFont font( const int = NameId ) const;
virtual _PTR(SObject) object() const;
- bool isReference() const;
+ virtual QString refEntry() const;
+ virtual bool isReference() const;
_PTR(SObject) referencedObject() const;
+ bool hasChildren() const;
+ bool expandable() const;
+
+ virtual bool isVisible() const;
+
virtual QString componentDataType() const;
virtual bool customSorting( const int = NameId ) const;
virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
+ virtual void insertChildAtTag( SalomeApp_DataObject*, int );
+ virtual void updateItem();
+
private:
QString ior( const _PTR(SObject)& ) const;
QString entry( const _PTR(SObject)& ) const;
QPixmap icon( const int = NameId ) const;
QColor color( const ColorRole, const int = NameId ) const;
QString toolTip( const int = NameId ) const;
+ void setToSynchronize(bool value){_toSynchronize=value;};
+ bool toSynchronize() const {return _toSynchronize;};
+protected:
+ bool _toSynchronize;
};
class SALOMEAPP_EXPORT SalomeApp_SavePointObject : public virtual LightApp_DataObject
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
+// Copyright (C) 2007-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
+// 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
+//
+// 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
+// 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
//
+
// File: SalomeApp_DoubleSpinBox.cxx
// Author: Oleg UVAROV
+//
+#include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
+#include <PyConsole_Console.h>
#include "SalomeApp_DoubleSpinBox.h"
#include "SalomeApp_Application.h"
#include <QKeyEvent>
#include <QLineEdit>
+#include <QToolTip>
+#include <QRegExp>
+
+#include <string>
/*!
\class SalomeApp_DoubleSpinBox
myDefaultValue( 0.0 ),
myIsRangeSet( false ),
myMinimum( 0.0 ),
- myMaximum( 99.99 )
+ myMaximum( 99.99 ),
+ myAcceptNames( true ),
+ myShowTip( true )
{
connectSignalsAndSlots();
}
myDefaultValue( 0.0 ),
myIsRangeSet( false ),
myMinimum( min ),
- myMaximum( max )
+ myMaximum( max ),
+ myAcceptNames( true ),
+ myShowTip( true )
{
connectSignalsAndSlots();
}
\param max spin box maximum possible value
\param step spin box increment/decrement value
\param parent parent object
+ \param acceptNames if true, enables variable names in the spin box
+ \param showTip if true, makes the widget show a tooltip when invalid text is entered by the user
*/
-SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min, double max, double step, int prec, int dec, QWidget* parent )
+SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox( double min,
+ double max,
+ double step,
+ int prec,
+ int dec,
+ QWidget* parent,
+ bool acceptNames,
+ bool showTip )
: QtxDoubleSpinBox( min, max, step, prec, dec, parent ),
myDefaultValue( 0.0 ),
myIsRangeSet( false ),
myMinimum( min ),
- myMaximum( max )
+ myMaximum( max ),
+ myAcceptNames( acceptNames ),
+ myShowTip( showTip )
{
connectSignalsAndSlots();
}
{
}
+/*!
+ \brief Perform \a steps increment/decrement steps.
+
+ Re-implemented to handle cases when Notebook variable
+ name is specified by the user as the widget text.
+ Otherwise, simply calls the base implementation.
+
+ \param steps number of increment/decrement steps
+*/
+void SalomeApp_DoubleSpinBox::stepBy( int steps )
+{
+ QString str = text();
+ QString pref = prefix();
+ QString suff = suffix();
+
+ if ( pref.length() && str.startsWith( pref ) )
+ str = str.right( str.length() - pref.length() );
+ if ( suff.length() && str.endsWith( suff ) )
+ str = str.left( str.length() - suff.length() );
+
+ QRegExp varNameMask( "([a-z]|[A-Z]|_).*" );
+ if ( varNameMask.exactMatch( str ) )
+ return;
+
+ QtxDoubleSpinBox::stepBy( steps );
+}
+
/*!
\brief Connect signals and slots.
*/
void SalomeApp_DoubleSpinBox::connectSignalsAndSlots()
{
connect( this, SIGNAL( editingFinished() ),
- this, SLOT( onEditingFinished() ) );
+ this, SLOT( onEditingFinished() ) );
connect( this, SIGNAL( valueChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
connect( lineEdit(), SIGNAL( textChanged( const QString& )),
- this, SIGNAL( textChanged( const QString& ) ) );
+ this, SIGNAL( textChanged( const QString& ) ) );
}
/*!
*/
QValidator::State SalomeApp_DoubleSpinBox::validate( QString& str, int& pos ) const
{
- return QValidator::Acceptable;
+ QValidator::State res = QValidator::Invalid;
+
+ // Considering the input text as a variable name
+ // Applying Python identifier syntax:
+ // either a string starting with a letter, or a string starting with
+ // an underscore followed by at least one alphanumeric character
+ if ( isAcceptNames() ){
+ QRegExp varNameMask( "(([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|_)*)|(_([a-z]|[A-Z]|[0-9])+([a-z]|[A-Z]|[0-9]|_)*)" );
+ if ( varNameMask.exactMatch( str ) )
+ res = QValidator::Acceptable;
+
+ if ( res == QValidator::Invalid ){
+ varNameMask.setPattern( "_" );
+ if ( varNameMask.exactMatch( str ) )
+ res = QValidator::Intermediate;
+ }
+ }
+
+ // Trying to interpret the current input text as a numeric value
+ if ( res == QValidator::Invalid )
+ res = QtxDoubleSpinBox::validate( str, pos );
+
+ // Show tooltip in case of invalid manual input
+ if ( isShowTipOnValidate() && lineEdit()->hasFocus() ){
+ if ( res != QValidator::Acceptable ){ // san: do we need to warn the user in Intermediate state???
+ SalomeApp_DoubleSpinBox* that = const_cast<SalomeApp_DoubleSpinBox*>( this );
+ QPoint pos( size().width(), 0. );
+ QPoint globalPos = mapToGlobal( pos );
+ QString minVal = textFromValue( minimum() );
+ QString maxVal = textFromValue( maximum() );
+
+ // Same stuff as in QtxDoubleSpinBox::textFromValue()
+ int digits = getPrecision();
+
+ // For 'g' format, max. number of digits after the decimal point is getPrecision() - 1
+ // See also QtxDoubleSpinBox::validate()
+ if ( digits < 0 )
+ digits = qAbs( digits ) - 1;
+
+ QString templ( isAcceptNames() ? tr( "VALID_RANGE_VAR_MSG" ) : tr( "VALID_RANGE_NOVAR_MSG" ) );
+ QString msg( templ.arg( minVal ).arg( maxVal ).arg( digits ) );
+
+ // Add extra hints to the message (if any passed through dynamic properties)
+ QVariant propVal = property( "validity_tune_hint" );
+ if ( propVal.isValid() ){
+ QString extraInfo = propVal.toString();
+ if ( !extraInfo.isEmpty() ){
+ msg += "\n";
+ msg += extraInfo;
+ }
+ }
+
+ QToolTip::showText( globalPos,
+ msg,
+ that );
+ }
+ else
+ QToolTip::hideText();
+ }
+
+ return res;
}
/*!
if( toCorrect )
{
if( aState == Incompatible )
- msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
+ msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
else if( aState == NoVariable )
- msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
+ msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
else if( aState == Invalid )
- msg += tr( "ERR_INVALID_VALUE" ) + "\n";
+ msg += tr( "ERR_INVALID_VALUE" ) + "\n";
setText( myCorrectValue );
}
{
QtxDoubleSpinBox::setValue( value );
- myCorrectValue = QString::number( value );
+ myCorrectValue = QtxDoubleSpinBox::textFromValue( value );
myTextValue = myCorrectValue;
}
if( aSearchState == NotFound )
{
bool ok = false;
- value = text.toDouble( &ok );
- if( !ok )
+ value = locale().toDouble( text, &ok );
+ if ( !ok )
return NoVariable;
}
else if( aSearchState == IncorrectType )
std::string aName = name.toStdString();
if( studyDS->IsVariable( aName ) )
{
- if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) )
- {
- value = studyDS->GetReal( aName );
- return Found;
- }
- return IncorrectType;
+ if( studyDS->IsReal( aName ) || studyDS->IsInteger( aName ) || studyDS->IsString( aName ) )
+ {
+ if( studyDS->IsString( aName ) )
+ {
+ PyConsole_Console* pyConsole = app->pythonConsole();
+ PyConsole_Interp* pyInterp = pyConsole->getInterp();
+ PyLockWrapper aLock = pyInterp->GetLockWrapper();
+ std::string command;
+ command = "import salome_notebook ; ";
+ command += "salome_notebook.notebook.setAsReal(\"";
+ command += aName;
+ command += "\")";
+ bool aResult;
+ aResult = pyInterp->run(command.c_str());
+ if(aResult)
+ {
+ return IncorrectType;
+ }
+ }
+ value = studyDS->GetReal( aName );
+ return Found;
+ }
+ return IncorrectType;
}
}
}
{
setText( myTextValue );
}
+
+/*!
+ \brief Enables or disables variable names in the spin box.
+ By default, variable names are enabled.
+ \param flag If true, variable names are enabled.
+*/
+void SalomeApp_DoubleSpinBox::setAcceptNames( const bool flag )
+{
+ myAcceptNames = flag;
+}
+
+/*!
+ \brief Returns true if the spin box accepts variable names.
+*/
+bool SalomeApp_DoubleSpinBox::isAcceptNames() const
+{
+ return myAcceptNames;
+}
+
+/*!
+ \brief Enables or disables tooltips in case of invalid or intermediate-state input.
+ Tooltips are enabled by default.
+ \param flag If true, tooltips are enabled.
+*/
+void SalomeApp_DoubleSpinBox::setShowTipOnValidate( const bool flag )
+{
+ myShowTip = myShowTip;
+}
+
+/*!
+ \brief Returns true if tooltip should be shown in case of invalid or intermediate-state input.
+*/
+bool SalomeApp_DoubleSpinBox::isShowTipOnValidate() const
+{
+ return myShowTip;
+}
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
+// Copyright (C) 2007-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
+// 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
+//
+// 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
+// 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
//
+
// File: SalomeApp_DoubleSpinBox.h
// Author: Oleg UVAROV
-
+//
#ifndef SALOMEAPP_DOUBLESPINBOX_H
#define SALOMEAPP_DOUBLESPINBOX_H
public:
SalomeApp_DoubleSpinBox( QWidget* = 0 );
SalomeApp_DoubleSpinBox( double, double, double = 1, QWidget* = 0 );
- SalomeApp_DoubleSpinBox( double, double, double, int, int, QWidget* = 0 );
+ SalomeApp_DoubleSpinBox( double, double, double, int, int, QWidget* = 0, bool = true, bool = true );
virtual ~SalomeApp_DoubleSpinBox();
+ virtual void stepBy( int );
+
virtual double valueFromText( const QString& ) const;
virtual QString textFromValue( double ) const;
virtual void setText(const QString& );
+ void setAcceptNames( const bool );
+ bool isAcceptNames() const;
+
+ void setShowTipOnValidate( const bool );
+ bool isShowTipOnValidate() const;
+
signals:
void textChanged( const QString& );
QString myCorrectValue;
QString myTextValue;
+
+ bool myAcceptNames;
+ bool myShowTip;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_ExceptionHandler.h"
+
#include "CASCatch.hxx"
+#include "Basics_OCCTVersion.hxx"
#include <OSD.hxx>
#include <QString>
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#else
/*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
{
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
try {
OCC_CATCH_SIGNALS;
#else
#endif
SUIT_ExceptionHandler::internalHandle( o, e );
}
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
catch(Standard_Failure) {
#else
CASCatch_CATCH(Standard_Failure) {
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_EXCEPTIONHANDLER_H
#define SALOMEAPP_EXCEPTIONHANDLER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_ExitDlg.cxx
// Author: Margarita KARPUNINA, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_ExitDlg.h
// Author: Margarita KARPUNINA, Open CASCADE S.A.S.
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_Filter.h"
/*!Constructor.Initialize by study.*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_FILTER_H
#define SALOMEAPP_FILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SALOMEGUI_ImportOperation.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#include "SalomeApp_ImportOperation.h"
#include <SUIT_Application.h>
-#ifndef WIN32
-using namespace std;
-#endif
-
/*!Constructor. Do nothing.*/
SalomeApp_ImportOperation::SalomeApp_ImportOperation( SUIT_Application* app ) :
SUIT_Operation( app )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEAPP : implementation of desktop and GUI kernel
// File : SalomeApp_ImportOperation.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#if !defined SALOMEAPP_IMPORTOPERATION
#define SALOMEAPP_IMPORTOPERATION
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
+// Copyright (C) 2007-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
+// 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
+//
+// 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
+// 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
//
+
// File: SalomeApp_IntSpinBox.cxx
// Author: Oleg UVAROV
+//
+#include <PyConsole_Interp.h> //this include must be first (see PyInterp_base.h)!
+#include <PyConsole_Console.h>
#include "SalomeApp_IntSpinBox.h"
#include "SalomeApp_Application.h"
#include <QKeyEvent>
#include <QLineEdit>
+#include <QToolTip>
+#include <QRegExp>
+
+#include <string>
/*!
\class SalomeApp_IntSpinBox
*/
SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( QWidget* parent )
: QtxIntSpinBox( parent ),
- myDefaultValue( 0 )
+ myDefaultValue( 0 ),
+ myAcceptNames( true ),
+ myShowTip( true )
{
connectSignalsAndSlots();
}
\param max spin box maximum possible value
\param step spin box increment/decrement value
\param parent parent object
+ \param acceptNames if true, enables variable names in the spin box
+ \param showTip if true, makes the widget show a tooltip when invalid text is entered by the user
*/
-SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( int min, int max, int step, QWidget* parent )
+SalomeApp_IntSpinBox::SalomeApp_IntSpinBox( int min,
+ int max,
+ int step,
+ QWidget* parent,
+ bool acceptNames,
+ bool showTip )
: QtxIntSpinBox( min, max, step, parent ),
- myDefaultValue( 0 )
+ myDefaultValue( 0 ),
+ myAcceptNames( acceptNames ),
+ myShowTip( showTip )
{
connectSignalsAndSlots();
}
{
}
+
+/*!
+ \brief Perform \a steps increment/decrement steps.
+
+ Re-implemented to handle cases when Notebook variable
+ name is specified by the user as the widget text.
+ Otherwise, simply calls the base implementation.
+
+ \param steps number of increment/decrement steps
+*/
+void SalomeApp_IntSpinBox::stepBy( int steps )
+{
+ QString str = text();
+ QString pref = prefix();
+ QString suff = suffix();
+
+ if ( pref.length() && str.startsWith( pref ) )
+ str = str.right( str.length() - pref.length() );
+ if ( suff.length() && str.endsWith( suff ) )
+ str = str.left( str.length() - suff.length() );
+
+ QRegExp varNameMask( "([a-z]|[A-Z]|_).*" );
+ if ( varNameMask.exactMatch( str ) )
+ return;
+
+ QtxIntSpinBox::stepBy( steps );
+}
+
/*!
\brief Connect signals and slots.
*/
void SalomeApp_IntSpinBox::connectSignalsAndSlots()
{
connect( this, SIGNAL( editingFinished() ),
- this, SLOT( onEditingFinished() ) );
+ this, SLOT( onEditingFinished() ) );
connect( this, SIGNAL( valueChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
connect( lineEdit(), SIGNAL( textChanged( const QString& ) ),
- this, SLOT( onTextChanged( const QString& ) ) );
+ this, SLOT( onTextChanged( const QString& ) ) );
connect( lineEdit(), SIGNAL( textChanged( const QString& )),
- this, SIGNAL( textChanged( const QString& ) ) );
+ this, SIGNAL( textChanged( const QString& ) ) );
}
/*!
*/
QValidator::State SalomeApp_IntSpinBox::validate( QString& str, int& pos ) const
{
- return QValidator::Acceptable;
+ //return QValidator::Acceptable;
+ QValidator::State res = QValidator::Invalid;
+
+ // Considering the input text as a variable name
+ // Applying Python identifier syntax:
+ // either a string starting with a letter, or a string starting with
+ // an underscore followed by at least one alphanumeric character
+ if ( isAcceptNames() ){
+ QRegExp varNameMask( "(([a-z]|[A-Z])([a-z]|[A-Z]|[0-9]|_)*)|(_([a-z]|[A-Z]|[0-9])+([a-z]|[A-Z]|[0-9]|_)*)" );
+ if ( varNameMask.exactMatch( str ) )
+ res = QValidator::Acceptable;
+
+ if ( res == QValidator::Invalid ){
+ varNameMask.setPattern( "_" );
+ if ( varNameMask.exactMatch( str ) )
+ res = QValidator::Intermediate;
+ }
+ }
+
+ // Trying to interpret the current input text as a numeric value
+ if ( res == QValidator::Invalid )
+ res = QtxIntSpinBox::validate( str, pos );
+
+ // Show tooltip in case of invalid manual input
+ if ( isShowTipOnValidate() && lineEdit()->hasFocus() ){
+ if ( res != QValidator::Acceptable ){ // san: do we need to warn the user in Intermediate state???
+ SalomeApp_IntSpinBox* that = const_cast<SalomeApp_IntSpinBox*>( this );
+ QPoint pos( size().width(), 0. );
+ QPoint globalPos = mapToGlobal( pos );
+ QString minVal = textFromValue( minimum() );
+ QString maxVal = textFromValue( maximum() );
+
+ QString templ( isAcceptNames() ? tr( "VALID_RANGE_VAR_MSG" ) : tr( "VALID_RANGE_NOVAR_MSG" ) );
+ QString msg( templ.arg( minVal ).arg( maxVal ) );
+
+ // Add extra hints to the message (if any passed through dynamic properties)
+ QVariant propVal = property( "validity_tune_hint" );
+ if ( propVal.isValid() ){
+ QString extraInfo = propVal.toString();
+ if ( !extraInfo.isEmpty() ){
+ msg += "\n";
+ msg += extraInfo;
+ }
+ }
+
+ QToolTip::showText( globalPos,
+ msg,
+ that );
+ }
+ else
+ QToolTip::hideText();
+ }
+
+ return res;
}
/*!
if( toCorrect )
{
if( aState == Incompatible )
- msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
+ msg += tr( "ERR_INCOMPATIBLE_TYPE" ).arg( text() ) + "\n";
else if( aState == NoVariable )
- msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
+ msg += tr( "ERR_NO_VARIABLE" ).arg( text() ) + "\n";
else if( aState == Invalid )
- msg += tr( "ERR_INVALID_VALUE" ) + "\n";
+ msg += tr( "ERR_INVALID_VALUE" ) + "\n";
setText( myCorrectValue );
}
{
text.toDouble( &ok );
if( ok )
- return Invalid;
+ return Invalid;
return NoVariable;
}
}
std::string aName = name.toStdString();
if( studyDS->IsVariable( aName ) )
{
- if( studyDS->IsInteger( aName ) )
- {
- value = studyDS->GetInteger( aName );
- return Found;
- }
- return IncorrectType;
+ if( studyDS->IsInteger( aName ) || studyDS->IsString( aName ) )
+ {
+ if( studyDS->IsString( aName ) )
+ {
+ PyConsole_Console* pyConsole = app->pythonConsole();
+ PyConsole_Interp* pyInterp = pyConsole->getInterp();
+ PyLockWrapper aLock = pyInterp->GetLockWrapper();
+ std::string command;
+ command = "import salome_notebook ; ";
+ command += "salome_notebook.notebook.setAsInteger(\"";
+ command += aName;
+ command += "\")";
+ bool aResult;
+ aResult = pyInterp->run(command.c_str());
+ if(aResult)
+ {
+ return IncorrectType;
+ }
+ }
+ value = studyDS->GetInteger( aName );
+ return Found;
+ }
+ return IncorrectType;
}
}
}
{
setText( myTextValue );
}
+
+/*!
+ \brief Enables or disables variable names in the spin box.
+ By default, variable names are enabled.
+ \param flag If true, variable names are enabled.
+*/
+void SalomeApp_IntSpinBox::setAcceptNames( const bool flag )
+{
+ myAcceptNames = flag;
+}
+
+/*!
+ \brief Returns true if the spin box accepts variable names.
+*/
+bool SalomeApp_IntSpinBox::isAcceptNames() const
+{
+ return myAcceptNames;
+}
+
+/*!
+ \brief Enables or disables tooltips in case of invalid or intermediate-state input.
+ Tooltips are enabled by default.
+ \param flag If true, tooltips are enabled.
+*/
+void SalomeApp_IntSpinBox::setShowTipOnValidate( const bool flag )
+{
+ myShowTip = myShowTip;
+}
+
+/*!
+ \brief Returns true if tooltip should be shown in case of invalid or intermediate-state input.
+*/
+bool SalomeApp_IntSpinBox::isShowTipOnValidate() const
+{
+ return myShowTip;
+}
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
+// Copyright (C) 2007-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
+// 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
+//
+// 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
+// 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
//
+
// File: SalomeApp_IntSpinBox.h
// Author: Oleg UVAROV
-
+//
#ifndef SALOMEAPP_INTSPINBOX_H
#define SALOMEAPP_INTSPINBOX_H
public:
SalomeApp_IntSpinBox( QWidget* = 0 );
- SalomeApp_IntSpinBox( int, int, int = 1, QWidget* = 0 );
+ SalomeApp_IntSpinBox( int, int, int = 1, QWidget* = 0, bool = true, bool = true );
virtual ~SalomeApp_IntSpinBox();
+ virtual void stepBy( int );
+
virtual int valueFromText( const QString& ) const;
virtual QString textFromValue( int ) const;
virtual void setText(const QString& );
+ void setAcceptNames( const bool );
+ bool isAcceptNames() const;
+
+ void setShowTipOnValidate( const bool );
+ bool isShowTipOnValidate() const;
+
signals:
void textChanged( const QString& );
QString myCorrectValue;
QString myTextValue;
+
+ bool myAcceptNames;
+ bool myShowTip;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SalomeApp_ListView.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
viewport()->installEventFilter(this);
connect(this, SIGNAL(itemSelectionChanged()),
- this, SLOT(onSelectionChanged()));
+ this, SLOT(onSelectionChanged()));
connect(header(), SIGNAL(sizeChange(int, int, int)),
- this, SLOT(onHeaderSizeChange(int, int, int)));
+ this, SLOT(onHeaderSizeChange(int, int, int)));
}
/*!
if (ok) {
aNeedsUpdate = myEditedItem->finishEditing(myEdit);
if (aNeedsUpdate == utCancel) {
- // something to do here on Cancel...
+ // something to do here on Cancel...
}
else {
- // something to do here on OK...
+ // something to do here on OK...
}
// updating contents
switch (aNeedsUpdate) {
\retval valid rect in success
*/
QRect SalomeApp_ListView::tip(QPoint aPos,
- QString& aText,
- QRect& dspRect,
- QFont& dspFnt) const
+ QString& aText,
+ QRect& dspRect,
+ QFont& dspFnt) const
{
QRect result( -1, -1, -1, -1 );
SalomeApp_ListViewItem* aItem = (SalomeApp_ListViewItem*)itemAt( aPos );
QRect aItemRect = aItem->itemRect(i);
QRect aTextRect = aItem->textRect(i);
if ( !aItem->text(i).isEmpty() &&
- ( aItemRect.width() > header()->sectionSize(i) ||
- aTextRect.left() < 0 ||
+ ( aItemRect.width() > header()->sectionSize(i) ||
+ aTextRect.left() < 0 ||
aTextRect.top() < 0 ||
aTextRect.right() > viewport()->width() ||
aTextRect.bottom() > viewport()->height() ) ) {
// calculating tip data
aText = aItem->tipText();
- dspRect = aItem->tipRect();
- dspFnt = font();
+ dspRect = aItem->tipRect();
+ dspFnt = font();
if (dspRect.isValid()) {
result = QRect(QPoint(0, aItemRect.top()),
QSize(viewport()->width(), aItemRect.height()));
Constructor
*/
SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent,
- SalomeApp_ListViewItem* after) :
+ SalomeApp_ListViewItem* after) :
QTreeWidgetItem( parent, after )
{
init();
Constructor
*/
SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent,
- const QStringList& theStrings,
- const bool theEditable) :
+ const QStringList& theStrings,
+ const bool theEditable) :
QTreeWidgetItem(parent, theStrings)
{
init();
Constructor
*/
SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
- const QStringList& theString,
- const bool theEditable) :
+ const QStringList& theString,
+ const bool theEditable) :
QTreeWidgetItem(parent, theString)
{
init();
Constructor
*/
SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
- SalomeApp_ListViewItem* after,
- const QString& theName,
- const bool theEditable) :
+ SalomeApp_ListViewItem* after,
+ const QString& theName,
+ const bool theEditable) :
QTreeWidgetItem(parent, after)
{
setData(0,Qt::DisplayRole,QVariant(theName));
Constructor
*/
SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent,
- SalomeApp_ListViewItem* after,
- const QString& theName,
- const bool theEditable) :
+ SalomeApp_ListViewItem* after,
+ const QString& theName,
+ const bool theEditable) :
QTreeWidgetItem(parent, after)
{
setData(0,Qt::DisplayRole,QVariant(theName));
Constructor
*/
SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListViewItem* parent,
- SalomeApp_ListViewItem* after,
- const QString& theName,
- const QString& theValue,
- const bool theEditable) :
+ SalomeApp_ListViewItem* after,
+ const QString& theName,
+ const QString& theValue,
+ const bool theEditable) :
QTreeWidgetItem(parent, after)
{
setData(0,Qt::DisplayRole,QVariant(theName));
Constructor
*/
SalomeApp_ListViewItem::SalomeApp_ListViewItem(SalomeApp_ListView* parent,
- SalomeApp_ListViewItem* after,
- const QString& theName,
- const QString& theValue,
- const bool theEditable) :
+ SalomeApp_ListViewItem* after,
+ const QString& theName,
+ const QString& theValue,
+ const bool theEditable) :
QTreeWidgetItem(parent, after)
{
setData(0,Qt::DisplayRole,QVariant(theName));
return 0;
aWidget = new SalomeApp_EntityEdit(aListView->viewport(),
anEditType,
- aValueType,
- aButtons & SalomeApp_EntityEdit::btApply,
- aButtons & SalomeApp_EntityEdit::btCancel);
+ aValueType,
+ aButtons & SalomeApp_EntityEdit::btApply,
+ aButtons & SalomeApp_EntityEdit::btCancel);
computeEditGeometry(this, aWidget);
fillWidgetWithValues(aWidget);
Adds item in combo box
*/
void SalomeApp_ComboBox::insertItem(const QString& theValue,
- int theIndex)
+ int theIndex)
{
if (duplicatesEnabled() || findItem(theValue) < 0)
QComboBox::insertItem(theIndex, theValue);
Constructor
*/
SalomeApp_EntityEdit::SalomeApp_EntityEdit(QWidget* parent,
- int controlType,
- int valueType,
- bool butApply,
- bool butCancel) :
+ int controlType,
+ int valueType,
+ bool butApply,
+ bool butCancel) :
QWidget(parent),
myEdit(0),
myCombo(0),
Adds item in combo box, sets it current if theSetCurrent is true
*/
void SalomeApp_EntityEdit::insertItem(const QString& theValue,
- bool theSetCurrent,
- int theOrder)
+ bool theSetCurrent,
+ int theOrder)
{
if (myCombo) {
int aIndexAt = -1;
Adds items in combo box, sets item theCurrent as current
*/
void SalomeApp_EntityEdit::insertList(const QStringList& theList,
- const int theCurrent)
+ const int theCurrent)
{
if (myCombo)
myCombo->insertList(theList);
Adds item in combo box, sets it current if theSetCurrent is true
*/
void SalomeApp_EntityEdit::insertItem(const int theValue,
- bool theSetCurrent)
+ bool theSetCurrent)
{
if (myCombo) {
myCombo->insertItem(theValue);
Adds items in combo box, sets item theCurrent as current
*/
void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList,
- const int theCurrent)
+ const int theCurrent)
{
if (myCombo)
myCombo->insertList(theList);
Adds item in combo box, sets it current if theSetCurrent is true
*/
void SalomeApp_EntityEdit::insertItem(const double theValue,
- bool theSetCurrent)
+ bool theSetCurrent)
{
if (myCombo) {
myCombo->insertItem(theValue);
Adds items in combo box, sets item theCurrent as current
*/
void SalomeApp_EntityEdit::insertList(const TColStd_ListOfReal& theList,
- const int theCurrent)
+ const int theCurrent)
{
if (myCombo)
myCombo->insertList(theList);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SalomeApp_ListView.h
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
public:
SalomeApp_EntityEdit( QWidget* parent,
- int controlType = etLineEdit,
- int valueType = vtString,
- bool butApply = false,
- bool butCancel = false);
+ int controlType = etLineEdit,
+ int valueType = vtString,
+ bool butApply = false,
+ bool butCancel = false);
~SalomeApp_EntityEdit();
void finishEditing();
QString getText();
void setText(const QString& theText );
void insertItem( const QString& theValue,
- bool theSetCurrent = false,
- int theOrder = atBottom );
+ bool theSetCurrent = false,
+ int theOrder = atBottom );
void insertList( const QStringList& theList,
- const int theCurrent = -1 );
+ const int theCurrent = -1 );
void insertItem( const int theValue,
- bool theSetCurrent = false );
+ bool theSetCurrent = false );
void insertList( const TColStd_ListOfInteger& theList,
- const int theCurrent = -1 );
+ const int theCurrent = -1 );
void insertItem( const double theValue,
- bool theSetCurrent = false );
+ bool theSetCurrent = false );
void insertList( const TColStd_ListOfReal& theList,
- const int theCurrent = -1 );
+ const int theCurrent = -1 );
QWidget* getControl();
void setFocus();
void setValidator(const QValidator*);
public:
SalomeApp_ListViewItem( SalomeApp_ListView* );
SalomeApp_ListViewItem( SalomeApp_ListView*,
- SalomeApp_ListViewItem* );
+ SalomeApp_ListViewItem* );
SalomeApp_ListViewItem( SalomeApp_ListView*,
- const QStringList&,
- const bool = false );
+ const QStringList&,
+ const bool = false );
SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
- const QStringList&,
- const bool = false );
+ const QStringList&,
+ const bool = false );
SalomeApp_ListViewItem( SalomeApp_ListView*,
- SalomeApp_ListViewItem*,
- const QString&,
- const bool = false );
+ SalomeApp_ListViewItem*,
+ const QString&,
+ const bool = false );
SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
- SalomeApp_ListViewItem*,
- const QString&,
- const bool = false);
+ SalomeApp_ListViewItem*,
+ const QString&,
+ const bool = false);
SalomeApp_ListViewItem( SalomeApp_ListView*,
- SalomeApp_ListViewItem*,
- const QString& theName,
- const QString& theValue,
- const bool = false);
+ SalomeApp_ListViewItem*,
+ const QString& theName,
+ const QString& theValue,
+ const bool = false);
SalomeApp_ListViewItem( SalomeApp_ListViewItem*,
- SalomeApp_ListViewItem*,
- const QString&,
- const QString&,
- const bool = false);
+ SalomeApp_ListViewItem*,
+ const QString&,
+ const QString&,
+ const bool = false);
~SalomeApp_ListViewItem();
QString fullName();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_LoadStudiesDlg.h"
#include <QLabel>
myList = new QListWidget( this );
myList->setMinimumSize( MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT );
myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,
- QSizePolicy::Expanding ) );
+ QSizePolicy::Expanding ) );
myList->setSelectionMode( QAbstractItemView::SingleSelection );
topLayout->addWidget( lab );
connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( myList, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ),
- this, SLOT( accept() ) );
+ this, SLOT( accept() ) );
connect( myList, SIGNAL( itemSelectionChanged() ),
- this, SLOT( updateState() ) );
+ this, SLOT( updateState() ) );
myList->addItems( studies );
updateState();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_LOADSTUDIESDLG_H
#define SALOMEAPP_LOADSTUDIESDLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_Module.cxx
// Created: 10/25/2004 11:39:56 AM
// Author: Sergey LITONIN
-//
+
#include "SalomeApp_Module.h"
#include "SalomeApp_DataModel.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_DataObject.h"
#include "LightApp_Selection.h"
#include <SALOME_ListIO.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <SALOME_InteractiveObject.hxx>
+
+#include <LightApp_DataObject.h>
#include <SUIT_Session.h>
+#include <SUIT_DataBrowser.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
#include <QString>
/*!Constructor.*/
SalomeApp_Module::SalomeApp_Module( const QString& name )
-: LightApp_Module( name )
+ : LightApp_Module( name ),
+ myIsFirstActivate( true )
{
}
_PTR(SObject) SO = study->studyDS()->FindObjectID( obj->getEntry() );
if( SO && QString( SO->GetID().c_str() ) == SO->GetFatherComponent()->GetID().c_str() )
{ //component is selected
- _PTR(SComponent) SC( SO->GetFatherComponent() );
- _PTR(ChildIterator) anIter ( study->studyDS()->NewChildIterator( SC ) );
- anIter->InitEx( true );
- while( anIter->More() )
- {
- _PTR(SObject) valSO ( anIter->Value() );
- _PTR(SObject) refSO;
- if( !valSO->ReferencedObject( refSO ) )
- {
- QString id = valSO->GetID().c_str(),
- comp = SC->ComponentDataType().c_str(),
- val = valSO->GetName().c_str();
-
- Handle( SALOME_InteractiveObject ) new_obj =
- new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() );
- dest.Append( new_obj );
- }
- anIter->Next();
- }
- continue;
+ _PTR(SComponent) SC( SO->GetFatherComponent() );
+ _PTR(ChildIterator) anIter ( study->studyDS()->NewChildIterator( SC ) );
+ anIter->InitEx( true );
+ while( anIter->More() )
+ {
+ _PTR(SObject) valSO ( anIter->Value() );
+ _PTR(SObject) refSO;
+ if( !valSO->ReferencedObject( refSO ) )
+ {
+ QString id = valSO->GetID().c_str(),
+ comp = SC->ComponentDataType().c_str(),
+ val = valSO->GetName().c_str();
+
+ Handle( SALOME_InteractiveObject ) new_obj =
+ new SALOME_InteractiveObject( id.toLatin1(), comp.toLatin1(), val.toLatin1() );
+ dest.Append( new_obj );
+ }
+ anIter->Next();
+ }
+ continue;
}
}
dest.Append( obj );
* \brief Virtual public
*
* This method is called just before the study document is saved, so the module has a possibility
- * to store visual parameters in AttributeParameter attribue(s)
+ * to store visual parameters in AttributeParameter attribut
*/
void SalomeApp_Module::storeVisualParameters(int savePoint)
{
}
+
+/*!Activate module.*/
+bool SalomeApp_Module::activateModule( SUIT_Study* theStudy )
+{
+ bool state = LightApp_Module::activateModule( theStudy );
+
+ if (!myIsFirstActivate)
+ return state;
+
+ updateModuleVisibilityState();
+
+ myIsFirstActivate = false;
+
+ return state;
+}
+
/*!
* \brief Virtual public
*
{
}
+/*! Redefined to reset internal flags valid for study instance */
+void SalomeApp_Module::studyClosed( SUIT_Study* theStudy )
+{
+ LightApp_Module::studyClosed( theStudy );
+
+ myIsFirstActivate = true;
+
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>(application());
+ if (!app)
+ return;
+
+ SUIT_DataBrowser* ob = app->objectBrowser();
+ if (ob && ob->model())
+ disconnect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
+ this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ) );
+}
+
+
+/*!
+ * \brief Virtual public slot
+ *
+ * This method is called after the object inserted into data view to update their visibility state
+ * This is default implementation
+ */
+void SalomeApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn )
+{
+ if (!isActiveModule())
+ return;
+ // change visibility of object
+ if (!theObject || theColumn != SUIT_DataObject::VisibilityId )
+ return;
+
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if( !study )
+ return;
+
+ LightApp_DataObject* lo = dynamic_cast<LightApp_DataObject*>(theObject);
+ if(!lo)
+ return;
+
+ // detect action index (from LightApp level)
+ int id = -1;
+
+ if ( study->visibilityState(lo->entry()) == Qtx::ShownState )
+ id = myErase;
+ else if ( study->visibilityState(lo->entry()) == Qtx::HiddenState )
+ id = myDisplay;
+
+ if ( id != -1 )
+ startOperation( id );
+}
+
+
+/*!
+ Called then study closed
+*/
+void SalomeApp_Application::onStudyClosed( SUIT_Study* theStudy){
+ LightApp_Application::onStudyClosed(theStudy);
+
+ disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+ this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
+}
+
+
+void SalomeApp_Module::updateModuleVisibilityState() {
+
+ // update visibility state of objects
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
+ if (!app)
+ return;
+
+ SUIT_DataBrowser* ob = app->objectBrowser();
+ if (!ob || !ob->model())
+ return;
+
+ // connect to click on item
+ connect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
+ this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ), Qt::UniqueConnection );
+
+ SUIT_DataObject* rootObj = ob->root();
+ if( !rootObj )
+ return;
+
+ DataObjectList listObj = rootObj->children( true );
+
+ SUIT_ViewModel* vmod = 0;
+ if ( SUIT_ViewManager* vman = app->activeViewManager() )
+ vmod = vman->getViewModel();
+ app->updateVisibilityState( listObj, vmod );
+}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_Module.h
// Created: 10/25/2004 11:33:06 AM
// Author: Sergey LITONIN
-//
+
#ifndef SALOMEAPP_MODULE_H
#define SALOMEAPP_MODULE_H
class LightApp_Selection;
class SALOME_ListIO;
class QString;
+class SUIT_DataObject;
/*!
* \brief Base class for all salome modules
-*/
-class SALOMEAPP_EXPORT SalomeApp_Module : public LightApp_Module
+ */
+class SALOMEAPP_EXPORT SalomeApp_Module : virtual public LightApp_Module
{
Q_OBJECT
virtual void storeVisualParameters(int savePoint);
virtual void restoreVisualParameters(int savePoint);
virtual LightApp_Selection* createSelection() const;
+
+ public slots:
+ virtual bool activateModule( SUIT_Study* );
+ virtual void studyClosed( SUIT_Study* );
+ virtual void onObjectClicked( SUIT_DataObject*, int );
+
+ virtual void updateModuleVisibilityState();
protected:
virtual CAM_DataModel* createDataModel();
virtual void extractContainers( const SALOME_ListIO&, SALOME_ListIO& ) const;
+
+
+ protected:
+ bool myIsFirstActivate;
};
#endif
-// Copyright (C) 2008 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// Copyright (C) 2007-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
+// 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.
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_NoteBookDlg.cxx
// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
// Module : GUI
+//
+#include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
+#include <PyConsole_Console.h>
#include "SalomeApp_NoteBookDlg.h"
#include "SalomeApp_Application.h"
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
-#include <PyConsole_Console.h>
-
#include <SALOMEDS_Tool.hxx>
#include <QWidget>
#include <string>
#include <vector>
-using namespace std;
-
#define DEFAULT_MARGIN 11
#define DEFAULT_SPACING 6
#define SPACER_SIZE 120
* Purpose : Constructor
*/
//============================================================================
-NoteBook_TableRow::NoteBook_TableRow(int index, QWidget* parent):
+NoteBook_TableRow::NoteBook_TableRow(int index, NoteBook_Table* parentTable, QWidget* parent):
QWidget(parent),
+ myParentTable(parentTable),
myIndex(index),
myRowHeader(new QTableWidgetItem()),
myVariableName(new QTableWidgetItem()),
{
bool aResult = false;
QString aValue = GetValue();
- if( (!aValue.isEmpty()) &&
- (IsRealValue(aValue)) ||
- IsIntegerValue(aValue)||
- IsBooleanValue(aValue))
+ if(!aValue.isEmpty() &&
+ (IsRealValue(aValue) ||
+ IsIntegerValue(aValue) ||
+ IsBooleanValue(aValue) ||
+ IsValidStringValue(aValue)))
aResult = true;
return aResult;
{
bool aResult = false;
double aDResult = theValue.toDouble(&aResult);
- if(theResult)
+ if(aResult && theResult)
*theResult = aDResult;
return aResult;
aBResult = false;
aResult = true;
}
- if(theResult)
+ if(aResult && theResult)
*theResult = aBResult;
return aResult;
int anIResult;
anIResult = theValue.toInt(&aResult);
- if(theResult)
+ if(aResult && theResult)
*theResult = anIResult;
return aResult;
}
+//============================================================================
+/*! Function : IsValidStringValue
+ * Purpose : Return true if theValue string is valid, otherwise return
+ * false
+ * The string are always valid for the moment
+ * The whole notebook is verified on apply
+ */
+//============================================================================
+bool NoteBook_TableRow::IsValidStringValue(const QString theValue)
+{
+ int aNumRows = myParentTable->myRows.count();
+ if( aNumRows == 0 )
+ return true;
+
+ bool aLastRowIsEmpty = myParentTable->myRows[ aNumRows - 1 ]->GetName().isEmpty() &&
+ myParentTable->myRows[ aNumRows - 1 ]->GetValue().isEmpty();
+
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ PyConsole_Console* pyConsole = app->pythonConsole();
+ PyConsole_Interp* pyInterp = pyConsole->getInterp();
+ PyLockWrapper aLock = pyInterp->GetLockWrapper();
+ std::string command = "import salome_notebook ; ";
+ command += "salome_notebook.checkThisNoteBook(";
+ for( int i = 0, n = aLastRowIsEmpty ? aNumRows - 1 : aNumRows; i < n; i++ ) {
+ command += myParentTable->myRows[i]->GetName().toStdString();
+ command += "=\"";
+ command += myParentTable->myRows[i]->GetValue().toStdString();
+ command += "\", ";
+ }
+ command += ") ";
+
+ //rnv: fix for bug 21947 WinTC5.1.4: Wrong error management of "Salome NoteBook"
+ bool oldSuppressValue = pyConsole->isSuppressOutput();
+ pyConsole->setIsSuppressOutput(true);
+ bool aResult = pyInterp->run(command.c_str());
+ pyConsole->setIsSuppressOutput(oldSuppressValue);
+ return !aResult;
+}
///////////////////////////////////////////////////////////////////////////
// NoteBook_Table class //
NoteBook_TableRow* aRow = myRows[ i ];
if( aRow )
{
- delete aRow;
- aRow = 0;
+ delete aRow;
+ aRow = 0;
}
}
myRows.clear();
myVariableMap.clear();
//Add all variables into the table
- vector<string> aVariables = theStudy->GetVariableNames();
+ std::vector<std::string> aVariables = theStudy->GetVariableNames();
for(int iVar = 0; iVar < aVariables.size(); iVar++ ) {
AddRow(QString(aVariables[iVar].c_str()),
- Variable2String(aVariables[iVar],theStudy));
+ Variable2String(aVariables[iVar],theStudy));
}
//Add empty row
* Purpose : Convert variable values to QString
*/
//============================================================================
-QString NoteBook_Table::Variable2String(const string& theVarName,
+QString NoteBook_Table::Variable2String(const std::string& theVarName,
_PTR(Study) theStudy)
{
QString aResult;
aResult = QString::number(theStudy->GetInteger(theVarName));
else if( theStudy->IsBoolean(theVarName) )
aResult = theStudy->GetBoolean(theVarName) ? QString("True") : QString("False");
+ else if( theStudy->IsString(theVarName) )
+ aResult = theStudy->GetString(theVarName).c_str();
return aResult;
}
if( !myRows[i]->CheckName() || !IsUniqueName( myRows[i] ) || !myRows[i]->CheckValue() )
return false;
- return true;
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ PyConsole_Console* pyConsole = app->pythonConsole();
+ PyConsole_Interp* pyInterp = pyConsole->getInterp();
+ PyLockWrapper aLock = pyInterp->GetLockWrapper();
+ std::string command = "import salome_notebook ; ";
+ command += "salome_notebook.checkThisNoteBook(";
+ for( int i = 0, n = aLastRowIsEmpty ? aNumRows - 1 : aNumRows; i < n; i++ )
+ {
+ command += myRows[i]->GetName().toStdString();
+ command += "=\"";
+ command += myRows[i]->GetValue().toStdString();
+ command += "\",";
+ }
+ command += ")";
+
+ //rnv: fix for bug 21947 WinTC5.1.4: Wrong error management of "Salome NoteBook"
+ bool oldSuppressValue = pyConsole->isSuppressOutput();
+ pyConsole->setIsSuppressOutput(true);
+ bool aResult = pyInterp->run(command.c_str());
+ pyConsole->setIsSuppressOutput(oldSuppressValue);
+
+ return !aResult;
}
//============================================================================
* Purpose : renumber row items
*/
//============================================================================
-void NoteBook_Table::RenamberRowItems(){
+void NoteBook_Table::RenamberRowItems() {
for(int i=0; i<myRows.size();i++){
myRows[i]->GetHeaderItem()->setText(QString::number(i+1));
}
void NoteBook_Table::AddRow(const QString& theName, const QString& theValue)
{
int anIndex = getUniqueIndex();
- NoteBook_TableRow* aRow = new NoteBook_TableRow(anIndex, this);
+ NoteBook_TableRow* aRow = new NoteBook_TableRow(anIndex, this, this);
aRow->SetName(theName);
aRow->SetValue(theValue);
aRow->AddToTable(this);
QString aMsg;
if(aCurrentColumn == NAME_COLUMN) {
- int anIndex = aRow->GetIndex();
- if( myVariableMap.contains( anIndex ) )
- {
- const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
- if( !aVariable.Name.isEmpty() && myStudy->IsVariableUsed( string( aVariable.Name.toLatin1().constData() ) ) )
- {
- if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
- tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ),
- QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
- {
- bool isBlocked = blockSignals( true );
- aRow->SetName( aVariable.Name );
- blockSignals( isBlocked );
- return;
- }
- }
- }
+ int anIndex = aRow->GetIndex();
+ if( myVariableMap.contains( anIndex ) )
+ {
+ const NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
+ if( !aVariable.Name.isEmpty() && myStudy->IsVariableUsed( std::string( aVariable.Name.toLatin1().constData() ) ) )
+ {
+ if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
+ tr( "RENAME_VARIABLE_IS_USED" ).arg( aVariable.Name ),
+ QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
+ {
+ bool isBlocked = blockSignals( true );
+ aRow->SetName( aVariable.Name );
+ blockSignals( isBlocked );
+ return;
+ }
+ }
+ }
}
//Case then varible name changed.
if(aCurrentColumn == NAME_COLUMN) {
if(!aRow->CheckName()) {
- IsCorrect = false;
- aMsg = tr( "VARNAME_INCORRECT" ).arg(aRow->GetName());
- }
+ IsCorrect = false;
+ aMsg = tr( "VARNAME_INCORRECT" ).arg(aRow->GetName());
+ }
else if(!IsUniqueName(aRow)) {
- IsCorrect = false;
+ IsCorrect = false;
aMsg = tr( "VARNAME_EXISTS" ).arg(aRow->GetName());
- }
- else
- IsVariableComplited = aRow->CheckValue();
+ }
+ else
+ IsVariableComplited = aRow->CheckValue();
}
//Case then varible value changed.
else if(aCurrentColumn == VALUE_COLUMN){
if(!aRow->CheckValue()) {
- IsCorrect = false;
- aMsg = tr( "VARVALUE_INCORRECT" ).arg(aRow->GetName());
- }
- else
- IsVariableComplited = aRow->CheckName() && IsUniqueName(aRow);
+ IsCorrect = false;
+ aMsg = tr( "VARVALUE_INCORRECT" ).arg(aRow->GetName());
+ }
+ else
+ IsVariableComplited = aRow->CheckName() && IsUniqueName(aRow);
}
if(!IsCorrect && !aMsg.isEmpty())
- SUIT_MessageBox::warning( parentWidget(), tr( "WARNING" ), aMsg );
+ SUIT_MessageBox::warning( parentWidget(), tr( "WARNING" ), aMsg );
bool isBlocked = blockSignals( true );
theItem->setForeground( QBrush( IsCorrect ? Qt::black : Qt::red ) );
int anIndex = aRow->GetIndex();
if( myVariableMap.contains( anIndex ) )
{
- NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
- if( aVariable.Name.compare( aRow->GetName() ) != 0 ||
- aVariable.Value.compare( aRow->GetValue() ) != 0 )
- {
- aVariable.Name = aRow->GetName();
- aVariable.Value = aRow->GetValue();
- }
- else
- isModified = false;
+ NoteBoox_Variable& aVariable = myVariableMap[ anIndex ];
+ if( aVariable.Name.compare( aRow->GetName() ) != 0 ||
+ aVariable.Value.compare( aRow->GetValue() ) != 0 )
+ {
+ aVariable.Name = aRow->GetName();
+ aVariable.Value = aRow->GetValue();
+ }
+ else
+ isModified = false;
}
if(IsCorrect && IsVariableComplited && IsLastRow(aRow))
- AddEmptyRow();
+ AddEmptyRow();
}
if( !myIsModified )
else {
int nRow = row(aSelectedItems[i]);
- if( myStudy->IsVariableUsed( string( aRow->GetName().toLatin1().constData() ) ) )
- {
- if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
- tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ),
- QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
- {
- isProcessItemChangedSignal = true;
- return;
- }
- }
-
- int index = aRow->GetIndex();
+ if( myStudy->IsVariableUsed( std::string( aRow->GetName().toLatin1().constData() ) ) )
+ {
+ if( QMessageBox::warning( parentWidget(), tr( "WARNING" ),
+ tr( "REMOVE_VARIABLE_IS_USED" ).arg( aRow->GetName() ),
+ QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
+ {
+ isProcessItemChangedSignal = true;
+ return;
+ }
+ }
+
+ int index = aRow->GetIndex();
QString aVarName = aRow->GetName();
- myRemovedRows.append( index );
- if( myVariableMap.contains( index ) )
- myVariableMap.remove( index );
+ myRemovedRows.append( index );
+ if( myVariableMap.contains( index ) )
+ myVariableMap.remove( index );
removeRow(nRow);
myRows.removeAt(nRow);
if(myStudy->IsVariable(aVarName.toLatin1().constData()))
if( aVariableMapRef.contains( anIndex ) )
{
QString aRemovedVariable = aVariableMapRef[ anIndex ].Name;
- myStudy->RemoveVariable( string( aRemovedVariable.toLatin1().constData() ) );
+ myStudy->RemoveVariable( std::string( aRemovedVariable.toLatin1().constData() ) );
}
}
{
if( aVariableMapRef.contains( anIndex ) )
{
- const NoteBoox_Variable& aVariableRef = aVariableMapRef[ anIndex ];
- QString aNameRef = aVariableRef.Name;
- QString aValueRef = aVariableRef.Value;
-
- if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName )
- {
- myStudy->RenameVariable( string( aNameRef.toLatin1().constData() ),
- string( aName.toLatin1().constData() ) );
- }
+ const NoteBoox_Variable& aVariableRef = aVariableMapRef[ anIndex ];
+ QString aNameRef = aVariableRef.Name;
+ QString aValueRef = aVariableRef.Value;
+
+ if( !aNameRef.isEmpty() && !aValueRef.isEmpty() && aNameRef != aName )
+ {
+ myStudy->RenameVariable( std::string( aNameRef.toLatin1().constData() ),
+ std::string( aName.toLatin1().constData() ) );
+ }
}
if( NoteBook_TableRow::IsIntegerValue(aValue,&anIVal) )
- myStudy->SetInteger(string(aName.toLatin1().constData()),anIVal);
+ myStudy->SetInteger(std::string(aName.toLatin1().constData()),anIVal);
else if( NoteBook_TableRow::IsRealValue(aValue,&aDVal) )
- myStudy->SetReal(string(aName.toLatin1().constData()),aDVal);
+ myStudy->SetReal(std::string(aName.toLatin1().constData()),aDVal);
else if( NoteBook_TableRow::IsBooleanValue(aValue,&aBVal) )
- myStudy->SetBoolean(string(aName.toLatin1().constData()),aBVal);
+ myStudy->SetBoolean(std::string(aName.toLatin1().constData()),aBVal);
+
+ else
+ myStudy->SetString(std::string(aName.toLatin1().constData()),aValue.toStdString());
}
}
myTable->ResetMaps();
if( myTable->IsModified() )
{
int answer = QMessageBox::question( this, tr( "CLOSE_CAPTION" ), tr( "CLOSE_DESCRIPTION" ),
- QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel );
+ QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel );
switch( answer )
{
case QMessageBox::Yes : onOK(); return;
case QMessageBox::No : break;
case QMessageBox::Cancel : return;
- default : break;
+ default : break;
}
}
reject();
// dump study to the temporary directory
QString aFileName( "notebook" );
bool toPublish = true;
+ bool isMultiFile = false;
bool toSaveGUI = true;
int savePoint;
ip->setDumpPython(studyDS);
savePoint = SalomeApp_VisualState( app ).storeState(); //SRN: create a temporary save point
}
- bool ok = studyDS->DumpStudy( aTmpDir.toStdString(), aFileName.toStdString(), toPublish );
+ bool ok = studyDS->DumpStudy( aTmpDir.toStdString(), aFileName.toStdString(), toPublish, isMultiFile );
if ( toSaveGUI )
study->removeSavePoint(savePoint); //SRN: remove the created temporary save point.
app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
// load study from the temporary directory
- QString command = QString( "execfile(\"%1\")" ).arg( aTmpDir + QDir::separator() + aFileName + ".py" );
+ QString command = QString( "execfile(r\"%1\")" ).arg( aTmpDir + QDir::separator() + aFileName + ".py" );
PyConsole_Console* pyConsole = app->pythonConsole();
if ( pyConsole )
int aY = y();
// Disconnect dialog from application desktop in case if:
- // 1) Application is not the first application in the session
+ // 1) Application is not the first application in the session
// 2) Application is the first application in session but not the only.
bool changeDesktop = ((anIndex > 0) || (anIndex == 0 && aList.count() > 1));
-// Copyright (C) 2008 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// Copyright (C) 2007-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
+// 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.
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File: SalomeApp_NoteBookDlg.h
// Author : Roman NIKOLAEV, Open CASCADE S.A.S.
// Module : GUI
-
+//
#ifndef SALOMEAPP_NOTEBOOKDLG_H
#define SALOMEAPP_NOTEBOOKDLG_H
class QWidget;
class QPushButton;
class QTableWidgetItem;
+class NoteBook_Table;
struct NoteBoox_Variable
{
class SALOMEAPP_EXPORT NoteBook_TableRow : public QWidget
{
public:
- NoteBook_TableRow(int, QWidget* parent=0);
+ NoteBook_TableRow(int, NoteBook_Table* parentTable, QWidget* parent=0 );
virtual ~NoteBook_TableRow();
int GetIndex() const { return myIndex; }
static bool IsRealValue(const QString theValue, double* theResult = 0);
static bool IsIntegerValue(const QString theValue, int* theResult = 0);
static bool IsBooleanValue(const QString theValue, bool* theResult = 0);
+ bool IsValidStringValue(const QString theName);
private:
int myIndex;
+ NoteBook_Table* myParentTable;
QTableWidgetItem* myRowHeader;
QTableWidgetItem* myVariableName;
QTableWidgetItem* myVariableValue;
void Init(_PTR(Study) theStudy);
static QString Variable2String(const std::string& theVarName,
- _PTR(Study) theStudy);
+ _PTR(Study) theStudy);
bool IsValid() const;
void ResetMaps();
+ QList<NoteBook_TableRow*> myRows;
+
public slots:
void onItemChanged(QTableWidgetItem* theItem);
private:
bool isProcessItemChangedSignal;
- QList<NoteBook_TableRow*> myRows;
bool myIsModified;
QList<int> myRemovedRows;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SalomeApp_PyInterp.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#include "SalomeApp_PyInterp.h"
#include <utilities.h>
#include "PyInterp.h" // this include must be first (see PyInterp_base.h)!
-using namespace std;
-
/*!
* constructor : multi Python interpreter, one per SALOME study.
* calls initialize method defined in base class, which calls virtual methods
// Call init_shared_modules to initialize the shared import mechanism for modules
//that must not be imported twice
- PyObjWrapper m2( PyObject_CallMethod( m1, "init_shared_modules", "O", KERNEL_PYTHON::salome_shared_modules_module ) );
+ PyObjWrapper m2( PyObject_CallMethod( m1, (char*)"init_shared_modules", (char*)"O", KERNEL_PYTHON::salome_shared_modules_module ) );
if ( !m2 )
{
MESSAGE( "initContext: problem with init_shared_modules call" );
*/
void SalomeApp_PyInterp::initPython()
{
- MESSAGE("PyInterp_base::initPython");
+ MESSAGE("SalomeApp_PyInterp::initPython");
ASSERT(KERNEL_PYTHON::_gtstate); // initialisation in main
SCRUTE(KERNEL_PYTHON::_gtstate);
_gtstate=KERNEL_PYTHON::_gtstate;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SALOMEGUI : implementation of desktop and GUI kernel
// File : SalomeApp_PyInterp.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef _SalomeApp_PYINTERP_H_
#define _SalomeApp_PYINTERP_H_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_Study.h"
#include "SalomeApp_Module.h"
// temporary commented
//#include <OB_Browser.h>
+#include <QCoreApplication>
+#include <QEvent>
+#include <QFileInfo>
+#include "SALOME_Event.h"
+#include "Basics_Utils.hxx"
+
#include <SUIT_ResourceMgr.h>
+#include <SUIT_TreeModel.h>
+#include <SUIT_DataBrowser.h>
+
+#include <LightApp_Displayer.h>
#include "utilities.h"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Exception)
-using namespace std;
+//#define NOTIFY_BY_EVENT
+
+class ObserverEvent : public QEvent
+{
+public:
+ ObserverEvent(const char* theID, CORBA::Long event):QEvent(QEvent::User)
+ {
+ _anID=theID;
+ _event=event;
+ }
+
+ std::string _anID;
+ CORBA::Long _event;
+};
+
+class SalomeApp_Study::Observer_i : public virtual POA_SALOMEDS::Observer, QObject
+{
+ typedef std::map<std::string, SalomeApp_DataObject*> EntryMap;
+ typedef std::map<std::string, SalomeApp_DataObject*>::iterator EntryMapIter;
+
+public:
+
+ Observer_i(_PTR(Study) aStudyDS, SalomeApp_Study* aStudy)
+ {
+ myStudyDS=aStudyDS;
+ myStudy=aStudy;
+ fillEntryMap();
+ }
+
+ SUIT_DataObject* findObject( const char* theID ) const
+ {
+ EntryMap::const_iterator it = entry2SuitObject.find( theID );
+ return it != entry2SuitObject.end() ? it->second : 0;
+ }
+
+ virtual void notifyObserverID(const char* theID, CORBA::Long event)
+ {
+#ifdef NOTIFY_BY_EVENT
+ QCoreApplication::postEvent(this,new ObserverEvent(theID,event));
+#else
+ notifyObserverID_real(theID,event);
+#endif
+ }
+
+ virtual bool event(QEvent *event)
+ {
+ if (event->type() == QEvent::User )
+ {
+ //START_TIMING(notify);
+ notifyObserverID_real(static_cast<ObserverEvent *>(event)->_anID.c_str(),static_cast<ObserverEvent *>(event)->_event);
+ //END_TIMING(notify,100);
+ }
+ return true;
+ }
+
+ void notifyObserverID_real(const std::string& theID, long event)
+ {
+ SalomeApp_DataObject* suit_obj = 0;
+
+ switch(event) {
+ case 1:
+ { //Add sobject
+ _PTR(SObject) aSObj = myStudyDS->FindObjectID(theID);
+ _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
+
+ if (!aSComp || aSComp->IsNull()) {
+ MESSAGE("Entry " << theID << " has not father component. Problem ??");
+ return;
+ }
+
+ // Mantis issue 0020136: Drag&Drop in OB
+ _PTR(UseCaseBuilder) aUseCaseBuilder = myStudyDS->GetUseCaseBuilder();
+ if (aUseCaseBuilder->IsUseCaseNode(aSComp)) { // BEGIN: work with tree nodes structure
+ if (!aUseCaseBuilder->IsUseCaseNode(aSObj)) {
+ // tree node is not yet set, it is a normal situation
+ return;
+ }
+
+ _PTR(SObject) aFatherSO = aUseCaseBuilder->GetFather(aSObj);
+ if (!aFatherSO || aFatherSO->IsNull()) {
+ MESSAGE("Father SObject is not found. Problem ??");
+ return;
+ }
+
+ std::string parent_id = aFatherSO->GetID();
+ EntryMapIter it = entry2SuitObject.find(parent_id.c_str());
+
+ if (it == entry2SuitObject.end()) {
+ MESSAGE("Father data object is not found. Problem ??");
+ return;
+ }
+
+ SalomeApp_DataObject* aFatherDO = it->second;
+
+ it = entry2SuitObject.find(theID);
+ if (it != entry2SuitObject.end()) { // this SOobject is already added somethere
+ suit_obj = it->second;
+ SUIT_DataObject* oldFather = suit_obj->parent();
+ if (oldFather) {
+ oldFather->removeChild(suit_obj, false);
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( myStudy->application() );
+ SUIT_AbstractModel* model = dynamic_cast<SUIT_AbstractModel*>(app->objectBrowser()->model());
+ model->forgetObject( suit_obj );
+
+ if (SalomeApp_DataObject* oldFatherSA = dynamic_cast<SalomeApp_DataObject*>(oldFather)) {
+ oldFatherSA->updateItem();
+ }
+ }
+ }
+ else {
+ suit_obj = new SalomeApp_DataObject(aSObj);
+ entry2SuitObject[theID] = suit_obj;
+ }
+
+ suit_obj->updateItem();
+ // define position in the data tree (in aFatherDO) to insert the aSObj
+ int pos = -1;
+ //int childDataObjCount = aFatherDO->childCount();
+ _PTR(UseCaseIterator) aUseCaseIter = aUseCaseBuilder->GetUseCaseIterator(aFatherSO);
+ for (int cur = 0; aUseCaseIter->More() && pos < 0; cur++, aUseCaseIter->Next()) {
+ if (aUseCaseIter->Value()->GetID() == theID) {
+ pos = cur;
+ break;
+ }
+ }
+
+ aFatherDO->insertChildAtPos(suit_obj, pos);
+ //aFatherDO->insertChild(suit_obj, pos);
+ aFatherDO->updateItem();
+
+ } // END: work with tree nodes structure
+ else { // BEGIN: work with study structure
+ EntryMapIter it = entry2SuitObject.find( theID );
+ if ( it != entry2SuitObject.end() ) {
+ MESSAGE("Entry " << theID << " is already added. Problem ??");
+ return;
+ }
+
+ int last2Pnt_pos = theID.rfind( ":" );
+ std::string parent_id = theID.substr( 0, last2Pnt_pos );
+ int tag = atoi( theID.substr( last2Pnt_pos+1 ).c_str() );
+
+ if ( parent_id.length() == 3 ) // "0:1" - root item?
+ {
+ // It's probably a SComponent
+ if ( theID == aSComp->GetID() )
+ suit_obj = new SalomeApp_ModuleObject( aSComp );
+ else
+ suit_obj = new SalomeApp_DataObject( aSObj );
+ }
+ else
+ {
+ suit_obj = new SalomeApp_DataObject( aSObj );
+ }
+
+ it = entry2SuitObject.find( parent_id );
+ if ( it != entry2SuitObject.end() ) {
+ SalomeApp_DataObject* father = it->second;
+ father->insertChildAtTag( suit_obj, tag );
+ }
+ else {
+ if ( parent_id.length() == 3 ) // "0:1" - root item?
+ {
+ // This should be for a module
+ SUIT_DataObject* father=myStudy->root();
+ father->appendChild(suit_obj);
+ }
+ else
+ {
+ MESSAGE("SHOULD NEVER GET HERE!!!");
+
+ //Try to find the SalomeApp_DataObject object parent
+ std::string root_id = parent_id.substr( 0, 4 );
+ std::string obj_id = parent_id.substr( 4 );
+
+ std::string anID;
+ std::string::size_type debut = 0;
+ std::string::size_type fin;
+ SalomeApp_DataObject* anObj = dynamic_cast<SalomeApp_DataObject*>( myStudy->root() );
+ while ( 1 ) {
+ fin = obj_id.find_first_of( ':', debut );
+ if ( fin == std::string::npos ) {
+ //last id
+ anObj = dynamic_cast<SalomeApp_DataObject*>(anObj->childObject(atoi(obj_id.substr(debut).c_str())-1));
+ entry2SuitObject[parent_id] = anObj;
+ break;
+ }
+ anID = root_id + obj_id.substr( 0, fin );
+ EntryMapIter it2 = entry2SuitObject.find( anID );
+ if ( it2 == entry2SuitObject.end() ) {
+ //the ID is not known in entry2SuitObject
+ anObj = dynamic_cast<SalomeApp_DataObject*>(anObj->childObject(atoi(obj_id.substr(debut, fin-debut).c_str())-1));
+ entry2SuitObject[anID] = anObj;
+ }
+ else
+ anObj = it2->second;
+ debut = fin+1;
+ }
+ anObj->insertChildAtTag( suit_obj, tag );
+ }
+ }
+ entry2SuitObject[theID] = suit_obj;
+ } // END: work with study structure
+ break;
+ }
+ case 2:
+ { // Remove sobject
+ EntryMapIter it = entry2SuitObject.find( theID );
+ if ( it != entry2SuitObject.end() )
+ {
+ suit_obj = it->second;
+ // VSR: object is not removed, since SALOMEDS::SObject is not actually removed,
+ // only its attributes are cleared;
+ // thus, the object can be later reused
+ suit_obj->updateItem();
+ //SUIT_DataObject* father=suit_obj->parent();
+ //if(father)
+ // father->removeChild(suit_obj);
+ //entry2SuitObject.erase(it);
+ }
+ else
+ {
+ MESSAGE("Want to remove an unknown object" << theID);
+ }
+ break;
+ }
+ case 0:
+ { //modify sobject
+ //MESSAGE("Want to modify an object " << theID);
+ EntryMapIter it = entry2SuitObject.find( theID );
+ if ( it != entry2SuitObject.end() )
+ {
+ suit_obj = it->second;
+ suit_obj->updateItem();
+ }
+ else
+ {
+ MESSAGE("Want to modify an unknown object" << theID);
+ }
+ break;
+ }
+ case 5: //IOR of the object modified
+ {
+ EntryMapIter it = entry2SuitObject.find( theID );
+ if ( it != entry2SuitObject.end() )
+ suit_obj = it->second;
+
+ /* Define visibility state */
+ bool isComponent = dynamic_cast<SalomeApp_ModuleObject*>( suit_obj ) != 0;
+ if ( suit_obj && !isComponent ) {
+ QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType());
+ if (!moduleTitle.isEmpty()) {
+ LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false);
+ if (aDisplayer) {
+ if(aDisplayer->canBeDisplayed(theID.c_str())) {
+ myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState );
+ //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!");
+ }
+ else
+ MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!");
+ }
+ }
+ }
+ break;
+ }
+ default:MESSAGE("Unknown event: " << event);break;
+ } //switch
+ } //notifyObserverID_real
+
+private:
+ void fillEntryMap()
+ {
+ entry2SuitObject.clear();
+ SUIT_DataObject* o = myStudy->root();
+ while (o) {
+ SalomeApp_DataObject* so = dynamic_cast<SalomeApp_DataObject*>( o );
+ if ( so ) {
+ std::string entry = so->entry().toLatin1().constData();
+ if ( entry.size() )
+ entry2SuitObject[entry] = so;
+ }
+ if ( o->childCount() > 0 ) {
+ // parse the children
+ o = o->firstChild();
+ }
+ else if ( o->nextBrother() > 0 ) {
+ o = o->nextBrother();
+ }
+ else {
+ // step to the next appropriate parent
+ o = o->parent();
+ while ( o ) {
+ if ( o->nextBrother() ) {
+ o = o->nextBrother();
+ break;
+ }
+ o = o->parent();
+ }
+ }
+ }
+ }
+
+private:
+ _PTR(Study) myStudyDS;
+ SalomeApp_Study* myStudy;
+ EntryMap entry2SuitObject;
+};
+
/*!
Constructor.
*/
SalomeApp_Study::SalomeApp_Study( SUIT_Application* app )
-: LightApp_Study( app )
+: LightApp_Study( app ), myObserver( 0 )
{
-}
+}
/*!
Destructor.
int SalomeApp_Study::id() const
{
int id = -1;
- if ( myStudyDS )
+ if ( studyDS() )
id = studyDS()->StudyId();
return id;
}
+/*!
+ Get study name.
+*/
+QString SalomeApp_Study::studyName() const
+{
+ // redefined from SUIT_Study to update study name properly since
+ // it can be changed outside of GUI
+ // TEMPORARILY SOLUTION: better to be implemented with help of SALOMEDS observers
+ if ( studyDS() ) {
+ QString newName = studyDS()->Name().c_str();
+ if ( LightApp_Study::studyName() != newName ) {
+ SalomeApp_Study* that = const_cast<SalomeApp_Study*>( this );
+ that->setStudyName( newName );
+ ((SalomeApp_Application*)application())->updateDesktopTitle();
+ }
+ }
+ return LightApp_Study::studyName();
+}
+
/*!
Gets studyDS pointer.
*/
*/
bool SalomeApp_Study::createDocument( const QString& theStr )
{
- MESSAGE( "openDocument" );
+ MESSAGE( "createDocument" );
// initialize myStudyDS, read HDF file
QString aName = newStudyName();
- _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.toStdString() ) );
+ _PTR(Study) study ( SalomeApp_Application::studyMgr()->NewStudy( aName.toUtf8().data() ) );
if ( !study )
return false;
setStudyName( aName );
// create myRoot
- setRoot( new SalomeApp_RootObject( this ) );
+ SalomeApp_RootObject* aRoot=new SalomeApp_RootObject( this );
+#ifdef WITH_SALOMEDS_OBSERVER
+ aRoot->setToSynchronize(false);
+#endif
+ setRoot( aRoot );
bool aRet = CAM_Study::createDocument( theStr );
+
+#ifdef WITH_SALOMEDS_OBSERVER
+ myObserver = new Observer_i(myStudyDS,this);
+ //attach an observer to the study with notification of modifications
+ myStudyDS->attach(myObserver->_this(),true);
+#endif
+
emit created( this );
return aRet;
MESSAGE( "openDocument" );
// initialize myStudyDS, read HDF file
- _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( (char*) theFileName.toStdString().c_str() ) );
+ _PTR(Study) study ( SalomeApp_Application::studyMgr()->Open( theFileName.toUtf8().data() ) );
if ( !study )
return false;
ModelList dm_s;
dataModels( dm_s );
QListIterator<CAM_DataModel*> it( dm_s );
- while ( it.hasNext() )
+ while ( it.hasNext() )
openDataModel( studyName(), it.next() );
-
+
// this will build a SUIT_DataObject-s tree under myRoot member field
// passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
- // but tree that corresponds to not-loaded data models will be updated any way.
- ((SalomeApp_Application*)application())->updateObjectBrowser( false );
+ // but tree that corresponds to not-loaded data models will be updated any way.
+ ((SalomeApp_Application*)application())->updateObjectBrowser( false );
+
+#ifdef WITH_SALOMEDS_OBSERVER
+ dynamic_cast<SalomeApp_RootObject*>( root() )->setToSynchronize(false);
+ myObserver = new Observer_i(myStudyDS,this);
+ //attach an observer to the study with notification of modifications
+ myStudyDS->attach(myObserver->_this(),true);
+#endif
bool res = CAM_Study::openDocument( theFileName );
-
+
emit opened( this );
study->IsSaved(true);
SalomeApp_VisualState( (SalomeApp_Application*)application() ).restoreState( savePoints[savePoints.size()-1] );
}
- ((SalomeApp_Application*)application())->updateObjectBrowser( true );
+ ((SalomeApp_Application*)application())->updateObjectBrowser( true );
return res;
}
MESSAGE( "loadDocument" );
// obtain myStudyDS from StudyManager
- _PTR(Study) study ( SalomeApp_Application::studyMgr()->GetStudyByName( (char*) theStudyName.toStdString().c_str() ) );
+ _PTR(Study) study ( SalomeApp_Application::studyMgr()->GetStudyByName( theStudyName.toUtf8().data() ) );
if ( !study )
return false;
// this will build a SUIT_DataObject-s tree under myRoot member field
// passing "false" in order NOT to rebuild existing data models' trees - it was done in previous step
- // but tree that corresponds to not-loaded data models will be updated any way.
- ((SalomeApp_Application*)application())->updateObjectBrowser( false );
+ // but tree that corresponds to not-loaded data models will be updated any way.
+ ((SalomeApp_Application*)application())->updateObjectBrowser( false );
+
+#ifdef WITH_SALOMEDS_OBSERVER
+ dynamic_cast<SalomeApp_RootObject*>( root() )->setToSynchronize(false);
+ myObserver = new Observer_i(myStudyDS,this);
+ //attach an observer to the study with notification of modifications
+ myStudyDS->attach(myObserver->_this(),true);
+#endif
bool res = CAM_Study::openDocument( theStudyName );
emit opened( this );
bool store = application()->resourceMgr()->booleanValue( "Study", "store_visual_state", false );
if ( store )
SalomeApp_VisualState( (SalomeApp_Application*)application() ).storeState();
-
+
ModelList list; dataModels( list );
QListIterator<CAM_DataModel*> it( list );
QStringList listOfFiles;
while ( it.hasNext() ) {
- if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() ) {
+ // Cast to LightApp class in order to give a chance
+ // to light modules to save their data
+ if ( LightApp_DataModel* aModel =
+ dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
listOfFiles.clear();
aModel->saveAs( theFileName, this, listOfFiles );
if ( !listOfFiles.isEmpty() )
- saveModuleData(aModel->module()->name(), listOfFiles);
+ saveModuleData(aModel->module()->name(), listOfFiles);
}
}
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false );
- bool res = (isAscii ?
- SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.toStdString(), studyDS(), isMultiFile ) :
- SalomeApp_Application::studyMgr()->SaveAs ( theFileName.toStdString(), studyDS(), isMultiFile ))
+ bool res = (isAscii ?
+ SalomeApp_Application::studyMgr()->SaveAsASCII( theFileName.toUtf8().data(), studyDS(), isMultiFile ) :
+ SalomeApp_Application::studyMgr()->SaveAs ( theFileName.toUtf8().data(), studyDS(), isMultiFile ))
&& CAM_Study::saveDocumentAs( theFileName );
-
+
res = res && saveStudyData(theFileName);
if ( res )
QListIterator<CAM_DataModel*> it( list );
QStringList listOfFiles;
while ( it.hasNext() ) {
- if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() ) {
+ // Cast to LightApp class in order to give a chance
+ // to light modules to save their data
+ if ( LightApp_DataModel* aModel =
+ dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
listOfFiles.clear();
aModel->save(listOfFiles);
- if ( !listOfFiles.isEmpty() )
- saveModuleData(aModel->module()->name(), listOfFiles);
+ if ( !listOfFiles.isEmpty() )
+ saveModuleData(aModel->module()->name(), listOfFiles);
}
}
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
bool isAscii = resMgr->booleanValue( "Study", "ascii_file", false );
- bool res = (isAscii ?
+ bool res = (isAscii ?
SalomeApp_Application::studyMgr()->SaveASCII( studyDS(), isMultiFile ) :
SalomeApp_Application::studyMgr()->Save ( studyDS(), isMultiFile )) && CAM_Study::saveDocument();
res = res && saveStudyData(studyName());
if ( res )
- emit saved( this );
+ emit saved( this );
return res;
}
}
}
+/*!
+ Dump study operation. Writes a Python dump file using
+ SALOMEDS services. Additionally, gives a chance to light modules
+ to participate in dump study operation.
+
+ \param theFileName - full path to the output Python file
+ \param toPublish - if true, all objects are published in a study
+ by the output script, including those not orignally present
+ in the current study.
+ \param isMultiFile - if true, each module's dump is written into
+ a separate Python file, otherwise a single output file is written
+ \param toSaveGUI - if true, the GUI state is written
+
+ \return - true if the operation succeeds, and false otherwise.
+*/
+bool SalomeApp_Study::dump( const QString& theFileName,
+ bool toPublish,
+ bool isMultiFile,
+ bool toSaveGUI )
+{
+ int savePoint;
+ _PTR(AttributeParameter) ap;
+ _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+ _PTR(Study) aStudy = studyDS();
+
+ if( ip->isDumpPython( aStudy ) )
+ ip->setDumpPython( aStudy ); //Unset DumpPython flag.
+
+ if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method
+ ip->setDumpPython( aStudy );
+ //SRN: create a temporary save point
+ savePoint = SalomeApp_VisualState(
+ dynamic_cast<SalomeApp_Application*>( application() ) ).storeState();
+ }
+
+ // Issue 21377 - Each data model is asked to dump its data not present in SALOMEDS study.
+ // This is an optional but important step, it gives a chance to light modules
+ // to dump their data as a part of common dump study operation
+ ModelList list;
+ dataModels( list );
+
+ QListIterator<CAM_DataModel*> it( list );
+ QStringList listOfFiles;
+ while ( it.hasNext() ) {
+ if ( LightApp_DataModel* aModel =
+ dynamic_cast<LightApp_DataModel*>( it.next() ) ) {
+ listOfFiles.clear();
+ if ( aModel->dumpPython( theFileName, this, isMultiFile, listOfFiles ) &&
+ !listOfFiles.isEmpty() )
+ // This call simply passes the data model's dump output to SalomeApp_Engine servant.
+ // This code is shared with persistence mechanism.
+ // NOTE: this should be revised if behavior of saveModuleData() changes!
+ saveModuleData(aModel->module()->name(), listOfFiles);
+ }
+ }
+
+ // Now dump SALOMEDS part that also involves SalomeApp_Engine in case if
+ // any light module is present in the current configuration
+ QFileInfo aFileInfo( theFileName );
+ bool res = aStudy->DumpStudy( aFileInfo.absolutePath().toUtf8().data(),
+ aFileInfo.baseName().toUtf8().data(),
+ toPublish,
+ isMultiFile);
+ if ( toSaveGUI )
+ removeSavePoint( savePoint ); //SRN: remove the created temporary save point.
+
+ // Issue 21377 - Clean up light module data in SalomeApp_Engine servant
+ // This code is shared with persistence mechanism.
+ // NOTE: this should be revised if behavior of saveStudyData() changes!
+ saveStudyData( theFileName );
+
+ return res;
+}
+
/*!
\return true, if study is modified in comparison with last open/save
*/
if (!isAnyChanged)
isAnyChanged = LightApp_Study::isModified();
- return isAnyChanged;
+ return isAnyChanged;
}
/*!
if (!isAllSaved)
isAllSaved = LightApp_Study::isSaved();
- return isAllSaved;
+ return isAllSaved;
}
/*!
for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
if ( (*it).isEmpty() )
continue;
- aListOfFiles[anIndex] = (*it).toStdString();
+ aListOfFiles[anIndex] = (*it).toUtf8().data();
anIndex++;
}
SetListOfFiles(theModuleName.toStdString().c_str(), aListOfFiles);
}
/*!
- Saves data from study
+ Re-implemented from LightApp_Study, actually does not save anything but
+ simply cleans up light modules' data
*/
bool SalomeApp_Study::saveStudyData( const QString& theFileName )
{
ModelList list; dataModels( list );
QListIterator<CAM_DataModel*> it( list );
std::vector<std::string> listOfFiles(0);
- while ( it.hasNext() )
- if ( SalomeApp_DataModel* aModel = (SalomeApp_DataModel*)it.next() )
- SetListOfFiles(aModel->module()->name().toStdString().c_str(), listOfFiles);
+ while ( it.hasNext() ){
+ LightApp_DataModel* aLModel =
+ dynamic_cast<LightApp_DataModel*>( it.next() );
+ // It is safe to call SetListOfFiles() for any kind of module
+ // because SetListOfFiles() does nothing for full modules :)
+ if ( aLModel )
+ SetListOfFiles(aLModel->module()->name().toStdString().c_str(), listOfFiles);
+ }
return true;
}
myStudyDS = s;
}
+/*!
+ Virtual method re-implemented from LightApp_Study in order to create
+ the module object connected to SALOMEDS - SalomeApp_ModuleObject.
+
+ \param theDataModel - data model instance to create a module object for
+ \param theParent - the module object's parent (normally it's the study root)
+ \return the module object instance
+ \sa LightApp_Study class, LightApp_DataModel class
+*/
+CAM_ModuleObject* SalomeApp_Study::createModuleObject( LightApp_DataModel* theDataModel,
+ SUIT_DataObject* theParent ) const
+{
+ SalomeApp_Study* that = const_cast<SalomeApp_Study*>( this );
+
+ // Ensure that SComponent instance is published in the study for the given module
+ // This line causes automatic creation of SalomeApp_ModuleObject in case if
+ // WITH_SALOMEDS_OBSERVER is defined
+ that->addComponent( theDataModel );
+
+ // SalomeApp_ModuleObject might have been created by SALOMEDS observer
+ // or by someone else so check if it exists first of all
+ CAM_ModuleObject* res = 0;
+
+ DataObjectList children = root()->children();
+ DataObjectList::const_iterator anIt = children.begin(), aLast = children.end();
+ for( ; !res && anIt!=aLast; anIt++ )
+ {
+ SalomeApp_ModuleObject* obj = dynamic_cast<SalomeApp_ModuleObject*>( *anIt );
+ if ( obj && obj->componentDataType() == theDataModel->module()->name() )
+ res = obj;
+ }
+
+ if ( !res ){
+ _PTR(Study) aStudy = studyDS();
+ if ( !aStudy )
+ return res;
+
+ _PTR(SComponent) aComp = aStudy->FindComponent(
+ theDataModel->module()->name().toStdString() );
+ if ( !aComp )
+ return res;
+
+ res = new SalomeApp_ModuleObject( theDataModel, aComp, theParent );
+ }
+
+ return res;
+}
+
/*!
Insert data model.
*/
if (!aModule) {
// Check SComponent existance
_PTR(Study) aStudy = studyDS();
- if (!aStudy)
+ if (!aStudy)
return;
- _PTR(SComponent) aComp = aStudy->FindComponent(dm->module()->name().toStdString());
+
+ std::string aCompDataType = dm->module()->name().toStdString();
+
+ _PTR(SComponent) aComp = aStudy->FindComponent(aCompDataType);
if (!aComp) {
// Create SComponent
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
- aComp = aBuilder->NewComponent(dm->module()->name().toStdString());
+ aComp = aBuilder->NewComponent(aCompDataType);
aBuilder->SetName(aComp, dm->module()->moduleName().toStdString());
QString anIconName = dm->module()->iconName();
if (!anIconName.isEmpty()) {
if (anAttr)
anAttr->SetPixMap(anIconName.toStdString());
}
+
// Set default engine IOR
- aBuilder->DefineComponentInstance(aComp, SalomeApp_Application::defaultEngineIOR().toStdString());
+ // Issue 21377 - using separate engine for each type of light module
+ std::string anEngineIOR = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.c_str(),
+ true );
+ aBuilder->DefineComponentInstance(aComp, anEngineIOR);
//SalomeApp_DataModel::BuildTree( aComp, root(), this, /*skipExisitng=*/true );
SalomeApp_DataModel::synchronize( aComp, this );
}
+ else {
+ _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+ aBuilder->SetName(aComp, dm->module()->moduleName().toStdString());
+ QString anIconName = dm->module()->iconName();
+ if (!anIconName.isEmpty()) {
+ _PTR(AttributePixMap) anAttr = aBuilder->FindOrCreateAttribute(aComp, "AttributePixMap");
+ if (anAttr)
+ anAttr->SetPixMap(anIconName.toStdString());
+ }
+ // Set default engine IOR
+ }
}
}
QString anEngine;
// 1. aModule == 0 means that this is a light module (no CORBA enigine)
if (!aModule) {
- anEngine = SalomeApp_Application::defaultEngineIOR();
- aSComp = aStudy->FindComponent(dm->module()->name().toStdString());
+ // Issue 21377 - using separate engine for each type of light module
+ std::string aCompDataType = dm->module()->name().toStdString();
+ anEngine = SalomeApp_Engine_i::EngineIORForComponent( aCompDataType.c_str(), true ).c_str();
+ aSComp = aStudy->FindComponent( aCompDataType );
}
else {
SalomeApp_DataModel* aDM = dynamic_cast<SalomeApp_DataModel*>( dm );
curName = prefix.arg( i );
for ( j = 0 ; j < n; j++ ){
if ( !strcmp( studies[j].c_str(), curName.toLatin1() ) )
- break;
+ break;
}
if ( j == n )
newName = curName;
}
/*!
+ Note that this method does not create or activate SalomeApp_Engine_i instance,
+ therefore it can be called safely for any kind of module, but for full
+ modules it returns an empty list.
\return list of files used by module: to be used by CORBAless modules
\param theModuleName - name of module
*/
std::vector<std::string> SalomeApp_Study::GetListOfFiles( const char* theModuleName ) const
{
- SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance();
+ // Issue 21377 - using separate engine for each type of light module
+ SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false );
if (aDefaultEngine)
- return aDefaultEngine->GetListOfFiles(id(), theModuleName);
+ return aDefaultEngine->GetListOfFiles(id());
std::vector<std::string> aListOfFiles;
return aListOfFiles;
}
/*!
- Sets list of files used by module: to be used by CORBAless modules
+ Sets list of files used by module: to be used by CORBAless modules.
+ Note that this method does not create or activate SalomeApp_Engine_i instance,
+ therefore it can be called safely for any kind of module, but for full
+ modules it simply does nothing.
\param theModuleName - name of module
\param theListOfFiles - list of files
*/
void SalomeApp_Study::SetListOfFiles ( const char* theModuleName,
const std::vector<std::string> theListOfFiles )
{
- SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance();
+ // Issue 21377 - using separate engine for each type of light module
+ SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance( theModuleName, false );
if (aDefaultEngine)
- aDefaultEngine->SetListOfFiles(theListOfFiles, id(), theModuleName);
+ aDefaultEngine->SetListOfFiles(theListOfFiles, id());
}
/*!
setIsSaved(true);
}
+LightApp_DataObject* SalomeApp_Study::findObjectByEntry( const QString& theEntry )
+{
+ LightApp_DataObject* o = dynamic_cast<LightApp_DataObject*>( myObserver ? myObserver->findObject( theEntry.toLatin1().constData() ) : 0 );
+ return o;
+}
+
/*!
Deletes all references to object
\param obj - object
*/
void SalomeApp_Study::components( QStringList& comps ) const
{
- for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() )
+ for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() )
+ {
+ _PTR(SComponent) aComponent ( it->Value() );
+ // skip the magic "Interface Applicative" component
+ if ( aComponent && aComponent->ComponentDataType() != getVisualComponentName().toLatin1().constData() )
+ comps.append( aComponent->ComponentDataType().c_str() );
+ }
+}
+
+/*!
+ Get the entry for the given module
+ \param comp - list to be filled
+ \return module root's entry
+*/
+QString SalomeApp_Study::centry( const QString& comp ) const
+{
+ QString e;
+ for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More() && e.isEmpty(); it->Next() )
{
_PTR(SComponent) aComponent ( it->Value() );
- if( aComponent && aComponent->ComponentDataType() == "Interface Applicative" )
- continue; // skip the magic "Interface Applicative" component
- comps.append( aComponent->ComponentDataType().c_str() );
+ if ( aComponent && comp == aComponent->ComponentDataType().c_str() )
+ e = aComponent->GetID().c_str();
}
+ return e;
}
/*!
{
std::vector<int> v;
- _PTR(SObject) so = studyDS()->FindComponent("Interface Applicative");
+ _PTR(SObject) so = studyDS()->FindComponent( getVisualComponentName().toLatin1().constData() );
if(!so) return v;
_PTR(StudyBuilder) builder = studyDS()->NewBuilder();
void SalomeApp_Study::removeSavePoint(int savePoint)
{
if(savePoint <= 0) return;
- _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+ _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
_PTR(SObject) so = AP->GetSObject();
_PTR(StudyBuilder) builder = studyDS()->NewBuilder();
builder->RemoveObjectWithChildren(so);
*/
QString SalomeApp_Study::getNameOfSavePoint(int savePoint)
{
- _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+ _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
_PTR(IParameters) ip = ClientFactory::getIParameters(AP);
return ip->getProperty("AP_SAVEPOINT_NAME").c_str();
}
*/
void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint)
{
- _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+ _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
_PTR(IParameters) ip = ClientFactory::getIParameters(AP);
ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.toStdString());
}
-/*!
- \return a name of the component where visual parameters are stored
-*/
-std::string SalomeApp_Study::getVisualComponentName()
-{
- return "Interface Applicative";
-}
-
/*!
* \brief Restores the study state
*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_STUDY_H
#define SALOMEAPP_STUDY_H
{
Q_OBJECT
+ class Observer_i;
+
public:
SalomeApp_Study( SUIT_Application* );
virtual ~SalomeApp_Study();
virtual int id() const;
+ virtual QString studyName() const;
virtual bool createDocument( const QString& );
virtual bool openDocument( const QString& );
virtual void closeDocument(bool permanently = true);
+ virtual bool dump( const QString&, bool, bool, bool );
+
virtual bool isSaved() const;
virtual bool isModified() const;
virtual void Modified();
virtual bool isComponent( const QString& ) const;
virtual void children( const QString&, QStringList& ) const;
virtual void components( QStringList& ) const;
+ virtual QString centry( const QString& ) const;
std::vector<int> getSavePoints();
void removeSavePoint(int savePoint);
QString getNameOfSavePoint(int savePoint);
void setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
- virtual std::string getVisualComponentName();
virtual void restoreState(int savePoint);
void markAsSavedIn(QString theFileName);
+ virtual LightApp_DataObject* findObjectByEntry( const QString& theEntry );
+
protected:
virtual void saveModuleData ( QString theModuleName, QStringList theListOfFiles );
virtual void openModuleData ( QString theModuleName, QStringList& theListOfFiles );
virtual void dataModelInserted( const CAM_DataModel* );
virtual bool openDataModel( const QString&, CAM_DataModel* );
void setStudyDS(const _PTR(Study)& s );
-
+ virtual CAM_ModuleObject* createModuleObject( LightApp_DataModel* theDataModel,
+ SUIT_DataObject* theParent ) const;
protected slots:
virtual void updateModelRoot( const CAM_DataModel* );
private:
_PTR(Study) myStudyDS;
+ Observer_i* myObserver;
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME SalomeApp
// File : SalomeApp_StudyPropertiesDlg.cxx
-// Author : Sergey ANIKIN
-// Module : SALOME
-// $Header$
-//
+// Author : Roman NIKOLAEV
+
#include "SalomeApp_StudyPropertiesDlg.h"
-#include "SalomeApp_ListView.h"
#include "SalomeApp_Study.h"
#include "SUIT_Session.h"
// QT Includes
#include <QPushButton>
#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QFrame>
+#include <QLineEdit>
+#include <QLabel>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QTextEdit>
+#include <QTreeWidget>
+#include <QPushButton>
-using namespace std;
-
+#include <iostream>
+
#define DEFAULT_MARGIN 11
-#define DEFAULT_SPACING 6
+#define DEFAULT_SPACING 6
#define SPACER_SIZE 5
#define MIN_LIST_WIDTH 300
#define MIN_LIST_HEIGHT 150
-class SalomeApp_PropItem : public SalomeApp_ListViewItem
-{
-public:
- /*! constructor */
- SalomeApp_PropItem(SalomeApp_ListView* parent,
- const QString theName,
- const bool theEditable,
- const int theUserType) :
- SalomeApp_ListViewItem( parent, QStringList(theName), theEditable )
- {
- setUserType(theUserType);
- }
- /*! constructor */
- SalomeApp_PropItem(SalomeApp_ListView* parent,
- SalomeApp_ListViewItem* after,
- const QString theName,
- const bool theEditable,
- const int theUserType) :
- SalomeApp_ListViewItem( parent, after, theName, theEditable )
- {
- setUserType(theUserType);
- }
- /*! fills widget with initial values (list or single value)*/
- void fillWidgetWithValues( SalomeApp_EntityEdit* theWidget )
- {
- QStringList list;
- switch(getUserType()) {
- //case SalomeApp_StudyPropertiesDlg::prpModeId:
- // {
- // list << SalomeApp_StudyPropertiesDlg::tr("PRP_MODE_FROM_SCRATCH") <<
- // SalomeApp_StudyPropertiesDlg::tr("PRP_MODE_FROM_COPYFROM");
- // theWidget->insertList(list);
- // break;
- // }
- case SalomeApp_StudyPropertiesDlg::prpLockedId:
- {
- list << SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) << SalomeApp_StudyPropertiesDlg::tr( "PRP_YES" );
- theWidget->insertList(list, getValue() == SalomeApp_StudyPropertiesDlg::tr( "PRP_NO" ) ? 0 : 1 );
- break;
- }
- case SalomeApp_StudyPropertiesDlg::prpModificationsId:
- {
- SalomeApp_Study* study =
- dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
- if (study) {
- _PTR(Study) studyDoc = study->studyDS();
- _PTR(AttributeStudyProperties) propAttr;
- if ( studyDoc ) {
- propAttr = studyDoc->GetProperties();
- if ( propAttr ) {
- std::vector<std::string> aUsers;
- std::vector<int> aMins, aHours, aDays, aMonths, aYears;
- propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false);
- int aCnt = aUsers.size();
- for ( int i = 0; i < aCnt; i++ ) {
- QString val;
- val.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d",
- aDays [i],
- aMonths[i],
- aYears [i],
- aHours [i],
- aMins [i]);
- val = val + " : " + QString( aUsers[i].c_str() );
- list.prepend(val);
- }
- theWidget->setDuplicatesEnabled(true);
- theWidget->insertList(list);
- }
- }
- }
- break;
- }
- default:
- {
- SalomeApp_ListViewItem::fillWidgetWithValues(theWidget);
- break;
- }
- }
- }
- /*! finishes editing of entity */
- virtual UpdateType finishEditing( SalomeApp_EntityEdit* theWidget ) {
- if ( getUserType() == SalomeApp_StudyPropertiesDlg::prpModificationsId )
- return utCancel;
- else
- return SalomeApp_ListViewItem::finishEditing(theWidget);
- }
-};
/*!Constructor. Initialize study properties dialog.*/
SalomeApp_StudyPropertiesDlg::SalomeApp_StudyPropertiesDlg(QWidget* parent)
- : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
- myChanged( false )
+ : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
+ myIsChanged(false)
{
- setObjectName( "" );
setModal( TRUE );
setWindowTitle(tr("TLT_STUDY_PROPERTIES"));
setSizeGripEnabled( true );
- setWindowFlags( windowFlags() ^ QFlags<Qt::WindowType>(!Qt::WindowContextHelpButtonHint) );
-
- QGridLayout* mainLayout = new QGridLayout(this);
- mainLayout->setMargin(DEFAULT_MARGIN);
- mainLayout->setSpacing(DEFAULT_SPACING);
-
- myPropList = new SalomeApp_ListView(this);
- myPropList->setColumnCount(2);
- QStringList aLabels;
- aLabels << "" << "";
- myPropList->setHeaderLabels( aLabels );
- myPropList->enableEditing(TRUE);
- myPropList->setMinimumSize(MIN_LIST_WIDTH, MIN_LIST_HEIGHT);
- mainLayout->addWidget(myPropList, 0, 0, 1, 3);
-
- myOKBtn = new QPushButton(tr("BUT_OK"), this);
- mainLayout->addWidget(myOKBtn, 1, 0);
-
- myCancelBtn = new QPushButton(tr("BUT_CANCEL"), this);
- mainLayout->addWidget(myCancelBtn, 1, 2);
-
- QSpacerItem* spacer1 =
- new QSpacerItem(SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum);
- mainLayout->addItem(spacer1, 1, 1);
+ setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint );
// Display study properties
SalomeApp_Study* study =
if (study)
myStudyDoc = study->studyDS();
- initData();
+ //Author
+ QLabel* authorLbl = new QLabel(tr("PRP_AUTHOR"),this);
+ myAuthor = new QLineEdit(this);
+
+ //Creation date
+ QLabel* dateLbl = new QLabel(tr("PRP_DATE"),this);
+ myDate = new QLabel(this);
+
+ //Locked flag
+ myLocked = new QCheckBox(tr("PRP_LOCKED"), this);
+
+ //Modification flag
+ myModification = new QLabel(this);
+
+ //Units
+ QLabel* unitsLbl = new QLabel(tr("PRP_UNITS"),this);
+ myUnits = new QComboBox(this);
+
+ //Comment
+ QLabel* commentLabel = new QLabel(tr("PRP_COMMENT"),this);
+ myComment = new QTextEdit(this);
+ myComment->setMaximumHeight(80);
- connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
- connect(myCancelBtn, SIGNAL(clicked()), this, SLOT(reject()));
+ //Modifications
+ QLabel* modificationsLabel = new QLabel(tr("PRP_MODIFICATIONS"),this);
+ myModifications = new QTreeWidget(this);
+ myModifications->setRootIsDecorated(false);
+ myModifications->setUniformRowHeights(true);
+ myModifications->setAllColumnsShowFocus(true);
+ myModifications->setColumnCount(2);
+ myModifications->setMaximumHeight(80);
+ QStringList columnNames;
+ columnNames.append(tr("PRP_AUTHOR"));
+ columnNames.append(tr("PRP_DATE_MODIF"));
+
+ QTreeWidgetItem * headerItem = new QTreeWidgetItem(columnNames);
+ myModifications->setHeaderItem ( headerItem );
+
+ QFrame* buttonFrame = new QFrame(this);
+
+ QHBoxLayout* horizontalLayout = new QHBoxLayout(buttonFrame);
+
+ myOkButton = new QPushButton(tr("BUT_OK"), buttonFrame);
+ myCancelButton = new QPushButton(tr("BUT_CANCEL"), buttonFrame);
+
+ horizontalLayout->addWidget(myOkButton);
+ horizontalLayout->addItem( new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum) );
+ horizontalLayout->addWidget(myCancelButton);
+
+ QGridLayout* gridLayout = new QGridLayout(this);
+ gridLayout->setMargin(DEFAULT_MARGIN);
+ gridLayout->setSpacing(DEFAULT_SPACING);
+ gridLayout->addWidget(authorLbl, 0, 0, 1, 1);
+ gridLayout->addWidget(myAuthor, 0, 1, 1, 1);
+ gridLayout->addWidget(dateLbl, 1, 0, 1, 1);
+ gridLayout->addWidget(myDate, 1, 1, 1, 1);
+ gridLayout->addWidget(myLocked, 2, 0, 1, 1);
+ gridLayout->addWidget(myModification, 2, 1, 1, 1);
+ gridLayout->addWidget(unitsLbl, 3, 0, 1, 1);
+ gridLayout->addWidget(myUnits, 3, 1, 1, 1);
+ gridLayout->addItem(new QSpacerItem(/*72*/0, 0/*20*/, QSizePolicy::Expanding, QSizePolicy::Minimum), 3, 2, 1, 1);
+ gridLayout->addWidget(commentLabel, 4, 0, 1, 1);
+ gridLayout->addWidget(myComment, 4, 1, 1, 2);
+ gridLayout->addWidget(modificationsLabel, 5, 0, 1, 1);
+ gridLayout->addWidget(myModifications, 5, 1, 1, 2);
+ gridLayout->addWidget(buttonFrame, 6, 0, 1, 3);
+
+ connect(myOkButton, SIGNAL(clicked()), this, SLOT(clickOnOk()));
+ connect(myCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
+
+ initData();
}
/*!
if (hasData)
propAttr = myStudyDoc->GetProperties();
hasData = hasData && propAttr;
-
- // Study author's name
- SalomeApp_PropItem* item = new SalomeApp_PropItem(myPropList, tr("PRP_AUTHOR")+":", true, prpAuthorId);
- if (hasData)
- item->setValue(propAttr->GetUserName().c_str());
-
- // Date of creation
- item = new SalomeApp_PropItem(myPropList, item, tr("PRP_DATE")+":", false, prpDateId);
+
if (hasData) {
+ //Creator and creation date
+ myAuthor->setText(propAttr->GetUserName().c_str());
int minutes, hours, day, month, year;
if (propAttr->GetCreationDate(minutes, hours, day, month, year)) {
QString strDate;
strDate.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", day, month, year, hours, minutes);
- item->setValue(strDate);
+ myDate->setText(strDate);
+ }
+
+ //Is Locked?
+ myLocked->setChecked(propAttr->IsLocked());
+
+ //Is Modified?
+ bool isModified = false;
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>
+ (SUIT_Session::session()->activeApplication()->activeStudy());
+ if (study) {
+ isModified = study->isModified();
+ if (hasData) {
+ if (propAttr->IsModified() != isModified) {
+ propAttr->SetModified((int)isModified);
+ }
+ }
}
- }
- // Creation mode
-// item = new SalomeApp_PropItem(myPropList, item, tr("PRP_MODE")+":", true, prpModeId);
-// item->setEditingType( SalomeApp_EntityEdit::etComboBox);
-// if (hasData) item->setValue(propAttr->GetCreationMode());
+ QString modif = propAttr->IsModified() ? tr( "PRP_MODIFIED" ) : tr( "PRP_NOT_MODIFIED" );
+ myModification->setText(modif);
+
+ //Units
+ QStringList theList;
+ theList <<""<<"mm"<<"cm"<<"m"<<"km"<<"inch";
+ myUnits->insertItems(0,theList);
- // Locked or not
- item = new SalomeApp_PropItem(myPropList, item, tr("PRP_LOCKED")+":", true, prpLockedId);
- item->setEditingType( SalomeApp_EntityEdit::etComboBox);
- if ( hasData )
- item->setValue( tr( propAttr->IsLocked() ? "PRP_YES" : "PRP_NO" ) );
+ QString anUnit = propAttr->GetUnits().c_str();
- // Saved or not
- item = new SalomeApp_PropItem(myPropList, item, tr("PRP_MODIFIED")+":", false, prpSavedId);
- bool isModified = false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>
- (SUIT_Session::session()->activeApplication()->activeStudy());
- if (study) {
- isModified = study->isModified();
- if (hasData) {
- if (propAttr->IsModified() != isModified) {
- propAttr->SetModified((int)isModified);
+ int aFound = -1;
+ for (int i = 0; i < myUnits->count(); i++) {
+ if ( myUnits->itemText(i) == anUnit ) {
+ aFound = i;
+ break;
}
}
- }
- if (hasData) {
- if (propAttr->IsModified())
- item->setValue( tr( "PRP_YES" ) );
- else
- item->setValue( tr( "PRP_NO" ) );
- }
-
- // Modifications list
- item = new SalomeApp_PropItem(myPropList, item, tr("PRP_MODIFICATIONS")+":", true, prpModificationsId);
- item->setEditingType( SalomeApp_EntityEdit::etComboBox);
- if (hasData) {
+
+ if (aFound >= 0) {
+ myUnits->setCurrentIndex(aFound);
+ }
+
+ //Comments
+ myComment->setPlainText(propAttr->GetComment().c_str());
+
+ //Modifications
std::vector<std::string> aUsers;
- std::vector<int> aMins, aHours, aDays, aMonths, aYears;
+ std::vector<int> aMins, aHours, aDays, aMonths, aYears;
propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false);
- int aLast = aUsers.size()-1;
- if (aLast >= 0) {
- QString val;
- val.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d",
- aDays [aLast],
- aMonths[aLast],
- aYears [aLast],
- aHours [aLast],
- aMins [aLast]);
- val = val + " : " + QString(aUsers[aUsers.size()-1].c_str());
- item->setValue(val);
- }
+ int aCnt = aUsers.size();
+ for ( int i = 0; i < aCnt; i++ ) {
+ QString date;
+ date.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d",
+ aDays [i],
+ aMonths[i],
+ aYears [i],
+ aHours [i],
+ aMins [i]);
+ QStringList aList;
+ aList.append(aUsers[i].c_str());
+ aList.append(date);
+ QTreeWidgetItem* item = new QTreeWidgetItem(aList);
+ myModifications->addTopLevelItem(item);
+ }
}
-
- myOKBtn->setEnabled(hasData);
-}
-
-/*!
- accept data. Return true.
-*/
-bool SalomeApp_StudyPropertiesDlg::acceptData()
-{
- return TRUE;
+ adjustSize();
}
/*!
Fill properties attributes.
*/
-void SalomeApp_StudyPropertiesDlg::onOK()
+void SalomeApp_StudyPropertiesDlg::clickOnOk()
{
- myPropList->accept();
-
- if (acceptData()) {
- _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
- //myChanged = propChanged();
- if ( propAttr /*&& myChanged*/ ) {
- QTreeWidgetItemIterator it( myPropList );
- // iterate through all items of the listview
- while (*it) {
- SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it);
- switch (item->getUserType()) {
- case prpAuthorId:
- if (QString(propAttr->GetUserName().c_str()) != item->getValue().trimmed()) {
- if (!propAttr->IsLocked()) {
- propAttr->SetUserName(item->getValue().trimmed().toStdString());
- myChanged = true;
- } else {
- SUIT_MessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
- }
- }
- break;
- //case prpModeId:
- // propAttr->SetCreationMode(item->getValue().trimmed().latin1());
- // break;
- case prpLockedId:
- {
- bool bLocked = item->getValue().compare(tr("PRP_YES")) == 0;
- if (propAttr->IsLocked() != bLocked) {
- propAttr->SetLocked(bLocked);
- myChanged = true;
- }
- }
- break;
- default:
- break;
- }
- ++it;
+ _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
+ //Firstly, store locked flag
+ if(propAttr) {
+ bool bLocked = myLocked->isChecked();
+ if (propAttr->IsLocked() != bLocked) {
+ propAttr->SetLocked(bLocked);
+ myIsChanged = true;
+ }
+
+ bool needWarning = false;
+
+ //Author
+ if (QString(propAttr->GetUserName().c_str()) != myAuthor->text().trimmed()) {
+ if(!propAttr->IsLocked()) {
+ propAttr->SetUserName(myAuthor->text().trimmed().toStdString());
+ myIsChanged = true;
+ } else {
+ needWarning = true;
}
}
- accept();
- }
-}
-
-/*!
- Check is properties changed?
-*/
-bool SalomeApp_StudyPropertiesDlg::propChanged()
-{
- _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties();
- if (propAttr) {
- QTreeWidgetItemIterator it (myPropList);
- // iterate through all items of the listview
- while (*it) {
- SalomeApp_PropItem* item = (SalomeApp_PropItem*)(*it);
- switch (item->getUserType()) {
- case prpAuthorId:
- if ( QString( propAttr->GetUserName().c_str() ) != item->getValue().trimmed() ) {
- return true;
- }
- break;
- //case prpModeId:
- // if ( QString( propAttr->GetCreationMode().c_str() ) != item->getValue().trimmed() ) {
- // return true;
- // }
- // break;
- case prpLockedId:
- {
- bool bLocked = item->getValue().compare( tr( "PRP_YES" ) ) == 0;
- if ( propAttr->IsLocked() != bLocked ) {
- return true;
- }
- break;
- }
- default:
- break;
+ //Unit
+ if (QString(propAttr->GetUnits().c_str()) != myUnits->currentText()) {
+ if(!propAttr->IsLocked()) {
+ propAttr->SetUnits(myUnits->currentText().toStdString());
+ myIsChanged = true;
+ } else {
+ needWarning = true;
}
- ++it;
}
+
+ //Comment
+ if (QString(propAttr->GetComment().c_str()) != myComment->toPlainText()) {
+ if(!propAttr->IsLocked()) {
+ propAttr->SetComment(myComment->toPlainText().toStdString());
+ myIsChanged = true;
+ } else {
+ needWarning = true;
+ }
+ }
+
+ if(needWarning) {
+ SUIT_MessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED") );
+ }
+
+ accept();
}
- return false;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SalomeApp_StudyPropertiesDlg.h
-// Author : Sergey ANIKIN
+// Author : Roman NIKOLAEV
// Module : SALOME
//
#ifndef SALOMEAPP_STUDY_PROPERTIES_DLG_H
#include <SALOMEDSClient_Study.hxx>
-class SalomeApp_ListView;
+class QLineEdit;
+class QLabel;
+class QCheckBox;
+class QComboBox;
+class QTextEdit;
+class QTreeWidget;
class QPushButton;
class SALOMEAPP_EXPORT SalomeApp_StudyPropertiesDlg : public QDialog
{
Q_OBJECT
-
-public:
- enum {
- prpAuthorId,
- prpModeId,
- prpDateId,
- prpSavedId,
- prpLockedId,
- prpModificationsId,
- prpLastId
- };
-
public:
SalomeApp_StudyPropertiesDlg( QWidget* parent = 0 );
~SalomeApp_StudyPropertiesDlg();
- bool isChanged() { return myChanged; }
-
+ bool isChanged() { return myIsChanged; }
+
public slots:
- void onOK();
-
+ void clickOnOk();
+
private:
- void initData();
- bool acceptData();
- bool propChanged();
+ void initData();
private:
- SalomeApp_ListView* myPropList;
- QPushButton* myOKBtn;
- QPushButton* myCancelBtn;
- bool myChanged;
-
- _PTR(Study) myStudyDoc;
+ _PTR(Study) myStudyDoc;
+ bool myIsChanged;
+ QLineEdit* myAuthor;
+ QLabel* myDate;
+ QCheckBox* myLocked;
+ QLabel* myModification;
+ QComboBox* myUnits;
+ QTextEdit* myComment;
+ QTreeWidget* myModifications;
+ QPushButton* myOkButton;
+ QPushButton* myCancelButton;
};
#endif // SALOMEAPP_STUDY_PROPERTIES_DLG_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_Tools.h"
#include <SUIT_Session.h>
*/
Quantity_Color SalomeApp_Tools::color( const QColor& c )
{
- Quantity_Color aColor;
- if ( c.isValid() )
- aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
- return aColor;
+ Quantity_Color aColor;
+ if ( c.isValid() )
+ aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
+ return aColor;
}
/*!
*/
QColor SalomeApp_Tools::color( const Quantity_Color& c )
{
- return QColor( (int)( c.Red() * 255 ), (int)( c.Green() * 255 ), (int)( c.Blue() * 255 ) );
+ return QColor( (int)( c.Red() * 255 ), (int)( c.Green() * 255 ), (int)( c.Blue() * 255 ) );
}
/*!
case SALOME::COMM:
case SALOME::INTERNAL_ERROR:
{
- message = QString( S_ex.details.text );
- QString source( S_ex.details.sourceFile );
- QString line;
- line.setNum( S_ex.details.lineNumber );
- message = message + " \n" + source + " : " + line;
+ message = QString( S_ex.details.text );
+ QString source( S_ex.details.sourceFile );
+ QString line;
+ line.setNum( S_ex.details.lineNumber );
+ message = message + " \n" + source + " : " + line;
break;
}
case SALOME::BAD_PARAM:
{
- message = QString( S_ex.details.text );
+ message = QString( S_ex.details.text );
#ifdef _DEBUG_
- QString source( S_ex.details.sourceFile );
- QString line;
- line.setNum( S_ex.details.lineNumber );
- message = message + " \n" + source + " : " + line;
+ QString source( S_ex.details.sourceFile );
+ QString line;
+ line.setNum( S_ex.details.lineNumber );
+ message = message + " \n" + source + " : " + line;
#endif
- break;
+ break;
}
default:
{
- message = QString( "SALOME CORBA Exception Type invalid" );
- QString source( S_ex.details.sourceFile );
- QString line;
- line.setNum( S_ex.details.lineNumber );
- message = message + " \n" + source + " : " + line;
- break;
+ message = QString( "SALOME CORBA Exception Type invalid" );
+ QString source( S_ex.details.sourceFile );
+ QString line;
+ line.setNum( S_ex.details.lineNumber );
+ message = message + " \n" + source + " : " + line;
+ break;
}
}
return message;
case SALOME::BAD_PARAM:
error = false;
title = QObject::tr( "Engine Warning" );
- break;
+ break;
default:
title = QObject::tr( "Internal SALOME Error" );
break;
if ( error )
SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
- title, message );
+ title, message );
else
SUIT_MessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(),
- title, message );
+ title, message );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_TOOLS_H
#define SALOMEAPP_TOOLS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_TypeFilter.h"
#include "LightApp_DataOwner.h"
_PTR(SObject) aSObj( aStudy->FindObjectID( entry.toStdString() ) );
if (aSObj)
- {
- _PTR(SComponent) aComponent(aSObj->GetFatherComponent());
- if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) )
- return true;
- }
+ {
+ _PTR(SComponent) aComponent(aSObj->GetFatherComponent());
+ if ( aComponent && (aComponent->ComponentDataType() == myKind.toStdString()) )
+ return true;
+ }
}
return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_TYPEFILTER_H
#define SALOMEAPP_TYPEFILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "SalomeApp_VisualState.h"
#include "SalomeApp_Module.h"
#include <vector>//?
#include <string>//?
+#include <cstdio>
/*!
Constructor.
: QObject(),
myApp( app )
{
-}
+}
/*!
Destructor.
Sets names of all view windows in given list. This is used
in order to apply the same naming algorithm when saving and restoring
view windows. Names of view windows must be the same before saving
- workstack (splitters) information, and before its restoring!
+ workstack (splitters) information, and before its restoring!
Naming rule: ViewerType_IndexOfViewerOfThisType_IndexOfViewInThisViewer
VTKViewer_0_0
OCCViewer_0_0 OCCViewer_0_1 OCCViewer_0_2
*/
void nameViewWindows( const ViewManagerList& lst )
{
- QMultiHash<QString,int> viewersCounter; // map viewerType - to - index_of_this_viewer_type
- QListIterator<SUIT_ViewManager*> it(lst);
- SUIT_ViewManager* aVM = 0;
- while ( it.hasNext() ) {
- aVM = it.next();
- if ( !aVM ) continue;
+ QMap<QString, int> viewersCounter;
+ for ( QList<SUIT_ViewManager*>::const_iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ SUIT_ViewManager* aVM = *it;
+ if ( !aVM )
+ continue;
int view_count = aVM->getViewsCount();
QString vType = aVM->getType();
if ( !view_count )
continue; //No views is opened in the viewer
-
- int viewerID = viewersCounter.value( vType );
- if ( !viewerID ) {
- viewerID = 0;
- viewersCounter.insert( vType, viewerID );
- }
- else
- ++viewerID;
+
+ if ( !viewersCounter.contains( vType ) )
+ viewersCounter.insert( vType, 0 );
+
+ int& viewerID = viewersCounter[vType];
QVector<SUIT_ViewWindow*> views = aVM->getViews();
- for ( int i = 0; i < view_count; i++ ) {
+ for ( int i = 0; i < view_count; i++ )
+ {
QString vName = QString( "%1_%2_%3" ).arg( vType ).arg( viewerID ).arg( i );
views[i]->setObjectName( vName );
}
+ viewerID++;
}
- viewersCounter.clear();
}
/*!
if ( !study )
return -1;
+ // unlock study if it is locked
+ bool aLocked = study->studyDS()->GetProperties()->IsLocked();
+ if (aLocked) study->studyDS()->GetProperties()->SetLocked(false);
+
int savePoint = 1;
std::vector<int> savePoints = study->getSavePoints();
//Calculate a new savePoint number = the last save point number + 1
- if ( savePoints.size() > 0)
+ if ( savePoints.size() > 0)
savePoint = savePoints[savePoints.size()-1] + 1;
- _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
+ _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(),
+ savePoint );
_PTR(IParameters) ip = ClientFactory::getIParameters( ap );
ViewManagerList lst;
myApp->viewManagers( lst );
- // setting unique names for view windows in order to save this view inside
+ // setting unique names for view windows in order to save this view inside
// workstack's structure (see below). On restore the views with the same names will
// be placed to the same place inside the workstack's splitters.
nameViewWindows( lst );
// store active window's name
- SUIT_ViewWindow* win = myApp->desktop()->activeWindow();
+ SUIT_ViewWindow* win = myApp->desktop()->activeWindow();
if ( win )
ip->setProperty("AP_ACTIVE_VIEW", win->objectName().toStdString() );
if ( !vm ) continue;
int view_count = vm->getViewsCount();
- if ( !view_count )
+ if ( !view_count )
continue; //No views is opened in the viewer
-
+
std::string viewerEntry = QString( "%1_%2" ).arg( vm->getType() ).arg( ++viewerID ).toStdString();
ip->append("AP_VIEWERS_LIST", viewerEntry);
-
+
QVector<SUIT_ViewWindow*> views = vm->getViews();
for(int i = 0; i<view_count; i++) {
ip->append( viewerEntry, views[i]->windowTitle().toStdString() );
}
//Save information about split areas
- if ( myApp->desktop()->inherits( "STD_TabDesktop" ) ) {
- QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
+ if ( myApp->desktop()->inherits( "STD_TabDesktop" ) )
+ {
QString workstackInfo;
- (*workstack) >> workstackInfo;
- ip->setProperty( "AP_WORKSTACK_INFO", workstackInfo.toStdString() );
+ QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
+ QByteArray geomState = workstack->saveState( 0 );
+ ip->setProperty( "AP_WORKSTACK_INFO", QString( geomState.toHex() ).toStdString() );
}
-
+
//Save a name of the active module
- if ( CAM_Module* activeModule = myApp->activeModule() )
+ if ( CAM_Module* activeModule = myApp->activeModule() )
ip->setProperty( "AP_ACTIVE_MODULE", activeModule->moduleName().toStdString() );
//Store visual parameters of the modules
- QList<CAM_Module*> mlist;
+ QList<CAM_Module*> mlist;
myApp->modules( mlist );
QListIterator<CAM_Module*> itM( mlist );
CAM_Module* module = 0;
// set default name of new savePoint
study->setNameOfSavePoint( savePoint, QObject::tr( "SAVE_POINT_DEF_NAME" ) + QString::number( savePoint ) );
-
+
+ if (aLocked) study->studyDS()->GetProperties()->SetLocked(true);
+
return savePoint;
}
if ( !study )
return;
- _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
+ _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(),
+ savePoint );
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
qApp->installEventFilter( this );
//Remove all already existent veiwers and their views
- ViewManagerList lst;
- myApp->viewManagers( lst );
- QListIterator<SUIT_ViewManager*> it(lst);
- while ( it.hasNext() ) {
- myApp->removeViewManager( it.next() );
- qApp->processEvents();
- }
+ //myApp->clearViewManagers();
+ myApp->clearKnownViewManagers();
+
//Restore the viewers and view windows
int nbViewers = ip->nbValues( "AP_VIEWERS_LIST" );
SUIT_ViewWindow* viewWin = 0;
// parameters of view windows are stored in a map for restoring after restoring of the workstack
QMap<SUIT_ViewWindow*, QString> viewersParameters;
-
- for ( int i = 0; i < nbViewers; i++ ) {
+
+ for ( int i = 0; i < nbViewers; i++ )
+ {
std::string viewerEntry = ip->getValue( "AP_VIEWERS_LIST", i );
std::vector<std::string> veiewerParams = ip->parseValue(viewerEntry,'_');
std::string type = veiewerParams[0];
std::string viewerID = veiewerParams[1];
SUIT_ViewManager* vm = myApp->newViewManager( type.c_str() );
- if ( !vm )
+ if ( !vm )
continue; //Unknown viewer
-
+
int nbViews = (ip->nbValues(viewerEntry))/2;
-
+
//Create nbViews-1 view (-1 because 1 view is created by createViewManager)
- for ( int i = 1; i< nbViews; i++ ) {
+ for ( int i = 1; i< nbViews; i++ )
+ {
SUIT_ViewWindow* aView = vm->createViewWindow();
aView->show();
}
int viewCount = vm->getViewsCount();
- if (viewCount != nbViews) {
+ if ( viewCount != nbViews )
+ {
printf( "\nRestore visual state: Unknow error, Can't create a view!\n" );
continue;
}
//Resize the views, set their captions and apply visual parameters.
- QVector<SUIT_ViewWindow*> views = vm->getViews();
- for (int i = 0, j = 0; i<viewCount; i++, j+=2) {
+ QVector<SUIT_ViewWindow*> views = vm->getViews();
+ for ( int i = 0, j = 0; i<viewCount; i++, j+=2 )
+ {
viewWin = views[i];
- if ( !viewWin )
- continue;
+ if ( !viewWin )
+ continue;
// wait untill the window is really shown. This step fixes MANY bugs..
- while ( !vm->isVisible() )
- qApp->processEvents();
-
- viewWin->setWindowTitle(ip->getValue(viewerEntry, j).c_str());
-
+ // while ( !vm->isVisible() )
+ // qApp->processEvents();
+
+ viewWin->setWindowTitle( ip->getValue( viewerEntry, j ).c_str() );
+
// printf ( "VP for viewWin \"%s\": %s\n", viewerEntry.c_str(), ip->getValue(viewerEntry, j+1).c_str() );
- viewersParameters[ viewWin ] = ip->getValue(viewerEntry, j+1).c_str();
+ viewersParameters[ viewWin ] = ip->getValue( viewerEntry, j + 1 ).c_str();
//viewWin->setVisualParameters(ip->getValue(viewerEntry, j+1).c_str());
}
}
// restore modules' visual parameters
- std::vector<std::string> v = ip->getValues("AP_MODULES_LIST");
- for ( int i = 0; i < v.size(); i++ ) {
+ std::vector<std::string> v = ip->getValues( "AP_MODULES_LIST" );
+ for ( int i = 0; i < v.size(); i++ )
+ {
myApp->activateModule( v[i].c_str() );
if ( SalomeApp_Module* module = dynamic_cast<SalomeApp_Module*>( myApp->activeModule() ) )
module->restoreVisualParameters( savePoint );
// new view windows may have been created in module->restoreVisualParameters() [GAUSS]
// so here we store their visual parameters for later restoring..
- lst.clear();
- myApp->viewManagers(lst);
- QListIterator<SUIT_ViewManager*> itVM( lst );
- SUIT_ViewManager* aVM = 0;
- while ( itVM.hasNext() ) {
- aVM = itVM.next();
- if ( !aVM ) continue;
+ QList<SUIT_ViewManager*> lst;
+ myApp->viewManagers( lst );
+ for ( QList<SUIT_ViewManager*>::iterator itVM = lst.begin(); itVM != lst.end(); ++itVM )
+ {
+ SUIT_ViewManager* aVM = *itVM;
+ if ( !aVM )
+ continue;
int view_count = aVM->getViewsCount();
QVector<SUIT_ViewWindow*> views = aVM->getViews();
- for ( int i = 0; i < view_count; i++ ) {
- if ( !viewersParameters.contains( views[i] ) ) {
- viewersParameters[ views[i] ] = views[i]->getVisualParameters();
- // printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().toLatin1().constData() );
+ for ( int i = 0; i < view_count; i++ )
+ {
+ if ( !viewersParameters.contains( views[i] ) )
+ {
+ viewersParameters[ views[i] ] = views[i]->getVisualParameters();
+ // printf ( "store VP for viewWin \"%s\": %s\n", views[i]->name(), views[i]->getVisualParameters().toLatin1().constData() );
}
}
- }
+ }
// activate module that was active on save
QString activeModuleName( ip->getProperty("AP_ACTIVE_MODULE" ).c_str() );
- if ( !activeModuleName.isEmpty() )
+ if ( !activeModuleName.isEmpty() )
myApp->activateModule( activeModuleName );
- // setting unique names for view windows in order to restore positions of view windows inside
- // workstack's structure (see below). During save the same naming algorithm was used,
+ // setting unique names for view windows in order to restore positions of view windows inside
+ // workstack's structure (see below). During save the same naming algorithm was used,
// so the same views will get the same names.
nameViewWindows( lst );
+ qApp->processEvents();
+
// restore workstack parameters. should be done after module's restoreVisualParameters(), because
// some modules can create their own viewers (like VISU creates GaussViewers)
- if ( myApp->desktop()->inherits( "STD_TabDesktop" ) ) {
+ if ( myApp->desktop()->inherits( "STD_TabDesktop" ) )
+ {
QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
- (*workstack) << ip->getProperty( "AP_WORKSTACK_INFO" ).c_str();
+ workstack->restoreState( QByteArray::fromHex( QByteArray( ip->getProperty( "AP_WORKSTACK_INFO" ).c_str() ) ), 0 );
}
// restore visual parameters of view windows. it must be done AFTER restoring workstack.
}
qApp->removeEventFilter( this );
-
+
// for ( it.toFirst(); it.current(); ++it ) {
// int view_count = it.current()->getViewsCount();
// QPtrVector<SUIT_ViewWindow> views = it.current()->getViews();
// QPtrVector<SUIT_ViewWindow> views = it.current()->getViews();
// for ( int i = 0; i < view_count; i++ ) {
// if ( activeViewName == views[i]->name() )
- // views[i]->setFocus();
+ // views[i]->setFocus();
// }
// }
}
aType == QEvent::KeyPress ||
aType == QEvent::KeyRelease )
return true;
-
+
return QObject::eventFilter( o, e );
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef SALOMEAPP_VISUALSTATE_H
#define SALOMEAPP_VISUALSTATE_H
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOMELocalTrace : log on local machine
# File : Makefile.in
# Author : Sergey RUIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include "SalomeAppTest.hxx"
-using namespace std;
+#include "SalomeAppTest.hxx"
// ============================================================================
/*!
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _SalomeAppTEST_HXX_
#define _SalomeAppTEST_HXX_
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// --- include all SalomeApp Test from basics until the present directory
//
#include "SalomeAppTest.hxx"
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# -*- coding: iso-8859-1 -*-
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
import sys, os,signal,string,commands
import runSalome
import orbmodule
+# 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
+#
+
[language]
language = en
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ 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
-->
<document>
+ <!-- import LightApp.xml file -->
+ <import name="LightApp"/>
<section name="launch">
<!-- SALOME launching parameters -->
- <parameter name="gui" value="yes"/>
- <parameter name="splash" value="yes"/>
- <parameter name="file" value="no"/>
- <parameter name="key" value="no"/>
- <parameter name="interp" value="no"/>
<parameter name="logger" value="no"/>
<parameter name="xterm" value="no"/>
<parameter name="portkill" value="no"/>
<parameter name="killall" value="no"/>
<parameter name="pinter" value="no"/>
<parameter name="noexcepthandler" value="no"/>
- <parameter name="modules" value="GEOM,SMESH,VISU,MED,YACS"/>
+ <parameter name="modules" value="GEOM,SMESH,VISU,MED,YACS,PARAVIS"/>
<parameter name="pyModules" value=""/>
<parameter name="embedded" value="SalomeAppEngine,study,cppContainer,registry,moduleCatalog"/>
<parameter name="standalone" value="pyContainer,supervContainer"/>
</section>
<section name="language">
<!-- Language settings (resource manager)-->
- <parameter name="language" value="en"/>
<parameter name="translators" value="%P_msg_%L.qm|%PM_msg_%L.qm|%P_icons.qm|%P_images.qm|%PM_images.qm"/>
</section>
- <section name="splash" >
- <!-- Splash screen settings -->
- <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="#eeeeff|#555555" />
- <parameter name="hide_on_click" value="no" />
- <parameter name="show_progress" value="yes" />
- <parameter name="show_message" value="yes" />
- <parameter name="show_percents" value="yes" />
- <parameter name="margin" value="40" />
- <parameter name="progress_width" value="20" />
- <parameter name="progress_flags" value="bottom,left_to_right" />
- <parameter name="opacity" value="0.70" />
- <parameter name="font" value="Tahoma,12,normal" />
- <parameter name="alignment" value="top,left" />
- <parameter name="progress_colors" value="#3b3e5d|#d14949|v" />
- </section>
- <section name="resources">
- <!-- Resource directories (resource manager)-->
- <parameter name="SUIT" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="STD" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="Plot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="SPlot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="GLViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="OCCViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="VTKViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="QxSceneViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="SVTK" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="PyConsole" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="LightApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="SalomeApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="OB" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="CAM" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="SUPERVGraph" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="QxGraph" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="ToolsGUI" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <!-- NETGENPlugin and GHS3DPlugin -->
- <!-- Here the environment variables are used in upper case, -->
- <!-- In SMESH/resources/SalomeApp.xml case-sensitive notation is used. -->
- <!-- As a result, both variants are acceptable. -->
- <parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
- <parameter name="GHS3DPlugin" value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
- <parameter name="BLSURFPlugin" value="${BLSURFPLUGIN_ROOT_DIR}/share/salome/resources/blsurfplugin"/>
- <parameter name="HexoticPLUGIN" value="${HexoticPLUGIN_ROOT_DIR}/share/salome/resources/hexoticplugin"/>
- <parameter name="GHS3DPRLPlugin" value="${GHS3DPRLPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dprlplugin"/>
- </section>
- <section name="SMESH">
- <!-- Default SMESH module plugins -->
- <parameter name="plugins" value="NETGENPlugin,GHS3DPlugin,GHS3DPRLPlugin,HexoticPLUGIN,BLSURFPlugin"/>
- </section>
- <section name="desktop" >
- <!-- Default GUI desktop state, position, size -->
- <parameter name="geometry" value="80%%x80%%+10%%+10%%"/>
- </section>
- <section name="Style">
- <!-- Style and theme preferences -->
- <parameter name="use_salome_style" value="true" />
- </section>
<section name="ObjectBrowser" >
<!-- Object Browser preferences -->
- <parameter name="auto_hide_search_tool" value="true" />
- <parameter name="auto_size" value="false" />
- <parameter name="auto_size_first" value="true" />
- <parameter name="resize_on_expand_item" value="false" />
- <parameter name="visibility_column_id_1" value="true" />
- <parameter name="visibility_column_id_2" value="true" />
- <parameter name="visibility_column_id_3" value="true" />
- <parameter name="visibility_column_id_4" value="true" />
- </section>
- <section name="PyConsole">
- <!-- Python console preferences -->
- <parameter name="font" value="Helvetic,12" />
- <parameter name="additional_families" value="Helvetic;Helvetica;Helvetica[Adobe];Times;Times[Adobe];Sans Serif;Serif;Monospace;Lucida"/>
+ <parameter name="visibility_column_id_1" value="false" />
+ <parameter name="visibility_column_id_2" value="false" />
+ <parameter name="visibility_column_id_3" value="false" />
+ <parameter name="visibility_column_id_4" value="false" />
</section>
- <section name="OCCViewer" >
- <!-- OCC viewer preferences -->
- <parameter name="background" value="35, 136, 145" />
- <parameter name="iso_number_u" value="1" />
- <parameter name="iso_number_v" value="1" />
- <parameter name="trihedron_size" value="100" />
- </section>
- <section name="VTKViewer" >
- <!-- VTK viewer preferences -->
- <parameter name="background" value="0, 0, 0" />
- <parameter name="trihedron_size" value="105" />
- <parameter name="relative_size" value="true" />
- <parameter name="use_advanced_selection_algorithm" value="true" />
- <parameter name="recorder_mode" value="1" />
- <parameter name="recorder_fps" value="17.3" />
- <parameter name="recorder_quality" value="100" />
- <parameter name="recorder_progressive" value="true" />
- </section>
- <section name="Plot2d" >
- <!-- Plot2d viewer preferences -->
- <parameter name="Background" value="255, 255, 255"/>
- <parameter name="CurveType" value="1" />
- <parameter name="HorScaleMode" value="0" />
- <parameter name="LegendPos" value="1" />
- <parameter name="MarkerSize" value="9" />
- <parameter name="ShowLegend" value="true" />
- <parameter name="VerScaleMode" value="0" />
- </section>
- <section name="SUPERVGraph" >
- <!-- Supervision viewer preferences -->
- <parameter name="Background" value="144, 208, 211" />
- <parameter name="Title" value="63, 213, 255" />
- <parameter name="NodeBody" value="255, 249, 147" />
- </section>
- <section name="MRU" >
- <!-- Show "Most recently used" studies-->
- <parameter name="show_mru" value="true"/>
- <!-- Max number of stored "Most recently used" studies-->
- <parameter name="max_count" value="50"/>
- <!-- Max visible number of "Most recently used" studies-->
- <parameter name="visible_count" value="7"/>
- <!-- Insert mode-->
- <parameter name="insert_mode" value="0"/>
- <!-- Link type-->
- <parameter name="link_type" value="0"/>
- <!-- Show "Clear" item-->
- <parameter name="show_clear" value="true"/>
- </section>
- <section name="QxGraph" >
- <!-- QxGraph viewer preferences -->
- <parameter name="Background" value="144, 208, 211" />
- <parameter name="Title" value="63, 213, 255" />
- <parameter name="NodeBody" value="255, 249, 147" />
- </section>
- <section name="QxSceneViewer" >
- <!-- QxGraph viewer preferences -->
- <parameter name="Background" value="144, 208, 211" />
- <parameter name="Title" value="63, 213, 255" />
- <parameter name="NodeBody" value="255, 249, 147" />
- </section>
- <section name="FileDlg" >
+ <section name="FileDlg">
<!-- "Open/Save File" dialog box preferences-->
<parameter name="QuickDirList" value="${DATA_DIR}" />
</section>
<!-- General study settings -->
<parameter name="store_positions" value="false" />
<parameter name="store_visual_state" value="false" />
- </section>
- <section name="ExternalBrowser" >
- <!-- External HELP browser settings -->
- <parameter value="D:\Program Files\Internet Explorer\iexplore.exe" name="winapplication" />
- <parameter value="/usr/bin/mozilla" name="application" />
+ <parameter name="pydump_publish" value="true" />
+ <parameter name="multi_file_dump" value="false" />
+ <parameter name="pydump_save_gui" value="true" />
</section>
</document>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
</TS>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-02-22 16:56:46 CET\n"
-"PO-Revision-Date: 2004-02-17 11:17+0300\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-//=======================================================================================
-
-msgid "BUT_NEW"
-msgstr "&New"
-
-msgid "BUT_OPEN"
-msgstr "&Open"
-
-msgid "BUT_LOAD"
-msgstr "&Load"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::PYTHON_CONSOLE"
-msgstr "Python Console"
-
-msgid "SalomeApp_Application::TOT_DESK_FILE_DUMP_STUDY"
-msgstr "Dump study"
-
-msgid "SalomeApp_Application::MEN_DESK_FILE_DUMP_STUDY"
-msgstr "&Dump Study..."
-
-msgid "SalomeApp_Application::PRP_DESK_FILE_DUMP_STUDY"
-msgstr "Dumps study to the python script"
-
-msgid "SalomeApp_Application::TOT_DESK_FILE_SAVE_GUI_STATE"
-msgstr "Save GUI state"
-
-msgid "SalomeApp_Application::MEN_DESK_FILE_SAVE_GUI_STATE"
-msgstr "Save GUI state"
-
-msgid "SalomeApp_Application::PRP_DESK_FILE_SAVE_GUI_STATE"
-msgstr "Saves current state of viewers, displayed objects, etc."
-
-msgid "SalomeApp_Application::TOT_DESK_FILE_LOAD_SCRIPT"
-msgstr "Load python script"
-
-msgid "SalomeApp_Application::MEN_DESK_FILE_LOAD_SCRIPT"
-msgstr "Load Scrip&t..."
-
-msgid "SalomeApp_Application::PRP_DESK_FILE_LOAD_SCRIPT"
-msgstr "Loads python script from file"
-
-msgid "SalomeApp_Application::TOT_FILE_DESK_PREFERENCES"
-msgstr "Preferences"
-
-msgid "SalomeApp_Application::MEN_DESK_TOOLS"
-msgstr "&Tools"
-
-msgid "SalomeApp_Application::TOT_DESK_CATALOG_GENERATOR"
-msgstr "Catalog generator"
-
-msgid "SalomeApp_Application::MEN_DESK_CATALOG_GENERATOR"
-msgstr "Catalog &Generator"
-
-msgid "SalomeApp_Application::PRP_DESK_CATALOG_GENERATOR"
-msgstr "Generates XML catalog of a component's interface"
-
-msgid "SalomeApp_Application::TOT_DESK_REGISTRY_DISPLAY"
-msgstr "Registry display"
-
-msgid "SalomeApp_Application::MEN_DESK_REGISTRY_DISPLAY"
-msgstr "Registry &Display"
-
-msgid "SalomeApp_Application::PRP_DESK_REGISTRY_DISPLAY"
-msgstr "Displays content of the Registry CORBA server"
-
-msgid "SalomeApp_Application::TOT_DESK_MRU"
-msgstr "Most recently used"
-
-msgid "SalomeApp_Application::MEN_DESK_MRU"
-msgstr "Most Recently Used"
-
-msgid "SalomeApp_Application::TOT_DESK_PROPERTIES"
-msgstr "Study properties"
-
-msgid "SalomeApp_Application::MEN_DESK_PROPERTIES"
-msgstr "Pro&perties..."
-
-msgid "SalomeApp_Application::PRP_DESK_PROPERTIES"
-msgstr "Edits study properties"
-
-msgid "SalomeApp_Application::PREF_CATEGORY_SALOME"
-msgstr "SALOME"
-
-msgid "SalomeApp_Application::PREF_TAB_OBJBROWSER"
-msgstr "Object browser"
-
-msgid "SalomeApp_Application::MEN_OPENWITH"
-msgstr "Activate %1 Module"
-
-msgid "SalomeApp_Application::MEN_DELETE_INVALID_REFERENCE"
-msgstr "Delete Invalid Reference"
-
-msgid "SalomeApp_Application::PREF_STORE_VISUAL_STATE"
-msgstr "Store/restore last GUI state"
-
-//=======================================================================================
-
-msgid "PUBLISH_IN_STUDY"
-msgstr "Publish in study"
-
-msgid "SAVE_GUI_STATE"
-msgstr "Save GUI state"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::MEN_WINDOWS_NEW"
-msgstr "New Window"
-
-msgid "SalomeApp_Application::MEN_VIEW_WNDS"
-msgstr "Windows"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::PREF_GROUP_DEF_COLUMNS"
-msgstr "Default columns"
-
-msgid "SalomeApp_Application::PREF_OBJ_BROWSER_SETTINGS"
-msgstr "Settings"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::OBJ_BROWSER_NAME"
-msgstr "Object"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_0"
-msgstr "Entry"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_1"
-msgstr "Value"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_2"
-msgstr "IOR"
-
-msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_3"
-msgstr "Reference entry"
-
-msgid "SalomeApp_Application::ALL_FILES_FILTER"
-msgstr "All files (*.*)"
-
-msgid "SalomeApp_Application::PYTHON_FILES_FILTER"
-msgstr "PYTHON Files (*.py)"
-
-msgid "SalomeApp_Application::STUDY_LOCKED"
-msgstr "LOCKED"
-
-msgid "SalomeApp_Application::QUE_DOC_ALREADYEXIST"
-msgstr "The document %1 already exists in study manager.\nDo you want to reload it ?"
-
-//=======================================================================================
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODE_FROM_SCRATCH"
-msgstr "from scratch"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODE_FROM_COPYFROM"
-msgstr "copy from"
-
-msgid "SalomeApp_StudyPropertiesDlg::TLT_STUDY_PROPERTIES"
-msgstr "Study Properties"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_AUTHOR"
-msgstr "Author"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_DATE"
-msgstr "Created"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODE"
-msgstr "Mode"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_LOCKED"
-msgstr "Locked"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODIFIED"
-msgstr "Modified"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_MODIFICATIONS"
-msgstr "Modifications"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_YES"
-msgstr "Yes"
-
-msgid "SalomeApp_StudyPropertiesDlg::PRP_NO"
-msgstr "No"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::PUBLISH_IN_STUDY"
-msgstr "Publish in study"
-
-msgid "SalomeApp_Application::WRN_DUMP_STUDY_FAILED"
-msgstr "Dump study failed"
-
-msgid "SAVE_POINT_OBJECT_TOOLTIP"
-msgstr "Saved GUI state: %1"
-
-msgid "SAVE_POINT_DEF_NAME"
-msgstr "GUI state: "
-
-msgid "SAVE_POINT_ROOT_TOOLTIP"
-msgstr "Persistent GUI states"
-
-msgid "SAVE_POINT_ROOT_NAME"
-msgstr "GUI states"
-
-msgid "CLOSE_LOCKED_STUDY"
-msgstr "Close locked study?"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::MEN_RESTORE_VS"
-msgstr "Restore"
-
-msgid "SalomeApp_Application::MEN_RENAME_VS"
-msgstr "Rename"
-
-msgid "SalomeApp_Application::MEN_DELETE_VS"
-msgstr "Delete"
-
-//=======================================================================================
-
-msgid "SalomeApp_Application::APPCLOSE_SAVE"
-msgstr "&Save&&Close"
-
-msgid "SalomeApp_Application::APPCLOSE_CLOSE"
-msgstr "&Close w/o saving"
-
-msgid "SalomeApp_Application::APPCLOSE_UNLOAD"
-msgstr "&Unload"
-
-msgid "SalomeApp_Application::APPCLOSE_CANCEL"
-msgstr "&Cancel"
-
-msgid "SalomeApp_Application::APPCLOSE_CAPTION"
-msgstr "Close active study"
-
-msgid "SalomeApp_Application::APPCLOSE_DESCRIPTION"
-msgstr "Do you want to close or only unload the study"
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
<source>WRN_FILE_NAME_BAD</source>
- <translation>Please enter correct file name. Special characters are not allowed.</translation>
+ <translation>Please enter correct file name.
+Python file must include only letters, digits and underscores and start from letter or underscore.</translation>
+ </message>
+ <message>
+ <source>WRN_FILE_NOT_EXIST</source>
+ <translation>The file %1 does not exist.</translation>
</message>
<message>
<source>CLOSE_LOCKED_STUDY</source>
<source>PUBLISH_IN_STUDY</source>
<translation>Publish in study</translation>
</message>
+ <message>
+ <source>MULTI_FILE_DUMP</source>
+ <translation>Multi file dump</translation>
+ </message>
<message>
<source>BUT_NEW</source>
<translation>&New</translation>
</message>
<message>
<source>ERR_INCOMPATIBLE_TYPE</source>
- <translation>Variable with name "%1" has incompatible numeric type</translation>
+ <translation>Variable with name "%1" has incompatible numeric type</translation>
</message>
<message>
<source>ERR_INVALID_VALUE</source>
- <translation>Value hasn't been validated</translation>
+ <translation>Value hasn't been validated</translation>
</message>
<message>
<source>ERR_NO_VARIABLE</source>
- <translation>Variable with name "%1" doesn't exist</translation>
+ <translation>Variable with name "%1" doesn't exist</translation>
</message>
</context>
<context>
<source>TOT_DESK_FILE_LOAD_SCRIPT</source>
<translation>Load python script</translation>
</message>
+ <message>
+ <source>PREF_PYDUMP_PUBLISH</source>
+ <translation>Publish in study in python dump</translation>
+ </message>
+ <message>
+ <source>PREF_PYDUMP_MULTI_FILE</source>
+ <translation>Multi file python dump</translation>
+ </message>
+ <message>
+ <source>PREF_PYDUMP_SAVE_GUI</source>
+ <translation>Save GUI state in python dump</translation>
+ </message>
<message>
<source>PREF_STORE_VISUAL_STATE</source>
<translation>Store/restore last GUI state</translation>
<source>TOT_DESK_CATALOG_GENERATOR</source>
<translation>Catalog generator</translation>
</message>
+ <message>
+ <source>TOT_DESK_ADD_VARS_TO_NOTEBOOK</source>
+ <translation>Add vars to notebook</translation>
+ </message>
<message>
<source>PUBLISH_IN_STUDY</source>
<translation>Publish in study</translation>
<source>MEN_DESK_TOOLS</source>
<translation>&Tools</translation>
</message>
+ <message>
+ <source>MEN_DESK_PLUGINS_TOOLS</source>
+ <translation>Tools</translation>
+ </message>
+ <message>
+ <source>MEN_DESK_PLUGINS</source>
+ <translation>Plugins</translation>
+ </message>
<message>
<source>TOT_DESK_FILE_DUMP_STUDY</source>
<translation>Dump study</translation>
<source>PRP_DESK_CATALOG_GENERATOR</source>
<translation>Generates XML catalog of a component's interface</translation>
</message>
+ <message>
+ <source>PRP_DESK_ADD_VARS_TO_NOTEBOOK</source>
+ <translation>Add variables of the study to the notebook</translation>
+ </message>
<message>
<source>PRP_DESK_FILE_DUMP_STUDY</source>
<translation>Dumps study to the python script</translation>
<source>MEN_DESK_CATALOG_GENERATOR</source>
<translation>Catalog &Generator</translation>
</message>
+ <message>
+ <source>MEN_DESK_ADD_VARS_TO_NOTEBOOK</source>
+ <translation>Add vars to NoteBook</translation>
+ </message>
<message>
<source>APPCLOSE_CAPTION</source>
<translation>Close active study</translation>
<source>ACTIVATE_MODULE_OP_LOAD</source>
<translation>&Load...</translation>
</message>
+ <message>
+ <source>ACTIVATE_MODULE_OP_SCRIPT</source>
+ <translation>Load &Script...</translation>
+ </message>
</context>
<context>
<name>SalomeApp_StudyPropertiesDlg</name>
<source>PRP_MODIFICATIONS</source>
<translation>Modifications</translation>
</message>
+ <message>
+ <source>PRP_DATE_MODIF</source>
+ <translation>Date</translation>
+ </message>
+ <message>
+ <source>PRP_UNITS</source>
+ <translation>Length units</translation>
+ </message>
+ <message>
+ <source>PRP_COMMENT</source>
+ <translation>Comment</translation>
+ </message>
<message>
<source>PRP_NO</source>
<translation>No</translation>
<source>PRP_MODIFIED</source>
<translation>Modified</translation>
</message>
+ <message>
+ <source>PRP_NOT_MODIFIED</source>
+ <translation>Not modified</translation>
+ </message>
<message>
<source>PRP_DATE</source>
- <translation>Created</translation>
+ <translation>Creation date</translation>
</message>
<message>
<source>PRP_MODE</source>
<name>SalomeApp_ExitDlg</name>
<message>
<source>SHUTDOWN_SERVERS</source>
- <translation>Shutdown standalone servers</translation>
+ <translation>Shutdown servers</translation>
</message>
</context>
<context>
<name>NoteBook_Table</name>
- <message>
- <source>REMOVE_VARIABLE_IS_USED</source>
- <translation>Variable with name "%1" is used in the study.
+ <message>
+ <source>REMOVE_VARIABLE_IS_USED</source>
+ <translation>Variable with name "%1" is used in the study.
Do you really want to remove it?</translation>
- </message>
- <message>
- <source>RENAME_VARIABLE_IS_USED</source>
- <translation>Variable with name "%1" is used in the study.
+ </message>
+ <message>
+ <source>RENAME_VARIABLE_IS_USED</source>
+ <translation>Variable with name "%1" is used in the study.
Do you really want to rename it?</translation>
- </message>
- <message>
- <source>VARNAME_COLUMN</source>
- <translation>Variable Name</translation>
- </message>
- <message>
- <source>VARVALUE_COLUMN</source>
- <translation>Variable Value</translation>
- </message>
- <message>
- <source>VARVALUE_INCORRECT</source>
- <translation>Variable Value Incorrect: %1</translation>
- </message>
- <message>
- <source>VARNAME_INCORRECT</source>
- <translation>Valiable Name Incorrect :%1</translation>
- </message>
- <message>
- <source>VARNAME_EXISTS</source>
- <translation>Valiable with name "%1" exists</translation>
- </message>
+ </message>
+ <message>
+ <source>VARNAME_COLUMN</source>
+ <translation>Variable Name</translation>
+ </message>
+ <message>
+ <source>VARVALUE_COLUMN</source>
+ <translation>Variable Value</translation>
+ </message>
+ <message>
+ <source>VARVALUE_INCORRECT</source>
+ <translation>Variable Value Incorrect: %1</translation>
+ </message>
+ <message>
+ <source>VARNAME_INCORRECT</source>
+ <translation>Variable Name Incorrect :%1</translation>
+ </message>
+ <message>
+ <source>VARNAME_EXISTS</source>
+ <translation>Variable with name "%1" exists</translation>
+ </message>
</context>
<context>
<name>SalomeApp_NoteBookDlg</name>
- <message>
- <source>NOTEBOOK_TITLE</source>
- <translation>Salome NoteBook</translation>
- </message>
- <message>
- <source>BUT_UPDATE_STUDY</source>
- <translation>&Update Study</translation>
- </message>
- <message>
- <source>BUT_REMOVE</source>
- <translation>&Remove</translation>
- </message>
- <message>
- <source>BUT_APPLY_AND_CLOSE</source>
- <translation>A&pply and Close</translation>
- </message>
- <message>
- <source>BUT_HELP</source>
- <translation>&Help</translation>
- </message>
- <message>
- <source>CLOSE_CAPTION</source>
- <translation>Close NoteBook</translation>
- </message>
- <message>
- <source>CLOSE_DESCRIPTION</source>
- <translation>Do you want to save changes you made to NoteBook?</translation>
- </message>
- <message>
- <source>INCORRECT_DATA</source>
- <translation>At least one variable has been defined incorrectly.
+ <message>
+ <source>NOTEBOOK_TITLE</source>
+ <translation>Salome NoteBook</translation>
+ </message>
+ <message>
+ <source>BUT_UPDATE_STUDY</source>
+ <translation>&Update Study</translation>
+ </message>
+ <message>
+ <source>BUT_REMOVE</source>
+ <translation>&Remove</translation>
+ </message>
+ <message>
+ <source>BUT_APPLY_AND_CLOSE</source>
+ <translation>A&pply and Close</translation>
+ </message>
+ <message>
+ <source>BUT_HELP</source>
+ <translation>&Help</translation>
+ </message>
+ <message>
+ <source>CLOSE_CAPTION</source>
+ <translation>Close NoteBook</translation>
+ </message>
+ <message>
+ <source>CLOSE_DESCRIPTION</source>
+ <translation>Do you want to save changes you made to NoteBook?</translation>
+ </message>
+ <message>
+ <source>INCORRECT_DATA</source>
+ <translation>At least one variable has been defined incorrectly.
Please edit its parameters or remove it from table.</translation>
- </message>
- <message>
- <source>ERR_UPDATE_STUDY_FAILED</source>
- <translation>Failed to update study!</translation>
- </message>
+ </message>
+ <message>
+ <source>ERR_UPDATE_STUDY_FAILED</source>
+ <translation>Failed to update study!</translation>
+ </message>
+</context>
+<context>
+ <name>SalomeApp_DoubleSpinBox</name>
+ <message>
+ <source>VALID_RANGE_VAR_MSG</source>
+ <translation>Specify either a variable name or
+a floating-point value in range ( %1; %2 )
+with %3-digit precision</translation>
+ </message>
+ <message>
+ <source>VALID_RANGE_NOVAR_MSG</source>
+ <translation>Specify a floating-point value in range ( %1; %2 )
+with %3-digit precision</translation>
+ </message>
+</context>
+<context>
+ <name>SalomeApp_IntSpinBox</name>
+ <message>
+ <source>VALID_RANGE_VAR_MSG</source>
+ <translation>Specify either a variable name or
+an integer value in range ( %1; %2 )</translation>
+ </message>
+ <message>
+ <source>VALID_RANGE_NOVAR_MSG</source>
+ <translation>Specify an integer value in range ( %1; %2 )</translation>
+ </message>
</context>
</TS>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME Session : implementation of Session.idl
# File : Makefile.in
# Author : Paul RASCLE, EDF
# Module : SALOME
# $Header$
-#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES = libSalomeSession.la
libSalomeSession_la_CPPFLAGS = $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) \
$(HDF5_INCLUDES) $(BOOST_CPPFLAGS) @KERNEL_CXXFLAGS@ $(CAS_CPPFLAGS) \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
- -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl \
+ -I$(top_builddir)/idl \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Event \
- -I$(srcdir)/../Style @LIBXML_INCLUDES@
+ -I$(srcdir)/../Style -I$(srcdir)/../CASCatch @LIBXML_INCLUDES@
if ENABLE_TESTRECORDER
libSalomeSession_la_CPPFLAGS+= -DENABLE_TESTRECORDER $(TESTRECORDER_INCLUDES)
endif
-libSalomeSession_la_LDFLAGS = $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS \
+libSalomeSession_la_LDFLAGS = $(KERNEL_LDFLAGS) -lSalomeNS \
-lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog \
-lSalomeDSClient $(CAS_KERNEL) -lwith_loggerTraceCollector \
-lSalomeIDLKernel -lSalomeContainer -lTOOLSDS -lSalomeLauncher \
-lRegistry -lSALOMEBasics \
../SUIT/libsuit.la ../Event/libEvent.la ../../idl/libSalomeIDLGUI.la \
- ../Style/libSalomeStyle.la
+ ../Style/libSalomeStyle.la $(QT_MT_LIBS)
if ENABLE_TESTRECORDER
libSalomeSession_la_LDFLAGS+= $(TESTRECORDER_LIBS)
SALOME_Session_Server_CPPFLAGS = $(libSalomeSession_la_CPPFLAGS)
SALOME_Session_Server_LDADD = $(libSalomeSession_la_LDFLAGS) \
- $(PYTHON_LIBS) $(OMNIORB_LIBS) \
- $(HDF5_LIBS) -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS \
+ -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS \
-lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry \
-lSalomeNotification -lSALOMEBasics -lSalomeLauncher ../Qtx/libqtx.la \
- $(top_builddir)/idl/libSalomeIDLGUI.la \
- libSalomeSession.la
+ $(top_builddir)/idl/libSalomeIDLGUI.la libSalomeSession.la \
+ $(HDF5_LIBS) $(PYTHON_LIBS) $(OMNIORB_LIBS)
if ENABLE_TESTRECORDER
SALOME_Session_Server_LDADD+= $(TESTRECORDER_LIBS)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SALOME_Session.hxx
// Author : Alexander A. BORODIN
// Module : GUI
#define _SALOME_Session_HXX_
#if defined WIN32
-# if defined SESSION_EXPORTS
+# if defined SESSION_EXPORTS || defined SalomeSession_EXPORTS
# define SESSION_EXPORT __declspec( dllexport )
# else
# define SESSION_EXPORT __declspec( dllimport )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Session : implementation of Session.idl
// File : SALOME_Session_Server.cxx
// Author : Paul RASCLE, EDF
// Module : SALOME
-//
-#include <Container_init_python.hxx>
-#include <Utils_ORB_INIT.hxx>
-#include <Utils_SINGLETON.hxx>
+
#include <SALOME_NamingService.hxx>
#include <SALOME_ModuleCatalog_impl.hxx>
-#include <OpUtil.hxx>
-#include <RegistryService.hxx>
-#include <ConnectionManager_i.hxx>
#include <SALOME_LifeCycleCORBA.hxx>
+#include <SALOME_Event.h>
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <Container_init_python.hxx>
+#include <ConnectionManager_i.hxx>
+#include <RegistryService.hxx>
#ifdef ENABLE_TESTRECORDER
#include <TestApplication.h>
#endif
-#include <QDir>
-#include <QFile>
-#include <QApplication>
-#include <QMutex>
-#include <QWaitCondition>
-#include <QRegExp>
-#include <QTextStream>
-
+#include <OpUtil.hxx>
+#include <Utils_ORB_INIT.hxx>
+#include <Utils_SINGLETON.hxx>
#include <Utils_SALOME_Exception.hxx>
#include <Utils_CorbaException.hxx>
-#include <SALOME_Event.h>
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOME_Session)
-#include CORBA_SERVER_HEADER(SALOMEDS)
#include <utilities.h>
#include "Session_ServerLauncher.hxx"
#include "Session_ServerCheck.hxx"
+#include "Session_Session_i.hxx"
+#include <Qtx.h>
#include <QtxSplash.h>
+
#include <Style_Salome.h>
+
+#include "GUI_version.h"
#include <SUIT_Tools.h>
#include <SUIT_Session.h>
#include <SUIT_Application.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_ExceptionHandler.h>
-#include <Standard_Version.hxx>
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOME_Session)
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+#include <QDir>
+#include <QFile>
+#include <QApplication>
+#include <QMutex>
+#include <QWaitCondition>
+#include <QRegExp>
+#include <QTextStream>
/*! - read arguments, define list of server to launch with their arguments.
* - wait for naming service
switch ( type )
{
case QtDebugMsg:
- MESSAGE( "Debug: " << msg );
+ //MESSAGE( "Debug: " << msg );
break;
case QtWarningMsg:
MESSAGE( "Warning: " << msg );
QString salomeVersion()
{
- QString path( ::getenv( "GUI_ROOT_DIR" ) );
- if ( !path.isEmpty() )
- path += QDir::separator();
- path += QString( "bin/salome/VERSION" );
-
- QFile vf( path );
- if ( !vf.open( QIODevice::ReadOnly ) )
- return QString();
-
- QString line( vf.readLine( 1024 ) );
-
- vf.close();
-
- if ( line.isEmpty() )
- return QString();
-
- while ( !line.isEmpty() && line.at( line.length() - 1 ) == QChar( '\n' ) )
- line.remove( line.length() - 1, 1 );
-
- QString ver;
- int idx = line.lastIndexOf( ":" );
- if ( idx != -1 )
- ver = line.mid( idx + 1 ).trimmed();
-
- return ver;
+ return GUI_VERSION_STR;
}
class SALOME_ResourceMgr : public SUIT_ResourceMgr
if ( myExtAppVersion == "APP_VERSION" ) {
if ( myExtAppName != "SalomeApp" )
myExtAppVersion = "";
- else myExtAppVersion = salomeVersion();
+ else myExtAppVersion = salomeVersion();
}
}
}
return SUIT_ResourceMgr::userFileName( myExtAppName, for_load );
}
- virtual int userFileId( const QString& _fname ) const
+ virtual long userFileId( const QString& _fname ) const
{
+ long id = -1;
if ( !myExtAppName.isEmpty() ) {
+#ifdef WIN32
+ QRegExp exp( QString( "%1\\.%2\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ).arg( currentFormat() ) );
+#else
QRegExp exp( QString( "\\.%1rc\\.([a-zA-Z0-9.]+)$" ).arg( myExtAppName ) );
+#endif
QRegExp vers_exp( "^([0-9]+)([A-Za-z]?)([0-9]*)$" );
QString fname = QFileInfo( _fname ).fileName();
if( exp.exactMatch( fname ) ) {
- QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
- int major=0, minor=0;
- major = vers[0].toInt();
- minor = vers[1].toInt();
- if( vers_exp.indexIn( vers[2] )==-1 )
- return -1;
- int release = 0, dev1 = 0, dev2 = 0;
- release = vers_exp.cap( 1 ).toInt();
- dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
- dev2 = vers_exp.cap( 3 ).toInt();
-
- int dev = dev1*100+dev2, id = major;
- id*=100; id+=minor;
- id*=100; id+=release;
- id*=10000;
- if ( dev > 0 ) id+=dev-10000;
- return id;
+ QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
+ int major=0, minor=0;
+ int release = 0, dev1 = 0, dev2 = 0;
+ 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 ) {
+ release = vers_exp.cap( 1 ).toInt();
+ dev1 = vers_exp.cap( 2 )[ 0 ].toLatin1();
+ dev2 = vers_exp.cap( 3 ).toInt();
+ }
+ }
+
+ int dev = dev1*100+dev2;
+ id = major;
+ id*=100; id+=minor;
+ id*=100; id+=release;
+ id*=10000;
+ if ( dev > 0 ) id+=dev-10000;
}
}
-
- return -1;
+ return id;
}
public:
#ifdef ENABLE_TESTRECORDER
SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {}
#else
- SALOME_QApplication( int& argc, char** argv ) : QApplication( argc, argv ), myHandler ( 0 ) {}
+ SALOME_QApplication( int& argc, char** argv )
+#ifndef WIN32
+ // san: Opening an X display and choosing a visual most suitable for 3D visualization
+ // in order to make SALOME viewers work with non-native X servers
+ : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
+#else
+ : QApplication( argc, argv ),
+#endif
+ myHandler ( 0 ) {}
#endif
virtual bool notify( QObject* receiver, QEvent* e )
{
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
+#if OCC_VERSION_LARGE < 0x06010100
// Disable GUI user actions while python command is executed
if (SUIT_Session::IsPythonExecuted()) {
// Disable mouse and keyboard events
return myHandler ? myHandler->handle( receiver, e ) :
TestApplication::notify( receiver, e );
#else
- return myHandler ? myHandler->handle( receiver, e ) :
- QApplication::notify( receiver, e );
+ try {
+ return myHandler ? myHandler->handle( receiver, e ) : QApplication::notify( receiver, e );
+ }
+ catch (std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ }
+ catch (CORBA::Exception& e) {
+ std::cerr << "Caught CORBA::Exception" << std::endl;
+ CORBA::Any tmp;
+ tmp<<= e;
+ CORBA::TypeCode_var tc = tmp.type();
+ const char *p = tc->name();
+ std::cerr << "notify(): CORBA exception of the kind : " << p << " is caught" << std::endl;
+ }
+ catch (...) {
+ std::cerr << "Unknown exception caught in Qt handler: it's probably a bug in SALOME platform" << std::endl;
+ }
+ return false; // return false when exception is caught
#endif
}
SUIT_ExceptionHandler* handler() const { return myHandler; }
// Install Qt debug messages handler
qInstallMsgHandler( MessageOutput );
+ // add $QTDIR/plugins to the pluins search path for image plugins
+ QString qtdir( ::getenv( "QTDIR" ) );
+ if ( !qtdir.isEmpty() )
+ QApplication::addLibraryPath( QDir( qtdir ).absoluteFilePath( "plugins" ) );
+
// Create Qt application instance;
// this should be done the very first!
SALOME_QApplication _qappl( argc, argv );
+ _qappl.setOrganizationName( "salome" );
+ _qappl.setApplicationName( "salome" );
+ _qappl.setApplicationVersion( salomeVersion() );
// Add application library path (to search style plugin etc...)
QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) );
SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) );
resMgr.setCurrentFormat( "xml" );
resMgr.setWorkingMode( QtxResourceMgr::IgnoreUserValues );
- resMgr.loadLanguage( "LightApp", "en" );
+ resMgr.loadLanguage( "LightApp" );
//
splash = QtxSplash::splash( QPixmap() );
splash->readSettings( &resMgr );
try {
// ...initialize Python (only once)
int _argc = 1;
- char* _argv[] = {""};
+ char* _argv[] = {(char*)""};
KERNEL_PYTHON::init_python( _argc,_argv );
PyEval_RestoreThread( KERNEL_PYTHON::_gtstate );
if ( !KERNEL_PYTHON::salome_shared_modules_module ) // import only once
const char *p = tc->name();
INFOS ( "run(): CORBA exception of the kind : "<<p<< " is caught" );
}
- catch ( exception& e ) {
+ catch ( std::exception& e ) {
INFOS( "run(): An exception has been caught: " <<e.what() );
}
catch (...) {
splash->setProgress( 0, sc.totalSteps() );
// start check loop
while ( true ) {
- int step = sc.currentStep();
- int total = sc.totalSteps();
- QString msg = sc.currentMessage();
- QString err = sc.error();
- if ( !err.isEmpty() ) {
- QtxSplash::setError( err );
- QApplication::instance()->processEvents();
- result = -1;
- break;
- }
- QtxSplash::setStatus( msg, step );
- QApplication::instance()->processEvents();
- if ( step >= total )
- break;
- // ...block this thread until servers checking is finished
- _SplashStarted.wait( &_SplashMutex );
+ int step = sc.currentStep();
+ int total = sc.totalSteps();
+ QString msg = sc.currentMessage();
+ QString err = sc.error();
+ if ( !err.isEmpty() ) {
+ QtxSplash::setError( err );
+ QApplication::instance()->processEvents();
+ result = -1;
+ break;
+ }
+ QtxSplash::setStatus( msg, step );
+ QApplication::instance()->processEvents();
+ if ( step >= total )
+ break;
+ // ...block this thread until servers checking is finished
+ _SplashStarted.wait( &_SplashMutex );
}
// ...unlock mutex 'cause it is no more needed
_SplashMutex.unlock();
_GUIMutex.unlock();
}
- bool shutdown = false;
+ // Obtain Session interface reference
+ CORBA::Object_var obj = _NS->Resolve( "/Kernel/Session" );
+ SALOME::Session_var session = SALOME::Session::_narrow( obj ) ;
+
+ bool shutdownAll = false;
+ bool shutdownSession = false;
if ( !result ) {
// Launch GUI activator
if ( isGUI ) {
if ( splash )
- splash->setStatus( QApplication::translate( "", "Activating desktop..." ) );
- // ...retrieve Session interface reference
- CORBA::Object_var obj = _NS->Resolve( "/Kernel/Session" );
- SALOME::Session_var session = SALOME::Session::_narrow( obj ) ;
- ASSERT ( ! CORBA::is_nil( session ) );
+ splash->setStatus( QApplication::translate( "", "Activating desktop..." ) );
// ...create GUI launcher
MESSAGE( "Session activated, Launch IAPP..." );
guiThread = new GetInterfaceThread( session );
_SessionMutex.unlock();
+ // Session might be shutdowning here, check status
+ SALOME::StatSession stat = session->GetStatSession();
+ shutdownSession = stat.state == SALOME::shutdown;
+ if ( shutdownSession ) {
+ _SessionMutex.lock(); // lock mutex before leaving loop - it will be unlocked later
+ break;
+ }
+
// SUIT_Session creation
aGUISession = new SALOME_Session();
SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 );
if ( aGUIApp )
{
- Style_Salome::initialize( aGUIApp->resourceMgr() );
- if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
- Style_Salome::apply();
-
- if ( !isFound( "noexcepthandler", argc, argv ) )
- _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
- // aGUISession contains SalomeApp_ExceptionHandler
- // Run GUI loop
- MESSAGE( "run(): starting the main event loop" );
-
- if ( splash )
- splash->finish( aGUIApp->desktop() );
-
- result = _qappl.exec();
+ Style_Salome::initialize( aGUIApp->resourceMgr() );
+ if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
+ Style_Salome::apply();
+
+ if ( !isFound( "noexcepthandler", argc, argv ) )
+ _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
+ // aGUISession contains SalomeApp_ExceptionHandler
+ // Run GUI loop
+ MESSAGE( "run(): starting the main event loop" );
+
+ if ( splash )
+ splash->finish( aGUIApp->desktop() );
- splash = 0;
-
- if ( result == SUIT_Session::NORMAL ) { // desktop is closed by user from GUI
- shutdown = aGUISession->exitFlags();
+ result = _qappl.exec();
+
+ splash = 0;
+
+ if ( result == SUIT_Session::NORMAL ) {
+ // desktop is explicitly closed by user from GUI
+ // exit flags says if it's necessary to shutdown all servers
+ // all session server only
+ shutdownAll = aGUISession->exitFlags();
+ }
+ else {
+ // desktop might be closed from:
+ // - StopSesion() /temporarily/ or
+ // - Shutdown() /permanently/
+ stat = session->GetStatSession();
+ shutdownSession = stat.state == SALOME::shutdown;
+ }
+ if ( shutdownAll || shutdownSession ) {
+ _SessionMutex.lock(); // lock mutex before leaving loop - it will be unlocked later
break;
}
}
delete aGUISession;
aGUISession = 0;
-
+
// Prepare _GUIMutex for a new GUI activation
_SessionMutex.lock();
}
// unlock Session mutex
_SessionMutex.unlock();
- if ( shutdown )
+ if ( shutdownAll )
shutdownServers( _NS );
if ( myServerLauncher )
myServerLauncher->KillAll(); // kill embedded servers
+ // Unregister session server
+ SALOME_Session_i* sessionServant = dynamic_cast<SALOME_Session_i*>( poa->reference_to_servant( session.in() ) );
+ if ( sessionServant )
+ sessionServant->NSunregister();
+
delete aGUISession;
delete guiThread;
delete myServerLauncher;
delete _NS;
- PyGILState_STATE gstate = PyGILState_Ensure();
- Py_Finalize();
-
try {
orb->shutdown(0);
}
// exception is raised when orb->destroy() is called and
// cpp continer is launched in the embedded mode
//////////////////////////////////////////////////////////////
- // std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl;
+ // std::cerr << "Caught unexpected exception on shutdown : ignored !!" << std::endl;
+ if ( shutdownAll )
+ killOmniNames();
+ abort(); //abort program to avoid deadlock in destructors or atexit when shutdown has been interrupted
}
- if ( shutdown )
+ PyGILState_Ensure();
+ //Destroy orb from python (for chasing memory leaks)
+ //PyRun_SimpleString("from omniORB import CORBA");
+ //PyRun_SimpleString("orb=CORBA.ORB_init([''], CORBA.ORB_ID)");
+ //PyRun_SimpleString("orb.destroy()");
+ Py_Finalize();
+
+ if ( shutdownAll )
killOmniNames();
+ MESSAGE( "Salome_Session_Server:endofserver" );
return result;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
// File : SalomeApp_Engine_i.cxx
// Author : Alexander SLADKOV
-// Module : SALOME
-// $Header$
-//
-#include "SalomeApp_Engine_i.hxx"
-#include "SALOMEDS_Tool.hxx"
+#include "SalomeApp_Engine_i.hxx"
-#include <iostream>
+#include <SALOME_NamingService.hxx>
+#include <SALOMEDS_Tool.hxx>
+#include <Utils_ORB_INIT.hxx>
+#include <Utils_SINGLETON.hxx>
+#include <Utils_SALOME_Exception.hxx>
+#include <utilities.h>
-using namespace std;
+#include <QApplication>
+#include <QDir>
+#include <QFile>
-SalomeApp_Engine_i* SalomeApp_Engine_i::myInstance = NULL;
+#include <iostream>
/*!
Constructor
*/
-SalomeApp_Engine_i::SalomeApp_Engine_i()
+SalomeApp_Engine_i::SalomeApp_Engine_i( const char* theComponentName )
{
- myInstance = this;
+ myComponentName = theComponentName;
+ MESSAGE("SalomeApp_Engine_i::SalomeApp_Engine_i(): myComponentName = " <<
+ myComponentName << ", this = " << this);
}
/*!
*/
SalomeApp_Engine_i::~SalomeApp_Engine_i()
{
+ MESSAGE("SalomeApp_Engine_i::~SalomeApp_Engine_i(): myComponentName = " <<
+ myComponentName << ", this = " << this);
}
SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theComponent,
{
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
- cout << "SalomeApp_Engine_i::Save() isMultiFile = " << isMultiFile << endl;
if (CORBA::is_nil(theComponent) || CORBA::is_nil(theComponent->GetStudy()))
return aStreamFile._retn();
const int studyId = theComponent->GetStudy()->StudyId();
- cout << "SalomeApp_Engine_i::Save() - studyId = " << studyId << endl;
// Get a temporary directory to store a file
//std::string aTmpDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
if (myMap.count(studyId)) {
- cout << "SalomeApp_Engine_i::Save() - myMap.count(studyId)" << endl;
- MapOfListOfFiles mapOfListOfFiles = myMap[studyId];
std::string componentName (theComponent->ComponentDataType());
- cout << "SalomeApp_Engine_i::Save() - componentName = " << componentName << endl;
- ListOfFiles listOfFiles = mapOfListOfFiles[componentName];
+
+ // Error somewhere outside - Save() called with
+ // wrong SComponent instance
+ if ( myComponentName != componentName )
+ return aStreamFile._retn();
+
+ const ListOfFiles& listOfFiles = myMap[studyId];
// listOfFiles must contain temporary directory name in its first item
// and names of files (relatively the temporary directory) in the others
if (n > 0) { // there are some files, containing persistent data of the component
std::string aTmpDir = listOfFiles[0];
- cout << "SalomeApp_Engine_i::Save() - aTmpDir = " << aTmpDir << endl;
// Create a list to store names of created files
SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
const char* theURL,
bool isMultiFile)
{
- cout << "SalomeApp_Engine_i::Load() isMultiFile = " << isMultiFile << endl;
+ std::cout << "SalomeApp_Engine_i::Load() isMultiFile = " << isMultiFile << std::endl;
if (CORBA::is_nil(theComponent) || CORBA::is_nil(theComponent->GetStudy()))
return false;
+ // Error somewhere outside - Load() called with
+ // wrong SComponent instance
+ std::string componentName (theComponent->ComponentDataType());
+ if ( myComponentName != componentName )
+ return false;
+
const int studyId = theComponent->GetStudy()->StudyId();
// Create a temporary directory for the component's data files
for (int i = 1; i < n; i++)
listOfFiles[i] = std::string(aSeq[i - 1]);
- //MapOfListOfFiles mapOfListOfFiles;
- //if (myMap.count(studyId))
- // mapOfListOfFiles = myMap[studyId];
- //std::string componentName (theComponent->ComponentDataType());
- //mapOfListOfFiles[componentName] = listOfFiles;
- //myMap[studyId] = mapOfListOfFiles;
-
- SetListOfFiles(listOfFiles, studyId, theComponent->ComponentDataType());
+ SetListOfFiles(listOfFiles, studyId);
return true;
}
-SalomeApp_Engine_i::ListOfFiles SalomeApp_Engine_i::GetListOfFiles (const int theStudyId,
- const char* theComponentName)
+SalomeApp_Engine_i::ListOfFiles SalomeApp_Engine_i::GetListOfFiles (const int theStudyId)
{
ListOfFiles aListOfFiles;
- if (myMap.count(theStudyId))
+ if (myMap.find(theStudyId) != myMap.end())
{
- MapOfListOfFiles mapOfListOfFiles = myMap[theStudyId];
- std::string componentName (theComponentName);
- if (mapOfListOfFiles.count(componentName))
- aListOfFiles = mapOfListOfFiles[componentName];
+ aListOfFiles = myMap[theStudyId];
}
return aListOfFiles;
}
-void SalomeApp_Engine_i::SetListOfFiles (const ListOfFiles theListOfFiles,
- const int theStudyId,
- const char* theComponentName)
+void SalomeApp_Engine_i::SetListOfFiles (const ListOfFiles& theListOfFiles,
+ const int theStudyId)
{
- //if (!myMap.count(theStudyId)) {
- // MapOfListOfFiles mapOfListOfFiles;
- // myMap[theStudyId] = mapOfListOfFiles;
- //}
-
- MapOfListOfFiles& mapOfListOfFiles = myMap[theStudyId];
- std::string componentName (theComponentName);
- mapOfListOfFiles[componentName] = theListOfFiles;
+ myMap[theStudyId] = theListOfFiles;
+}
+
+/*!
+ * DumpPython implementation for light modules
+ */
+Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Object_ptr theStudy,
+ CORBA::Boolean isPublished,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean& isValidScript)
+{
+ MESSAGE("SalomeApp_Engine_i::DumpPython(): myComponentName = "<<
+ myComponentName << ", this = " << this);
+
+ // Temporary solution: returning a non-empty sequence
+ // even if there's nothing to dump, to avoid crashes in SALOMEDS
+ // TODO: Improve SALOMEDSImpl_Study::DumpStudy() by skipping the components
+ // with isValidScript == false, and initialize isValidScript by false below.
+ Engines::TMPFile_var aStreamFile = new Engines::TMPFile(1);
+ aStreamFile->length( 1 );
+ aStreamFile[0] = '\0';
+ isValidScript = true;
+
+ if (CORBA::is_nil(theStudy))
+ return aStreamFile._retn();
+
+ SALOMEDS::Study_var studyDS = SALOMEDS::Study::_narrow( theStudy );
+ const int studyId = studyDS->StudyId();
+
+ if (!myMap.count(studyId))
+ return aStreamFile._retn();
+
+ ListOfFiles listOfFiles = myMap[studyId];
+
+ // listOfFiles must contain temporary directory name in its first item
+ // and names of files (relatively the temporary directory) in the others
+ if ( listOfFiles.size() < 2 )
+ return aStreamFile._retn();
+
+ // there are some files, containing persistent data of the component
+ QString aTmpPath( listOfFiles.front().c_str() );
+ QDir aTmpDir( aTmpPath );
+ if ( !aTmpDir.exists() )
+ return aStreamFile._retn();
+
+ // Calculate file sizes
+ QStringList aFilePaths;
+ QList<qint64> aFileSizes;
+ qint64 aBuffSize = 0;
+ ListOfFiles::const_iterator aFIt = listOfFiles.begin();
+ ListOfFiles::const_iterator aFEnd = listOfFiles.end();
+ aFIt++;
+ for (; aFIt != aFEnd; aFIt++){
+ QString aFileName( (*aFIt).c_str() );
+ if ( !aTmpDir.exists( aFileName ) ){
+ continue;
+ }
+
+ QFile aFile( aTmpDir.filePath( aFileName ) );
+ if ( !aFile.open( QIODevice::ReadOnly ) ){
+ continue;
+ }
+
+ aFilePaths.push_back( aTmpDir.filePath( aFileName ) );
+ aFileSizes.push_back( aFile.size() );
+ aBuffSize += aFileSizes.back();
+
+ aFile.close();
+ }
+
+ if ( !aFilePaths.size() || !aBuffSize )
+ return aStreamFile._retn();
+
+ char* aBuffer = new char[aBuffSize + 1];
+ if ( !aBuffer )
+ return aStreamFile._retn();
+
+ // Convert the file(s) to the byte stream, multiple files are simply
+ // concatenated
+ // TODO: imporve multi-script support if necessary...
+ qint64 aCurrPos = 0;
+ QStringList::const_iterator aFileIt = aFilePaths.begin();
+ QStringList::const_iterator aFileEnd = aFilePaths.end();
+ QList<qint64>::const_iterator aSIt = aFileSizes.begin();
+ for ( ; aFileIt != aFileEnd; aFileIt++, aSIt++ ){
+ QFile aFile( aTmpDir.filePath( *aFileIt ) );
+ if ( !aFile.open( QIODevice::ReadOnly ) ){
+ continue;
+ }
+
+ // Incorrect size of file
+ // Do not remove the bad file to have some diagnostic means
+ if ( aFile.read( aBuffer + aCurrPos, *aSIt ) != *aSIt ){
+ aFile.close();
+ return aStreamFile._retn();
+ }
+
+ aCurrPos += (*aSIt);
+ aFile.remove();
+ }
+
+ // Here we should end up with empty aTmpDir
+ // TODO: Handle QDir::rmdir() error status somehow...
+ aTmpDir.rmdir( aTmpPath );
+
+ aBuffer[aBuffSize] = '\0';
+ CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
+ aStreamFile = new Engines::TMPFile(aBuffSize + 1, aBuffSize + 1, anOctetBuf, 1);
+
+ return aStreamFile._retn();
}
/*!
- \return shared instance of engine
+ \return Component data type string for this instance of the engine
*/
-SalomeApp_Engine_i* SalomeApp_Engine_i::GetInstance()
+char* SalomeApp_Engine_i::ComponentDataType()
{
- return myInstance;
+ return const_cast<char*>( myComponentName.c_str() );
}
+
+/*!
+ \return
+*/
+CORBA::ORB_var SalomeApp_Engine_i::orb()
+{
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ // TODO: using QApplication here looks ugly, think how to
+ // obtain the ORB reference in a nicer way...
+ static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+ return _orb;
+}
+
+/*!
+ \return
+*/
+PortableServer::POA_var SalomeApp_Engine_i::poa()
+{
+ static PortableServer::POA_var _poa;
+ if ( CORBA::is_nil( _poa ) ){
+ CORBA::Object_var obj = orb()->resolve_initial_references( "RootPOA" );
+ _poa = PortableServer::POA::_narrow( obj );
+ }
+ return _poa;
+}
+
+/*!
+ \return
+*/
+SALOME_NamingService* SalomeApp_Engine_i::namingService()
+{
+ static SALOME_NamingService _ns(orb());
+ return &_ns;
+}
+
+/*!
+ Internal method, creates a CORBA engine for a light SALOME module
+ with the given "component data type" string,
+ activates it and registers in SALOME naming service with
+ /SalomeAppEngine/comp_data_type path. If the engine is already in the
+ naming service, simply returns and object reference to it.
+ \param theComponentName - synthetic "component data type" used to identify a given light module
+ \return Object reference to the CORBA engine
+*/
+CORBA::Object_ptr SalomeApp_Engine_i::engineForComponent( const char* theComponentName,
+ bool toCreate )
+{
+ CORBA::Object_var anEngine;
+ if ( !theComponentName || !strlen( theComponentName ) )
+ return anEngine._retn();
+
+ std::string aPath( "/SalomeAppEngine/" );
+ aPath += theComponentName;
+ anEngine = namingService()->Resolve( aPath.c_str() );
+
+ // Activating a new instance of the servant
+ if ( toCreate && CORBA::is_nil( anEngine ) ){
+ try {
+ SalomeApp_Engine_i* aServant = new SalomeApp_Engine_i( theComponentName );
+ PortableServer::ObjectId_var id = poa()->activate_object( aServant );
+ anEngine = aServant->_this();
+ aServant->_remove_ref();
+ namingService()->Register( anEngine.in(), aPath.c_str() );
+ }
+ catch (CORBA::SystemException&) {
+ INFOS("Caught CORBA::SystemException.");
+ }
+ catch (CORBA::Exception&) {
+ INFOS("Caught CORBA::Exception.");
+ }
+ catch (...) {
+ INFOS("Caught unknown exception.");
+ }
+ }
+
+ return anEngine._retn();
+}
+
+/*!
+ \param theComponentName - synthetic "component data type" used to identify a given light module
+ \return IOR string for the CORBA engine for a light SALOME module
+ with the given "component data type" string
+ \sa GetInstance( const char* theComponentName )
+*/
+std::string SalomeApp_Engine_i::EngineIORForComponent( const char* theComponentName,
+ bool toCreate )
+{
+ std::string anIOR( "" );
+ CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+ if ( !CORBA::is_nil( anEngine ) )
+ {
+ CORBA::String_var objStr = orb()->object_to_string( anEngine.in() );
+ anIOR = std::string( objStr.in() );
+ }
+ return anIOR;
+}
+
+/*!
+ \param theComponentName - synthetic "component data type" used to identify a given light module
+ \return A pointer to corresponding C++ engine instance, null means some internal problems.
+ \sa EngineIORForComponent( const char* theComponentName )
+*/
+SalomeApp_Engine_i* SalomeApp_Engine_i::GetInstance( const char* theComponentName,
+ bool toCreate )
+{
+ SalomeApp_Engine_i* aServant = 0;
+ CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+ if ( !CORBA::is_nil( anEngine ) )
+ {
+ PortableServer::Servant aServantBase = poa()->reference_to_servant( anEngine.in() );
+ aServant = dynamic_cast<SalomeApp_Engine_i*>( aServantBase );
+ }
+ MESSAGE("SalomeApp_Engine_i::GetInstance(): theComponentName = " <<
+ theComponentName << ", aServant = " << aServant);
+ return aServant;
+}
+
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
// File : SalomeApp_Engine_i.hxx
// Author : Alexander SLADKOV
-// Module : SALOME
-// $Header$
-//
+
#ifndef _SALOMEAPP_ENGINE_I_HXX_
#define _SALOMEAPP_ENGINE_I_HXX_
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SalomeApp_Engine)
+class SALOME_NamingService;
+
class SESSION_EXPORT SalomeApp_Engine_i: public POA_SalomeApp::Engine,
- public Engines_Component_i
+ public Engines_Component_i
{
public:
- SalomeApp_Engine_i();
+ SalomeApp_Engine_i( const char* theComponentName );
~SalomeApp_Engine_i();
SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
bool isMultiFile );
+ virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
+ CORBA::Boolean isPublished,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean& isValidScript);
+
public:
typedef std::vector<std::string> ListOfFiles;
- ListOfFiles GetListOfFiles (const int theStudyId,
- const char* theComponentName);
-
- void SetListOfFiles (const ListOfFiles theListOfFiles,
- const int theStudyId,
- const char* theComponentName);
+ ListOfFiles GetListOfFiles (const int theStudyId);
+ void SetListOfFiles (const ListOfFiles& theListOfFiles,
+ const int theStudyId);
- static SalomeApp_Engine_i* GetInstance();
+ static std::string EngineIORForComponent( const char* theComponentName,
+ bool toCreate );
+ static SalomeApp_Engine_i* GetInstance ( const char* theComponentName,
+ bool toCreate );
public:
// methods from SALOMEDS::Driver without implementation. Must be redefined because
SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr, const char*, bool ) {return 0;}
CORBA::Boolean LoadASCII( SALOMEDS::SComponent_ptr, const SALOMEDS::TMPFile&, const char*, bool ) {return 0;}
void Close( SALOMEDS::SComponent_ptr ) {}
- char* ComponentDataType() {return 0;}
+ char* ComponentDataType();
char* IORToLocalPersistentID( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;}
char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;}
bool CanPublishInStudy( CORBA::Object_ptr ) {return 0;}
SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile&, CORBA::Long, SALOMEDS::SObject_ptr ) {return 0;}
private:
- typedef std::map<std::string, ListOfFiles> MapOfListOfFiles;
- typedef std::map<int, MapOfListOfFiles> MapOfMapOfListOfFiles;
- MapOfMapOfListOfFiles myMap;
+ static CORBA::ORB_var orb();
+ static PortableServer::POA_var poa();
+ static SALOME_NamingService* namingService();
+ static CORBA::Object_ptr engineForComponent( const char* theComponentName,
+ bool toCreate );
+
+private:
+ typedef std::map<int, ListOfFiles> MapOfListOfFiles;
+ MapOfListOfFiles myMap;
- static SalomeApp_Engine_i* myInstance;
+ std::string myComponentName;
};
#endif
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-#TEMPLATE = lib
-#TARGET = SalomeSession
-#DESTDIR = ../../lib
-#MOC_DIR = ../../moc
-#OBJECTS_DIR = ../../obj/$$TARGET
-
-# ================>
-
-TEMPLATE =
-TARGET = SALOME_Session_Server
-DESTDIR = ../../bin
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-# <================
-
-
-QT_MT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
-
-PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
-
-HDF5_INCLUDES = $$(HDF5HOME)/include
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-OMNIORBDIR = $$(OMNIORBDIR)
-CORBA_INCLUDES = $${OMNIORBDIR}/include $${OMNIORBDIR}/include/omniORB4 $${OMNIORBDIR}/include/COS
-
-INCLUDEPATH += $${QT_MT_INCLUDES} $${PYTHON_INCLUDES} $${HDF5_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${CAS_CPPFLAGS} $${CORBA_INCLUDES} ../../salome_adm/unix $$(GUI_ROOT_DIR)/idl ../Qtx ../SUIT ../Event
-
-QT_MT_LIBS = -L$$(QTDIR)/lib -lQtCore -lQtXml -lQtGui -lQtOpenGL
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-LIBS += $${QT_MT_LIBS} $${KERNEL_LDFLAGS} -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog -lSalomeDSClient $${CAS_KERNEL} -L../../lib -lwith_loggerTraceCollector -lsuit -lEvent -L$$(GUI_ROOT_DIR)/idl -lSalomeIDLGUI
-
-# ================>
-
-OMNIORB_LIBS = -L$${OMNIORBDIR}/lib -lomniORB4 -lomniDynamic4 -lCOS4 -lCOSDynamic4 -lomnithread
-
-HDF5_LIBS = -L$$(HDF5HOME)/lib -lhdf5
-
-INCLUDEPATH = $${INCLUDEPATH}
-LIBS = $${LIBS} $${OMNIORB_LIBS} $${HDF5_LIBS} -lSalomeContainer -lSalomeResourcesManager -lTOOLSDS -lSalomeHDFPersist -lSalomeDSImpl -lSalomeGenericObj -lRegistry -lSalomeNotification -lSALOMEBasics -L$$(GUI_ROOT_DIR)/lib -lqtx -lSalomeSession
-
-# <================
-
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += SESSION_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
-
-HEADERS = Session_Session_i.hxx
-HEADERS += Session_ServerLauncher.hxx
-HEADERS += Session_ServerThread.hxx
-HEADERS += Session_ServerCheck.hxx
-HEADERS += SalomeApp_Engine_i.hxx
-
-SOURCES = Session_Session_i.cxx
-SOURCES += Session_ServerThread.cxx
-SOURCES += Session_ServerLauncher.cxx
-SOURCES += Session_ServerCheck.cxx
-SOURCES += SalomeApp_Engine_i.cxx
-
-# ================>
-
-SOURCES += SALOME_Session_Server.cxx
-
-# <================
-
-#includes.files = $$HEADERS
-#includes.path = ../../include
-
-#INSTALLS += includes
-
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Session_ServerCheck.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
CORBA::Object_var obj = orb->resolve_initial_references( "NameService" );
CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj );
if ( !CORBA::is_nil( _root_context ) ) {
- setStep( ++current * myAttempts );
- break;
+ setStep( ++current * myAttempts );
+ break;
}
}
catch( CORBA::COMM_FAILURE& ) {
CORBA::Object_var obj = NS.Resolve( "/Registry" );
Registry::Components_var registry = Registry::Components::_narrow( obj );
if ( !CORBA::is_nil( registry ) ) {
- MESSAGE( "/Registry is found" );
- registry->ping();
- MESSAGE( "Registry was activated" );
- setStep( ++current * myAttempts );
- break;
+ MESSAGE( "/Registry is found" );
+ registry->ping();
+ MESSAGE( "Registry was activated" );
+ setStep( ++current * myAttempts );
+ break;
}
}
catch ( ServiceUnreachable& ) {
CORBA::Object_var obj = NS.Resolve( "/myStudyManager" );
SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow( obj );
if ( !CORBA::is_nil( studyManager ) ) {
- MESSAGE( "/myStudyManager is found" );
- studyManager->ping();
- MESSAGE( "StudyManager was activated" );
- setStep( ++current * myAttempts );
- break;
+ MESSAGE( "/myStudyManager is found" );
+ studyManager->ping();
+ MESSAGE( "StudyManager was activated" );
+ setStep( ++current * myAttempts );
+ break;
}
}
catch ( ServiceUnreachable& ) {
CORBA::Object_var obj = NS.Resolve( "/Kernel/ModulCatalog" );
SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow( obj );
if ( !CORBA::is_nil( catalog ) ){
- MESSAGE( "/Kernel/ModulCatalog is found" );
- catalog->ping();
- MESSAGE( "ModuleCatalog was activated" );
- setStep( ++current * myAttempts );
- break;
+ MESSAGE( "/Kernel/ModulCatalog is found" );
+ catalog->ping();
+ MESSAGE( "ModuleCatalog was activated" );
+ setStep( ++current * myAttempts );
+ break;
}
}
catch ( ServiceUnreachable& ) {
CORBA::Object_var obj = NS.Resolve( "/Kernel/Session" );
SALOME::Session_var session = SALOME::Session::_narrow( obj );
if ( !CORBA::is_nil( session ) ) {
- MESSAGE( "/Kernel/Session is found" );
- session->ping();
- MESSAGE( "SALOME_Session was activated" );
- setStep( ++current * myAttempts );
- break;
+ MESSAGE( "/Kernel/Session is found" );
+ session->ping();
+ MESSAGE( "SALOME_Session was activated" );
+ setStep( ++current * myAttempts );
+ break;
}
}
catch ( ServiceUnreachable& ) {
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
- ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
- NS.init_orb( orb );
- QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() );
- CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
- Engines::Container_var FScontainer = Engines::Container::_narrow( obj );
- if ( !CORBA::is_nil( FScontainer ) ) {
- MESSAGE( containerName.toLatin1().constData() << " is found" );
- FScontainer->ping();
- MESSAGE( "FactoryServer container was activated" );
- setStep( ++current * myAttempts );
- break;
- }
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
+ ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
+ NS.init_orb( orb );
+ QString containerName = QString( "/Containers/%1/FactoryServer" ).arg( Kernel_Utils::GetHostname().c_str() );
+ CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
+ Engines::Container_var FScontainer = Engines::Container::_narrow( obj );
+ if ( !CORBA::is_nil( FScontainer ) ) {
+ MESSAGE( containerName.toLatin1().constData() << " is found" );
+ FScontainer->ping();
+ MESSAGE( "FactoryServer container was activated" );
+ setStep( ++current * myAttempts );
+ break;
+ }
}
catch ( ServiceUnreachable& ) {
- MESSAGE( "Caught exception: Naming Service unreachable." );
- error = "Naming service unreachable";
+ MESSAGE( "Caught exception: Naming Service unreachable." );
+ error = "Naming service unreachable";
}
catch ( CORBA::COMM_FAILURE& ) {
- MESSAGE( "Caught CORBA::SystemException CommFailure." );
- error = "Caught CORBA::SystemException CommFailure.";
+ MESSAGE( "Caught CORBA::SystemException CommFailure." );
+ error = "Caught CORBA::SystemException CommFailure.";
}
catch ( CORBA::SystemException& ) {
- MESSAGE( "Caught CORBA::SystemException." );
- error = "Caught CORBA::SystemException.";
+ MESSAGE( "Caught CORBA::SystemException." );
+ error = "Caught CORBA::SystemException.";
}
catch ( CORBA::Exception& ) {
- MESSAGE( "Caught CORBA::Exception." );
- error = "Caught CORBA::Exception.";
+ MESSAGE( "Caught CORBA::Exception." );
+ error = "Caught CORBA::Exception.";
}
catch (...) {
- MESSAGE( "Caught unknown exception." );
- error = "Caught unknown exception.";
+ MESSAGE( "Caught unknown exception." );
+ error = "Caught unknown exception.";
}
if ( i == myAttempts-1 ) {
- setError( tr( "C++ container is not found.\n%1" ).arg ( error ) );
- return;
+ setError( tr( "C++ container is not found.\n%1" ).arg ( error ) );
+ return;
}
}
}
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
- ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
- NS.init_orb( orb );
- QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() );
- CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
- Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj );
- if ( !CORBA::is_nil( FSPcontainer ) ) {
- MESSAGE( containerName.toLatin1().constData() << " is found" );
- FSPcontainer->ping();
- MESSAGE("FactoryServerPy container was activated");
- setStep( ++current * myAttempts );
- break;
- }
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
+ ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
+ NS.init_orb( orb );
+ QString containerName = QString( "/Containers/%1/FactoryServerPy" ).arg( Kernel_Utils::GetHostname().c_str() );
+ CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
+ Engines::Container_var FSPcontainer = Engines::Container::_narrow( obj );
+ if ( !CORBA::is_nil( FSPcontainer ) ) {
+ MESSAGE( containerName.toLatin1().constData() << " is found" );
+ FSPcontainer->ping();
+ MESSAGE("FactoryServerPy container was activated");
+ setStep( ++current * myAttempts );
+ break;
+ }
}
catch ( ServiceUnreachable& ) {
- MESSAGE( "Caught exception: Naming Service unreachable." );
- error = "Naming service unreachable";
+ MESSAGE( "Caught exception: Naming Service unreachable." );
+ error = "Naming service unreachable";
}
catch ( CORBA::COMM_FAILURE& ) {
- MESSAGE( "Caught CORBA::SystemException CommFailure." );
- error = "Caught CORBA::SystemException CommFailure.";
+ MESSAGE( "Caught CORBA::SystemException CommFailure." );
+ error = "Caught CORBA::SystemException CommFailure.";
}
catch ( CORBA::SystemException& ) {
- MESSAGE( "Caught CORBA::SystemException." );
- error = "Caught CORBA::SystemException.";
+ MESSAGE( "Caught CORBA::SystemException." );
+ error = "Caught CORBA::SystemException.";
}
catch ( CORBA::Exception& ) {
- MESSAGE( "Caught CORBA::Exception." );
- error = "Caught CORBA::Exception.";
+ MESSAGE( "Caught CORBA::Exception." );
+ error = "Caught CORBA::Exception.";
}
catch (...) {
- MESSAGE( "Caught unknown exception." );
- error = "Caught unknown exception.";
+ MESSAGE( "Caught unknown exception." );
+ error = "Caught unknown exception.";
}
if ( i == myAttempts-1 ) {
- setError( tr( "Python container is not found.\n%1" ).arg ( error ) );
- return;
+ setError( tr( "Python container is not found.\n%1" ).arg ( error ) );
+ return;
}
}
}
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
- SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
- ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
- NS.init_orb( orb );
- QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() );
- CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
- Engines::Container_var SVcontainer = Engines::Container::_narrow( obj );
- if ( !CORBA::is_nil( SVcontainer ) ) {
- MESSAGE( containerName.toLatin1().constData() << " is found" );
- SVcontainer->ping();
- MESSAGE("SuperVisionContainer container was activated");
- setStep( ++current * myAttempts );
- break;
- }
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance();
+ ASSERT( SINGLETON_<SALOME_NamingService>::IsAlreadyExisting() );
+ NS.init_orb( orb );
+ QString containerName = QString( "/Containers/%1/SuperVisionContainer" ).arg( Kernel_Utils::GetHostname().c_str() );
+ CORBA::Object_var obj = NS.Resolve( containerName.toLatin1() );
+ Engines::Container_var SVcontainer = Engines::Container::_narrow( obj );
+ if ( !CORBA::is_nil( SVcontainer ) ) {
+ MESSAGE( containerName.toLatin1().constData() << " is found" );
+ SVcontainer->ping();
+ MESSAGE("SuperVisionContainer container was activated");
+ setStep( ++current * myAttempts );
+ break;
+ }
}
catch ( ServiceUnreachable& ) {
- MESSAGE( "Caught exception: Naming Service unreachable." );
- error = "Naming service unreachable";
+ MESSAGE( "Caught exception: Naming Service unreachable." );
+ error = "Naming service unreachable";
}
catch ( CORBA::COMM_FAILURE& ) {
- MESSAGE( "Caught CORBA::SystemException CommFailure." );
- error = "Caught CORBA::SystemException CommFailure.";
+ MESSAGE( "Caught CORBA::SystemException CommFailure." );
+ error = "Caught CORBA::SystemException CommFailure.";
}
catch ( CORBA::SystemException& ) {
- MESSAGE( "Caught CORBA::SystemException." );
- error = "Caught CORBA::SystemException.";
+ MESSAGE( "Caught CORBA::SystemException." );
+ error = "Caught CORBA::SystemException.";
}
catch ( CORBA::Exception& ) {
- MESSAGE( "Caught CORBA::Exception." );
- error = "Caught CORBA::Exception.";
+ MESSAGE( "Caught CORBA::Exception." );
+ error = "Caught CORBA::Exception.";
}
catch (...) {
- MESSAGE( "Caught unknown exception." );
- error = "Caught unknown exception.";
+ MESSAGE( "Caught unknown exception." );
+ error = "Caught unknown exception.";
}
if ( i == myAttempts-1 ) {
- setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) );
- return;
+ setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) );
+ return;
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Session_ServerCheck.hxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Session : implementation of Session_ServerLauncher.cxx
// File : Session_ServerLauncher.xx
// Author : Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-//
+
#include "Session_ServerLauncher.hxx"
#include "Session_ServerThread.hxx"
#include <QMutex>
#include <QWaitCondition>
-using namespace std;
/*!
default constructor not for use
*/
constructor
*/
Session_ServerLauncher::Session_ServerLauncher(int argc,
- char ** argv,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- QMutex *GUIMutex,
- QWaitCondition *ServerLaunch,
- QMutex *SessionMutex,
- QWaitCondition *SessionStarted)
+ char ** argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ QMutex *GUIMutex,
+ QWaitCondition *ServerLaunch,
+ QMutex *SessionMutex,
+ QWaitCondition *SessionStarted)
{
_argc = argc;
_argv = argv;
SCRUTE(_argv[iarg]);
_argCopy.push_back(_argv[iarg]);
switch (argState)
- {
- case 0: // looking for "--with"
- {
- if (strcmp(_argv[iarg],"--with")==0)
- argState = 1;
- break;
- }
- case 1: // looking for server type
- {
- for (int i=0; i<Session_ServerThread::NB_SRV_TYP; i++)
- if (strcmp(_argv[iarg],Session_ServerThread::_serverTypes[i])==0)
- {
- aServArg._servType = i;
- argState = 2;
- break;
- }
- break;
- }
- case 2: // looking for "("
- {
- if (strcmp(_argv[iarg],"(")!=0)
- {
- INFOS("parenthesis '(' is required here...");
- for (int i=0; i<iarg; i++)
- cerr << _argv[i] << " ";
- cerr << endl;
- throw SALOME_Exception(LOCALIZED("Error in command arguments, missing prenthesis"));
- }
- else
- {
- aServArg._firstArg=iarg+1; // arg after '('
- argState = 3;
- }
- break;
- }
- case 3: // looking for arguments
- {
- if (strcmp(_argv[iarg],")")==0) // end of arguments = ')'
- {
- aServArg._lastArg=iarg-1; // arg before ')'
- MESSAGE("server : "<< Session_ServerThread::_serverTypes[aServArg._servType]);
- for (int i=aServArg._firstArg; i<=aServArg._lastArg; i++)
- MESSAGE(" arg : " << _argCopy[i]);
- _argServToLaunch.push_back(aServArg);
- argState = 0;
- }
- break;
- }
- default:
- {
- ASSERT(0);
- break;
- }
- }
+ {
+ case 0: // looking for "--with"
+ {
+ if (strcmp(_argv[iarg],"--with")==0)
+ argState = 1;
+ break;
+ }
+ case 1: // looking for server type
+ {
+ // Temporary solution
+ // Issue 21337 - no more SalomeApp_Engine_i activation here
+ // TODO: To be removed as soon as any trace of SalomeAppEngine
+ // has been eliminated from KERNEL scripts
+ if (strcmp(_argv[iarg], "SalomeAppEngine")==0){
+ argState = 0;
+ iarg += 2; // skipping "()"
+ break;
+ }
+ // Temporary solution
+
+ for (int i=0; i<Session_ServerThread::NB_SRV_TYP; i++)
+ if (strcmp(_argv[iarg],Session_ServerThread::_serverTypes[i])==0)
+ {
+ aServArg._servType = i;
+ argState = 2;
+ break;
+ }
+ break;
+ }
+ case 2: // looking for "("
+ {
+ if (strcmp(_argv[iarg],"(")!=0)
+ {
+ INFOS("parenthesis '(' is required here...");
+ for (int i=0; i<iarg; i++)
+ std::cerr << _argv[i] << " ";
+ std::cerr << std::endl;
+ throw SALOME_Exception(LOCALIZED("Error in command arguments, missing prenthesis"));
+ }
+ else
+ {
+ aServArg._firstArg=iarg+1; // arg after '('
+ argState = 3;
+ }
+ break;
+ }
+ case 3: // looking for arguments
+ {
+ if (strcmp(_argv[iarg],")")==0) // end of arguments = ')'
+ {
+ aServArg._lastArg=iarg-1; // arg before ')'
+ MESSAGE("server : "<< Session_ServerThread::_serverTypes[aServArg._servType]);
+ for (int i=aServArg._firstArg; i<=aServArg._lastArg; i++)
+ MESSAGE(" arg : " << _argCopy[i]);
+ _argServToLaunch.push_back(aServArg);
+ argState = 0;
+ }
+ break;
+ }
+ default:
+ {
+ ASSERT(0);
+ break;
+ }
+ }
}
if (argState == 1)
throw SALOME_Exception(LOCALIZED("Error in command arguments, missing server type"));
void Session_ServerLauncher::ActivateAll()
{
- list<ServArg>::iterator itServ;
+ std::list<ServArg>::iterator itServ;
for (itServ = _argServToLaunch.begin(); itServ !=_argServToLaunch.end(); itServ++)
{
int argc = 2 + (*itServ)._lastArg - (*itServ)._firstArg;
if (argc>1)
{
for (int i=0; i<argc-1; i++)
- //argv[i+1] = _argCopy[(*itServ)._firstArg + i].c_str();
- argv[i+1] = _argv[(*itServ)._firstArg + i];
+ //argv[i+1] = _argCopy[(*itServ)._firstArg + i].c_str();
+ argv[i+1] = _argv[(*itServ)._firstArg + i];
}
MESSAGE("*** activating [" << argc << "] : " << argv[0]);
int argc=1;
char** argv = new char*[argc];
- argv[0] = "Session";
+ argv[0] = (char*)"Session";
Session_SessionThread* aServerThread
= new Session_SessionThread(argc, argv, _orb,_root_poa,_SessionMutex,_SessionStarted);
_serverThreads.push_front(aServerThread);
void Session_ServerLauncher::KillAll()
{
MESSAGE("Session_ServerLauncher::KillAll()");
- list<Session_ServerThread*>::reverse_iterator itServ;
+ std::list<Session_ServerThread*>::reverse_iterator itServ;
for (itServ = _serverThreads.rbegin(); itServ !=_serverThreads.rend(); itServ++)
{
delete (*itServ);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Session : implementation of Session_ServerLauncher.hxx
// File : Session_ServerLauncher.hxx
// Author : Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-//
+
#ifndef _SESSION_SERVERLAUNCHER_HXX_
#define _SESSION_SERVERLAUNCHER_HXX_
#include <string>
#include <QThread>
-using namespace std;
-
class SESSION_EXPORT ServArg
{
public:
public:
Session_ServerLauncher();
Session_ServerLauncher(int argc,
- char ** argv,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- QMutex *GUIMutex,
- QWaitCondition *ServerLaunch,
- QMutex *SessionMutex,
- QWaitCondition *SessionStarted);
+ char ** argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ QMutex *GUIMutex,
+ QWaitCondition *ServerLaunch,
+ QMutex *SessionMutex,
+ QWaitCondition *SessionStarted);
virtual ~Session_ServerLauncher();
void run();
void KillAll();
void ActivateAll();
private:
- int _argc;
- char ** _argv;
- CORBA::ORB_var _orb;
- PortableServer::POA_var _root_poa;
- QMutex* _GUIMutex;
- QWaitCondition* _ServerLaunch;
- QMutex* _SessionMutex;
- QWaitCondition* _SessionStarted;
- list<ServArg> _argServToLaunch;
- vector<string> _argCopy;
- list<Session_ServerThread*> _serverThreads;
+ int _argc;
+ char** _argv;
+ CORBA::ORB_var _orb;
+ PortableServer::POA_var _root_poa;
+ QMutex* _GUIMutex;
+ QWaitCondition* _ServerLaunch;
+ QMutex* _SessionMutex;
+ QWaitCondition* _SessionStarted;
+ std::list<ServArg> _argServToLaunch;
+ std::vector<std::string> _argCopy;
+ std::list<Session_ServerThread*> _serverThreads;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Session : implementation of Session_ServerThread.cxx
// File : Session_ServerThread.cxx
// Author : Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-// #include <SALOMEconfig.h>
-// #include CORBA_SERVER_HEADER(SALOME_Session)
-// #include CORBA_SERVER_HEADER(SALOMEDS)
-//
+
#include "Session_ServerThread.hxx"
#include <SALOME_NamingService.hxx>
#include <RegistryService.hxx>
#include "Session_Session_i.hxx"
-#include "SalomeApp_Engine_i.hxx"
#include <Utils_ORB_INIT.hxx>
#include <Utils_SINGLETON.hxx>
#include <QMutex>
#include <QWaitCondition>
-using namespace std;
-
-const int Session_ServerThread::NB_SRV_TYP = 7;
+const int Session_ServerThread::NB_SRV_TYP = 6;
const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container",
- "ModuleCatalog",
- "Registry",
- "SALOMEDS",
- "Session",
- "SalomeAppEngine",
+ "ModuleCatalog",
+ "Registry",
+ "SALOMEDS",
+ "Session",
"ContainerManager"};
/*!
constructor
*/
Session_ServerThread::Session_ServerThread(int argc,
- char ** argv,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa)
+ char ** argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
{
//MESSAGE("Session_ServerThread Constructor " << argv[0]);
_argc = argc;
MESSAGE("Server Thread type : "<<_serverTypes[i]);
switch (_servType) {
case 0: // Container
- {
- NamingService_WaitForServerReadiness(_NS,"/Registry");
- NamingService_WaitForServerReadiness(_NS,"/ContainerManager");
- ActivateContainer(_argc, _argv);
- break;
- }
+ {
+ NamingService_WaitForServerReadiness(_NS,"/Registry");
+ NamingService_WaitForServerReadiness(_NS,"/ContainerManager");
+ ActivateContainer(_argc, _argv);
+ break;
+ }
case 1: // ModuleCatalog
- {
- NamingService_WaitForServerReadiness(_NS,"/Registry");
- ActivateModuleCatalog(_argc, _argv);
- break;
- }
+ {
+ NamingService_WaitForServerReadiness(_NS,"/Registry");
+ ActivateModuleCatalog(_argc, _argv);
+ break;
+ }
case 2: // Registry
- {
- NamingService_WaitForServerReadiness(_NS,"");
- ActivateRegistry(_argc, _argv);
- break;
- }
+ {
+ NamingService_WaitForServerReadiness(_NS,"");
+ ActivateRegistry(_argc, _argv);
+ break;
+ }
case 3: // SALOMEDS
- {
- NamingService_WaitForServerReadiness(_NS,"/Kernel/ModulCatalog");
- ActivateSALOMEDS(_argc, _argv);
- break;
- }
+ {
+ NamingService_WaitForServerReadiness(_NS,"/Kernel/ModulCatalog");
+ ActivateSALOMEDS(_argc, _argv);
+ break;
+ }
case 4: // Session
- {
- NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
- string containerName = "/Containers/";
- containerName = containerName + Kernel_Utils::GetHostname();
- containerName = containerName + "/FactoryServer";
- NamingService_WaitForServerReadiness(_NS,containerName);
- ActivateSession(_argc, _argv);
- break;
- }
- case 5: // SalomeApp_Engine
- {
- NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
- ActivateEngine(_argc, _argv);
- break;
- }
- case 6: // Container Manager
- {
- NamingService_WaitForServerReadiness(_NS,"");
- ActivateContainerManager(_argc, _argv);
- break;
- }
+ {
+ NamingService_WaitForServerReadiness(_NS,"/myStudyManager");
+ std::string containerName = "/Containers/";
+ containerName = containerName + Kernel_Utils::GetHostname();
+ containerName = containerName + "/FactoryServer";
+ NamingService_WaitForServerReadiness(_NS,containerName);
+ ActivateSession(_argc, _argv);
+ break;
+ }
+ case 5: // Container Manager
+ {
+ NamingService_WaitForServerReadiness(_NS,"");
+ ActivateContainerManager(_argc, _argv);
+ break;
+ }
default:
- {
- ASSERT(0);
- break;
- }
+ {
+ ASSERT(0);
+ break;
+ }
}
}
}
}
void Session_ServerThread::ActivateModuleCatalog(int argc,
- char ** argv)
+ char ** argv)
{
try {
MESSAGE("ModuleCatalog thread started");
}
void Session_ServerThread::ActivateSALOMEDS(int argc,
- char ** argv)
+ char ** argv)
{
try {
MESSAGE("SALOMEDS thread started");
}
void Session_ServerThread::ActivateRegistry(int argc,
- char ** argv)
+ char ** argv)
{
MESSAGE("Registry thread started");
SCRUTE(argc);
const char *registryName = "Registry";
Registry::Components_var varComponents;
try {
- RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance();
+ RegistryService *ptrRegistry = new RegistryService;
ptrRegistry->SessionName( ptrSessionName );
ptrRegistry->SetOrb(_orb);
varComponents = ptrRegistry->_this();
+ ptrRegistry->_remove_ref(); //let poa manage registry service deletion
// The RegistryService must not already exist.
try {
}
catch( const CORBA::Exception &/*exx*/ ) {
}
- string absoluteName = string("/") + registryName;
+ std::string absoluteName = std::string("/") + registryName;
_NS->Register( varComponents , absoluteName.c_str() );
- MESSAGE("On attend les requetes des clients");
}
catch( const SALOME_Exception &ex ) {
INFOS( "Communication Error : " << ex.what() );
}
void Session_ServerThread::ActivateContainerManager(int argc,
- char ** argv)
+ char ** argv)
{
try {
PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
- cout << "Activate SalomeLauncher ......!!!! " << endl;
- SALOME_Launcher * myContainer = new SALOME_Launcher(_orb,root_poa);
+ std::cout << "Activate SalomeLauncher ......!!!! " << std::endl;
+ new SALOME_Launcher(_orb,root_poa);
}
catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.");
}
void Session_ServerThread::ActivateContainer(int argc,
- char ** argv)
+ char ** argv)
{
try {
MESSAGE("Container thread started");
MESSAGE("factory_poa does not exists, create...");
// define policy objects
PortableServer::ImplicitActivationPolicy_var implicitActivation =
- _root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION);
+ _root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION);
// default = NO_IMPLICIT_ACTIVATION
PortableServer::ThreadPolicy_var threadPolicy =
- _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL);
+ _root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL);
// default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
// create policy list
CORBA::PolicyList policyList;
policyList.length(2);
policyList[0] = PortableServer::ImplicitActivationPolicy::
- _duplicate(implicitActivation);
+ _duplicate(implicitActivation);
policyList[1] = PortableServer::ThreadPolicy::
- _duplicate(threadPolicy);
+ _duplicate(threadPolicy);
PortableServer::POAManager_var nil_mgr
- = PortableServer::POAManager::_nil();
+ = PortableServer::POAManager::_nil();
factory_poa = _root_poa->create_POA("factory_poa",
- nil_mgr,
- policyList);
+ nil_mgr,
+ policyList);
//with nil_mgr instead of pman,
//a new POA manager is created with the new POA
MESSAGE("pmanfac->activate()");
}
- char *containerName = "";
+ char *containerName = (char*)"";
if (argc >1) {
containerName = argv[1];
}
- Engines_Container_i * myContainer
- = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
+ new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
}
catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.");
}
}
-void Session_ServerThread::ActivateEngine(int /*argc*/, char ** /*argv*/)
-{
- try {
- MESSAGE("SalomeApp_Engine thread started");
- SalomeApp_Engine_i* anEngine = new SalomeApp_Engine_i();
- PortableServer::ObjectId_var id =_root_poa->activate_object( anEngine );
- MESSAGE("poa->activate_object( SalomeApp_Engine )");
-
- CORBA::Object_var obj = anEngine->_this();
- anEngine->_remove_ref();
- _NS->Register( obj ,"/SalomeAppEngine");
- }
- catch (CORBA::SystemException&) {
- INFOS("Caught CORBA::SystemException.");
- }
- catch (CORBA::Exception&) {
- INFOS("Caught CORBA::Exception.");
- }
- catch (...) {
- INFOS("Caught unknown exception.");
- }
-}
-
void Session_ServerThread::ActivateSession(int argc,
- char ** argv)
+ char ** argv)
{
MESSAGE("Session_ServerThread::ActivateSession() not implemented!");
}
constructor
*/
Session_SessionThread::Session_SessionThread(int argc,
- char** argv,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- QMutex* GUIMutex,
- QWaitCondition* GUILauncher)
+ char** argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ QMutex* GUIMutex,
+ QWaitCondition* GUILauncher)
: Session_ServerThread(argc, argv, orb, poa),
_GUIMutex( GUIMutex ),
_GUILauncher( GUILauncher )
}
void Session_SessionThread::ActivateSession(int argc,
- char ** argv)
+ char ** argv)
{
try {
MESSAGE("Session thread started");
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME Session : implementation of Session_ServerThread.hxx
// File : Session_ServerThread.hxx
// Author : Paul RASCLE, EDF
-// Module : SALOME
-// $Header$
-//
+
#ifndef _SESSION_SERVERTHREAD_HXX_
#define _SESSION_SERVERTHREAD_HXX_
#include <CORBA.h>
#include <string>
-using namespace std;
-
-void WaitForServerReadiness(string serverName);
+void WaitForServerReadiness(std::string serverName);
class SALOME_NamingService;
Session_ServerThread();
Session_ServerThread(int argc,
- char ** argv,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa);
+ char ** argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
virtual ~Session_ServerThread();
void Init();
protected:
public:
Session_SessionThread() {}
Session_SessionThread(int argc,
- char** argv,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- QMutex* GUIMutex,
- QWaitCondition* GUILauncher);
+ char** argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ QMutex* GUIMutex,
+ QWaitCondition* GUILauncher);
virtual ~Session_SessionThread();
protected:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SALOME Session : implementation of Session.idl
// File : SALOME_Session_i.cxx
// Author : Paul RASCLE, EDF
// Module : SALOME
-// $Header$
-//
+
#include "utilities.h"
#include "Session_Session_i.hxx"
#include "SUIT_Desktop.h"
#include "SUIT_Study.h"
+#include "Basics_Utils.hxx"
+
#include <QMutex>
#include <QWaitCondition>
#ifdef WNT
# include <process.h>
+#else
+#include <unistd.h>
#endif
-
-using namespace std;
-
/*!
constructor
*/
SALOME_Session_i::SALOME_Session_i(int argc,
- char ** argv,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- QMutex* GUIMutex,
- QWaitCondition* GUILauncher)
+ char ** argv,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ QMutex* GUIMutex,
+ QWaitCondition* GUILauncher)
{
_argc = argc ;
_argv = argv ;
_GUIMutex = GUIMutex;
_GUILauncher = GUILauncher;
_NS = new SALOME_NamingService(_orb);
+ _isShuttingDown = false;
//MESSAGE("constructor end");
}
/*!
returns Visu component
*/
-Engines::Component_ptr SALOME_Session_i::GetComponent(const char* theLibraryName)
+Engines::EngineComponent_ptr SALOME_Session_i::GetComponent(const char* theLibraryName)
{
- typedef Engines::Component_ptr TGetImpl(CORBA::ORB_ptr,
- PortableServer::POA_ptr,
- SALOME_NamingService*,QMutex*);
+ typedef Engines::EngineComponent_ptr TGetImpl(CORBA::ORB_ptr,
+ PortableServer::POA_ptr,
+ SALOME_NamingService*,QMutex*);
OSD_SharedLibrary aSharedLibrary(const_cast<char*>(theLibraryName));
if(aSharedLibrary.DlOpen(OSD_RTLD_LAZY))
if(OSD_Function anOSDFun = aSharedLibrary.DlSymb("GetImpl"))
return ((TGetImpl (*)) anOSDFun)(_orb,_poa,_NS,_GUIMutex);
- return Engines::Component::_nil();
+ return Engines::EngineComponent::_nil();
}
/*!
//MESSAGE("Session registered in Naming Service");
}
+/*!
+ Unregister session server from CORBA Naming Service
+*/
+void SALOME_Session_i::NSunregister()
+{
+ try
+ {
+ _NS->Destroy_Name("/Kernel/Session");
+ }
+ catch (ServiceUnreachable&)
+ {
+ INFOS("Caught exception: Naming Service Unreachable");
+ }
+ catch (...)
+ {
+ INFOS("Caught unknown exception from Naming Service");
+ }
+}
+
/*!
Launches the GUI if there is none.
The Corba method is oneway (corba client does'nt wait for GUI completion)
if ( !SUIT_Session::session() )
{
_GUILauncher->wakeAll();
- MESSAGE("SALOME_Session_i::GetInterface() called, starting GUI...")
- }
+ MESSAGE("SALOME_Session_i::GetInterface() called, starting GUI...");
+ }
}
/*!
{
public:
virtual void Execute() {
- SUIT_Session* session = SUIT_Session::session();
- session->closeSession( SUIT_Session::DONT_SAVE );
- //if ( SUIT_Application::getDesktop() )
- // QAD_Application::getDesktop()->closeDesktop( true );
+ if ( SUIT_Session::session() )
+ SUIT_Session::session()->closeSession( SUIT_Session::DONT_SAVE );
}
};
/*!
- Processes event to close session
+ Stop session (close all GUI windows)
*/
void SALOME_Session_i::StopSession()
{
- ProcessVoidEvent( new CloseEvent() );
+ _GUIMutex->lock();
+ _GUIMutex->unlock();
+ if ( SUIT_Session::session() ) {
+ ProcessVoidEvent( new CloseEvent() );
+ }
+}
+
+//! Shutdown session
+void SALOME_Session_i::Shutdown()
+{
+ _GUIMutex->lock();
+ bool isBeingShuttingDown = _isShuttingDown;
+ _isShuttingDown = true;
+ _GUIMutex->unlock();
+ if ( !isBeingShuttingDown ) {
+ if ( SUIT_Session::session() ) {
+ ProcessVoidEvent( new CloseEvent() );
+ }
+ else {
+ _GUILauncher->wakeAll();
+ }
+ }
}
/*!
_runningStudies = SUIT_Session::session()->activeApplication()->getNbStudies();
}
- _GUIMutex->unlock();
-
// getting stat info
SALOME::StatSession_var myStats = new SALOME::StatSession ;
if (_runningStudies)
myStats->state = SALOME::running ;
+ else if (_isShuttingDown)
+ myStats->state = SALOME::shutdown ;
else
myStats->state = SALOME::asleep ;
myStats->runningStudies = _runningStudies ;
myStats->activeGUI = _isGUI ;
+
+ _GUIMutex->unlock();
+
return myStats._retn() ;
}
#endif
}
+char* SALOME_Session_i::getHostname()
+{
+ std::string aHostName = Kernel_Utils::GetHostname();
+ return CORBA::string_dup( aHostName.data() );
+}
+
bool SALOME_Session_i::restoreVisualState(CORBA::Long theSavePoint)
{
class TEvent: public SALOME_Event {
virtual void Execute() {
SUIT_Study* study = SUIT_Session::session()->activeApplication()->activeStudy();
if ( study ) {
- study->restoreState(_savePoint);
+ study->restoreState(_savePoint);
}
}
};
if ( SUIT_Session::session() ) {
if ( SUIT_Session::session()->activeApplication() ) {
if ( SUIT_Session::session()->activeApplication()->desktop() ) {
- ProcessVoidEvent( new TEvent(theMessage) );
+ ProcessVoidEvent( new TEvent(theMessage) );
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SALOME Session : implementation of Session.idl
// File : Session_Session_i.hxx
// Author : Paul RASCLE, EDF
// Module : SALOME
-// $Header$
-//
+
#ifndef _SESSION_SESSION_I_HXX_
#define _SESSION_SESSION_I_HXX_
class QWaitCondition;
class SESSION_EXPORT SALOME_Session_i: public virtual POA_SALOME::Session,
- public virtual PortableServer::ServantBase
+ public virtual PortableServer::ServantBase
{
public:
SALOME_Session_i(int argc,
void GetInterface();
//! Return VISU component
- Engines::Component_ptr GetComponent(const char* theLibraryName);
+ Engines::EngineComponent_ptr GetComponent(const char* theLibraryName);
//! Stop the Session (must be idle): kill servant & server
void StopSession();
//! Get session state
SALOME::StatSession GetStatSession();
+ //! Shutdown session
+ void Shutdown();
+
//! Register the servant to Naming Service
void NSregister();
+ //! Unregister the servant from Naming Service
+ void NSunregister();
CORBA::Long GetActiveStudyId();
void ping(){};
CORBA::Long getPID();
+ char* getHostname();
//! Restors a visual state of the study at theSavePoint
bool restoreVisualState(CORBA::Long theSavePoint);
int _runningStudies ;
CORBA::ORB_var _orb;
PortableServer::POA_var _poa;
+ bool _isShuttingDown;
};
#endif
-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : SalomeApp
../Qtx/libqtx.la
dist_salomeres_DATA = resources/SalomeStyle.xml
+
+nodist_salomeres_DATA = Style_msg_fr.qm
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style.h
// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
//
#define STYLE_H
#if defined WIN32
-# if defined STYLE_SALOME_EXPORTS || defined STYLE_EXPORTS
+# if defined STYLE_SALOME_EXPORTS || defined STYLE_EXPORTS || defined SalomeStyle_EXPORTS
# define STYLE_SALOME_EXPORT _declspec( dllexport )
# else
# define STYLE_SALOME_EXPORT _declspec( dllimport )
<file>images/warning.png</file>
</qresource>
</RCC>
+
\ No newline at end of file
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_Model.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
//
#include "Style_Model.h"
+#include "Style_Salome.h"
#include <QtxResourceMgr.h>
static QColor mixColors( const QColor& c1, const QColor& c2 )
{
return QColor( (c1.red() + c2.red() ) / 2,
- (c1.green() + c2.green() ) / 2,
- (c1.blue() + c2.blue() ) / 2,
- (c1.alpha() + c2.alpha() ) / 2 );
+ (c1.green() + c2.green() ) / 2,
+ (c1.blue() + c2.blue() ) / 2,
+ (c1.alpha() + c2.alpha() ) / 2 );
}
/*!
if ( !QApplication::instance() ) // application object is not created yet
return;
- if ( !myAppData ) {
- // if not yes initialized from the application,
- // store current application's style, palette, etc
+ if ( !myAppData ) // if not yes initialized from the application init myAppData
myAppData = new AppData;
+
+ // store original application's style, palette, etc
+ if ( !Style_Salome::isActive() ) {
myAppData->myStyle = QApplication::style();
myAppData->myPalette = QApplication::palette();
myAppData->myFont = QApplication::font();
for ( int i = (int)QPalette::Active; i <= (int)QPalette::Inactive; i++ ) {
for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) {
myColors[ (QPalette::ColorGroup)i ][ (Style_Model::ColorRole)j ] =
- myAppData->myPalette.color( (QPalette::ColorGroup)i, (QPalette::ColorRole)j );
+ myAppData->myPalette.color( (QPalette::ColorGroup)i, (QPalette::ColorRole)j );
}
}
setWidgetEffect( (WidgetEffect)effect );
}
else if ( resourceMgr()->hasValue( section, "is-highlight-widget" ) ||
- resourceMgr()->hasValue( section, "is-raising-widget" ) ) {
+ resourceMgr()->hasValue( section, "is-raising-widget" ) ) {
bool highlight = resourceMgr()->booleanValue( section, "is-highlight-widget", false );
bool autoraise = resourceMgr()->booleanValue( section, "is-highlight-widget", false );
if ( highlight )
\sa color()
*/
void Style_Model::setColor( Style_Model::ColorRole role, const QColor& active,
- const QColor& inactive, const QColor& disabled )
+ const QColor& inactive, const QColor& disabled )
{
QColor ac = active, ic = inactive, dc = disabled;
switch ( role ) {
case WindowText:
case Text:
+ case ButtonText:
dc = color( Button ).darker();
break;
case Base:
\sa readColorValue()
*/
void Style_Model::writeColorValue( ColorRole role, const QString& prefix,
- QtxResourceMgr* resMgr, const QString& resSection ) const
+ QtxResourceMgr* resMgr, const QString& resSection ) const
{
QString active = QString( "%1-color" ).arg( prefix );
QString inactive = QString( "%1-color-inactive" ).arg( prefix );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_Model.h
// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_PrefDlg.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
//
l->addWidget( myActiveLab = new QLabel( tr( "Active" ), myContainer ), myCurrentRow, myCurrentColumn*4+1 );
l->addWidget( myInactiveLab = new QLabel( tr( "Inactive" ), myContainer ), myCurrentRow, myCurrentColumn*4+2 );
- l->addWidget( myDisabledLab = new QLabel( tr( "Disable" ), myContainer ), myCurrentRow, myCurrentColumn*4+3 );
+ l->addWidget( myDisabledLab = new QLabel( tr( "Disabled" ), myContainer ), myCurrentRow, myCurrentColumn*4+3 );
int w = 0;
w = qMax( w, myActiveLab->sizeHint().width() );
w = qMax( w, myInactiveLab->sizeHint().width() );
\internal
*/
void Style_PrefDlg::PaletteEditor::setColor( int id, const QColor& active,
- const QColor& inactive, const QColor& disabled )
+ const QColor& inactive, const QColor& disabled )
{
setColor( id, QPalette::Active, active );
setColor( id, QPalette::Inactive, inactive.isValid() ? inactive : active );
const QPalette pal = QPalette( c );
for ( int i = 0; i < (int)Style_Model::NColorRoles; i++ ) {
setColor( i,
- pal.color( QPalette::Active, (QPalette::ColorRole)i ),
- pal.color( QPalette::Inactive, (QPalette::ColorRole)i ),
- pal.color( QPalette::Disabled, (QPalette::ColorRole)i ) );
+ pal.color( QPalette::Active, (QPalette::ColorRole)i ),
+ pal.color( QPalette::Inactive, (QPalette::ColorRole)i ),
+ pal.color( QPalette::Disabled, (QPalette::ColorRole)i ) );
}
// Header
setColor( Style_Model::Header,
- pal.color( QPalette::Active, QPalette::Button ),
- pal.color( QPalette::Inactive, QPalette::Button ),
- pal.color( QPalette::Disabled, QPalette::Button ) );
+ pal.color( QPalette::Active, QPalette::Button ),
+ pal.color( QPalette::Inactive, QPalette::Button ),
+ pal.color( QPalette::Disabled, QPalette::Button ) );
// Checked
setColor( Style_Model::Checked,
- pal.color( QPalette::Active, QPalette::Base ),
- pal.color( QPalette::Inactive, QPalette::Base ),
- pal.color( QPalette::Disabled, QPalette::Base ) );
+ pal.color( QPalette::Active, QPalette::Base ),
+ pal.color( QPalette::Inactive, QPalette::Base ),
+ pal.color( QPalette::Disabled, QPalette::Base ) );
// Lines
setColor( Style_Model::Lines,
- pal.color( QPalette::Active, QPalette::Mid ),
- pal.color( QPalette::Inactive, QPalette::Mid ),
- pal.color( QPalette::Disabled, QPalette::Mid ) );
+ pal.color( QPalette::Active, QPalette::Mid ),
+ pal.color( QPalette::Inactive, QPalette::Mid ),
+ pal.color( QPalette::Disabled, QPalette::Mid ) );
// Slider
setColor( Style_Model::Slider,
- pal.color( QPalette::Active, QPalette::Button ),
- pal.color( QPalette::Inactive, QPalette::Button ),
- pal.color( QPalette::Disabled, QPalette::Button ) );
+ pal.color( QPalette::Active, QPalette::Button ),
+ pal.color( QPalette::Inactive, QPalette::Button ),
+ pal.color( QPalette::Disabled, QPalette::Button ) );
// ProgressBar
setColor( Style_Model::ProgressBar,
- pal.color( QPalette::Active, QPalette::Highlight ),
- pal.color( QPalette::Inactive, QPalette::Highlight ),
- pal.color( QPalette::Disabled, QPalette::Highlight ) );
+ pal.color( QPalette::Active, QPalette::Highlight ),
+ pal.color( QPalette::Inactive, QPalette::Highlight ),
+ pal.color( QPalette::Disabled, QPalette::Highlight ) );
// FieldLight
setColor( Style_Model::FieldLight,
- pal.color( QPalette::Active, QPalette::Light ),
- pal.color( QPalette::Inactive, QPalette::Light ),
- pal.color( QPalette::Disabled, QPalette::Light ) );
+ pal.color( QPalette::Active, QPalette::Light ),
+ pal.color( QPalette::Inactive, QPalette::Light ),
+ pal.color( QPalette::Disabled, QPalette::Light ) );
// FieldDark
setColor( Style_Model::FieldDark,
- pal.color( QPalette::Active, QPalette::Mid ).light( 125 ),
- pal.color( QPalette::Inactive, QPalette::Mid ).light( 125 ),
- pal.color( QPalette::Disabled, QPalette::Mid ).light( 125 ) );
+ pal.color( QPalette::Active, QPalette::Mid ).light( 125 ),
+ pal.color( QPalette::Inactive, QPalette::Mid ).light( 125 ),
+ pal.color( QPalette::Disabled, QPalette::Mid ).light( 125 ) );
// GridLine
setColor( Style_Model::GridLine,
- pal.color( QPalette::Active, QPalette::Mid ),
- pal.color( QPalette::Inactive, QPalette::Mid ),
- pal.color( QPalette::Disabled, QPalette::Mid ) );
+ pal.color( QPalette::Active, QPalette::Mid ),
+ pal.color( QPalette::Inactive, QPalette::Mid ),
+ pal.color( QPalette::Disabled, QPalette::Mid ) );
// HighlightWidget
setColor( Style_Model::HighlightWidget,
- pal.color( QPalette::Active, QPalette::Button ),
- pal.color( QPalette::Inactive, QPalette::Button ),
- pal.color( QPalette::Disabled, QPalette::Button ) );
+ pal.color( QPalette::Active, QPalette::Button ),
+ pal.color( QPalette::Inactive, QPalette::Button ),
+ pal.color( QPalette::Disabled, QPalette::Button ) );
// HighlightWidget
setColor( Style_Model::HighlightBorder,
- pal.color( QPalette::Active, QPalette::Button ).dark( 100 ),
- pal.color( QPalette::Inactive, QPalette::Button ).dark( 100 ),
- pal.color( QPalette::Disabled, QPalette::Button ).dark( 100 ) );
+ pal.color( QPalette::Active, QPalette::Button ).dark( 100 ),
+ pal.color( QPalette::Inactive, QPalette::Button ).dark( 100 ),
+ pal.color( QPalette::Disabled, QPalette::Button ).dark( 100 ) );
// Pointer
setColor( Style_Model::Pointer, Qt::black, Qt::black, Qt::black );
// BorderTop
setColor( Style_Model::BorderTop,
- aDarkActive.lighter(),
- aDarkInactive.lighter(),
- aDarkDisabled.lighter() );
+ aDarkActive.lighter(),
+ aDarkInactive.lighter(),
+ aDarkDisabled.lighter() );
// BorderBottom
setColor( Style_Model::BorderBottom,
- aDarkActive.darker(),
- aDarkInactive.darker(),
- aDarkDisabled.darker() );
+ aDarkActive.darker(),
+ aDarkInactive.darker(),
+ aDarkDisabled.darker() );
// TabBorderTop
setColor( Style_Model::TabBorderTop,
- aDarkActive.light().light().light(),
- aDarkInactive.light().light().light(),
- aDarkDisabled.light().light().light() );
+ aDarkActive.light().light().light(),
+ aDarkInactive.light().light().light(),
+ aDarkDisabled.light().light().light() );
// TabBorderBottom
setColor( Style_Model::TabBorderBottom,
- aDarkActive.dark().dark().dark(),
- aDarkInactive.dark().dark().dark(),
- aDarkDisabled.dark().dark().dark() );
+ aDarkActive.dark().dark().dark(),
+ aDarkInactive.dark().dark().dark(),
+ aDarkDisabled.dark().dark().dark() );
}
/*!
case Style_Model::BrightText: // 7
name = tr( "Bright text" ); break;
case Style_Model::ButtonText: // 8
- name = tr( "Buttont text" ); break;
+ name = tr( "Button text" ); break;
case Style_Model::Base: // 9
name = tr( "Base" ); break;
case Style_Model::Window: // 10
main->setMargin( 0 ); main->setSpacing( SPACING );
// create main widgets
- myStyleCheck = new QCheckBox( tr( "Use SALOME Style" ), this );
+ myStyleCheck = new QCheckBox( tr( "Enable SALOME Style" ), this );
QFrame* fr = new QFrame( this );
fr->setFrameStyle( QFrame::Box | QFrame::Sunken );
setButtonPosition( Right, Close );
setDialogFlags( AlignOnce );
myStylesList->setEditTriggers( QAbstractItemView::EditKeyPressed );
+ myStylesList->installEventFilter( this );
QStringList globalStyles = resourceMgr()->styles( Style_ResourceMgr::Global );
QStringList userStyles = resourceMgr()->styles( Style_ResourceMgr::User );
connect( myStyleCheck, SIGNAL( toggled( bool ) ), fr, SLOT( setEnabled( bool ) ) );
connect( myStylesList, SIGNAL( itemSelectionChanged() ), this, SLOT( onStyleChanged() ) );
connect( myStylesList, SIGNAL( itemChanged( QListWidgetItem* ) ),
- this, SLOT( onItemChanged( QListWidgetItem* ) ) );
+ this, SLOT( onItemChanged( QListWidgetItem* ) ) );
connect( myStylesList, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ),
- this, SLOT( onApply() ) );
+ this, SLOT( onApply() ) );
connect( myLinesCombo, SIGNAL( activated( int ) ), this, SLOT( onLinesType() ) );
connect( myPaletteEditor, SIGNAL( changed() ), this, SIGNAL( styleChanged() ) );
connect( myFontEdit, SIGNAL( changed( QFont ) ), this, SIGNAL( styleChanged() ) );
connect( mySplitterLength, SIGNAL( valueChanged( int ) ), this, SIGNAL( styleChanged() ) );
connect( mySliderSize, SIGNAL( valueChanged( int ) ), this, SIGNAL( styleChanged() ) );
connect( aGroup, SIGNAL( buttonClicked( QAbstractButton* ) ),
- this, SLOT( onEffectChanged( QAbstractButton* ) ) );
+ this, SLOT( onEffectChanged( QAbstractButton* ) ) );
connect( this, SIGNAL( styleChanged() ), this, SLOT( onChanged() ) );
connect( this, SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
\brief Process key press event
\param e key event
*/
-void Style_PrefDlg::keyPressEvent( QKeyEvent* e )
+bool Style_PrefDlg::eventFilter( QObject* o, QEvent* e )
{
- if ( e->key() == Qt::Key_Delete ) {
- QListWidgetItem* item = myStylesList->currentItem();
- if ( item && item->data( TypeRole ).toInt() == User ) {
- if ( QMessageBox::question( this,
- tr( "Delete user theme" ),
- tr( "Remove theme %1?" ).arg( item->text() ),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::Yes ) == QMessageBox::Yes ) {
- resourceMgr()->remove( item->data( NameRole ).toString() );
- resourceMgr()->save();
- delete item;
+ if ( o == myStylesList && e->type() == QEvent::KeyPress ) {
+ QKeyEvent* ke = (QKeyEvent*)e;
+ if ( ke->key() == Qt::Key_Delete ) {
+ QListWidgetItem* item = myStylesList->currentItem();
+ if ( item && item->data( TypeRole ).toInt() == User ) {
+ if ( QMessageBox::question( this,
+ tr( "Delete user theme" ),
+ tr( "Remove theme %1?" ).arg( item->text() ),
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::Yes ) == QMessageBox::Yes ) {
+ resourceMgr()->remove( item->data( NameRole ).toString() );
+ resourceMgr()->save();
+ delete item;
+ }
}
}
+ if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
+// onApply();
+// return true;
+ }
}
- QtxDialog::keyPressEvent( e );
+ return QtxDialog::eventFilter( o, e );
}
/*!
// ... first set Button color 'cause it is used to calculate other ones
if ( myPaletteEditor->isAuto() )
model->setColor( Style_Model::Button,
- myPaletteEditor->color( Style_Model::Button, QPalette::Active ) );
+ myPaletteEditor->color( Style_Model::Button, QPalette::Active ) );
else
model->setColor( Style_Model::Button,
- myPaletteEditor->color( Style_Model::Button, QPalette::Active ),
- myPaletteEditor->color( Style_Model::Button, QPalette::Inactive ),
- myPaletteEditor->color( Style_Model::Button, QPalette::Disabled ));
+ myPaletteEditor->color( Style_Model::Button, QPalette::Active ),
+ myPaletteEditor->color( Style_Model::Button, QPalette::Inactive ),
+ myPaletteEditor->color( Style_Model::Button, QPalette::Disabled ));
// ... then set all other colors
for ( int i = (int)Style_Model::WindowText; i < (int)Style_Model::LastColor; i++ ) {
if ( i == Style_Model::NoRole ) continue; // not supported
if ( i == Style_Model::Button ) continue; // already set
if ( myPaletteEditor->isAuto() )
model->setColor( (Style_Model::ColorRole)i,
- myPaletteEditor->color( i, QPalette::Active ) );
+ myPaletteEditor->color( i, QPalette::Active ) );
else
model->setColor( (Style_Model::ColorRole)i,
- myPaletteEditor->color( i, QPalette::Active ),
- myPaletteEditor->color( i, QPalette::Inactive ),
- myPaletteEditor->color( i, QPalette::Disabled ));
+ myPaletteEditor->color( i, QPalette::Active ),
+ myPaletteEditor->color( i, QPalette::Inactive ),
+ myPaletteEditor->color( i, QPalette::Disabled ));
}
model->setAutoPalette( myPaletteEditor->isAuto() ); // internal
// font
myStylesList->blockSignals( false );
}
onChanged();
-}
+}
/*!
\brief Called when widget effect is changed
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_PrefDlg.h
// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
//
~Style_PrefDlg();
void accept();
-
-protected:
- void keyPressEvent( QKeyEvent* );
+ bool eventFilter( QObject*, QEvent* );
private:
Style_ResourceMgr* resourceMgr();
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_ResourceMgr.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
//
setWorkingMode( IgnoreUserValues );
QMutableListIterator<QString> it( sl );
while ( it.hasNext() ) {
- QString s = it.next();
- if ( hasSection( s ) ) it.remove();
+ QString s = it.next();
+ if ( hasSection( s ) ) it.remove();
}
}
break;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_ResourceMgr.h
// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
//
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_Salome.cxx
// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
//
// set SALOME style
QApplication::style()->setParent( 0 ); // avoid deleting original application style
QApplication::setStyle( new Style_Salome() ); // set style
+ QApplication::setDesktopSettingsAware(false); // prevent the style changing from another tools
}
update(); // update style
}
// check if SALOME style is set to the application
if ( !isActive() )
return;
+
+ QApplication::setDesktopSettingsAware(true);
+
// restore previous style
model()->restore();
}
\param w widget
*/
void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComplex* opt,
- QPainter* p, const QWidget* w ) const
+ QPainter* p, const QWidget* w ) const
{
if ( checkDebugLevel(4) ) {
QWindowsStyle::drawComplexControl( cc, opt, p, w );
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
QRect optr = opt->rect, arUp = subControlRect( cc, spin, SC_SpinBoxUp, w );
- optr.setWidth( arUp.x()-optr.x()+1 );
+ if (spin->buttonSymbols != QAbstractSpinBox::NoButtons)
+ optr.setWidth( arUp.x()-optr.x()+1 );
double aRad = model()->widgetRounding( Style_Model::EditRadius );
bool antialized = model()->antialiasing();
QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
if ( hover )
drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true);
else
Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left,
model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr,
model()->color( Style_Model::FieldDark ), // Style_Model::fld_dark_clr,
- aBrdTopCol, aBrdBotCol, antialized, false );
+ aBrdTopCol, aBrdBotCol, antialized, false );
QRect aBtnRect = QRect( QPoint( arUp.x(), optr.y() ), QPoint( arUp.right(), optr.bottom() ) );
QColor aBtnCol = opt->palette.color( QPalette::Button );
bool aStateOn = opt->state & ( State_Sunken | State_On );
Style_Tools::shadowRect( p, aBtnRect, aRad, 0.0, SHADOW, Style_Tools::Right,
aBtnCol.light( BUT_PERCENT_COL ), aBtnCol.dark( BUT_PERCENT_COL ),
aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
- State flags = State_None;
QStyleOptionSpinBox copy;
PrimitiveElement pe;
if (spin->subControls & SC_SpinBoxUp) {
copy.rect = aBtnRect;
drawPrimitive(pe, ©, p, w);
}
- break;
+ break;
}
case CC_ComboBox: {
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
bool antialized = model()->antialiasing();
double aRad = model()->widgetRounding( Style_Model::EditRadius );
QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
if ( hover )
drawHoverRect(p, optr, opt->palette.color( QPalette::Window ), aRad, Style_Tools::Left, true);
else
Style_Tools::shadowRect( p, optr, aRad, LINE_GR_MARGIN, SHADOW, Style_Tools::Left,
model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr,
model()->color( Style_Model::FieldDark ), // Style_Model::fld_dark_clr,
- aBrdTopCol, aBrdBotCol, antialized, false );
+ aBrdTopCol, aBrdBotCol, antialized, false );
if (cmb->subControls & SC_ComboBoxArrow) {
State flags = State_None;
QColor aBtnCol = opt->palette.color( QPalette::Button );
p->setPen(cmb->palette.highlightedText().color());
}
else
- p->setPen(cmb->palette.text().color());
+ p->setPen(cmb->palette.text().color());
}
break;
}
if( hasHover() && (slider->state & State_Enabled) &&
(slider->state & State_MouseOver) ) {
- QRect moderated = w->rect();
+ QRect moderated = w->rect();
drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ),
model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false);
}
bool tickAbove = slider->tickPosition == QSlider::TicksAbove;
bool tickBelow = slider->tickPosition == QSlider::TicksBelow;
QColor aBtnCol = model()->color( Style_Model::Slider ); // Style_Model::slider_clr
- QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
// rect was changed on +/-DELTA_SLIDER value for correct painting Antialised border of slider
int aDelta = DELTA_SLIDER-1;
QRect slRect = QRect(x+aDelta, y+aDelta, wi-aDelta, he-aDelta);
menuArea = subControlRect(cc, toolbutton, SC_ToolButtonMenu, w);
if (w && ( qobject_cast<QToolBar *>(w->parentWidget() ) ||
- toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) )
- ) {
+ ( toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) ) )
+ ) {
QWindowsStyle::drawComplexControl( cc, opt, p, w );
return;
}
bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect;
bool isHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect;
bool hover = hasHover() && (opt->state & State_Enabled) && ( opt->state & State_MouseOver );
- QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
QRect aRect = button;
int aType = isMenuBtn ? Style_Tools::Left : Style_Tools::All;
if ( toolbutton->subControls & SC_ToolButton ) {
else
Style_Tools::shadowRect( p, aRect, aMinDelta, -1, SHADOW, aType, top, bottom,
aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
- }
+ }
if (toolbutton->subControls & SC_ToolButtonMenu) {
p->save();
if ( aMinDelta > menuArea.height()/2 )
fr.rect.adjust(3, 3, -3, -3);
if (toolbutton->features & QStyleOptionToolButton::Menu)
fr.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator, toolbutton, w), 0);
- Style_Tools::drawFocus( p, fr.rect, aMinDelta-1, isMenuBtn ? Style_Tools::Left :
+ Style_Tools::drawFocus( p, fr.rect, aMinDelta-1, isMenuBtn ? Style_Tools::Left :
Style_Tools::All, aBrdBotCol );
}
QStyleOptionToolButton label = *toolbutton;
QRect checkBoxRect = subControlRect( cc, opt, SC_GroupBoxCheckBox, w);
if (groupBox->subControls & QStyle::SC_GroupBoxFrame) {
QRect aRect = subControlRect( cc, opt, SC_GroupBoxFrame, w);
- QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::FrameRadius ), 0.,
SHADOW, Style_Tools::All,
model()->color( Style_Model::FieldLight ), // Style_Model::fld_light_clr
model()->color( Style_Model::FieldDark ), // Style_Model::fld_dark_clr
- aBrdTopCol, aBrdBotCol, false, false, false, false);
+ aBrdTopCol, aBrdBotCol, false, false, false, false);
}
// Draw title
if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) {
drawControl(CE_PushButtonLabel, &subopt, p, w);
if (btn->state & State_HasFocus) {
QRect aRect = subElementRect( SE_PushButtonFocusRect, btn, w );
- Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ),
+ Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ),
Style_Tools::All, model()->color( Style_Model::BorderBottom ) );
}
- break;
+ break;
}
case CE_PushButtonBevel:
- if ( qstyleoption_cast<const QStyleOptionButton *>(opt) ) {
+ if ( const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt) ) {
double aRad = model()->widgetRounding( Style_Model::ButtonRadius );
bool aStateOn = opt->state & ( State_Sunken | State_On );
bool isAutoRaising = model()->widgetEffect() == Style_Model::AutoRaiseEffect;
QColor aBtnCol = opt->palette.color( QPalette::Button );
QColor top = aBtnCol.light( BUT_PERCENT_COL ),
- bottom = aBtnCol.dark( BUT_PERCENT_COL );
+ bottom = aBtnCol.dark( BUT_PERCENT_COL );
QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
QRect r = opt->rect;
bool antialized = model()->antialiasing();
if ( isAutoRaising && hover && !aStateOn )
aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
else if ( isHighWdg && hover && !aStateOn )
drawHoverRect( p, r, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true );
- else
+ else
Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, top, bottom,
aBrdTopCol, aBrdBotCol, antialized, true, aStateOn );
- break;
+ if (btn->features & QStyleOptionButton::HasMenu) {
+ int mbi = pixelMetric(PM_MenuButtonIndicator, btn, w);
+ QStyleOptionButton newBtn = *btn;
+ newBtn.rect = QRect(r.right() - mbi-2, r.height()/2 - mbi/2, mbi, mbi);
+ drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w);
+ }
+ break;
}
case CE_DockWidgetTitle:
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
dwOpt->state & State_Enabled, aTitle,
floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText);
p->setFont(oldFont);
- }
- break;
+ }
+ break;
}
case CE_Splitter: {
QWindowsStyle::drawControl( ce, opt, p, w );
bool isSelected = opt->state & State_Selected;
bool isLast = tab->position == QStyleOptionTab::End ||
tab->position == QStyleOptionTab::OnlyOneTab;
- QColor aColor = opt->palette.color( QPalette::Window ),
+ QColor aColor = opt->palette.color( QPalette::Window ),
aDarkColor = aColor.dark( BUT_PERCENT_ON );
- QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
bool isHover = hasHover() && (opt->state & State_Enabled) &&
(opt->state & State_MouseOver);
DELTA_H_TAB, aColor, aDarkColor,
aBrdTopCol, aBrdBotCol, isSelected, isLast, isHover );
p->restore();
- } else
+ } else
QCommonStyle::drawControl(ce, opt, p, w);
break;
}
case CE_TabBarTabLabel:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- if ( tab->position == QStyleOptionTab::End ||
+ if ( tab->position == QStyleOptionTab::End ||
tab->position == QStyleOptionTab::OnlyOneTab ) {
QRect oldRect = opt->rect;
int aDelta = 0;
aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2);
oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right()-aDelta, oldRect.bottom() ) );
}
- else {
+ else {
aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2);
oldRect = QRect( oldRect.topLeft(), QPoint( oldRect.right(), oldRect.bottom()-aDelta ) );
- }
+ }
QStyleOptionTab* copyTab = (QStyleOptionTab*)tab;
copyTab->rect = oldRect;
QWindowsStyle::drawControl( ce, copyTab, p, w );
- }
+ }
else
QWindowsStyle::drawControl( ce, opt, p, w );
break;
QColor aBtnCol = opt->palette.color( QPalette::Window ),
top = aBtnCol.light( BUT_PERCENT_ON ),
bottom = aBtnCol.dark( BUT_PERCENT_ON );
- QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect;
if ( !aStateOn && aHighWdg && (opt->state & State_Enabled) &&
(opt->state & State_Selected) )
break;
case CE_ProgressBarGroove: {
QColor aBgColor = opt->palette.color( QPalette::Window ),
- top = aBgColor.light( BUT_PERCENT_ON ),
+ top = aBgColor.light( BUT_PERCENT_ON ),
bottom = aBgColor.dark( BUT_PERCENT_ON );
QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
int myHeight = pbBits.rect.height();
pbBits.state = State_None;
QRect aRect;
- QColor aColor = model()->color( Style_Model::ProgressBar ); // Style_Model::prbar_clr
- QColor top = aColor.light( BUT_PERCENT_COL );
- QColor bottom = aColor.dark( BUT_PERCENT_COL );
+ QColor aColor = model()->color( Style_Model::ProgressBar ); // Style_Model::prbar_clr
+ QColor top = aColor.light( BUT_PERCENT_COL );
+ QColor bottom = aColor.dark( BUT_PERCENT_COL );
int aType;
for (int i = 0; i <= nu; ++i) {
aType = Style_Tools::None;
if ( unit_width > 1 ) {
aTopClr = aColor.light();
aBotClr = aColor.dark();
- }
+ }
Style_Tools::shadowRect( p, aRect, model()->widgetRounding( Style_Model::EditRadius ), -1, 0,
aType, top, bottom, aTopClr, aBotClr, false, true );
x += reverse ? -unit_width : unit_width;
double aMargin = LINE_GR_MARGIN;
QLinearGradient gr(x,y,menuitem->rect.right(),y);
gr.setColorAt( 0.0, aBgColor );
- gr.setColorAt( aMargin/width, model()->color( Style_Model::FieldLight ) ); // Style_Model::fld_light_clr
+ gr.setColorAt( aMargin/width, model()->color( Style_Model::FieldLight ) ); // Style_Model::fld_light_clr
gr.setColorAt( 1.0, model()->color( Style_Model::FieldLight ) );
QBrush fill;
if ( act )
p->fillRect(menuitem->rect, fill);
if (menuitem->menuItemType == QStyleOptionMenuItem::Separator){
int yoff = y-1 + h / 2;
- QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
p->setPen( aBrdBotCol );
p->drawLine(x + 2, yoff, x + width - 4, yoff);
p->setPen( aBrdTopCol );
Qt::AlignLeft | Qt::AlignVCenter,
iconRect.size(), alignRect);
- // Here's absent filling of pixmap on basic color for editable comboBox
+ // Here's absent filling of pixmap on basic color for editable comboBox
drawItemPixmap(p, iconRect, Qt::AlignCenter, pixmap);
if (cb->direction == Qt::RightToLeft)
QColor top = aBtnCol.light( BUT_PERCENT_COL ),
bottom = aBtnCol.dark( BUT_PERCENT_COL );
QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol,
aBrdBotCol, false, true, aStateOn, true );
PrimitiveElement arrow;
if ( hasHover() && enabled && (opt->state & State_MouseOver) )
drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, false);
else {
- QColor aColor = model()->color( Style_Model::Slider ); // Style_Model::slider_clr
+ QColor aColor = model()->color( Style_Model::Slider ); // Style_Model::slider_clr
if ( !enabled )
aColor = opt->palette.button().color();
- QColor top = aColor.light( BUT_PERCENT_ON ),
+ QColor top = aColor.light( BUT_PERCENT_ON ),
bottom = aColor.dark( BUT_PERCENT_ON );
- QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
QRect r = opt->rect;
QPainterPath path = Style_Tools::roundRect( r, aRad,
Style_Tools::All );
\param w widget (optional)
*/
void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt,
- QPainter* p, const QWidget* w ) const
+ QPainter* p, const QWidget* w ) const
{
if ( checkDebugLevel(6) ) {
QWindowsStyle::drawPrimitive( pe, opt, p, w );
QColor aBtnCol = opt->palette.color( QPalette::Window ),
top = aBtnCol.light( BUT_PERCENT_ON ),
bottom = aBtnCol.dark( BUT_PERCENT_ON );
- QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
Style_Tools::shadowRect( p, opt->rect, 0, 0., SHADOW, Style_Tools::All, top,
bottom, aBrdTopCol, aBrdBotCol, false, false, false, false );
break;
case PE_PanelButtonTool : {
if ( w && ( opt->state & State_Enabled ) &&
( ( qobject_cast<QToolBar*>( w->parentWidget() ) ) ||
- ( w->inherits("QDockWidgetTitleButton") ) ||
+ ( w->inherits("QDockWidgetTitleButton") ) ||
( w->inherits("QtxWorkstackAreaTitleButton") ) ) ) {
bool aStateOn = opt->state & (State_Sunken | State_On);
bool aHighWdg = model()->widgetEffect() == Style_Model::HighlightEffect;
drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), 0, Style_Tools::All, true);
else {
QColor aBtnCol = opt->palette.color( QPalette::Window );
- QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
QColor top = aBtnCol.light( BUT_PERCENT_COL ),
bottom = aBtnCol.dark( BUT_PERCENT_COL );
Style_Tools::shadowRect( p, opt->rect, 0.0, 0, SHADOW, Style_Tools::All, top, bottom,
aBrdTopCol, aBrdBotCol, model()->antialiasing(), true, aStateOn );
- }
- break;
+ }
+ break;
}
else
QWindowsStyle::drawPrimitive( pe, opt, p, w );
case PE_FrameFocusRect: {
if (w && qobject_cast<QTabBar*>((QWidget*)w)) {
QTabBar* tabBar = qobject_cast<QTabBar*>((QWidget*)w);
- QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+ QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
+ QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
bool isHover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
Style_Tools::tabRect( p, opt->rect, (int)tabBar->shape(),
model()->widgetRounding( Style_Model::FrameRadius ), DELTA_H_TAB,
aBrdTopCol, aBrdBotCol, false, false, isHover, true );
}
else {
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QWindowsStyle::drawPrimitive( pe, opt, p, w );
}
break;
}
QRect rect = opt->rect;
QColor pen, brush;
if ( opt->state & State_Enabled ) {
- pen = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr
- brush = opt->palette.color( QPalette::Button );
+ pen = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr
+ brush = opt->palette.color( QPalette::Button );
if ( ( opt->state & State_Sunken ) && (opt->state & State_Enabled ) )
rect.moveTo( rect.x()+1, rect.y()+1 );
} else {
pen = opt->palette.mid().color();
- brush = pen;
+ brush = pen;
}
if ( pe == PE_IndicatorSpinPlus || pe == PE_IndicatorSpinMinus )
- Style_Tools::drawSign( pe, p, rect, pen, brush );
+ Style_Tools::drawSign( pe, p, rect, pen, brush );
else
- Style_Tools::drawArrow( pe, p, rect, pen, brush );
+ Style_Tools::drawArrow( pe, p, rect, pen, brush );
break;
}
case PE_IndicatorCheckBox: {
if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ),
- model()->widgetRounding( Style_Model::EditRadius ),
+ model()->widgetRounding( Style_Model::EditRadius ),
Style_Tools::All, false);
QBrush fill;
if (opt->state & State_NoChange)
}
const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt);
p->setPen(itemViewOpt && itemViewOpt->showDecorationSelected
- && opt->state & State_Selected ? opt->palette.highlightedText().color()
- : opt->palette.text().color());
+ && opt->state & State_Selected ? opt->palette.highlightedText().color()
+ : opt->palette.text().color());
if (opt->state & State_NoChange)
- p->setBrush( opt->palette.color( QPalette::Button ) );
+ p->setBrush( opt->palette.color( QPalette::Button ) );
p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11);
if (!(opt->state & State_Off)) {
QLineF lines[11];
QColor aColor = model()->color( Style_Model::Pointer ); // Style_Model::pointer_clr
if ( !(opt->state & State_Enabled ) )
aColor = opt->palette.mid().color();
- if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected )
+ if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected )
aColor = opt->palette.highlightedText().color();
p->setPen( QPen( aColor ) );
case PE_IndicatorRadioButton: {
if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ),
- model()->widgetRounding( Style_Model::ButtonRadius ),
+ model()->widgetRounding( Style_Model::ButtonRadius ),
Style_Tools::All, false);
#define PTSARRLEN(x) sizeof(x)/(sizeof(QPoint))
static const QPoint pts_border[] = { // border line
else {
QColor fillColor = opt->palette.color( QPalette::Base );
if ( enabled && on )
- fillColor = model()->color( Style_Model::Checked ); // Style_Model::checked_clr
+ fillColor = model()->color( Style_Model::Checked ); // Style_Model::checked_clr
QLinearGradient gr( 3, 3, 8, 8 );
gr.setColorAt( 0.0, fillColor.dark( BUT_PERCENT_ON ) );
gr.setColorAt( 1.0, fillColor );
}
if ( pe == PE_FrameLineEdit ) {
QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
+ QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr
bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver);
double aRad = model()->widgetRounding( Style_Model::EditRadius );
if ( hover )
drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true);
else {
Style_Tools::shadowRect( p, opt->rect, aRad, LINE_GR_MARGIN, SHADOW,
- Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ),
+ Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ),
model()->color( Style_Model::FieldDark ), aBrdTopCol, aBrdBotCol,
model()->antialiasing(), false );
}
if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
QRect rect = panel->rect.adjusted( panel->lineWidth, panel->lineWidth,
-panel->lineWidth, -panel->lineWidth);
- if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) {
+ if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) {
drawPrimitive( PE_FrameLineEdit, panel, p, w );
- }
+ }
else {
- QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255);
+ QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255);
p->fillRect( rect, c ); // panel->palette.brush(QPalette::Base)
- }
- }
+ }
+ }
}
break;
}
if ( aTabPos != QTabWidget::East )
aRoundType = aRoundType | Style_Tools::TopRight;
QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
+ QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
Style_Tools::shadowRect( p, opt->rect, model()->widgetRounding( Style_Model::FrameRadius ),
0., SHADOW, aRoundType,
model()->color( Style_Model::FieldLight ),
gr.setColorAt( 0.0, aBgCol.light( BUT_PERCENT_ON ) );
gr.setColorAt( 1.0, aBgCol );
p->fillRect( r, gr );
- QRect aRect = QRect( r.x(), r.y(), r.width(), r.height() );
drawHandle( p, r, horiz, false );
p->restore();
break;
if (const QStyleOptionTabBarBase *tbb
= qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
if (tbb->shape != QTabBar::RoundedNorth && tbb->shape != QTabBar::RoundedEast &&
- tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) {
+ tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) {
QWindowsStyle::drawPrimitive( pe, opt, p, w );
break;
}
if ( tabBar )
isLast = tabBar->currentIndex() == tabBar->count() -1;
QColor aColor = opt->palette.color( QPalette::Window );
- QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr
- QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr
bool isHover = hasHover() && (opt->state & State_Enabled) &&
(opt->state & State_MouseOver);
QPainterPath aSelPath = Style_Tools::tabRect( p, aSelRect, (int)tbb->shape,
- model()->widgetRounding( Style_Model::FrameRadius ),
- DELTA_H_TAB, aColor, aColor,
+ model()->widgetRounding( Style_Model::FrameRadius ),
+ DELTA_H_TAB, aColor, aColor,
aColor, aColor, isSelected, isLast, isHover, false, false );
if ( !aSelPath.isEmpty() )
aSelRect = aSelPath.controlPointRect().toRect();
QStyleOptionTabBarBase* copyOpt = (QStyleOptionTabBarBase*)tbb;
copyOpt->selectedTabRect = aSelRect;
- QCommonStyle::drawPrimitive( pe, copyOpt, p, w );
+ QCommonStyle::drawPrimitive( pe, copyOpt, p, w );
break;
}
case PE_IndicatorBranch: {
QPalette aPal = aWdg->palette();
double aMarg = LINE_GR_MARGIN;
QColor base = model()->color( Style_Model::Base ), // Style_Model::pal_base_clr
- light = base,
- light_alt = base.dark(110),//AlternateBase color
- dark = model()->color( Style_Model::FieldDark ); // Style_Model::fld_dark_clr
+ light = base,
+ light_alt = base.dark(110),//AlternateBase color
+ dark = model()->color( Style_Model::FieldDark ); // Style_Model::fld_dark_clr
//light.setAlpha( 0 ); // VSR commented: IPAL19262
QLinearGradient gr_h(r.x(), r.y(), r.right(), r.y());
gr_h.setColorAt( 0.0, dark );
// draw frame
p->fillRect( r, base );
p->fillRect( r, gr_h );
- p->fillRect( r, gr_v );
+ p->fillRect( r, gr_v );
aPal.setBrush( QPalette::Base, QBrush( light ) );
QLinearGradient gr_alt(r.x(), r.y(), r.right(), r.y());
\return metric value
*/
int Style_Salome::pixelMetric( PixelMetric metric, const QStyleOption* opt,
- const QWidget* w ) const
+ const QWidget* w ) const
{
if ( checkDebugLevel(7) ) {
return QWindowsStyle::pixelMetric( metric, opt, w );
if ( tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth ) {
int aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2);
sz.setWidth( sz.width() + aDelta );
- }
+ }
if ( tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedWest ) {
int aDelta = (int)(opt->rect.width()*DELTA_H_TAB/2);
sz.setHeight( sz.height() + aDelta );
- }
+ }
}
break;
}
aDelta += aHalfRect; // for right of line edit internal
sz.setWidth( res.width() + aDelta + aHalfRect );
}
- break;
+ break;
default:
break;
}
\return standard icon
*/
QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon,
- const QStyleOption* opt,
- const QWidget* w ) const
+ const QStyleOption* opt,
+ const QWidget* w ) const
{
if ( checkDebugLevel(10) ) {
return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
\return subcontrol rectangle
*/
QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex* opt,
- SubControl sc, const QWidget* wid ) const
+ SubControl sc, const QWidget* wid ) const
{
if ( checkDebugLevel(12) ) {
return QWindowsStyle::subControlRect( cc, opt, sc, wid );
else
res.setTop( res.top() - aRect - 1);
break;
- default:
- break;
+ default:
+ break;
}
break;
}
for ( int j = (int)Style_Model::WindowText; j < (int)Style_Model::NColorRoles; j++ ) {
if ( j == QPalette::NoRole ) continue;
pal.setColor( (QPalette::ColorGroup)i, (QPalette::ColorRole)j,
- model()->color( (Style_Model::ColorRole)j, (QPalette::ColorGroup)i ) );
+ model()->color( (Style_Model::ColorRole)j, (QPalette::ColorGroup)i ) );
}
}
QPixmapCache::clear();
for (QWidgetList::ConstIterator it2 = all.constBegin(); it2 != all.constEnd(); ++it2) {
w = *it2;
if (w->windowType() != Qt::Desktop && w->testAttribute(Qt::WA_WState_Polished)
- && !w->testAttribute(Qt::WA_SetStyle)) {
+ && !w->testAttribute(Qt::WA_SetStyle)) {
QEvent e(QEvent::StyleChange);
QApplication::sendEvent(w, &e);
polish( w );
{
const int d = 3;
for ( int i = 0; i <= h; i += d )
- lines.append( QLine( x, y+i, w, r.y()+i ) );
+ lines.append( QLine( x, y+i, w, r.y()+i ) );
}
break;
case Style_Model::Inclined:
w = w/d*d;
h = h/d*d;
for ( int i = 0; i <= w; i += d )
- lines.append( QLine( x+i, y, x, y+i ) );
+ lines.append( QLine( x+i, y, x, y+i ) );
for ( int i = 0; i < h; i += d )
- lines.append( QLine( left+w-i, top+h, left+w, top+h-i ) );
+ lines.append( QLine( left+w-i, top+h, left+w, top+h-i ) );
}
break;
default:
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_Salome.h
// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
//
virtual void polish( QWidget* );
virtual void unpolish( QWidget* );
virtual void drawComplexControl( ComplexControl, const QStyleOptionComplex*,
- QPainter*, const QWidget* = 0 ) const;
+ QPainter*, const QWidget* = 0 ) const;
virtual void drawControl( ControlElement, const QStyleOption*, QPainter*, const QWidget* ) const;
virtual void drawPrimitive( PrimitiveElement, const QStyleOption*,
- QPainter*, const QWidget* = 0 ) const;
+ QPainter*, const QWidget* = 0 ) const;
virtual int pixelMetric( PixelMetric, const QStyleOption* = 0,
- const QWidget* = 0 ) const;
+ const QWidget* = 0 ) const;
virtual QSize sizeFromContents ( ContentsType, const QStyleOption*,
- const QSize&, const QWidget* = 0 ) const;
+ const QSize&, const QWidget* = 0 ) const;
virtual QPixmap standardPixmap( StandardPixmap, const QStyleOption*,
- const QWidget* = 0) const;
+ const QWidget* = 0) const;
virtual int styleHint( StyleHint, const QStyleOption* = 0,
- const QWidget* = 0, QStyleHintReturn* = 0 ) const;
+ const QWidget* = 0, QStyleHintReturn* = 0 ) const;
virtual QRect subControlRect( ComplexControl, const QStyleOptionComplex*,
- SubControl, const QWidget* = 0 ) const;
+ SubControl, const QWidget* = 0 ) const;
virtual QRect subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const;
protected slots:
QIcon standardIconImplementation( StandardPixmap, const QStyleOption* = 0,
- const QWidget* = 0 ) const;
+ const QWidget* = 0 ) const;
private:
void updatePaletteColors();
void updateAllWidgets( QApplication* );
bool hasHover() const;
void drawHoverRect( QPainter*, const QRect&, const QColor&, const double,
- const int, const bool ) const;
+ const int, const bool ) const;
void drawHandle( QPainter*, const QRect&, bool, bool = true ) const;
void drawBackground( QPainter*, const QRect&, const QColor&, const bool,
- const bool = false, const bool = true ) const;
+ const bool = false, const bool = true ) const;
void drawBorder( QPainter*, const QRect&, bool ) const;
QString titleText( const QString&, const int, const int, QFont& ) const;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_Tools.cxx
// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
//
\param brush background painter brush
*/
void Style_Tools::drawSign( QStyle::PrimitiveElement type, QPainter* p, const QRect& r,
- const QColor& pen, const QColor& brush )
+ const QColor& pen, const QColor& brush )
{
p->save();
QPainterPath sign;
deltaY = -deltaY;
}
if ( correct )
- sign.moveTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) );
+ sign.moveTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) );
else {
- sign.moveTo( aDelta/3, -aDelta/2 );
- sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) );
- sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) );
+ sign.moveTo( aDelta/3, -aDelta/2 );
+ sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) );
+ sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) );
}
sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
if ( !correct ) {
- sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
- sign.lineTo( aDelta/3, -aDelta/2-deltaY );
- sign.lineTo( -aDelta/3, -aDelta/2-deltaY );
- sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+ sign.lineTo( aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
+ sign.lineTo( aDelta/3, -aDelta/2-deltaY );
+ sign.lineTo( -aDelta/3, -aDelta/2-deltaY );
+ sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
}
sign.lineTo( -deltaY/2, -aDelta/2-(deltaY/2-aDelta/3)-2*aDelta/3 );
sign.lineTo( -deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) );
if ( correct )
- sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) );
+ sign.lineTo( deltaY/2, -aDelta/2-(deltaY/2-aDelta/3) );
else {
- sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) );
- sign.lineTo( -aDelta/3, -aDelta/2 );
- sign.lineTo( aDelta/3, -aDelta/2);
+ sign.lineTo( -aDelta/3, -aDelta/2-(deltaY/2-aDelta/3) );
+ sign.lineTo( -aDelta/3, -aDelta/2 );
+ sign.lineTo( aDelta/3, -aDelta/2);
}
if ( correct )
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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 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.
//
-// 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
//
-// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : Style_Tools.h
// Author : Natalia Ermolaeva, Open CASCADE S.A.S.
//
static void drawArrow( QStyle::PrimitiveElement, QPainter*, const QRect&,
const QColor&, const QColor& );
static void drawSign( QStyle::PrimitiveElement, QPainter*, const QRect&,
- const QColor&, const QColor& );
+ const QColor&, const QColor& );
static QPainterPath tabRect( QPainter*, const QRect&, const int, const double,
const double, const QColor&, const QColor&,
const QColor&, const QColor&,
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ 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
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SALOME TOOLSGUI : implementation of desktop "Tools" optioins
# File : Makefile.in
# Author : Marc Tajchman (CEA)
# .po files to transform in .qm
nodist_salomeres_DATA = \
- ToolsGUI_msg_en.qm
+ ToolsGUI_msg_en.qm \
+ ToolsGUI_msg_fr.qm
libToolsGUI_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS) \
@KERNEL_CXXFLAGS@ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \
- -I$(top_builddir)/salome_adm/unix -I$(top_builddir)/idl \
- -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+ -I$(top_builddir)/idl -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
libToolsGUI_la_LDFLAGS = $(QT_MT_LIBS) ../SUIT/libsuit.la $(CAS_KERNEL) $(KERNEL_LDFLAGS) \
-lSalomeIDLKernel -lSALOMELocalTrace -lSalomeNS -lOpUtil $(top_builddir)/idl/libSalomeIDLGUI.la
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = ToolsGUI
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-BOOST_CPPFLAGS = $$(BOOSTDIR)/include
-
-KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
-
-CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
-
-INCLUDEPATH += $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${CORBA_INCLUDES} ../../salome_adm/unix ../../idl ../Qtx ../SUIT
-LIBS += -L../../lib -lsuit -lSalomeNS -lOpUtil $${CAS_KERNEL} $${KERNEL_LDFLAGS}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = ToolsGUI.h
-HEADERS += ToolsGUI_RegWidget.h
-HEADERS += ToolsGUI_CatalogGeneratorDlg.h
-
-SOURCES = ToolsGUI_CatalogGeneratorDlg.cxx
-SOURCES += ToolsGUI_RegWidget.cxx
-SOURCES += ToolsGUI.cxx
-
-TRANSLATIONS = resources/ToolsGUI_icons.ts \
- resources/ToolsGUI_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TOOLSGUI : implementation of desktop "Tools" optioins
// File : ToolsGUI.cxx
// Author : Nicolas REJNERI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TOOLSGUI : implementation of desktop "Tools" optioins
// File : ToolsGUI.h
// Author : Nicolas REJNERI
#define TOOLSGUI_H
#ifdef WIN32
-# ifdef TOOLSGUI_EXPORTS
+# if defined TOOLSGUI_EXPORTS || defined ToolsGUI_EXPORTS
# define TOOLSGUI_EXPORT __declspec(dllexport)
# else
# define TOOLSGUI_EXPORT __declspec(dllimport)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TOOLSGUI : implementation of desktop "Tools" optioins
// File : ToolsGUI_CatalogGeneratorDlg.cxx
// Author : Nicolas REJNERI
#include "utilities.h"
-using namespace std;
-
#define SPACING_SIZE 6
#define MARGIN_SIZE 11
#define MIN_EDIT_SIZE 250
QCString dir;
if (dir = getenv( modulename + "_ROOT_DIR")) {
IDLpath = IDLpath + "-I" + SUIT_Tools::addSlash( SUIT_Tools::addSlash(dir) +
- SUIT_Tools::addSlash("idl") +
- SUIT_Tools::addSlash("salome")) + " ";
+ SUIT_Tools::addSlash("idl") +
+ SUIT_Tools::addSlash("salome")) + " ";
}
}
void ToolsGUI_CatalogGeneratorDlg::updateButtonState()
{
myApplyBtn->setEnabled( !myIdlEdit->text().trimmed().isEmpty() &&
- !myXmlEdit->text().trimmed().isEmpty() );
+ !myXmlEdit->text().trimmed().isEmpty() );
}
/*!
if ( !XmlFile.isEmpty() && !IdlFile.isEmpty() ) {
if ( !QFile::exists( IdlFile ) ) {
SUIT_MessageBox::critical( this,
- tr("TOOLS_ERR_ERROR"),
- tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile) );
+ tr("TOOLS_ERR_ERROR"),
+ tr("TOOLS_ERR_FILE_NOT_EXIST").arg(IdlFile) );
}
else {
QString command = "";
if ( getenv("KERNEL_ROOT_DIR") )
- command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -K " + IDLpath + " -Wbcatalog=" + XmlFile;
+ command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/salome/runIDLparser -K " + IDLpath + " -Wbcatalog=" + XmlFile;
else {
- SUIT_MessageBox::critical( this,
- tr("TOOLS_ERR_ERROR"),
- tr("KERNEL_ROOT_DIR variable is not defined") );
+ SUIT_MessageBox::critical( this,
+ tr("TOOLS_ERR_ERROR"),
+ tr("KERNEL_ROOT_DIR variable is not defined") );
}
if (!Author.isEmpty()) command += ",author=" + Author;
if (!Version.isEmpty()) command += ",version=" + Version;
if (!PngFile.isEmpty()) {
- OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData());
- TCollection_AsciiString aFile = aPath.Name() + aPath.Extension();
- command += QString(",icon=") + QString(aFile.ToCString());
+ OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData());
+ TCollection_AsciiString aFile = aPath.Name() + aPath.Extension();
+ command += QString(",icon=") + QString(aFile.ToCString());
}
if (!CompName.isEmpty()) command += ",name=" + CompName;
if (!CompUserName.isEmpty()) command += ",username=" + CompUserName;
int res;
res = system( ( char* )( command.toLatin1().constData() ) );
if ( res == -1 ) {
- MESSAGE( "work failed (system command result = " << res );
+ MESSAGE( "work failed (system command result = " << res );
} else if (res == 217) {
- MESSAGE( "shell exec failed (system command result = " << res );
+ MESSAGE( "shell exec failed (system command result = " << res );
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME TOOLSGUI : implementation of desktop "Tools" optioins
// File : ToolsGUI_CatalogGeneratorDlg.h
// Author : Nicolas REJNERI
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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 RegistryDisplay : GUI for Registry server implementation
-// File : ToolsGUI_RegWidget.cxx
-// Author : Pascale NOYRET, EDF
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
# include "ToolsGUI_RegWidget.h"
-# include <QAction>
-# include <QDialog>
-# include <QSpinBox>
-# include <QPushButton>
-# include <QTreeWidget>
-# include <QTabWidget>
-# include <QStatusBar>
-# include <QTextEdit>
-# include <QTextStream>
-# include <QTimer>
-# include <QToolBar>
-# include <QEvent>
-# include <QKeyEvent>
-# include <QCloseEvent>
-# include <QFileInfo>
-# include <QGridLayout>
-# include <QLabel>
-# include <QGroupBox>
-
-# include <SALOME_NamingService.hxx>
-# include <ServiceUnreachable.hxx>
-# include <Utils_SINGLETON.hxx>
-# include <Utils_CommException.hxx>
-
-# include <utilities.h>
-# include <OpUtil.hxx>
-
-# include <Qtx.h>
-
-typedef int PIXELS;
+#include <QApplication>
+#include <QInputDialog>
+#include <QMenuBar>
+#include <QStatusBar>
+#include <QTabWidget>
+#include <QTextEdit>
+#include <QTimer>
+#include <QToolBar>
+#include <QTreeWidget>
+#include <QVBoxLayout>
+
+#include <Qtx.h>
+
+#include <SALOME_NamingService.hxx>
+#include <Utils_SINGLETON.hxx>
+#include <Utils_CommException.hxx>
#define MARGIN_SIZE 11
#define SPACING_SIZE 6
#define MIN_SPIN_WIDTH 100
-#define BOLD( text ) ( QString( "<b>" ) + QString( text ) + QString( "</b>" ) )
+#define BOLD( text ) QString( "<b>%1</b>" ).arg( QString( text ) )
static const char* const time_data[] = {
"16 16 6 1",
"......aaaaa....."};
/*!
- \brief Create components list.
+ \brief Get access to the Registry service
\internal
\param orb CORBA ORB reference
- \return list of registered components
+ \return reference to the Registry service
*/
-static Registry::Components_var MakeRegistry( CORBA::ORB_var& orb )
+static Registry::Components_ptr GetRegistry( CORBA::ORB_ptr orb )
{
-
- const char *registryName="Registry" ;
+ static const char* registryName = "Registry";
+ Registry::Components_var aRegistry;
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
- naming.init_orb( orb ) ;
+ SALOME_NamingService& naming = *SINGLETON_<SALOME_NamingService>::Instance();
+ naming.init_orb( orb );
- // Recuperation de la reference de l'objet
- CORBA::Object_var object = 0 ;
+ CORBA::Object_var object = 0;
try
{
- SCRUTE(registryName) ;
- object = naming.Resolve( registryName ) ;
- if(CORBA::is_nil(object)) throw CommException( "unable to find the RegistryService" ) ;
- }
- catch( const ServiceUnreachable& ex )
- {
- MESSAGE( ex.what() )
- exit( EXIT_FAILURE ) ;
+ object = naming.Resolve( registryName );
+ if ( CORBA::is_nil( object ) ) throw CommException( "Unable to find the Registry service" );
+ aRegistry = Registry::Components::_narrow( object );
}
- catch( const CORBA::Exception& )
+ catch( const CORBA::Exception& ex )
{
- exit( EXIT_FAILURE ) ;
+ MESSAGE( "Error: can't access Registry server" );
}
- // Specialisation de l'objet generique
-
- return Registry::Components::_narrow( object ) ;
-}
-
-/*!
- \class ToolsGUI_RegWidget::InfoWindow
- \brief Information window.
- \internal
-*/
-
-class ToolsGUI_RegWidget::InfoWindow : public QMainWindow
-{
-public:
- InfoWindow( QWidget* parent );
-
- void setText( const QString& text );
-
-protected:
- void keyPressEvent( QKeyEvent * e );
-
-private:
- QTextEdit* myTextView;
-};
-
-/*!
- \brief Constructor.
- \internal
- \param parent parent widget
-*/
-ToolsGUI_RegWidget::InfoWindow::InfoWindow( QWidget* parent )
-: QMainWindow( parent )
-{
- setAttribute( Qt::WA_DeleteOnClose );
-
- myTextView = new QTextEdit( this );
- myTextView->setReadOnly( true );
- setCentralWidget( myTextView );
- setMinimumSize( 450, 250 );
-}
-
-/*!
- \brief Set text to the information window.
- \internal
- \param text ionfo text
-*/
-void ToolsGUI_RegWidget::InfoWindow::setText( const QString& text )
-{
- myTextView->setText( text );
-}
-
-/*!
- \brief Key press event handler. Closeswindow on \c Escape key pressing.
- \internal
- \param e key press event
-*/
-void ToolsGUI_RegWidget::InfoWindow::keyPressEvent( QKeyEvent * e )
-{
- QMainWindow::keyPressEvent( e );
- if ( e->key() == Qt::Key_Escape )
- close();
-}
-
-/*!
- \class ToolsGUI_RegWidget::HelpWindow
- \brief Help window.
- \internal
-*/
-
-class ToolsGUI_RegWidget::HelpWindow : public QMainWindow
-{
-public:
- HelpWindow( QWidget* parent );
- ~HelpWindow();
-
- void setText( const QString& text );
-
-private:
- QTextEdit* myTextView;
-};
-
-/*!
- \brief Constructor.
- \internal
- \param parent parent widget
-*/
-ToolsGUI_RegWidget::HelpWindow::HelpWindow( QWidget* parent )
-: QMainWindow( parent )
-{
- setAttribute( Qt::WA_DeleteOnClose );
- setWindowTitle( tr( "Help" ) );
-
- myTextView = new QTextEdit( this );
- myTextView->setReadOnly( true );
- QPalette pal = myTextView->palette();
-
- pal.setBrush( QPalette::Active, QPalette::Highlight, QBrush( QColor( 0, 0, 128 ) ) );
- pal.setBrush( QPalette::Active, QPalette::HighlightedText, QBrush( Qt::white ) );
- pal.setBrush( QPalette::Active, QPalette::Base, QBrush( QColor( 255,255,220 ) ) );
- pal.setBrush( QPalette::Active, QPalette::Text, QBrush( Qt::black ) );
-
- pal.setBrush( QPalette::Inactive, QPalette::Highlight, QBrush( QColor( 0, 0, 128 ) ) );
- pal.setBrush( QPalette::Inactive, QPalette::HighlightedText, QBrush( Qt::white ) );
- pal.setBrush( QPalette::Inactive, QPalette::Base, QBrush( QColor( 255,255,220 ) ) );
- pal.setBrush( QPalette::Inactive, QPalette::Text, QBrush( Qt::black ) );
-
- pal.setBrush( QPalette::Disabled, QPalette::Highlight, QBrush( QColor( 0, 0, 128 ) ) );
- pal.setBrush( QPalette::Disabled, QPalette::HighlightedText, QBrush( Qt::white ) );
- pal.setBrush( QPalette::Disabled, QPalette::Base, QBrush( QColor( 255,255,220 ) ) );
- pal.setBrush( QPalette::Disabled, QPalette::Text, QBrush( Qt::black ) );
-
- myTextView->setPalette( pal );
-
- setCentralWidget( myTextView );
- setMinimumSize( 450, 250 );
-
- QFile f ( "tmp.txt" );
- if ( f.open( QIODevice::ReadOnly ) ) {
- QTextStream t( &f );
- while ( !t.atEnd() ) {
- myTextView->append( t.readLine() );
- }
- }
- f.close();
-}
-
-/*!
- \brief Destructor.
- \internal
-*/
-ToolsGUI_RegWidget::HelpWindow::~HelpWindow()
-{
-};
-
-/*!
- \brief Set text to the help window.
- \internal
- \param text help text
-*/
-void ToolsGUI_RegWidget::HelpWindow::setText( const QString& text )
-{
- myTextView->setText( text );
-}
-
-/*!
- \class ToolsGUI_RegWidget::IntervalWindow
- \brief Dialog box to enter time delay between registry window updates
- \internal
-*/
-
-class ToolsGUI_RegWidget::IntervalWindow : public QDialog
-{
-public:
- IntervalWindow( QWidget* parent );
- ~IntervalWindow();
-
- QPushButton* Ok();
- QPushButton* Cancel();
-
- int getValue();
- void setValue( int );
-
-private:
- QSpinBox* mySpinBox;
- QPushButton* myButtonOk;
- QPushButton* myButtonCancel;
-};
-
-/*!
- \brief Constructor.
- \internal
- \param parent parent widget
-*/
-ToolsGUI_RegWidget::IntervalWindow::IntervalWindow ( QWidget* parent )
-: QDialog( parent )
-{
- setModal( true );
- setAttribute( Qt::WA_DeleteOnClose );
-
- setWindowTitle( tr( "Refresh Interval" ) );
- setSizeGripEnabled( true );
-
- QGridLayout* topLayout = new QGridLayout( this );
- topLayout->setSpacing( SPACING_SIZE );
- topLayout->setMargin( MARGIN_SIZE );
-
- QGroupBox* intervalGrp = new QGroupBox( this );
- intervalGrp->setObjectName( "intervalGrp" );
- QGridLayout* intervalGrpLayout = new QGridLayout( intervalGrp );
- intervalGrpLayout->setAlignment( Qt::AlignTop );
- intervalGrpLayout->setSpacing( SPACING_SIZE );
- intervalGrpLayout->setMargin( MARGIN_SIZE );
-
- QHBoxLayout* aBtnLayout = new QHBoxLayout;
- aBtnLayout->setSpacing( SPACING_SIZE );
- aBtnLayout->setMargin( 0 );
-
- myButtonOk = new QPushButton( this );
- myButtonOk->setObjectName( "buttonOk" );
- myButtonOk->setText( tr( "BUT_OK" ) );
- myButtonOk->setAutoDefault( TRUE );
- myButtonOk->setDefault( TRUE );
-
- myButtonCancel = new QPushButton( this );
- myButtonCancel->setObjectName( "buttonCancel" );
- myButtonCancel->setText( tr( "BUT_CANCEL" ) );
- myButtonCancel->setAutoDefault( TRUE );
-
- QLabel* TextLabel = new QLabel( intervalGrp );
- TextLabel->setObjectName( "TextLabel" );
- TextLabel->setText( tr( "Please, enter a number of seconds:" ) );
-
- mySpinBox = new QSpinBox( intervalGrp );
- mySpinBox->setMinimum( 1 );
- mySpinBox->setMaximum( 999999999 );
- mySpinBox->setSingleStep( 1 );
- mySpinBox->setObjectName( "SpinBox" );
- mySpinBox->setValue( 100 );
- mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- mySpinBox->setMinimumWidth(MIN_SPIN_WIDTH);
-
- intervalGrpLayout->addWidget(TextLabel, 0, 0);
- intervalGrpLayout->addWidget(mySpinBox, 0, 1);
-
- aBtnLayout->addWidget( myButtonOk );
- aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
- aBtnLayout->addWidget( myButtonCancel );
-
- topLayout->addWidget( intervalGrp, 0, 0 );
- topLayout->addLayout( aBtnLayout, 1, 0 );
-}
-
-/*!
- \brief Destructor
- \internal
-*/
-ToolsGUI_RegWidget::IntervalWindow::~IntervalWindow()
-{
-}
-
-/*!
- \brief Set time interval value
- \internal
- \param size interval value
-*/
-void ToolsGUI_RegWidget::IntervalWindow::setValue( const int size )
-{
- mySpinBox->setValue(size);
-}
-
-/*!
- \brief Get time interval value
- \internal
- \return interval value
-*/
-int ToolsGUI_RegWidget::IntervalWindow::getValue()
-{
- return mySpinBox->value();
-}
-
-/*!
- \brief Get \c OK button
- \internal
- \return a pointer to \c OK button
-*/
-QPushButton* ToolsGUI_RegWidget::IntervalWindow::Ok()
-{
- return myButtonOk;
-}
-
-/*!
- \brief Get \c Cancel button
- \internal
- \return a pointer to \c Cancel button
-*/
-QPushButton* ToolsGUI_RegWidget::IntervalWindow::Cancel()
-{
- return myButtonCancel;
+ return aRegistry._retn();
}
/*!
\param orb CORBA ORB reference
\param parent parent widget
*/
-ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var& orb,
- QWidget* parent )
+ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_ptr orb,
+ QWidget* parent )
{
if ( !myRegWidgetPtr )
myRegWidgetPtr = new ToolsGUI_RegWidget( orb, parent );
return myRegWidgetPtr;
}
-/*!
- \brief This virtual function is reimplenented to disable popup menu on dock areas
- (instead of QMainWindow::setDockMenuEnabled( false ) method used in Qt3).
- \return always 0 to disable menu
-*/
-QMenu* ToolsGUI_RegWidget::createPopupMenu()
-{
- QMenu* aPopup = 0;
- return aPopup;
-}
-
/*!
\brief Constructor
\param orb CORBA ORB reference
\param parent parent widget
*/
-ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent )
-: QMainWindow( parent, Qt::Window ),
- _VarComponents( MakeRegistry(orb) ),
- _clients( 0 ),
- _history( 0 ),
- _parent( parent ),
- _tabWidget( 0 ),
- _refresh( 0 ),
- _interval( 0 ),
- myInfoWindow( 0 ),
- myHelpWindow( 0 ),
- myIntervalWindow( 0 )
+ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent )
+: QMainWindow( parent )
{
- setAttribute( Qt::WA_DeleteOnClose );
+ myOrb = CORBA::ORB::_duplicate( orb );
- if ( parent )
- setWindowIcon( parent->windowIcon() );
-
- // pixmap for buttons
- QPixmap image_refresh ( ( const char** ) refresh_data );
- QPixmap image_interval( ( const char** ) time_data );
- QPixmap image_close ( ( const char** ) close_data );
+ // set window attributes
+ setAttribute( Qt::WA_DeleteOnClose );
+ setWindowTitle( tr( "TLT_REGISTRY" ) );
- // Buttons definition
- QToolBar* topbar = new QToolBar( tr("Toolbar"), this );
- topbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
- addToolBar( Qt::TopToolBarArea, topbar );
+ // show status bar
+ statusBar();
- _refresh = topbar->addAction(image_refresh, tr( "Refresh" ), this, SLOT( slotListeSelect() ));
- _refresh->setToolTip( "" );
- _refresh->setStatusTip( tr("Immediately updates list of components") );
+ // get main menu bar
+ QMenuBar* mainMenu = menuBar();
- /* PAL5540 - this button is needless
- QPushButton* help = new QPushButton( tr( "Help" ), topbar );
- connect( help, SIGNAL( clicked() ), this, SLOT( slotHelp() ) );
- QToolTip::add( help, "", toolTipGroup(), tr("Opens Help window") );
- */
+ // add 'Actions' menu
+ QMenu* m = mainMenu->addMenu( tr( "MNU_ACTIONS" ) );
+ // add 'Actions' toolbar
+ QToolBar* tb = addToolBar( tr( "TB_ACTIONS" ) );
+
+ // create actions
+ myActions[Refresh] = new QAction( QPixmap( refresh_data ), tr( "MEN_REFRESH" ), this );
+ myActions[Refresh]->setStatusTip( tr( "STB_REFRESH" ) );
+ connect( myActions[Refresh], SIGNAL( triggered() ), this, SLOT( refresh() ) );
+ m->addAction( myActions[Refresh] );
+ tb->addAction( myActions[Refresh] );
- _interval = topbar->addAction(image_interval, tr( "Interval" ), this, SLOT( slotSelectRefresh() ));
- _interval->setToolTip( "" );
- _interval->setStatusTip( tr("Changes refresh interval") );
-
- topbar->addSeparator();
-
- _close = topbar->addAction( image_close, tr("Close"), this, SLOT( close() ));
- _close->setToolTip( "" );
- _close->setStatusTip( tr("Closes Registry window") );
+ myActions[Interval] = new QAction( QPixmap( time_data ), tr( "MEN_INTERVAL" ), this );
+ myActions[Interval]->setStatusTip( tr( "STB_INTERVAL" ) );
+ connect( myActions[Interval], SIGNAL( triggered() ), this, SLOT( refreshInterval() ) );
+ m->addAction( myActions[Interval] );
+ tb->addAction( myActions[Interval] );
- // Display area and associated slots definition
- _tabWidget = new QTabWidget( this );
- _clients = new QTreeWidget( _tabWidget );
- SetListe();
- _history = new QTreeWidget( _tabWidget );
- SetListeHistory();
-
- _tabWidget->addTab( _clients, tr( "Running" ) );
- _tabWidget->addTab( _history, tr( "History" ) );
- connect( _tabWidget, SIGNAL( currentChanged( QWidget* )), this, SLOT( slotListeSelect() ) );
- connect( _clients, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( slotClientChanged( QTreeWidgetItem* , int ) ) );
- connect( _history, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( slotHistoryChanged( QTreeWidgetItem* , int ) ) );
- setCentralWidget( _tabWidget );
+ m->addSeparator();
+ tb->addSeparator();
+
+ myActions[Close] = new QAction( QPixmap( close_data ), tr( "MEN_CLOSE" ), this );
+ myActions[Close]->setStatusTip( tr( "STB_CLOSE" ) );
+ connect( myActions[Close], SIGNAL( triggered() ), this, SLOT( close() ) );
+ m->addAction( myActions[Close] );
+ tb->addAction( myActions[Close] );
+
+ // central widget
+ setCentralWidget( new QWidget( this ) );
+
+ // Create tab widget: SALOME serives list (running and history)
+ QTabWidget* tabWidget = new QTabWidget( centralWidget() );
+
+ myViews[Clients] = new QTreeWidget( tabWidget );
+ myViews[Clients]->setColumnCount( 6 );
+ myViews[Clients]->setAllColumnsShowFocus( true );
+ myViews[Clients]->setRootIsDecorated( false );
+ QStringList runningLabels;
+ runningLabels << tr( "HDR_COMPONENT" ) << tr( "HDR_PID" ) << tr( "HDR_USERNAME" )
+ << tr( "HDR_HOSTNAME" ) << tr( "HDR_STARTED" ) << tr( "HDR_HELLO" );
+ myViews[Clients]->setHeaderLabels( runningLabels );
+ tabWidget->addTab( myViews[Clients], tr( "TAB_RUNNING" ) );
+
+ myViews[History] = new QTreeWidget( tabWidget );
+ myViews[History]->setColumnCount(6);
+ myViews[History]->setAllColumnsShowFocus( true );
+ myViews[History]->setRootIsDecorated( false );
+ QStringList historyLabels;
+ historyLabels << tr( "HDR_COMPONENT" ) << tr( "HDR_PID" ) << tr( "HDR_USERNAME" )
+ << tr( "HDR_HOSTNAME" ) << tr( "HDR_STARTED" ) << tr( "HDR_FINISHED" );
+ myViews[History]->setHeaderLabels( historyLabels );
+ tabWidget->addTab( myViews[History], tr( "TAB_HISTORY" ) );
+
+ connect( tabWidget, SIGNAL( currentChanged( int ) ), this, SLOT( refresh() ) );
+ connect( myViews[Clients], SIGNAL( itemActivated( QTreeWidgetItem*, int ) ),
+ this, SLOT( showDetails( QTreeWidgetItem*, int ) ) );
+ connect( myViews[History], SIGNAL( itemActivated( QTreeWidgetItem*, int ) ),
+ this, SLOT( showDetails( QTreeWidgetItem*, int ) ) );
+
+ // create information window
+ myDetails = new QTextEdit( centralWidget() );
+ myDetails->setReadOnly( true );
+ myDetails->setMinimumHeight( 100 );
+
+ // layout widgets
+ QVBoxLayout* topLayout = new QVBoxLayout( centralWidget() );
+ topLayout->setMargin( 0 );
+ topLayout->setSpacing( SPACING_SIZE );
+ topLayout->addWidget( tabWidget );
+ topLayout->addWidget( myDetails );
- // Timer definition (used to automaticaly refresh the display area)
- _counter = new QTimer( this );
- connect( _counter, SIGNAL( timeout() ), this, SLOT( slotListeSelect() ) );
- myRefreshInterval = 10;
- _counter->start( myRefreshInterval * 1000 );
+ // install auto-update timer
+ myTimer = new QTimer( this );
+ connect( myTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
+ myTimer->start( 10000 ); // 10 seconds by default
- PIXELS xpos = 160 ;
- PIXELS ypos = 100 ;
- PIXELS largeur = 800 ;
- PIXELS hauteur = 350 ;
- setGeometry( xpos, ypos, largeur, hauteur ) ;
- setWindowTitle( tr( "Registry" ) ) ;
- statusBar()->showMessage(" ");
-
- slotListeSelect();
+ // resize window and set its position
+ resize( 800, 400 );
+ Qtx::alignWidget( (QWidget*)this, (QWidget*)QApplication::desktop(), Qtx::AlignCenter );
+
+ // refresh registry information
+ refresh();
}
/*!
*/
ToolsGUI_RegWidget::~ToolsGUI_RegWidget()
{
- _counter->stop();
myRegWidgetPtr = 0;
};
/*!
- \brief Event filter
- \param object event receiver
- \param event event being processed
- \return \c true if event processing should be stopped
-*/
-bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event )
-{
- if ( object ) {
- if ( object == myHelpWindow && event->type() == QEvent::Close ) {
- myHelpWindow = 0;
- }
- else if ( object == myInfoWindow && event->type() == QEvent::Close ) {
- myInfoWindow = 0;
- }
- else if ( object == myIntervalWindow && event->type() == QEvent::Close ) {
- myIntervalWindow = 0;
- }
- else if ( object == _clients && event->type() == QEvent::KeyPress ) {
- QKeyEvent* ke = (QKeyEvent*)event;
- if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
- slotClientChanged( _clients->currentItem(), 0 );
- }
- }
- else if ( object == _history && event->type() == QEvent::KeyPress ) {
- QKeyEvent* ke = (QKeyEvent*)event;
- if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
- slotHistoryChanged( _history->currentItem(), 0 );
- }
- }
- }
- return QMainWindow::eventFilter( object, event );
-}
-
-/*!
- \brief Search item in the list.
- \param name component name
- \param pid PID
- \param machine machine name
- \param listclient list of registry data
- \return item index or -1 if it is not found.
-*/
-int ToolsGUI_RegWidget::numitem( const QString& name,
- const QString& pid,
- const QString& machine,
- const Registry::AllInfos* listclient )
-{
- for (CORBA::ULong i=0; i<listclient->length(); i++) {
- const Registry::Infos & c_info=(*listclient)[i];
- ASSERT( c_info.name!=NULL);
- QString b;
- b.setNum(int(c_info.pid));
- if ( (name.compare(QString(c_info.name)) == 0) &&
- (machine.compare(QString(c_info.machine)) == 0) &&
- (pid.compare(b) == 0) ) {
- return i;
- }
- }
- return -1;
-}
-
-/*!
- \brief Get description text, containing information about client.
+ \brief Get description text, containing information about the service.
\param c_info client info data
\return formatted client description
*/
-QString ToolsGUI_RegWidget::setlongText( const Registry::Infos& c_info )
+QString ToolsGUI_RegWidget::getDetails( const Registry::Infos& c_info )
{
- ASSERT( c_info.name != NULL );
- QString a = QString( "<hr><h2>" ) + tr( "Code" ) + QString( " : " );
- a.append( QString( c_info.name ) );
- a.append( "</h1><hr><br>" );
- a.append( "<code>" ); // ASV: 28.07.06 : added <code> tags to make the text font be
- // fixed width (looks much better on Windows)
- a.append( tr( "Process Id" ) + QString( " : " ) );
- a.append( BOLD( QString::number( int( c_info.pid ) ) ) );
- a.append( QString( " " ) + tr( "on machine" ) + QString( " " ) );
- a.append( BOLD( c_info.machine ) );
- a.append( QString( " " ) + tr( "ip address" ) + QString( " : " ) );
- a.append( BOLD( c_info.adip ) );
- a.append( "<br>" );
-
- a.append( tr( "launched by user" ) + QString( " " ) );
- a.append( BOLD( c_info.pwname ) );
- a.append( QString( " ( " ) + tr( "pid" ) + QString( " : " ) );
- a.append( BOLD( QString::number( int( c_info.uid ) ) ) );
- a.append( QString( " )<br> " ) + tr( "in directory" ) + QString( " " ));
- a.append( BOLD( c_info.cdir ) );
-
- time_t aTime;
- a.append( QString( "<br>" ) + tr( "begins" ) + QString( " " ) );
- aTime = time_t(c_info.tc_start);
- char * t1 = (char * )duplicate(ctime(&aTime));
- t1 [strlen(t1) -1 ] = ' ';
- a.append( BOLD( t1 ) );
- delete [] t1;
- a.append( "<br>" );
-
- if (c_info.tc_hello != 0 ) {
- aTime = time_t(c_info.tc_hello);
- char * t2 = (char * )duplicate(ctime(&aTime));
- t2 [strlen(t2) -1 ] = ' ';
- a.append( tr( "last signal" ) + QString(" : ") );
- a.append( BOLD( t2 ) );
+ QString a;
+ if ( c_info.name != NULL ) {
+ time_t aStarted( c_info.tc_start );
+ time_t aLastPing( c_info.tc_hello );
+ time_t aFinished( c_info.tc_end );
+
+ a.append( BOLD( tr( "INFO_SERVICE" ).arg( QString( c_info.name ) ) ) );
a.append( "<br>" );
- delete [] t2;
- }
- if ((c_info.tc_end - c_info.difftime) != 0) {
- aTime = time_t(c_info.tc_end);
- char * t3 = (char * )duplicate(ctime(&aTime));
- t3 [strlen(t3) -1 ] = ' ';
- a.append( tr( "ends" ) + QString( " " ) );
- a.append( BOLD( t3 ) );
a.append( "<br>" );
- delete [] t3;
- }
- else {
- a.append( tr( "still running" ) + QString( "<br>" ) );
- }
-
- SCRUTE(c_info.difftime);
- if (c_info.difftime!= 0) {
- a.append( QString( "(" ) + tr( "Time on" ) + QString( " " ) );
- a.append( BOLD( c_info.machine ) );
- a.append( QString( " " ) + tr( "differs from server's time. The difference is" ) + QString( " " ));
- a.append( BOLD( QString::number( int( c_info.difftime ) ) ) );
- a.append( QString( " " ) + tr( "seconds" ) + QString( ")<br>" ) );
+ a.append( tr( "INFO_PROCESS" ).arg( BOLD( QString::number( c_info.pid ) ),
+ BOLD( c_info.machine ),
+ BOLD( c_info.adip ),
+ BOLD( c_info.pwname ),
+ BOLD( QString::number( c_info.uid ) ),
+ BOLD( c_info.cdir ) ) );
+ a.append( "<br>" );
+ a.append( "<br>" );
+ a.append( tr( "INFO_STARTED" ).arg( BOLD( QString( ctime( &aStarted ) ).trimmed() ) ) );
+ a.append( "<br>" );
+ if ( c_info.tc_hello != 0 ) {
+ a.append( tr( "INFO_LAST_PING" ).arg( BOLD( QString( ctime( &aLastPing ) ).trimmed() ) ) );
+ a.append( "<br>" );
+ }
+ if ( c_info.tc_end - c_info.difftime != 0 ) {
+ a.append( tr( "INFO_FINISHED" ).arg( BOLD( QString( ctime( &aFinished ) ).trimmed() ) ) );
+ a.append( "<br>" );
+ }
+ else {
+ a.append( tr( "INFO_RUNNING" ) );
+ a.append( "<br>" );
+ }
+ if ( c_info.difftime != 0 ) {
+ a.append( tr( "INFO_TIME_DIFF" ).arg( BOLD( c_info.machine ), BOLD( QString::number( c_info.difftime ) ) ) );
+ a.append( "<br>" );
+ }
+ a.append( "</code>" ); // ASV: 28.07.06 : added <code> tags to make the text font be
+ // fixed width (looks much better on Windows)
}
- a.append( "</code>" ); // ASV: 28.07.06 : added <code> tags to make the text font be
- // fixed width (looks much better on Windows)
return a;
-
}
/*!
- \brief Close event handler.
- \param e close event
+ \brief Refresh registry information
*/
-void ToolsGUI_RegWidget::closeEvent( QCloseEvent* e )
+void ToolsGUI_RegWidget::refresh()
{
- if ( myInfoWindow )
- myInfoWindow->close();
- if ( myHelpWindow )
- myHelpWindow->close();
- if (myIntervalWindow)
- myIntervalWindow->close();
- e->accept();
-};
-
-/*!
- \brief Setup clients list.
-*/
-void ToolsGUI_RegWidget::SetListe()
-{
- _clients->installEventFilter( this );
- _clients->setColumnCount(6);
- _clients->setAllColumnsShowFocus( true );
- QStringList aLabels;
- aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("hello");
- _clients->setHeaderLabels( aLabels );
- //_clients->setColumnAlignment( 1, Qt::AlignRight );
-}
-
-/*!
- \brief Setup history list.
-*/
-void ToolsGUI_RegWidget::SetListeHistory()
-{
- _history->installEventFilter( this );
- _history->setColumnCount(6);
- _history->setAllColumnsShowFocus( true );
- QStringList aLabels;
- aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("ends");
- _history->setHeaderLabels( aLabels );
- //_history->setColumnAlignment( 1, Qt::AlignRight );
-}
-
-/*!
- \brief Update history list
-*/
-void ToolsGUI_RegWidget::InfoHistory()
-{
-
- _history->clear();
try {
- time_t aTime;
- _serverhistory = _VarComponents->history();
- for (CORBA::ULong i=0; i<_serverhistory->length(); i++) {
- const Registry::Infos & c_info=(*_serverhistory)[i];
- ASSERT( c_info.name!=NULL);
- QString a;
- a.setNum(int(c_info.pid));
- aTime = time_t(c_info.tc_start);
- char * t1 = (char * )duplicate(ctime(&aTime));
- t1 [strlen(t1) -1 ] = ' ';
- aTime = time_t(c_info.tc_end);
- char * t2 = (char * )duplicate(ctime(&aTime));
- t2 [strlen(t2) -1 ] = ' ';
- QStringList anItem;
- anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
- QTreeWidgetItem * item = new QTreeWidgetItem(_history, anItem);
- item=0 ;
- delete [] t1;
- delete [] t2;
-
+ // get reference to the Registry service
+ Registry::Components_var aRegistry = GetRegistry( myOrb );
+ if ( aRegistry->_is_nil() ) {
+ myActions[Interval]->setDisabled( true );
+ myActions[Refresh]->setDisabled( true );
+ myTimer->stop();
+ MESSAGE( "Sorry, no more Registry Server" );
+ statusBar()->showMessage( tr( "ERR_NO_REGISTRY" ) );
+ return;
}
- }
- catch( ... ) {
- _interval->setDisabled( TRUE ) ;
- _refresh->setDisabled( TRUE ) ;
- _counter->stop();
- MESSAGE("Sorry, No more Registry Server") ;
- statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
- }
-}
-/*!
- \brief Update clients list
-*/
-void ToolsGUI_RegWidget::InfoReg()
-{
- _clients->clear();
- try {
- time_t aTime;
- _serverclients = _VarComponents->getall();
- for (CORBA::ULong i=0; i<_serverclients->length(); i++) {
- const Registry::Infos & c_info=(*_serverclients)[i];
- ASSERT( c_info.name!=NULL);
- QString a;
- a.setNum(int(c_info.pid));
- aTime = time_t(c_info.tc_start);
- char * t1 = (char * )duplicate(ctime(&aTime));
- t1 [strlen(t1) -1 ] = ' ';
- aTime = time_t(c_info.tc_hello);
- char * t2 = (char * )duplicate(ctime(&aTime));
- t2 [strlen(t2) -1 ] = ' ';
- QStringList anItem;
- anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
- QTreeWidgetItem * item = new QTreeWidgetItem(_clients, anItem);
- item=0 ;
- delete [] t1;
- delete [] t2;
-
+ myData[Clients] = aRegistry->getall();
+ myData[History] = aRegistry->history();
+
+ // update current services list
+ myViews[Clients]->clear();
+ for ( int i = 0; i < myData[Clients]->length(); i++ ) {
+ const Registry::Infos& c_info = (*myData[Clients])[i];
+ time_t aStarted = time_t( c_info.tc_start );
+ time_t aLastPing = time_t( c_info.tc_hello );
+ QStringList aData;
+ aData << QString( c_info.name )
+ << QString::number( c_info.pid )
+ << QString( c_info.pwname )
+ << QString( c_info.machine )
+ << QString( ctime( &aStarted ) ).trimmed()
+ << QString( ctime( &aLastPing ) ).trimmed();
+ myViews[Clients]->addTopLevelItem( new QTreeWidgetItem( aData ) );
}
- }
- catch( ... ) {
- _interval->setDisabled( TRUE ) ;
- _refresh->setDisabled( TRUE ) ;
- _counter->stop();
- MESSAGE("Sorry, No more Registry Server") ;
- statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
- }
-}
-/*!
- \brief Called when \c Refresh button is clicked
-*/
-void ToolsGUI_RegWidget::slotListeSelect()
-{
- try {
- ASSERT(_tabWidget->currentWidget() != NULL);
- if (_tabWidget->currentWidget () == _clients) InfoReg();
- else if (_tabWidget->currentWidget () == _history) InfoHistory();
+ // update history
+ myViews[History]->clear();
+ for ( int i = 0; i < myData[History]->length(); i++ ) {
+ const Registry::Infos& c_info = (*myData[History])[i];
+ time_t aStarted = time_t( c_info.tc_start );
+ time_t aFinished = time_t( c_info.tc_end );
+ QStringList aData;
+ aData << QString( c_info.name )
+ << QString::number( c_info.pid )
+ << QString( c_info.pwname )
+ << QString( c_info.machine )
+ << QString( ctime( &aStarted ) ).trimmed()
+ << QString( ctime( &aFinished ) ).trimmed();
+ myViews[History]->addTopLevelItem( new QTreeWidgetItem( aData ) );
+ }
}
catch( ... ) {
- MESSAGE("Sorry, No more Registry Server") ;
- statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
+ myActions[Interval]->setDisabled( true );
+ myActions[Refresh]->setDisabled( true );
+ myTimer->stop();
+ MESSAGE( "Sorry, no more Registry Server" );
+ statusBar()->showMessage( tr( "ERR_NO_REGISTRY" ) );
}
}
\brief Called when \c Interval button is clicked (open dialog box to
change refresh interval).
*/
-void ToolsGUI_RegWidget::slotSelectRefresh()
+void ToolsGUI_RegWidget::refreshInterval()
{
- myIntervalWindow = new ToolsGUI_RegWidget::IntervalWindow(this);
- myIntervalWindow->installEventFilter( this );
- myIntervalWindow->setValue(myRefreshInterval);
- myIntervalWindow->show();
- connect( myIntervalWindow->Cancel(), SIGNAL( clicked() ), myIntervalWindow, SLOT( close() ) );
- connect( myIntervalWindow->Ok(), SIGNAL( clicked() ), this, SLOT( slotIntervalOk() ) );
+ bool ok;
+ int sec = QInputDialog::getInt( this, tr( "TLT_REFRESH_INTERVAL" ), tr( "LAB_REFRESH_INTERVAL" ),
+ myTimer->interval() / 1000, 1, 24 * 60 * 60, 1, &ok );
+ if ( ok )
+ myTimer->start( sec * 1000 );
}
/*!
- \brief Called when IntervalWindow's \c OK button is clicked
-*/
-void ToolsGUI_RegWidget::slotIntervalOk()
-{
- myRefreshInterval = myIntervalWindow->getValue();
- _counter->start( myRefreshInterval * 1000 );
- SCRUTE(myRefreshInterval);
- myIntervalWindow->close();
-}
-/*!
- \brief Called when \c Help button is clicked
+ \brief Show details about the chosen service.
+ \param item item activated by the user
+ \param column column index
*/
-void ToolsGUI_RegWidget::slotHelp()
+void ToolsGUI_RegWidget::showDetails( QTreeWidgetItem* item, int column )
{
- if ( !myHelpWindow ) {
- myHelpWindow = new ToolsGUI_RegWidget::HelpWindow( this );
- myHelpWindow->installEventFilter( this );
- }
- myHelpWindow->show();
- myHelpWindow->raise();
- myHelpWindow->activateWindow();
+ if ( !item || column < 0 ) return;
+ int i = sender() == myViews[Clients] ? Clients : History;
+ int idx = myViews[i]->indexOfTopLevelItem( item );
+ int size = myData[i]->length();
+ if ( idx < 0 || idx > size-1 ) return;
+ const Registry::Infos& c_info = (*myData[i])[idx];
+ myDetails->setText( getDetails( c_info ) );
}
-
-/*!
- \brief Called when user clicks on item in \c Running list
- \param item item clicked by the user
-*/
-void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item, int col )
-{
- if ( !item || col < 0 )
- return;
-
- blockSignals( true ); // for sure that item will not be deleted when refreshing
-
- int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverclients);
- SCRUTE(numeroItem) ;
- SCRUTE(item->text(1).toLatin1().constData()) ;
-
- ASSERT(numeroItem>=0) ;
- ASSERT((size_t)numeroItem<_serverclients->length()) ;
- const Registry::Infos & c_info=(*_serverclients)[numeroItem];
- ASSERT( c_info.name!=NULL);
-
- if ( !myInfoWindow ) {
- myInfoWindow = new ToolsGUI_RegWidget::InfoWindow( this );
- myInfoWindow->installEventFilter( this );
- }
- QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
- myInfoWindow->setWindowTitle(a);
- myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info) );
- myInfoWindow->show();
- myInfoWindow->raise();
- myInfoWindow->activateWindow();
-
- blockSignals( false ); // enabling signals again
-}
-
-/*!
- \brief Called when user clicks on item in \c History list
- \param item item clicked by the user
-*/
-void ToolsGUI_RegWidget::slotHistoryChanged( QTreeWidgetItem* item, int col )
-{
- if ( !item || col < 0 )
- return;
-
- blockSignals( true ); // for sure that item will not be deleted when refreshing
-
- int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverhistory);
-
- SCRUTE(numeroItem) ;
- SCRUTE(item->text(1).toLatin1().constData()) ;
- ASSERT(numeroItem>=0) ;
- ASSERT((size_t)numeroItem<_serverhistory->length()) ;
- const Registry::Infos & c_info=(*_serverhistory)[numeroItem];
- ASSERT( c_info.name!=NULL);
-
- if ( !myInfoWindow ) {
- myInfoWindow = new ToolsGUI_RegWidget::InfoWindow( this );
- myInfoWindow->installEventFilter( this );
- }
- QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
- myInfoWindow->setWindowTitle(a);
- myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info ) );
- myInfoWindow->show();
- myInfoWindow->raise();
- myInfoWindow->activateWindow();
-
- blockSignals( false ); // enabling signals again
-}
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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 RegistryDisplay : GUI for Registry server implementation
-// File : ToolsGUI_RegWidget.h
-// Author : Pascale NOYRET, EDF
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef TOOLSGUI_REGWIDGET_H
#define TOOLSGUI_REGWIDGET_H
#include "ToolsGUI.h"
#include <QMainWindow>
+#include <QMap>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_Registry)
-class QTabWidget;
class QTreeWidget;
class QTreeWidgetItem;
-class QWidget;
class QTimer;
-class QCloseEvent;
class QAction;
+class QTextEdit;
class TOOLSGUI_EXPORT ToolsGUI_RegWidget : public QMainWindow
{
Q_OBJECT
- class HelpWindow;
- class IntervalWindow;
- class InfoWindow;
+ enum { Refresh, Interval, Close };
+ enum { Clients, History };
- ToolsGUI_RegWidget( CORBA::ORB_var& orb, QWidget* parent = 0 );
+ ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent = 0 );
public:
~ToolsGUI_RegWidget();
- void SetListe();
- void SetListeHistory();
- void InfoReg();
- void InfoHistory();
-
- bool eventFilter( QObject* object, QEvent* event );
+ static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_ptr orb,
+ QWidget* parent = 0 );
- static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var& orb,
- QWidget* parent = 0 );
+private slots:
+ void refresh();
+ void showDetails( QTreeWidgetItem*, int );
+ void refreshInterval();
- virtual QMenu* createPopupMenu();
-
-public slots:
- void slotHelp();
- void slotListeSelect();
- void slotClientChanged( QTreeWidgetItem*, int );
- void slotHistoryChanged( QTreeWidgetItem*, int );
- void slotSelectRefresh();
- void slotIntervalOk();
-
-protected:
- static QString setlongText( const Registry::Infos& c_info );
- int numitem( const QString& name,
- const QString& pid,
- const QString& machine,
- const Registry::AllInfos* clistclient );
- void closeEvent( QCloseEvent* e );
+private:
+ static QString getDetails( const Registry::Infos& c_info );
-protected :
- QTreeWidget* _clients;
- QTreeWidget* _history;
- QWidget* _parent;
- QTabWidget* _tabWidget;
- QAction* _refresh;
- QAction* _interval;
- QAction* _close;
- QTimer* _counter;
- Registry::AllInfos* _serverhistory;
- Registry::AllInfos* _serverclients;
- InfoWindow* myInfoWindow;
- HelpWindow* myHelpWindow;
- IntervalWindow* myIntervalWindow;
- int myRefreshInterval;
-
private:
- const Registry::Components_var _VarComponents;
- static ToolsGUI_RegWidget* myRegWidgetPtr;
+ static ToolsGUI_RegWidget* myRegWidgetPtr;
+
+ CORBA::ORB_var myOrb;
+ QMap<int, Registry::AllInfos*> myData;
+ QMap<int, QAction*> myActions;
+ QMap<int, QTreeWidget*> myViews;
+ QTextEdit* myDetails;
+ QTimer* myTimer;
};
#endif // TOOLSGUI_REGWIDGET_H
+++ /dev/null
-# Copyright (C) 2007-2008 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 TOOLSGUI : implementation of desktop "Tools" optioins
-# File : ToolsGUI_icons.po
-# Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: SALOME VERSION 0.4\n"
-"POT-Creation-Date: 2002-04-25 10:04:12 PM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: Nicolas REJNERI\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:50
-msgid "ToolsGUI_CatalogGeneratorDlg::ICON_SELECT"
-msgstr "select1.png"
+++ /dev/null
-# Copyright (C) 2007-2008 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 TOOLSGUI : implementation of desktop "Tools" optioins
-# File : ToolsGUI_msg_en.po
-# Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: SALOME VERSION 0.4\n"
-"POT-Creation-Date: 2002-04-25 10:04:12 PM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: Nicolas REJNERI\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:58
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_FILES"
-msgstr "Files"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:58
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_SUPPLEMENT"
-msgstr "Component supplementary data"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:150
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_EXPORT"
-msgstr "Export"
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_IMPORT"
-msgstr "Import"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:47
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_CATALOG_GENERATOR"
-msgstr "Catalog generator"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:82
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_IDL_FILE"
-msgstr "IDL : "
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:88
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_XML_FILE"
-msgstr "XML : "
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:88
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_PNG_FILE"
-msgstr "Icon : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_AUTHOR"
-msgstr "Author : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_VERSION"
-msgstr "Version : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_NAME"
-msgstr "Name : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_USERNAME"
-msgstr "UserName : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_TYPE"
-msgstr "Type : "
-
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_COMP_MULTISTD"
-msgstr "Multistudy : "
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:153
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_EXPORT_XML"
-msgstr "XML Files ( *.xml )"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:154
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_IMPORT_IDL"
-msgstr "IDL Files ( *.idl )"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:154
-msgid "ToolsGUI_CatalogGeneratorDlg::TOOLS_MEN_IMPORT_PNG"
-msgstr "PNG Files ( *.png )"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:107
-msgid "TOOLS_BUT_CLOSE"
-msgstr "&Close"
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:113
-msgid "TOOLS_BUT_OK"
-msgstr "&Ok"
-
-msgid "TOOLS_BUT_BROWSE"
-msgstr "Browse..."
-
-msgid "TOOLS_BUT_APPLY"
-msgstr "&Apply"
-
-#
-#==============================================================================
-#
-
-#: ToolsGUI_CatalogGeneratorDlg.cxx:53
-msgid "TOOLS_WRN_WARNING"
-msgstr "Warning"
-
-msgid "TOOLS_ERR_ERROR"
-msgstr "Error"
-
-msgid "TOOLS_ERR_FILE_NOT_EXIST"
-msgstr "%1\nFile doesn't exist"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
</message>
<message>
<source>TOOLS_COMP_USERNAME</source>
- <translation>UserName : </translation>
+ <translation>User name : </translation>
</message>
<message>
<source>TOOLS_CATALOG_GENERATOR</source>
<translation>IDL : </translation>
</message>
</context>
+<context>
+ <name>ToolsGUI_RegWidget</name>
+ <message>
+ <source>TLT_REFRESH_INTERVAL</source>
+ <translation>Refresh Interval</translation>
+ </message>
+ <message>
+ <source>LAB_REFRESH_INTERVAL</source>
+ <translation>New refresh interval (in seconds)</translation>
+ </message>
+ <message>
+ <source>TLT_REGISTRY</source>
+ <translation>Registry</translation>
+ </message>
+ <message>
+ <source>MNU_ACTIONS</source>
+ <translation>Actions</translation>
+ </message>
+ <message>
+ <source>TB_ACTIONS</source>
+ <translation>Actions</translation>
+ </message>
+ <message>
+ <source>MEN_REFRESH</source>
+ <translation>Refresh</translation>
+ </message>
+ <message>
+ <source>STB_REFRESH</source>
+ <translation>Immediately updates list of components</translation>
+ </message>
+ <message>
+ <source>MEN_INTERVAL</source>
+ <translation>Refresh interval...</translation>
+ </message>
+ <message>
+ <source>STB_INTERVAL</source>
+ <translation>Change refresh interval</translation>
+ </message>
+ <message>
+ <source>MEN_CLOSE</source>
+ <translation>Close</translation>
+ </message>
+ <message>
+ <source>STB_CLOSE</source>
+ <translation>Close Registry window</translation>
+ </message>
+ <message>
+ <source>TAB_RUNNING</source>
+ <translation>Running</translation>
+ </message>
+ <message>
+ <source>TAB_HISTORY</source>
+ <translation>History</translation>
+ </message>
+ <message>
+ <source>HDR_COMPONENT</source>
+ <translation>Component</translation>
+ </message>
+ <message>
+ <source>HDR_PID</source>
+ <translation>PID</translation>
+ </message>
+ <message>
+ <source>HDR_USERNAME</source>
+ <translation>User name</translation>
+ </message>
+ <message>
+ <source>HDR_HOSTNAME</source>
+ <translation>Host name</translation>
+ </message>
+ <message>
+ <source>HDR_STARTED</source>
+ <translation>Started</translation>
+ </message>
+ <message>
+ <source>HDR_FINISHED</source>
+ <translation>Finished</translation>
+ </message>
+ <message>
+ <source>HDR_HELLO</source>
+ <translation>Last ping</translation>
+ </message>
+ <message>
+ <source>ERR_NO_REGISTRY</source>
+ <translation>Error: Registry Server is not found</translation>
+ </message>
+ <message>
+ <source>INFO_SERVICE</source>
+ <translation>Service : %1</translation>
+ </message>
+ <message>
+ <source>INFO_PROCESS</source>
+ <translation>Process ( PID : %1 ) on the machine %2 ( ip address : %3 ); launched by the user %4 ( UID : %5 ) in directory %6.</translation>
+ </message>
+ <message>
+ <source>INFO_STARTED</source>
+ <translation>Started : %1</translation>
+ </message>
+ <message>
+ <source>INFO_LAST_PING</source>
+ <translation>Last signal : %1</translation>
+ </message>
+ <message>
+ <source>INFO_FINISHED</source>
+ <translation>Finished : %1</translation>
+ </message>
+ <message>
+ <source>INFO_RUNNING</source>
+ <translation>Still running</translation>
+ </message>
+ <message>
+ <source>INFO_TIME_DIFF</source>
+ <translation>Time on %1 differs from server's time. The difference is %2 seconds.</translation>
+ </message>
+</context>
</TS>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
+# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : Vladimir Klyachin (OCN)
# Module : VTKViewer
-
+#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
+EXTRA_DIST += textures
+
lib_LTLIBRARIES = libVTKViewer.la
salomeinclude_HEADERS = \
VTKViewer.h \
VTKViewer_CellLocationsArray.h \
VTKViewer_Actor.h \
+ VTKViewer_FramedTextActor.h \
VTKViewer_ExtractUnstructuredGrid.h \
VTKViewer_ConvexTool.h \
VTKViewer_Filter.h \
VTKViewer_ViewManager.h \
VTKViewer_ViewModel.h \
VTKViewer_ViewWindow.h \
- VTKViewer_Functor.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
dist_libVTKViewer_la_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_ViewManager.cxx \
VTKViewer_ViewModel.cxx \
VTKViewer_ConvexTool.cxx \
- VTKViewer_ViewWindow.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
MOC_FILES = \
VTKViewer_RenderWindow_moc.cxx \
VTKViewer_RenderWindowInteractor_moc.cxx \
VTKViewer_ViewManager_moc.cxx \
VTKViewer_ViewModel_moc.cxx \
- VTKViewer_ViewWindow_moc.cxx
-nodist_libVTKViewer_la_SOURCES = $(MOC_FILES)
+ VTKViewer_ViewWindow_moc.cxx \
+ VTKViewer_MarkerWidget_moc.cxx \
+ VTKViewer_MarkerDlg_moc.cxx
+
+QRC_FILES = \
+ qrc_VTKViewer.cxx
+
+nodist_libVTKViewer_la_SOURCES = $(MOC_FILES) $(QRC_FILES)
dist_salomeres_DATA = \
+ resources/vtk_view_anticlockwise.png \
+ resources/vtk_view_clockwise.png \
resources/vtk_view_back.png \
resources/vtk_view_bottom.png \
resources/vtk_view_camera_dump.png \
resources/vtk_view_rotate.png \
resources/vtk_view_top.png \
resources/vtk_view_triedre.png \
- resources/vtk_view_zoom.png
+ resources/vtk_view_zoom.png \
+ resources/marker_1.png \
+ resources/marker_2.png \
+ resources/marker_3.png \
+ resources/marker_4.png \
+ resources/marker_5.png \
+ resources/marker_6.png \
+ resources/marker_7.png \
+ resources/marker_8.png \
+ resources/marker_9.png
nodist_salomeres_DATA = \
VTKViewer_images.qm \
- VTKViewer_msg_en.qm
+ VTKViewer_msg_en.qm \
+ VTKViewer_msg_fr.qm
libVTKViewer_la_CPPFLAGS = $(QT_INCLUDES) $(VTK_INCLUDES) $(CAS_CPPFLAGS) \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
-libVTKViewer_la_LDFLAGS = $(VTK_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(OGL_LIBS) \
- ../Qtx/libqtx.la ../SUIT/libsuit.la
+libVTKViewer_la_LDFLAGS = $(KERNEL_LDFLAGS) $(VTK_LIBS) $(QT_MT_LIBS) \
+ $(CAS_KERNEL) $(OGL_LIBS) ../Qtx/libqtx.la ../SUIT/libsuit.la
+
+libVTKViewer_la_LIBADD = -lSALOMELocalTrace
# Executable
dist_VTKViewer_SOURCES = VTKViewer.cxx
VTKViewer_CPPFLAGS = $(libVTKViewer_la_CPPFLAGS)
-VTKViewer_LDADD = libVTKViewer.la $(libVTKViewer_la_LDFLAGS)
+VTKViewer_LDFLAGS = $(libVTKViewer_la_LDFLAGS)
+VTKViewer_LDADD = libVTKViewer.la $(libVTKViewer_la_LIBADD)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File :
// Author :
-// Module :
-// $Header$
-//
+
#include "VTKViewer_Actor.h"
#include "VTKViewer_ExtractUnstructuredGrid.h"
#include "VTKViewer_ConvexTool.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_H
#define VTKVIEWER_H
#ifdef WIN32
-# ifdef VTKVIEWER_EXPORTS
+# if defined VTKVIEWER_EXPORTS || defined VTKViewer_EXPORTS
# define VTKVIEWER_EXPORT __declspec( dllexport )
# else
# define VTKVIEWER_EXPORT __declspec( dllimport )
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-TEMPLATE = lib
-TARGET = VTKViewer
-DESTDIR = ../../lib
-MOC_DIR = ../../moc
-OBJECTS_DIR = ../../obj/$$TARGET
-
-VTKHOME = $$(VTKHOME)
-VTK_INCLUDES = $${VTKHOME}/include/vtk
-
-VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt
-
-CASROOT = $$(CASROOT)
-CAS_CPPFLAGS = $${CASROOT}/inc
-
-CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
-
-INCLUDEPATH += ../../include $${VTK_INCLUDES} $${CAS_CPPFLAGS} ../Qtx ../SUIT
-LIBS += -L../../lib -lqtx -lsuit $${VTK_LIBS} $${CAS_KERNEL}
-
-CONFIG -= debug release debug_and_release
-CONFIG += qt thread debug dll shared
-
-win32:DEFINES += WIN32
-DEFINES += VTKVIEWER_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
-
-HEADERS = VTKViewer.h
-HEADERS += VTKViewer_CellLocationsArray.h
-HEADERS += VTKViewer_Actor.h
-HEADERS += VTKViewer_ExtractUnstructuredGrid.h
-HEADERS += VTKViewer_ConvexTool.h
-HEADERS += VTKViewer_Filter.h
-HEADERS += VTKViewer_GeometryFilter.h
-HEADERS += VTKViewer_AppendFilter.h
-HEADERS += VTKViewer_Algorithm.h
-HEADERS += VTKViewer_InteractorStyle.h
-HEADERS += VTKViewer_RenderWindow.h
-HEADERS += VTKViewer_RenderWindowInteractor.h
-HEADERS += VTKViewer_ShrinkFilter.h
-HEADERS += VTKViewer_TransformFilter.h
-HEADERS += VTKViewer_Transform.h
-HEADERS += VTKViewer_Trihedron.h
-HEADERS += VTKViewer_Utilities.h
-HEADERS += VTKViewer_ViewManager.h
-HEADERS += VTKViewer_ViewModel.h
-HEADERS += VTKViewer_ViewWindow.h
-HEADERS += VTKViewer_Functor.h
-
-SOURCES = VTKViewer_CellLocationsArray.cxx
-SOURCES += VTKViewer_Actor.cxx
-SOURCES += VTKViewer_ExtractUnstructuredGrid.cxx
-SOURCES += VTKViewer_Filter.cxx
-SOURCES += VTKViewer_GeometryFilter.cxx
-SOURCES += VTKViewer_AppendFilter.cxx
-SOURCES += VTKViewer_InteractorStyle.cxx
-SOURCES += VTKViewer_RenderWindow.cxx
-SOURCES += VTKViewer_RenderWindowInteractor.cxx
-SOURCES += VTKViewer_ShrinkFilter.cxx
-SOURCES += VTKViewer_Transform.cxx
-SOURCES += VTKViewer_TransformFilter.cxx
-SOURCES += VTKViewer_Trihedron.cxx
-SOURCES += VTKViewer_Utilities.cxx
-SOURCES += VTKViewer_ViewManager.cxx
-SOURCES += VTKViewer_ViewModel.cxx
-SOURCES += VTKViewer_ConvexTool.cxx
-SOURCES += VTKViewer_ViewWindow.cxx
-
-TRANSLATIONS = resources/VTKViewer_images.ts \
- resources/VTKViewer_msg_en.ts
-
-ICONS = resources/*.png
-
-includes.files = $$HEADERS
-includes.path = ../../include
-
-resources.files = $$ICONS resources/*.qm
-resources.path = ../../resources
-
-INSTALLS += includes resources
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_Actor.cxx
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
/*!
\class SALOME_Actor SALOME_Actor.h
\brief Abstract class of SALOME Objects in VTK.
*/
-
#include "VTKViewer_Actor.h"
#include "VTKViewer_Transform.h"
#include <vtkObjectFactory.h>
#include <vtkDataSetMapper.h>
#include <vtkPolyDataMapper.h>
-#include <vtkProperty.h>
#include <vtkRenderer.h>
#include <vtkPassThroughFilter.h>
-using namespace std;
-
#if defined __GNUC__
#if __GNUC__ == 2
#define __GNUC_2__
*/
VTKViewer_Actor
::VTKViewer_Actor():
+ myOpacity(1.0),
myIsHighlighted(false),
myIsPreselected(false),
- myRepresentation(VTK_SURFACE),
+ myRepresentation(VTKViewer::Representation::Surface),
myDisplayMode(1),
myProperty(vtkProperty::New()),
PreviewProperty(NULL),
myTransformFilter(VTKViewer_TransformFilter::New())
{
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ myPolygonOffsetUnits);
for(int i = 0; i < 6; i++)
myPassFilter.push_back(vtkPassThroughFilter::New());
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ myPolygonOffsetUnits);
Superclass::Render(ren,m);
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
void
VTKViewer_Actor
::SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units)
+ vtkFloatingPointType units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
void
VTKViewer_Actor
::GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units)
+ vtkFloatingPointType& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
VTKViewer_Actor
::SetRepresentation(int theMode)
{
+ using namespace VTKViewer::Representation;
switch(myRepresentation){
- case VTK_POINTS :
- case VTK_SURFACE :
+ case Points :
+ case Surface :
+ case SurfaceWithEdges :
myProperty->SetAmbient(GetProperty()->GetAmbient());
myProperty->SetDiffuse(GetProperty()->GetDiffuse());
myProperty->SetSpecular(GetProperty()->GetSpecular());
}
switch(theMode){
- case VTK_POINTS :
- case VTK_SURFACE :
+ case Points :
+ case Surface :
+ case SurfaceWithEdges :
GetProperty()->SetAmbient(myProperty->GetAmbient());
GetProperty()->SetDiffuse(myProperty->GetDiffuse());
GetProperty()->SetSpecular(myProperty->GetSpecular());
}
switch(theMode){
- case 3 :
+ case Insideframe :
myGeomFilter->SetInside(true);
myGeomFilter->SetWireframeMode(true);
GetProperty()->SetRepresentation(VTK_WIREFRAME);
break;
- case VTK_POINTS :
+ case Points :
GetProperty()->SetPointSize(VTKViewer_POINT_SIZE);
GetProperty()->SetRepresentation(theMode);
myGeomFilter->SetWireframeMode(false);
myGeomFilter->SetInside(false);
break;
- case VTK_WIREFRAME :
+ case Wireframe :
GetProperty()->SetRepresentation(theMode);
myGeomFilter->SetWireframeMode(true);
myGeomFilter->SetInside(false);
break;
- case VTK_SURFACE :
+ case Surface :
+ case SurfaceWithEdges :
GetProperty()->SetRepresentation(theMode);
myGeomFilter->SetWireframeMode(false);
myGeomFilter->SetInside(false);
void
VTKViewer_Actor
::SetColor(vtkFloatingPointType r,
- vtkFloatingPointType g,
- vtkFloatingPointType b)
+ vtkFloatingPointType g,
+ vtkFloatingPointType b)
{
GetProperty()->SetColor(r,g,b);
}
void
VTKViewer_Actor
::GetColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b)
+ vtkFloatingPointType& g,
+ vtkFloatingPointType& b)
{
vtkFloatingPointType aColor[3];
GetProperty()->GetColor(aColor);
}
+/*!
+ Change material
+*/
+void
+VTKViewer_Actor
+::SetMaterial(std::vector<vtkProperty*> theProps)
+{
+}
+
+/*!
+ Get current material
+*/
+vtkProperty*
+VTKViewer_Actor
+::GetMaterial()
+{
+ return NULL;
+}
+
/*!
\return display mode
*/
return myIsHighlighted;
}
+/*!
+ \return true if the VTKViewer_Actor is already preselected
+*/
+bool
+VTKViewer_Actor
+::isPreselected()
+{
+ return myIsPreselected;
+}
+
/*!
Set preselection mode
*/
myIsHighlighted = theIsHighlight;
}
+/*!
+ * On/Off representation 2D quadratic element as arked polygon
+ */
+void VTKViewer_Actor::SetQuadraticArcMode(bool theFlag){
+ myGeomFilter->SetQuadraticArcMode(theFlag);
+}
+
+/*!
+ * Return true if 2D quadratic element displayed as arked polygon
+ */
+bool VTKViewer_Actor::GetQuadraticArcMode() const{
+ return myGeomFilter->GetQuadraticArcMode();
+}
+/*!
+ * Set Max angle for representation 2D quadratic element as arked polygon
+ */
+void VTKViewer_Actor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
+ myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
+}
+
+/*!
+ * Return Max angle of the representation 2D quadratic element as arked polygon
+ */
+vtkFloatingPointType VTKViewer_Actor::GetQuadraticArcAngle() const{
+ return myGeomFilter->GetQuadraticArcAngle();
+}
+
+/*!
+ * Return pointer to the dataset, which used to calculation of the bounding box of the actor.
+ * By default it is the input dataset.
+ */
+vtkDataSet* VTKViewer_Actor::GetHighlightedDataSet() {
+ return GetInput();
+}
+
+
+
vtkCxxSetObjectMacro(VTKViewer_Actor,PreviewProperty,vtkProperty);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 : SALOME_Actor.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef VTKVIEVER_ACTOR_H
#define VTKVIEVER_ACTOR_H
#include <vector>
#include <vtkLODActor.h>
+#include <vtkProperty.h>
class vtkCell;
class vtkPointPicker;
extern int VTKViewer_POINT_SIZE;
extern int VTKViewer_LINE_WIDTH;
+namespace VTKViewer
+{
+ namespace Representation
+ {
+ typedef int Type;
+ const Type Points = VTK_POINTS;
+ const Type Wireframe = VTK_WIREFRAME;
+ const Type Surface = VTK_SURFACE;
+ const Type Insideframe = Surface + 1;
+ const Type SurfaceWithEdges = Insideframe + 1;
+ }
+}
+
#ifdef WIN32
#pragma warning ( disable:4251 )
#endif
virtual
void
SetColor(vtkFloatingPointType r,
- vtkFloatingPointType g,
- vtkFloatingPointType b);
+ vtkFloatingPointType g,
+ vtkFloatingPointType b);
//! Get current color
virtual
void
GetColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b);
+ vtkFloatingPointType& g,
+ vtkFloatingPointType& b);
//! Change color
virtual
void
SetColor(const vtkFloatingPointType theRGB[3]);
+ //! Change material
+ virtual
+ void
+ SetMaterial(std::vector<vtkProperty*> theProps);
+
+ //! Get current material
+ virtual
+ vtkProperty*
+ GetMaterial();
+
//----------------------------------------------------------------------------
// For selection mapping purpose
//! Maps VTK index of a node to corresponding object index
//! Set ResolveCoincidentTopology parameters
void
SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units);
+ vtkFloatingPointType units);
//! Get current ResolveCoincidentTopology parameters
void
GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units);
+ vtkFloatingPointType& units);
virtual
void
bool
isHighlighted();
+ //! Ask, if the VTKViewer_Actor is already preselected
+ virtual
+ bool
+ isPreselected();
+
//! Set preselection mode
virtual
void
void
SetPreviewProperty(vtkProperty* theProperty);
+ //----------------------------------------------------------------------------
+ //! Setting for displaying quadratic elements
+ virtual void SetQuadraticArcMode(bool theFlag);
+ virtual bool GetQuadraticArcMode() const;
+
+ virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
+ virtual vtkFloatingPointType GetQuadraticArcAngle() const;
+
+ //----------------------------------------------------------------------------
+ //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
+ virtual vtkDataSet* GetHighlightedDataSet();
+
protected:
//----------------------------------------------------------------------------
bool myIsResolveCoincidentTopology;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VTKViewer_ViewFrame.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef VTKViewer_Algorithm_H
#define VTKViewer_Algorithm_H
+#include "VTKViewer.h"
+
#include <vtkActorCollection.h>
class vtkActor;
namespace VTK
{
+ /*!
+ * This object should be used to avoid problems with recurring calls of GetActors() method of the vtkRenderer class.
+ *
+ * Instead of the following instructions:
+ *
+ * vtkRenderer* aRenderer = ...;
+ * vtkActorCollection* anActorCollection = aRenderer->GetActors();
+ * DoSomething( anActorCollection ); // where GetActors() could be called again
+ *
+ * A code like the following should be used:
+ *
+ * vtkRenderer* aRenderer = ...;
+ * vtkActorCollection* anActorCollection = aRenderer->GetActors();
+ * ActorCollectionCopy aCopy( anActorCollection );
+ * DoSomething( aCopy.GetActors() );
+ */
+ struct VTKVIEWER_EXPORT ActorCollectionCopy
+ {
+ vtkActorCollection* myActorCollection;
+
+ ActorCollectionCopy( vtkActorCollection* theActorCollection );
+ ~ActorCollectionCopy();
+
+ vtkActorCollection* GetActors() const;
+ };
+
/*!For each actor(for ex: someActor) from \a theCollection(that can be dynamic cast to type TActor)\n
* Call method \a theFun(someActor)
*/
template<typename TActor, typename TFunction>
TFunction ForEach(vtkActorCollection *theCollection, TFunction theFun)
{
- if(theCollection){
- theCollection->InitTraversal();
- while(vtkActor *anAct = theCollection->GetNextActor())
- if(TActor *anActor = dynamic_cast<TActor*>(anAct))
- theFun(anActor);
- }
- return theFun;
+ if(theCollection){
+ theCollection->InitTraversal();
+ while(vtkActor *anAct = theCollection->GetNextActor())
+ if(TActor *anActor = dynamic_cast<TActor*>(anAct))
+ theFun(anActor);
+ }
+ return theFun;
}
/*!For each actor(for ex: someActor) from \a theCollection(that can be dynamic cast to type TActor and \n
*/
template<typename TActor, typename TPredicate, typename TFunction>
TFunction ForEachIf(vtkActorCollection *theCollection,
- TPredicate thePredicate,
- TFunction theFun)
+ TPredicate thePredicate,
+ TFunction theFun)
{
- if(theCollection){
- theCollection->InitTraversal();
- while(vtkActor *anAct = theCollection->GetNextActor())
- if(TActor *anActor = dynamic_cast<TActor*>(anAct))
- if(thePredicate(anActor))
- theFun(anActor);
- }
- return theFun;
+ if(theCollection){
+ theCollection->InitTraversal();
+ while(vtkActor *anAct = theCollection->GetNextActor())
+ if(TActor *anActor = dynamic_cast<TActor*>(anAct))
+ if(thePredicate(anActor))
+ theFun(anActor);
+ }
+ return theFun;
}
/*!Find actor from collection, that can be dynamicaly cast to \a TActor, \n
template<typename TActor, typename TPredicate>
TActor* Find(vtkActorCollection *theCollection, TPredicate thePredicate)
{
- if(theCollection){
- theCollection->InitTraversal();
- while(vtkActor *anAct = theCollection->GetNextActor())
- if(TActor *anActor = dynamic_cast<TActor*>(anAct))
- if(thePredicate(anActor))
- return anActor;
- }
- return NULL;
+ if(theCollection){
+ theCollection->InitTraversal();
+ while(vtkActor *anAct = theCollection->GetNextActor())
+ if(TActor *anActor = dynamic_cast<TActor*>(anAct))
+ if(thePredicate(anActor))
+ return anActor;
+ }
+ return NULL;
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OBJECT : kernel of SALOME component
// File : VTKViewer_GeometryFilter.cxx
// Author :
-// Module : SALOME
-// $Header$
-//
+
#include "VTKViewer_AppendFilter.h"
#include <vtkCell.h>
int
VTKViewer_AppendFilter
::RequestData(
- vtkInformation *request,
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
+ vtkInformation *request,
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
int aRet = 0;
if(GetSharedPointsDataSet())
inline
vtkIdType
GetOutputID(vtkIdType theInputID,
- vtkIdType theInputDataSetID,
- const VTKViewer_AppendFilter::TVectorIds& theRanges)
+ vtkIdType theInputDataSetID,
+ const VTKViewer_AppendFilter::TVectorIds& theRanges)
{
theInputID = theInputDataSetID = -1;
vtkIdType
VTKViewer_AppendFilter
::GetPointOutputID(vtkIdType theInputID,
- vtkIdType theInputDataSetID)
+ vtkIdType theInputDataSetID)
{
if(GetSharedPointsDataSet())
return theInputID;
vtkIdType
VTKViewer_AppendFilter
::GetCellOutputID(vtkIdType theInputID,
- vtkIdType theInputDataSetID)
+ vtkIdType theInputDataSetID)
{
if(GetSharedPointsDataSet())
return theInputID;
{
void
GetInputID(vtkIdType theOutputID,
- vtkIdType& theInputID,
- vtkIdType& theStartID,
- vtkIdType& theInputDataSetID,
- const VTKViewer_AppendFilter::TVectorIds& theRanges)
+ vtkIdType& theInputID,
+ vtkIdType& theStartID,
+ vtkIdType& theInputDataSetID,
+ const VTKViewer_AppendFilter::TVectorIds& theRanges)
{
theInputID = theStartID = theInputDataSetID = -1;
for(vtkIdType aDataSetId = 0; aDataSetId < aNbInputs; ++aDataSetId){
vtkIdType aRange = theRanges[aDataSetId];
if(aRange > theOutputID){
- theInputID = theOutputID - aStartId;
- theInputDataSetID = aDataSetId;
- theStartID = aStartId;
- break;
+ theInputID = theOutputID - aStartId;
+ theInputDataSetID = aDataSetId;
+ theStartID = aStartId;
+ break;
}
aStartId = aRange;
}
void
VTKViewer_AppendFilter
::GetPointInputID(vtkIdType theOutputID,
- vtkIdType& theInputID,
- vtkIdType& theStartID,
- vtkIdType& theInputDataSetID)
+ vtkIdType& theInputID,
+ vtkIdType& theStartID,
+ vtkIdType& theInputDataSetID)
{
if(GetSharedPointsDataSet()) {
theStartID = theInputDataSetID = 0;
}
::GetInputID(theOutputID,
- theInputID,
- theStartID,
- theInputDataSetID,
- myNodeRanges);
+ theInputID,
+ theStartID,
+ theInputDataSetID,
+ myNodeRanges);
}
void
VTKViewer_AppendFilter
::GetCellInputID(vtkIdType theOutputID,
- vtkIdType& theInputID,
- vtkIdType& theStartID,
- vtkIdType& theInputDataSetID)
+ vtkIdType& theInputID,
+ vtkIdType& theStartID,
+ vtkIdType& theInputDataSetID)
{
::GetInputID(theOutputID,
- theInputID,
- theStartID,
- theInputDataSetID,
- myCellRanges);
+ theInputID,
+ theStartID,
+ theInputDataSetID,
+ myCellRanges);
}
vtkInformationVector *outputVector)
{
int idx;
- vtkIdType numPts, numCells, newCellId, cellId;
- vtkCellData *cd;
+ vtkIdType numPts, numCells, cellId;
+ // vtkCellData *cd;
vtkIdList *ptIds;
vtkDataSet *ds;
int numInputs = this->GetNumberOfInputConnections(0);
if (ds != NULL) {
numCells = ds->GetNumberOfCells();
- cd = ds->GetCellData();
+ // cd = ds->GetCellData();
// copy cell and cell data
for (cellId=0; cellId<numCells; cellId++) {
ds->GetCellPoints(cellId, ptIds);
- newCellId = output->InsertNextCell(ds->GetCellType(cellId), ptIds);
+ output->InsertNextCell(ds->GetCellType(cellId), ptIds);
}
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_APPENDFILTER_H
#define VTKVIEWER_APPENDFILTER_H
vtkIdType
GetPointOutputID(vtkIdType theInputID,
- vtkIdType theInputDataSetID);
+ vtkIdType theInputDataSetID);
vtkIdType
GetCellOutputID(vtkIdType theInputID,
- vtkIdType theInputDataSetID);
+ vtkIdType theInputDataSetID);
void
GetPointInputID(vtkIdType theOutputID,
- vtkIdType& theInputID,
- vtkIdType& theStartID,
- vtkIdType& theInputDataSetID);
+ vtkIdType& theInputID,
+ vtkIdType& theStartID,
+ vtkIdType& theInputDataSetID);
void
GetCellInputID(vtkIdType theOutputID,
- vtkIdType& theInputID,
- vtkIdType& theStartID,
- vtkIdType& theInputDataSetID);
+ vtkIdType& theInputID,
+ vtkIdType& theStartID,
+ vtkIdType& theInputDataSetID);
typedef std::vector<vtkIdType> TVectorIds;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// 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 :
// Author :
-// Module :
-// $Header$
-//
+
#include "VTKViewer_CellLocationsArray.h"
#include <vtkObjectFactory.h>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_CELLLOCATIONS_H
#define VTKVIEWER_CELLLOCATIONS_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_ConvexTool.h"
+#include "VTKViewer_GeometryFilter.h"
#include <set>
#include <map>
vtkFloatingPointType myOrigin[3];
vtkFloatingPointType myNormal[3];
TPolygon(const TConnectivities& theConnectivities,
- vtkFloatingPointType theOrigin[3],
- vtkFloatingPointType theNormal[3]):
+ vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3]):
myConnectivities(theConnectivities)
{
myOrigin[0] = theOrigin[0];
vtkPoints*
VTKViewer_Triangulator
::InitPoints(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId)
+ vtkIdType theCellId)
{
myPoints->Reset();
myPoints->Modified(); // the VTK bug
aCoordDiff[2] = (aBounds[5] - aBounds[4]);
return sqrt(aCoordDiff[0]*aCoordDiff[0] +
- aCoordDiff[1]*aCoordDiff[1] +
- aCoordDiff[2]*aCoordDiff[2]);
+ aCoordDiff[1]*aCoordDiff[1] +
+ aCoordDiff[2]*aCoordDiff[2]);
}
void
VTKViewer_Triangulator
::GetCellNeighbors(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId,
- vtkCell* theFace,
- vtkIdList* theCellIds)
+ vtkIdType theCellId,
+ vtkCell* theFace,
+ vtkIdList* theCellIds)
{
myFaceIds->Reset();
vtkIdList *anIdList = theFace->PointIds;
bool
VTKViewer_Triangulator
::Execute(vtkUnstructuredGrid *theInput,
- vtkCellData* thInputCD,
- vtkIdType theCellId,
- int theShowInside,
- int theAllVisible,
- const char* theCellsVisibility,
- vtkPolyData *theOutput,
- vtkCellData* theOutputCD,
- int theStoreMapping,
- std::vector<vtkIdType>& theVTK2ObjIds,
- bool theIsCheckConvex)
+ vtkCellData* thInputCD,
+ vtkIdType theCellId,
+ int theShowInside,
+ int theAllVisible,
+ int theAppendCoincident3D,
+ const char* theCellsVisibility,
+ vtkPolyData *theOutput,
+ vtkCellData* theOutputCD,
+ int theStoreMapping,
+ std::vector<vtkIdType>& theVTK2ObjIds,
+ std::map< vtkIdType, std::vector<vtkIdType> >& theDimension2VTK2ObjIds,
+ bool theIsCheckConvex)
{
vtkPoints *aPoints = InitPoints(theInput, theCellId);
vtkIdType aNumPts = GetNbOfPoints();
vtkCell* aFace = GetFace(aFaceId);
GetCellNeighbors(theInput, theCellId, aFace, myCellIds);
+ bool process = myCellIds->GetNumberOfIds() <= 0 ? true : theAppendCoincident3D;
if((!theAllVisible && !theCellsVisibility[myCellIds->GetId(0)]) ||
- myCellIds->GetNumberOfIds() <= 0 || theShowInside)
+ myCellIds->GetNumberOfIds() <= 0 || theShowInside || process)
{
TPointIds aPointIds;
vtkIdList *anIdList = aFace->PointIds;
vtkIdList *anIdList = aFace->PointIds;
vtkIdType aNewPts[3] = {anIdList->GetId(0), anIdList->GetId(1), anIdList->GetId(2)};
-
+
// To initialize set of points for the plane where the trinangle face belong to
TPointIds aPointIds;
aPointIds.insert(aNewPts[0]);
/* To calculate plane normal for face (aFace)
- ^ aNormal
- |
- | ^ aVector01
- | /
- /_________> aVector02
+ ^ aNormal
+ |
+ | ^ aVector01
+ | /
+ /_________> aVector02
*/
vtkFloatingPointType aVector01[3] = { aCoord[1][0] - aCoord[0][0],
- aCoord[1][1] - aCoord[0][1],
- aCoord[1][2] - aCoord[0][2] };
+ aCoord[1][1] - aCoord[0][1],
+ aCoord[1][2] - aCoord[0][2] };
vtkFloatingPointType aVector02[3] = { aCoord[2][0] - aCoord[0][0],
- aCoord[2][1] - aCoord[0][1],
- aCoord[2][2] - aCoord[0][2] };
+ aCoord[2][1] - aCoord[0][1],
+ aCoord[2][2] - aCoord[0][2] };
vtkMath::Normalize(aVector01);
vtkMath::Normalize(aVector02);
// To calculate bounds of the point set
vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0};
{
- TPointIds::const_iterator anIter = anInitialPointIds.begin();
- TPointIds::const_iterator anEndIter = anInitialPointIds.end();
- for(; anIter != anEndIter; anIter++){
- vtkFloatingPointType aPntCoord[3];
- vtkIdType aPntId = *anIter;
- aPoints->GetPoint(aPntId,aPntCoord);
-
- vtkFloatingPointType aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
- aPntCoord[1] - aCoord[0][1],
- aPntCoord[2] - aCoord[0][2] };
-
-
- vtkMath::Normalize(aVector0Pnt);
-
- vtkFloatingPointType aNormalPnt[3];
- // calculate aNormalPnt
- {
- vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
- vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
- if(aCosPnt01<-1)
- aCosPnt01 = -1;
- if(aCosPnt01>1)
- aCosPnt01 = 1;
- if(aCosPnt02<-1)
- aCosPnt02 = -1;
- if(aCosPnt02>1)
- aCosPnt02 = 1;
-
- vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
- vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01));
- vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02));
-
- /* check that triangle similar to equilateral triangle
- AOC or COB ?
- aVector0Pnt = (OC)
- aVector01 = (OB)
- aVector02 = (OA)
-
- B
- ^ aVector01 C
- | ^ aVector0Pnt
- | _____/
- | ___/
- |/________> aVector02
- O A
- */
- aDist01 = fabs(aAngPnt01-(vtkMath::Pi())/3.0);
- aDist02 = fabs(aAngPnt02-(vtkMath::Pi())/3.0);
-
- // caculate a normal for best triangle
- if(aDist01 <= aDist02)
- vtkMath::Cross(aVector0Pnt,aVector01,aNormalPnt);
- else
- vtkMath::Cross(aVector0Pnt,aVector02,aNormalPnt);
-
- }
-
- vtkMath::Normalize(aNormalPnt);
-
- if(DEBUG_TRIA_EXECUTE)
- cout<<"\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"};";
-
- vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
- if(DEBUG_TRIA_EXECUTE) cout<<": aDist = "<<aDist;
- if(fabs(aDist) < aDistEps){
- aPointIds.insert(aPntId);
- aCenter[0] += aPntCoord[0];
- aCenter[1] += aPntCoord[1];
- aCenter[2] += aPntCoord[2];
- if(DEBUG_TRIA_EXECUTE) cout << "; Added = TRUE" << endl;
- } else {
- if(DEBUG_TRIA_EXECUTE) cout << "; Added = FALSE" << endl;
- }
- }
- int aNbPoints = aPointIds.size();
- aCenter[0] /= aNbPoints;
- aCenter[1] /= aNbPoints;
- aCenter[2] /= aNbPoints;
+ TPointIds::const_iterator anIter = anInitialPointIds.begin();
+ TPointIds::const_iterator anEndIter = anInitialPointIds.end();
+ for(; anIter != anEndIter; anIter++){
+ vtkFloatingPointType aPntCoord[3];
+ vtkIdType aPntId = *anIter;
+ aPoints->GetPoint(aPntId,aPntCoord);
+
+ vtkFloatingPointType aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
+ aPntCoord[1] - aCoord[0][1],
+ aPntCoord[2] - aCoord[0][2] };
+
+
+ vtkMath::Normalize(aVector0Pnt);
+
+ vtkFloatingPointType aNormalPnt[3];
+ // calculate aNormalPnt
+ {
+ vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
+ vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
+ if(aCosPnt01<-1)
+ aCosPnt01 = -1;
+ if(aCosPnt01>1)
+ aCosPnt01 = 1;
+ if(aCosPnt02<-1)
+ aCosPnt02 = -1;
+ if(aCosPnt02>1)
+ aCosPnt02 = 1;
+
+ vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
+ vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01));
+ vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02));
+
+ /* check that triangle similar to equilateral triangle
+ AOC or COB ?
+ aVector0Pnt = (OC)
+ aVector01 = (OB)
+ aVector02 = (OA)
+
+ B
+ ^ aVector01 C
+ | ^ aVector0Pnt
+ | _____/
+ | ___/
+ |/________> aVector02
+ O A
+ */
+ aDist01 = fabs(aAngPnt01-(vtkMath::Pi())/3.0);
+ aDist02 = fabs(aAngPnt02-(vtkMath::Pi())/3.0);
+
+ // caculate a normal for best triangle
+ if(aDist01 <= aDist02)
+ vtkMath::Cross(aVector0Pnt,aVector01,aNormalPnt);
+ else
+ vtkMath::Cross(aVector0Pnt,aVector02,aNormalPnt);
+
+ }
+
+ vtkMath::Normalize(aNormalPnt);
+
+ if(DEBUG_TRIA_EXECUTE)
+ cout<<"\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"};";
+
+ vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
+ if(DEBUG_TRIA_EXECUTE) cout<<": aDist = "<<aDist;
+ if(fabs(aDist) < aDistEps){
+ aPointIds.insert(aPntId);
+ aCenter[0] += aPntCoord[0];
+ aCenter[1] += aPntCoord[1];
+ aCenter[2] += aPntCoord[2];
+ if(DEBUG_TRIA_EXECUTE) cout << "; Added = TRUE" << endl;
+ } else {
+ if(DEBUG_TRIA_EXECUTE) cout << "; Added = FALSE" << endl;
+ }
+ }
+ int aNbPoints = aPointIds.size();
+ aCenter[0] /= aNbPoints;
+ aCenter[1] /= aNbPoints;
+ aCenter[2] /= aNbPoints;
}
//To sinchronize orientation of the cell and its face
vtkFloatingPointType aVectorC[3] = { aCenter[0] - aCellCenter[0],
- aCenter[1] - aCellCenter[1],
- aCenter[2] - aCellCenter[2] };
+ aCenter[1] - aCellCenter[1],
+ aCenter[2] - aCellCenter[2] };
vtkMath::Normalize(aVectorC);
vtkFloatingPointType aDot = vtkMath::Dot(aNormal,aVectorC);
if(DEBUG_TRIA_EXECUTE) {
- cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
- cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
- cout<<"\t\taDot = "<<aDot<<"\n";
+ cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
+ cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
+ cout<<"\t\taDot = "<<aDot<<"\n";
}
if(aDot > 0){
- aNormal[0] = -aNormal[0];
- aNormal[1] = -aNormal[1];
- aNormal[2] = -aNormal[2];
+ aNormal[0] = -aNormal[0];
+ aNormal[1] = -aNormal[1];
+ aNormal[2] = -aNormal[2];
}
// To calculate the primary direction for point set
vtkFloatingPointType aVector0[3] = { aCoord[0][0] - aCenter[0],
- aCoord[0][1] - aCenter[1],
- aCoord[0][2] - aCenter[2] };
+ aCoord[0][1] - aCenter[1],
+ aCoord[0][2] - aCenter[2] };
vtkMath::Normalize(aVector0);
if(DEBUG_TRIA_EXECUTE) {
- cout<<"\t\taCenter = {"<<aCenter[0]<<", "<<aCenter[1]<<", "<<aCenter[2]<<"}";
- cout<<"; aVector0 = {"<<aVector0[0]<<", "<<aVector0[1]<<", "<<aVector0[2]<<"}\n";
+ cout<<"\t\taCenter = {"<<aCenter[0]<<", "<<aCenter[1]<<", "<<aCenter[2]<<"}";
+ cout<<"; aVector0 = {"<<aVector0[0]<<", "<<aVector0[1]<<", "<<aVector0[2]<<"}\n";
}
// To calculate the set of points by face those that belong to the plane
TFace2PointIds aRemoveFace2PointIds;
{
- TFace2PointIds::const_iterator anIter = aFace2PointIds.begin();
- TFace2PointIds::const_iterator anEndIter = aFace2PointIds.end();
- for(; anIter != anEndIter; anIter++){
- const TPointIds& anIds = *anIter;
- TPointIds anIntersection;
- std::set_intersection(aPointIds.begin(),aPointIds.end(),
- anIds.begin(),anIds.end(),
- std::inserter(anIntersection,anIntersection.begin()));
-
-
- if(DEBUG_TRIA_EXECUTE) {
- cout << "anIntersection:";
- TPointIds::iterator aII = anIntersection.begin();
- for(;aII!=anIntersection.end();aII++)
- cout << *aII << ",";
- cout << endl;
- cout << "anIds :";
- TPointIds::const_iterator aIIds = anIds.begin();
- for(;aIIds!=anIds.end();aIIds++)
- cout << *aIIds << ",";
- cout << endl;
- }
- if(anIntersection == anIds){
- aRemoveFace2PointIds.insert(anIds);
- }
- }
+ TFace2PointIds::const_iterator anIter = aFace2PointIds.begin();
+ TFace2PointIds::const_iterator anEndIter = aFace2PointIds.end();
+ for(; anIter != anEndIter; anIter++){
+ const TPointIds& anIds = *anIter;
+ TPointIds anIntersection;
+ std::set_intersection(aPointIds.begin(),aPointIds.end(),
+ anIds.begin(),anIds.end(),
+ std::inserter(anIntersection,anIntersection.begin()));
+
+
+ if(DEBUG_TRIA_EXECUTE) {
+ cout << "anIntersection:";
+ TPointIds::iterator aII = anIntersection.begin();
+ for(;aII!=anIntersection.end();aII++)
+ cout << *aII << ",";
+ cout << endl;
+ cout << "anIds :";
+ TPointIds::const_iterator aIIds = anIds.begin();
+ for(;aIIds!=anIds.end();aIIds++)
+ cout << *aIIds << ",";
+ cout << endl;
+ }
+ if(anIntersection == anIds){
+ aRemoveFace2PointIds.insert(anIds);
+ }
+ }
}
// To remove from the set of points by face those that belong to the plane
{
- TFace2PointIds::const_iterator anIter = aRemoveFace2PointIds.begin();
- TFace2PointIds::const_iterator anEndIter = aRemoveFace2PointIds.end();
- for(; anIter != anEndIter; anIter++){
- const TPointIds& anIds = *anIter;
- aFace2PointIds.erase(anIds);
- }
+ TFace2PointIds::const_iterator anIter = aRemoveFace2PointIds.begin();
+ TFace2PointIds::const_iterator anEndIter = aRemoveFace2PointIds.end();
+ for(; anIter != anEndIter; anIter++){
+ const TPointIds& anIds = *anIter;
+ aFace2PointIds.erase(anIds);
+ }
}
// To sort the planar set of the points accrding to the angle
{
- typedef std::map<vtkFloatingPointType,vtkIdType> TSortedPointIds;
- TSortedPointIds aSortedPointIds;
-
- TPointIds::const_iterator anIter = aPointIds.begin();
- TPointIds::const_iterator anEndIter = aPointIds.end();
- for(; anIter != anEndIter; anIter++){
- vtkFloatingPointType aPntCoord[3];
- vtkIdType aPntId = *anIter;
- aPoints->GetPoint(aPntId,aPntCoord);
- vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0],
- aPntCoord[1] - aCenter[1],
- aPntCoord[2] - aCenter[2] };
- vtkMath::Normalize(aVector);
-
- vtkFloatingPointType aCross[3];
- vtkMath::Cross(aVector,aVector0,aCross);
- vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal);
- bool aGreaterThanPi = aCr < 0;
- vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0);
- vtkFloatingPointType anAngle = 0.0;
- if(aCosinus >= 1.0){
- aCosinus = 1.0;
- } else if (aCosinus <= -1.0){
- aCosinus = -1.0;
- anAngle = vtkMath::Pi();
- } else {
- anAngle = acos(aCosinus);
- if(aGreaterThanPi)
- anAngle = 2*vtkMath::Pi() - anAngle;
- }
-
- if(DEBUG_TRIA_EXECUTE) {
- cout << "\t\t\t vtkMath::Dot(aCross,aNormal)="<<aCr<<endl;
- cout<<"\t\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}";
- cout<<"; aGreaterThanPi = "<<aGreaterThanPi<<"; aCosinus = "<<aCosinus<<"; anAngle = "<<anAngle<<"\n";
- }
- aSortedPointIds[anAngle] = aPntId;
- }
-
- if(!aSortedPointIds.empty()){
- int aNumFacePts = aSortedPointIds.size();
- ::TConnectivities aConnectivities(aNumFacePts);
- TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
- TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
- if(DEBUG_TRIA_EXECUTE) cout << "Polygon:";
- for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){
- vtkIdType aPntId = anIter->second;
- aConnectivities[anId] = GetConnectivity(aPntId);
- if(DEBUG_TRIA_EXECUTE) cout << aPntId << ",";
- }
- if(DEBUG_TRIA_EXECUTE) cout << endl;
- aPolygons.push_back(::TPolygon(aConnectivities,aCenter,aNormal));
- }
+ typedef std::map<vtkFloatingPointType,vtkIdType> TSortedPointIds;
+ TSortedPointIds aSortedPointIds;
+
+ TPointIds::const_iterator anIter = aPointIds.begin();
+ TPointIds::const_iterator anEndIter = aPointIds.end();
+ for(; anIter != anEndIter; anIter++){
+ vtkFloatingPointType aPntCoord[3];
+ vtkIdType aPntId = *anIter;
+ aPoints->GetPoint(aPntId,aPntCoord);
+ vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0],
+ aPntCoord[1] - aCenter[1],
+ aPntCoord[2] - aCenter[2] };
+ vtkMath::Normalize(aVector);
+
+ vtkFloatingPointType aCross[3];
+ vtkMath::Cross(aVector,aVector0,aCross);
+ vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal);
+ bool aGreaterThanPi = aCr < 0;
+ vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0);
+ vtkFloatingPointType anAngle = 0.0;
+ if(aCosinus >= 1.0){
+ aCosinus = 1.0;
+ } else if (aCosinus <= -1.0){
+ aCosinus = -1.0;
+ anAngle = vtkMath::Pi();
+ } else {
+ anAngle = acos(aCosinus);
+ if(aGreaterThanPi)
+ anAngle = 2*vtkMath::Pi() - anAngle;
+ }
+
+ if(DEBUG_TRIA_EXECUTE) {
+ cout << "\t\t\t vtkMath::Dot(aCross,aNormal)="<<aCr<<endl;
+ cout<<"\t\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}";
+ cout<<"; aGreaterThanPi = "<<aGreaterThanPi<<"; aCosinus = "<<aCosinus<<"; anAngle = "<<anAngle<<"\n";
+ }
+ aSortedPointIds[anAngle] = aPntId;
+ }
+
+ if(!aSortedPointIds.empty()){
+ int aNumFacePts = aSortedPointIds.size();
+ ::TConnectivities aConnectivities(aNumFacePts);
+ TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
+ TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
+ if(DEBUG_TRIA_EXECUTE) cout << "Polygon:";
+ for(vtkIdType anId = 0; anIter != anEndIter; anIter++, anId++){
+ vtkIdType aPntId = anIter->second;
+ aConnectivities[anId] = GetConnectivity(aPntId);
+ if(DEBUG_TRIA_EXECUTE) cout << aPntId << ",";
+ }
+ if(DEBUG_TRIA_EXECUTE) cout << endl;
+ aPolygons.push_back(::TPolygon(aConnectivities,aCenter,aNormal));
+ }
}
}
}
vtkFloatingPointType* aNormal = aPolygon.myNormal;
vtkFloatingPointType* anOrigin = aPolygon.myOrigin;
if(DEBUG_TRIA_EXECUTE) {
- cout<<"\taPolygonId = "<<aPolygonId<<"\n";
- cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
- cout<<"; anOrigin = {"<<anOrigin[0]<<", "<<anOrigin[1]<<", "<<anOrigin[2]<<"}\n";
+ cout<<"\taPolygonId = "<<aPolygonId<<"\n";
+ cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
+ cout<<"; anOrigin = {"<<anOrigin[0]<<", "<<anOrigin[1]<<", "<<anOrigin[2]<<"}\n";
}
for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){
- vtkFloatingPointType aPntCoord[3];
- vtkIdType anId = GetPointId(aPntId);
- aPoints->GetPoint(anId,aPntCoord);
- vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
- if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
- if(aDist < -aDistEps)
- return false;
+ vtkFloatingPointType aPntCoord[3];
+ vtkIdType anId = GetPointId(aPntId);
+ aPoints->GetPoint(anId,aPntCoord);
+ vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
+ if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
+ if(aDist < -aDistEps)
+ return false;
}
}
}
if(DEBUG_TRIA_EXECUTE) cout << "PoilygonId="<<aPolygonId<<" | ";
TConnectivities& aConnectivities = aPolygon.myConnectivities;
if(DEBUG_TRIA_EXECUTE) {
- for(int i=0;i<aConnectivities.size();i++)
- cout << aConnectivities[i] << ",";
- cout << endl;
+ for(int i=0;i<aConnectivities.size();i++)
+ cout << aConnectivities[i] << ",";
+ cout << endl;
}
int aNbPoints = aConnectivities.size();
vtkIdType aNewCellId = theOutput->InsertNextCell(VTK_POLYGON,aNbPoints,&aConnectivities[0]);
if(theStoreMapping)
- theVTK2ObjIds.push_back(theCellId);
+ VTKViewer_GeometryFilter::InsertId( theCellId, VTK_POLYGON, theVTK2ObjIds, theDimension2VTK2ObjIds );
theOutputCD->CopyData(thInputCD,theCellId,aNewCellId);
}
}
vtkPoints*
VTKViewer_OrderedTriangulator
::InitPoints(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId)
+ vtkIdType theCellId)
{
myBoundaryTris->Reset();
vtkFloatingPointType aBounds[6];
myPoints->GetBounds(aBounds);
-
+ vtkFloatingPointType xSize, ySize, zSize;
+ xSize = aBounds[1] - aBounds[0];
+ ySize = aBounds[3] - aBounds[2];
+ zSize = aBounds[5] - aBounds[4];
vtkFloatingPointType anAbsoluteCoord[3];
vtkFloatingPointType aParamentrucCoord[3];
for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
myPoints->GetPoint(aPntId, anAbsoluteCoord);
- aParamentrucCoord[0] = (anAbsoluteCoord[0] - aBounds[0]) / (aBounds[1] - aBounds[0]);
- aParamentrucCoord[1] = (anAbsoluteCoord[1] - aBounds[2]) / (aBounds[3] - aBounds[2]);
- aParamentrucCoord[2] = (anAbsoluteCoord[2] - aBounds[4]) / (aBounds[5] - aBounds[4]);
+ aParamentrucCoord[0] = xSize==0. ? 0. : ((anAbsoluteCoord[0] - aBounds[0]) / xSize);
+ aParamentrucCoord[1] = ySize==0. ? 0. : ((anAbsoluteCoord[1] - aBounds[2]) / ySize);
+ aParamentrucCoord[2] = zSize==0. ? 0. : ((anAbsoluteCoord[2] - aBounds[4]) / zSize);
myTriangulator->InsertPoint(aPntId, anAbsoluteCoord, aParamentrucCoord, 0);
}
vtkPoints*
VTKViewer_DelaunayTriangulator
::InitPoints(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId)
+ vtkIdType theCellId)
{
vtkPoints* aPoints = VTKViewer_Triangulator::InitPoints(theInput, theCellId);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _VTKViewer_ConvexTool_H
#define _VTKViewer_ConvexTool_H
#include "VTKViewer.h"
+#include <map>
#include <vector>
#include <vtkSystemIncludes.h>
bool
Execute(vtkUnstructuredGrid *theInput,
- vtkCellData* thInputCD,
- vtkIdType theCellId,
- int theShowInside,
- int theAllVisible,
- const char* theCellsVisibility,
- vtkPolyData *theOutput,
- vtkCellData* theOutputCD,
- int theStoreMapping,
- std::vector<vtkIdType>& theVTK2ObjIds,
- bool theIsCheckConvex);
+ vtkCellData* thInputCD,
+ vtkIdType theCellId,
+ int theShowInside,
+ int theAllVisible,
+ int theAppendCoincident3D,
+ const char* theCellsVisibility,
+ vtkPolyData *theOutput,
+ vtkCellData* theOutputCD,
+ int theStoreMapping,
+ std::vector<vtkIdType>& theVTK2ObjIds,
+ std::map< vtkIdType, std::vector<vtkIdType> >& theDimension2VTK2ObjIds,
+ bool theIsCheckConvex);
private:
vtkIdList* myCellIds;
virtual
vtkPoints*
InitPoints(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId);
+ vtkIdType theCellId);
virtual
vtkIdType
void
GetCellNeighbors(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId,
- vtkCell* theFace,
- vtkIdList* theCellIds);
+ vtkIdType theCellId,
+ vtkCell* theFace,
+ vtkIdList* theCellIds);
vtkIdType
GetConnectivity(vtkIdType thePntId);
virtual
vtkPoints*
InitPoints(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId);
+ vtkIdType theCellId);
virtual
vtkIdType
virtual
vtkPoints*
InitPoints(vtkUnstructuredGrid *theInput,
- vtkIdType theCellId);
+ vtkIdType theCellId);
virtual
vtkIdType
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// VISU CONVERTOR :
-// File: VISU_ExtractUnstructuredGrid.cxx
+
+// File: VTKViewer_ExtractUnstructuredGrid.cxx
// Author: Alexey PETROV
-// Module : VISU
-//
+
#include "VTKViewer_ExtractUnstructuredGrid.h"
#include "VTKViewer_CellLocationsArray.h"
#include <vtkCell.h>
#include <vtkInformation.h>
#include <vtkInformationVector.h>
+#include <vtkVersion.h>
-using namespace std;
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
+#include "utilities.h"
#if defined __GNUC__
#if __GNUC__ == 2
#endif
#endif
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+
vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid);
void VTKViewer_ExtractUnstructuredGrid::RegisterCellsWithType(vtkIdType theCellType){
// if(0 && MYDEBUG) MESSAGE("RegisterCellsWithType - theCellType = "<<theCellType);
myCellTypes.insert(theCellType);
+ //MESSAGE("myCellTypes.insert " << theCellType);
Modified();
}
if ( myCellIds.empty() && myCellTypes.empty() )
return theOutId;
- if ( myOut2InId.empty() || theOutId > (int)myOut2InId.size() )
+ if ( theOutId<0 || theOutId >= (int)myOut2InId.size() )
return -1;
-#if defined __GNUC_2__
return myOut2InId[theOutId];
-#else
- return myOut2InId.at(theOutId);
-#endif
}
vtkIdType VTKViewer_ExtractUnstructuredGrid::GetOutputId(int theInId) const{
inline void InsertCell(vtkUnstructuredGrid *theInput,
- vtkCellArray *theConnectivity,
- vtkUnsignedCharArray* theCellTypesArray,
- vtkIdType theCellId,
- vtkIdList *theIdList,
- bool theStoreMapping,
- vtkIdType theOutId,
- VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
- VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
+ vtkCellArray *theConnectivity,
+ vtkUnsignedCharArray* theCellTypesArray,
+ vtkIdTypeArray*& theFaces,
+ vtkIdTypeArray*& theFaceLocations,
+ vtkIdType theCellId,
+ vtkIdList *theIdList,
+ bool theStoreMapping,
+ vtkIdType theOutId,
+ VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
+ VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
{
vtkCell *aCell = theInput->GetCell(theCellId);
vtkIdList *aPntIds = aCell->GetPointIds();
for(vtkIdType i = 0; i < aNbIds; i++){
theIdList->SetId(i,aPntIds->GetId(i));
}
- theConnectivity->InsertNextCell(theIdList);
-
vtkIdType aCellType = aCell->GetCellType();
+#if VTK_XVERSION > 50700
+ if (aCellType != VTK_POLYHEDRON)
+ {
+#endif
+ theConnectivity->InsertNextCell(theIdList);
+ if (theFaceLocations)
+ theFaceLocations->InsertNextValue(-1);
+#if VTK_XVERSION > 50700
+ }
+ else
+ {
+ //MESSAGE("InsertCell type VTK_POLYHEDRON " << theStoreMapping);
+ if (!theFaces)
+ {
+ theFaces = vtkIdTypeArray::New();
+ theFaces->Allocate(theCellTypesArray->GetSize());
+ theFaceLocations = vtkIdTypeArray::New();
+ theFaceLocations->Allocate(theCellTypesArray->GetSize());
+ // FaceLocations must be padded until the current position
+ for (vtkIdType i = 0; i <= theCellTypesArray->GetMaxId(); i++)
+ {
+ theFaceLocations->InsertNextValue(-1);
+ }
+ }
+ // insert face location
+ theFaceLocations->InsertNextValue(theFaces->GetMaxId() + 1);
+
+ // insert cell connectivity and faces stream
+ vtkIdType nfaces;
+ vtkIdType* face;
+ vtkIdType realnpts;
+ theInput->GetFaceStream(theCellId, nfaces, face);
+ vtkUnstructuredGrid::DecomposeAPolyhedronCell(
+ nfaces, face, realnpts, theConnectivity, theFaces);
+ }
+#endif
+
theCellTypesArray->InsertNextValue(aCellType);
if(theStoreMapping){
theOut2InId.push_back(theCellId);
}
inline void InsertPointCell(vtkCellArray *theConnectivity,
- vtkUnsignedCharArray* theCellTypesArray,
- vtkIdType theCellId,
- vtkIdList *theIdList,
- bool theStoreMapping,
- vtkIdType theOutId,
- VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
- VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
+ vtkUnsignedCharArray* theCellTypesArray,
+ vtkIdType theCellId,
+ vtkIdList *theIdList,
+ bool theStoreMapping,
+ vtkIdType theOutId,
+ VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId,
+ VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId)
{
theIdList->SetId(0,theCellId);
theConnectivity->InsertNextCell(theIdList);
MESSAGE("Execute - myChangeMode = "<<myChangeMode);
}*/
if(myExtractionMode == eCells){
- if(myChangeMode == ePassAll || myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving){
+ if(myChangeMode == ePassAll || (myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving)){
if(vtkIdType aNbElems = anInput->GetNumberOfCells()){
- if(myStoreMapping) myOut2InId.reserve(aNbElems);
- anOutput->ShallowCopy(anInput);
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- if(myStoreMapping){
- myOut2InId.push_back(aCellId);
- myIn2OutId[aCellId] = anOutId;
- }
- }
+ if(myStoreMapping) myOut2InId.reserve(aNbElems);
+ anOutput->ShallowCopy(anInput);
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ if(myStoreMapping){
+ myOut2InId.push_back(aCellId);
+ myIn2OutId[aCellId] = anOutId;
+ }
+ }
}
}else{
vtkIdList *anIdList = vtkIdList::New();
vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->Allocate(aNbElems*aCellTypesArray->GetNumberOfComponents());
+
+ vtkIdTypeArray *newFaces = 0;
+ vtkIdTypeArray *newFaceLocations = 0;
+
if(!myCellIds.empty() && myCellTypes.empty()){
- if(myStoreMapping) myOut2InId.reserve(myCellIds.size());
- if(myChangeMode == eAdding){
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- if(myCellIds.find(aCellId) != myCellIds.end()){
- InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }else{
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- if(myCellIds.find(aCellId) == myCellIds.end()){
- InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }
+ if(myStoreMapping) myOut2InId.reserve(myCellIds.size());
+ if(myChangeMode == eAdding){
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ if(myCellIds.find(aCellId) != myCellIds.end()){
+ InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }else{
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ if(myCellIds.find(aCellId) == myCellIds.end()){
+ InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }
}else if(myCellIds.empty() && !myCellTypes.empty()){
- if(myChangeMode == eAdding){
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) != myCellTypes.end()){
- InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }else{
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) == myCellTypes.end()){
- InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }
+ if(myChangeMode == eAdding){
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) != myCellTypes.end()){
+ InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }else{
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) == myCellTypes.end()){
+ InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }
}else if(!myCellIds.empty() && !myCellTypes.empty()){
- if(myChangeMode == eAdding){
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) != myCellTypes.end()){
- if(myCellIds.find(aCellId) != myCellIds.end()){
- InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }
- }else{
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) == myCellTypes.end()){
- if(myCellIds.find(aCellId) == myCellIds.end()){
- InsertCell(anInput,aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }
- }
+ if(myChangeMode == eAdding){
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) != myCellTypes.end()){
+ if(myCellIds.find(aCellId) != myCellIds.end()){
+ InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }
+ }else{
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) == myCellTypes.end()){
+ if(myCellIds.find(aCellId) == myCellIds.end()){
+ InsertCell(anInput,aConnectivity,aCellTypesArray,newFaces,newFaceLocations,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }
+ }
}
if((aNbElems = aConnectivity->GetNumberOfCells())){
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
- aCellLocationsArray->SetNumberOfComponents(1);
- aCellLocationsArray->SetNumberOfTuples(aNbElems);
- aConnectivity->InitTraversal();
- for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
- aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
- }
- anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
- anOutput->SetPoints(anInput->GetPoints());
- aCellLocationsArray->Delete();
+ VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ aCellLocationsArray->SetNumberOfComponents(1);
+ aCellLocationsArray->SetNumberOfTuples(aNbElems);
+ aConnectivity->InitTraversal();
+ for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
+ aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
+ }
+#if VTK_XVERSION > 50700
+ anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity,newFaceLocations,newFaces);
+#else
+ anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
+#endif
+ anOutput->SetPoints(anInput->GetPoints());
+ aCellLocationsArray->Delete();
}
aCellTypesArray->Delete();
aConnectivity->Delete();
vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
aCellTypesArray->SetNumberOfComponents(1);
aCellTypesArray->Allocate(aNbElems*aCellTypesArray->GetNumberOfComponents());
- if(myChangeMode == ePassAll || myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving){
+ // additional condition has been added to treat a case described in IPAL21372
+ // note that it is significant only when myExtractionMode == ePoints
+ if(myChangeMode == ePassAll || (myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving) ||
+ !anInput->GetCellTypesArray()){
if(myStoreMapping) myOut2InId.reserve(aNbElems);
for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
}
}else if(!myCellIds.empty() && myCellTypes.empty()){
if(myStoreMapping) myOut2InId.reserve(myCellIds.size());
if(myChangeMode == eAdding){
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- if(myCellIds.find(aCellId) != myCellIds.end()){
- InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ if(myCellIds.find(aCellId) != myCellIds.end()){
+ InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
}else{
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- if(myCellIds.find(aCellId) == myCellIds.end()){
- InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ if(myCellIds.find(aCellId) == myCellIds.end()){
+ InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
}
}else if(myCellIds.empty() && !myCellTypes.empty()){
if(myChangeMode == eAdding){
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) != myCellTypes.end()){
- InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) != myCellTypes.end()){
+ InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
}else{
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) == myCellTypes.end()){
- InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) == myCellTypes.end()){
+ InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
}
}else if(!myCellIds.empty() && !myCellTypes.empty()){
if(myChangeMode == eAdding){
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) != myCellTypes.end()){
- if(myCellIds.find(aCellId) != myCellIds.end()){
- InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) != myCellTypes.end()){
+ if(myCellIds.find(aCellId) != myCellIds.end()){
+ InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }
}else{
- for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
- vtkIdType aType = anInput->GetCellType(aCellId);
- if(myCellTypes.find(aType) == myCellTypes.end()){
- if(myCellIds.find(aCellId) == myCellIds.end()){
- InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
- myStoreMapping,anOutId,myOut2InId,myIn2OutId);
- }
- }
- }
+ for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
+ vtkIdType aType = anInput->GetCellType(aCellId);
+ if(myCellTypes.find(aType) == myCellTypes.end()){
+ if(myCellIds.find(aCellId) == myCellIds.end()){
+ InsertPointCell(aConnectivity,aCellTypesArray,aCellId,anIdList,
+ myStoreMapping,anOutId,myOut2InId,myIn2OutId);
+ }
+ }
+ }
}
}
if((aNbElems = aConnectivity->GetNumberOfCells())){
aCellLocationsArray->SetNumberOfTuples(aNbElems);
aConnectivity->InitTraversal();
for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
- aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
+ aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
}
+#if VTK_XVERSION > 50700
+ anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity,0, 0);
+#else
anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
+#endif
anOutput->SetPoints(anInput->GetPoints());
aCellLocationsArray->Delete();
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
#define VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VTKViewer_Filter : Filter for VTK viewer
// File : VTKViewer_Filter.cxx
// Author : Sergey LITONIN
-// Module : SALOME
-//
+
#include "VTKViewer_Filter.h"
-using namespace std;
IMPLEMENT_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, MMgt_TShared)
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESHGUI_Filter : Filter for VTK viewer
// File : VTKViewer_Filter.h
// Author : Sergey LITONIN
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VTKViewer_ViewFrame.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
-//
+
#ifndef VTKViewer_Functor_H
#define VTKViewer_Functor_H
{}
void operator()(TActor* theActor)
{
- (theActor->*myAction)(myArg);
+ (theActor->*myAction)(myArg);
}
};
template<class TActor, class TArg = int> struct TSetVisibility: TSetFunction<TActor,TArg>
{
TSetVisibility(TArg theArg):
- TSetFunction<TActor,TArg>(&TActor::SetVisibility,theArg)
+ TSetFunction<TActor,TArg>(&TActor::SetVisibility,theArg)
{}
};
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SALOME OBJECT : kernel of SALOME component
+
// File : VTKViewer_GeometryFilter.cxx
// Author : Michael ZORIN
// Module : SALOME
-// $Header$
//
#include "VTKViewer_GeometryFilter.h"
#include "VTKViewer_ConvexTool.h"
+#include "VTKViewer_ArcBuilder.h"
#include <vtkSmartPointer.h>
#include <vtkCellArray.h>
#include <vtkCellData.h>
#include <vtkGenericCell.h>
+#include <vtkHexagonalPrism.h>
#include <vtkHexahedron.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
#include <vtkMergePoints.h>
#include <vtkObjectFactory.h>
#include <vtkPointData.h>
#include <vtkPolyData.h>
+#include <vtkPolygon.h>
#include <vtkPyramid.h>
#include <vtkStructuredGrid.h>
#include <vtkTetra.h>
#include <vtkUnstructuredGrid.h>
#include <vtkVoxel.h>
#include <vtkWedge.h>
-#include <vtkInformationVector.h>
-#include <vtkInformation.h>
#include <algorithm>
#include <iterator>
#include <map>
#include <set>
+#include "utilities.h"
+
#if defined __GNUC__
#if __GNUC__ == 2
#define __GNUC_2__
#endif
#endif
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+
+//#define __MYDEBUG__
//#define USE_ROBUST_TRIANGULATION
vtkCxxRevisionMacro(VTKViewer_GeometryFilter, "$Revision$");
vtkStandardNewMacro(VTKViewer_GeometryFilter);
VTKViewer_GeometryFilter
-::VTKViewer_GeometryFilter():
+::VTKViewer_GeometryFilter():
myShowInside(0),
myStoreMapping(0),
- myIsWireframeMode(0)
+ myAppendCoincident3D(0),
+ myIsWireframeMode(0),
+ myIsBuildArc(false),
+ myMaxArcAngle(2)
{}
{
return 0;
}
-
+
if (input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID){
return this->UnstructuredGridExecute(input, output, outInfo);
}else
int
VTKViewer_GeometryFilter
::UnstructuredGridExecute(
- vtkDataSet *dataSetInput,
- vtkPolyData *output,
- vtkInformation *outInfo)
+ vtkDataSet *dataSetInput,
+ vtkPolyData *output,
+ vtkInformation *outInfo)
{
-
+
vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput;
vtkCellArray *Connectivity = input->GetCells();
// Check input
vtkPointData *pd = input->GetPointData();
vtkCellData *cd = input->GetCellData();
vtkPointData *outputPD = output->GetPointData();
-
+
VTKViewer_OrderedTriangulator anOrderedTriangulator;
VTKViewer_DelaunayTriangulator aDelaunayTriangulator;
vtkIdType aNewPts[VTK_CELL_SIZE];
// ghost cell stuff
unsigned char updateLevel = (unsigned char)(output->GetUpdateGhostLevel());
- unsigned char *cellGhostLevels = 0;
-
+ unsigned char *cellGhostLevels = 0;
+
PixelConvert[0] = 0;
PixelConvert[1] = 1;
PixelConvert[2] = 3;
PixelConvert[3] = 2;
-
+
vtkDebugMacro(<<"Executing geometry filter for unstructured grid input");
vtkDataArray* temp = 0;
{
cellGhostLevels = ((vtkUnsignedCharArray*)temp)->GetPointer(0);
}
-
+
// Determine nature of what we have to do
if ( (!this->CellClipping) && (!this->PointClipping) &&
(!this->ExtentClipping) )
cellVis = new char[numCells];
}
- // Just pass points through, never merge
- output->SetPoints(input->GetPoints());
+ // Issue 0020115: [CEA 308] Quadratic elements visualization
+ // Fix of remark described in note 0005222 - SIGSEGV
+ vtkPoints* outputPoints = vtkPoints::New();
+ outputPoints->DeepCopy(input->GetPoints());
+ output->SetPoints(outputPoints);
+ outputPoints->Delete();
+
outputPD->PassData(pd);
outputCD->CopyAllocate(cd,numCells,numCells/2);
output->Allocate(numCells/4+1,numCells);
-
+
// Loop over the cells determining what's visible
if (!allVisible)
{
- for (cellId=0, Connectivity->InitTraversal();
- Connectivity->GetNextCell(npts,pts);
+ for (cellId=0, Connectivity->InitTraversal();
+ Connectivity->GetNextCell(npts,pts);
cellId++)
{
cellVis[cellId] = 1;
- if ( this->CellClipping && cellId < this->CellMinimum ||
+ if ( ( this->CellClipping && cellId < this->CellMinimum ) ||
cellId > this->CellMaximum )
{
cellVis[cellId] = 0;
}
else
{
- for (i=0; i < npts; i++)
+ for (i=0; i < npts; i++)
{
x = p->GetPoint(pts[i]);
- if ( (this->PointClipping && (pts[i] < this->PointMinimum ||
- pts[i] > this->PointMaximum) ) ||
- (this->ExtentClipping &&
- (x[0] < this->Extent[0] || x[0] > this->Extent[1] ||
- x[1] < this->Extent[2] || x[1] > this->Extent[3] ||
- x[2] < this->Extent[4] || x[2] > this->Extent[5] )) )
+ if ( ( ( ( this->PointClipping && (pts[i] < this->PointMinimum ) ) ||
+ pts[i] > this->PointMaximum) ) ||
+ ( this->ExtentClipping &&
+ ( x[0] < this->Extent[0] || x[0] > this->Extent[1] ||
+ x[1] < this->Extent[2] || x[1] > this->Extent[3] ||
+ x[2] < this->Extent[4] || x[2] > this->Extent[5] )) )
{
cellVis[cellId] = 0;
break;
}//if point clipping needs checking
}//for all cells
}//if not all visible
-
+
// Loop over all cells now that visibility is known
// (Have to compute visibility first for 3D cell boundarys)
int progressInterval = numCells/20 + 1;
+ TMapOfVectorId aDimension2VTK2ObjIds;
if(myStoreMapping){
myVTK2ObjIds.clear();
myVTK2ObjIds.reserve(numCells);
}
- for (cellId=0, Connectivity->InitTraversal();
- Connectivity->GetNextCell(npts,pts);
+ for (cellId=0, Connectivity->InitTraversal();
+ Connectivity->GetNextCell(npts,pts);
cellId++)
{
//Progress and abort method support
{ // Do not create surfaces in outer ghost cells.
continue;
}
-
+
if (allVisible || cellVis[cellId]) //now if visible extract geometry
{
//special code for nonlinear cells - rarely occurs, so right now it
case VTK_VERTEX:
case VTK_POLY_VERTEX:
newCellId = output->InsertNextCell(aCellType,npts,pts);
- if(myStoreMapping){
- myVTK2ObjIds.push_back(cellId); //apo
- }
+ if(myStoreMapping){
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ }
outputCD->CopyData(cd,cellId,newCellId);
break;
- case VTK_LINE:
+ case VTK_LINE:
case VTK_POLY_LINE:
newCellId = output->InsertNextCell(aCellType,npts,pts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
break;
case VTK_QUAD:
case VTK_POLYGON:
newCellId = output->InsertNextCell(aCellType,npts,pts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
break;
case VTK_TRIANGLE_STRIP:
newCellId = output->InsertNextCell(aCellType,npts,pts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
break;
case VTK_PIXEL:
newCellId = output->InsertNextCell(aCellType,npts,pts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
- outputCD->CopyData(cd,cellId,newCellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ outputCD->CopyData(cd,cellId,newCellId);
break;
-
- case VTK_CONVEX_POINT_SET: {
- bool anIsOk = anOrderedTriangulator.Execute(input,
- cd,
- cellId,
- myShowInside,
- allVisible,
- cellVis,
- output,
- outputCD,
- myStoreMapping,
- myVTK2ObjIds,
- true);
- if(!anIsOk)
- aDelaunayTriangulator.Execute(input,
- cd,
- cellId,
- myShowInside,
- allVisible,
- cellVis,
- output,
- outputCD,
- myStoreMapping,
- myVTK2ObjIds,
- false);
-
- break;
- }
+
+ case VTK_CONVEX_POINT_SET: {
+ bool anIsOk = anOrderedTriangulator.Execute(input,
+ cd,
+ cellId,
+ myShowInside,
+ allVisible,
+ myAppendCoincident3D,
+ cellVis,
+ output,
+ outputCD,
+ myStoreMapping,
+ myVTK2ObjIds,
+ aDimension2VTK2ObjIds,
+ true);
+ if(!anIsOk)
+ aDelaunayTriangulator.Execute(input,
+ cd,
+ cellId,
+ myShowInside,
+ allVisible,
+ myAppendCoincident3D,
+ cellVis,
+ output,
+ outputCD,
+ myStoreMapping,
+ myVTK2ObjIds,
+ aDimension2VTK2ObjIds,
+ false);
+
+ break;
+ }
case VTK_TETRA: {
for (faceId = 0; faceId < 4; faceId++)
{
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
- aCellType = VTK_TRIANGLE;
+ aCellType = VTK_TRIANGLE;
numFacePts = 3;
input->GetCellNeighbors(cellId, faceIds, cellIds);
- if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if ( process || myShowInside ||
(!allVisible && !cellVis[cellIds->GetId(0)]) )
{
for ( i=0; i < numFacePts; i++)
aNewPts[i] = pts[faceVerts[i]];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
}
}
break;
- }
+ }
case VTK_VOXEL: {
for (faceId = 0; faceId < 6; faceId++)
{
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
faceIds->InsertNextId(pts[faceVerts[3]]);
- aCellType = VTK_QUAD;
+ aCellType = VTK_QUAD;
numFacePts = 4;
input->GetCellNeighbors(cellId, faceIds, cellIds);
- if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if ( process || myShowInside ||
(!allVisible && !cellVis[cellIds->GetId(0)]) )
{
for ( i=0; i < numFacePts; i++)
aNewPts[i] = pts[faceVerts[PixelConvert[i]]];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
}
}
break;
- }
+ }
case VTK_HEXAHEDRON: {
for (faceId = 0; faceId < 6; faceId++)
{
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
faceIds->InsertNextId(pts[faceVerts[3]]);
- aCellType = VTK_QUAD;
+ aCellType = VTK_QUAD;
numFacePts = 4;
input->GetCellNeighbors(cellId, faceIds, cellIds);
- if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if ( process || myShowInside ||
(!allVisible && !cellVis[cellIds->GetId(0)]) )
{
for ( i=0; i < numFacePts; i++)
aNewPts[i] = pts[faceVerts[i]];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
}
}
break;
- }
+ }
case VTK_WEDGE: {
for (faceId = 0; faceId < 5; faceId++)
{
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
- aCellType = VTK_TRIANGLE;
+ aCellType = VTK_TRIANGLE;
numFacePts = 3;
if (faceVerts[3] >= 0)
{
faceIds->InsertNextId(pts[faceVerts[3]]);
- aCellType = VTK_QUAD;
+ aCellType = VTK_QUAD;
numFacePts = 4;
}
+
input->GetCellNeighbors(cellId, faceIds, cellIds);
- if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if ( process || myShowInside ||
(!allVisible && !cellVis[cellIds->GetId(0)]) )
{
for ( i=0; i < numFacePts; i++)
aNewPts[i] = pts[faceVerts[i]];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
}
}
break;
- }
+ }
+ case VTK_HEXAGONAL_PRISM: {
+ for (faceId = 0; faceId < 8; faceId++)
+ {
+ faceVerts = vtkHexagonalPrism::GetFaceArray(faceId);
+ faceIds->Reset();
+ faceIds->InsertNextId(pts[faceVerts[0]]);
+ faceIds->InsertNextId(pts[faceVerts[1]]);
+ faceIds->InsertNextId(pts[faceVerts[2]]);
+ faceIds->InsertNextId(pts[faceVerts[3]]);
+ aCellType = VTK_QUAD;
+ numFacePts = 4;
+ if (faceVerts[5] >= 0)
+ {
+ faceIds->InsertNextId(pts[faceVerts[4]]);
+ faceIds->InsertNextId(pts[faceVerts[5]]);
+ aCellType = VTK_POLYGON;
+ numFacePts = 6;
+ }
+ input->GetCellNeighbors(cellId, faceIds, cellIds);
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if ( process || myShowInside ||
+ (!allVisible && !cellVis[cellIds->GetId(0)]) )
+ {
+ for ( i=0; i < numFacePts; i++)
+ aNewPts[i] = pts[faceVerts[i]];
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ outputCD->CopyData(cd,cellId,newCellId);
+ }
+ }
+ break;
+ }
case VTK_PYRAMID: {
for (faceId = 0; faceId < 5; faceId++)
{
faceIds->InsertNextId(pts[faceVerts[0]]);
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
- aCellType = VTK_TRIANGLE;
+ aCellType = VTK_TRIANGLE;
numFacePts = 3;
if (faceVerts[3] >= 0)
{
faceIds->InsertNextId(pts[faceVerts[3]]);
- aCellType = VTK_QUAD;
+ aCellType = VTK_QUAD;
numFacePts = 4;
}
input->GetCellNeighbors(cellId, faceIds, cellIds);
- if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ||
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if ( process || myShowInside ||
(!allVisible && !cellVis[cellIds->GetId(0)]) )
{
for ( i=0; i < numFacePts; i++)
aNewPts[i] = pts[faceVerts[i]];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
}
}
break;
- }
+ }
+
+#if VTK_XVERSION > 50700
+ case VTK_POLYHEDRON:
+ {
+ //MESSAGE("VTK_POLYHEDRON geometry filter");
+ vtkIdType nFaces = 0;
+ vtkIdType* ptIds = 0;
+ int idp = 0;
+ input->GetFaceStream(cellId, nFaces, ptIds);
+ for (faceId = 0; faceId < nFaces; faceId++)
+ {
+ faceIds->Reset();
+ numFacePts = ptIds[idp];
+ //MESSAGE("numFacePts="<< numFacePts);
+ int pt0 = ++idp;
+ for (i = 0; i < numFacePts; i++)
+ {
+ //MESSAGE("ptIds[" << idp + i << "]=" << ptIds[idp + i]);
+ faceIds->InsertNextId(ptIds[idp + i]);
+ }
+ idp += numFacePts;
+ switch (numFacePts)
+ {
+ case 3:
+ aCellType = VTK_TRIANGLE;
+ break;
+ case 4:
+ aCellType = VTK_QUAD;
+ break;
+ default:
+ aCellType = VTK_POLYGON;
+ break;
+ }
+ // TODO understand and fix display of several polyhedrons
+ input->GetCellNeighbors(cellId, faceIds, cellIds);
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if (process || myShowInside
+ || (!allVisible && !cellVis[cellIds->GetId(0)]))
+ {
+ for (i = 0; i < numFacePts; i++)
+ aNewPts[i] = ptIds[pt0 + i];
+ newCellId = output->InsertNextCell(aCellType, numFacePts, aNewPts);
+ if (myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ outputCD->CopyData(cd, cellId, newCellId);
+ }
+ }
+ break;
+ }
+#endif
//Quadratic cells
case VTK_QUADRATIC_EDGE:
case VTK_QUADRATIC_TRIANGLE:
case VTK_QUADRATIC_QUAD:
+ case VTK_BIQUADRATIC_QUAD:
case VTK_QUADRATIC_TETRA:
case VTK_QUADRATIC_HEXAHEDRON:
+ case VTK_TRIQUADRATIC_HEXAHEDRON:
case VTK_QUADRATIC_WEDGE:
case VTK_QUADRATIC_PYRAMID:
- if(!myIsWireframeMode){
- input->GetCell(cellId,cell);
- vtkIdList *pts = vtkIdList::New();
- vtkPoints *coords = vtkPoints::New();
- vtkIdList *cellIds = vtkIdList::New();
- vtkIdType newCellId;
-
- if ( cell->GetCellDimension() == 1 ) {
- aCellType = VTK_LINE;
- numFacePts = 2;
- cell->Triangulate(0,pts,coords);
- for (i=0; i < pts->GetNumberOfIds(); i+=2) {
- aNewPts[0] = pts->GetId(i);
- aNewPts[1] = pts->GetId(i+1);
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
- outputCD->CopyData(cd,cellId,newCellId);
+ if(!myIsWireframeMode) {
+ input->GetCell(cellId,cell);
+ vtkIdList *lpts = vtkIdList::New();
+ vtkPoints *coords = vtkPoints::New();
+ vtkIdList *cellIds = vtkIdList::New();
+ vtkIdType newCellId;
+
+ if ( cell->GetCellDimension() == 1 ) {
+ vtkIdType arcResult = -1;
+ if(myIsBuildArc) {
+ arcResult = Build1DArc(cellId, input, output, pts, myMaxArcAngle);
+ newCellId = arcResult;
+ }
+
+ if(!myIsBuildArc || arcResult == -1 ) {
+ aCellType = VTK_LINE;
+ numFacePts = 2;
+ cell->Triangulate(0,lpts,coords);
+ for (i=0; i < lpts->GetNumberOfIds(); i+=2) {
+ aNewPts[0] = lpts->GetId(i);
+ aNewPts[1] = lpts->GetId(i+1);
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ outputCD->CopyData(cd,cellId,newCellId);
+ }
+ }
+ else {
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ outputCD->CopyData(cd,cellId,newCellId);
}
}
- else if ( cell->GetCellDimension() == 2 ) {
- aCellType = VTK_TRIANGLE;
- numFacePts = 3;
- cell->Triangulate(0,pts,coords);
- for (i=0; i < pts->GetNumberOfIds(); i+=3) {
- aNewPts[0] = pts->GetId(i);
- aNewPts[1] = pts->GetId(i+1);
- aNewPts[2] = pts->GetId(i+2);
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
- outputCD->CopyData(cd,cellId,newCellId);
+ else if ( cell->GetCellDimension() == 2 ) {
+ if(!myIsBuildArc) {
+ aCellType = VTK_TRIANGLE;
+ numFacePts = 3;
+ cell->Triangulate(0,lpts,coords);
+ for (i=0; i < lpts->GetNumberOfIds(); i+=3) {
+ aNewPts[0] = lpts->GetId(i);
+ aNewPts[1] = lpts->GetId(i+1);
+ aNewPts[2] = lpts->GetId(i+2);
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ outputCD->CopyData(cd,cellId,newCellId);
+ }
}
- }
- else //3D nonlinear cell
+ else{
+ BuildArcedPolygon(cellId,input,output,aDimension2VTK2ObjIds,true);
+ }
+ }
+ else //3D nonlinear cell
{
- aCellType = VTK_TRIANGLE;
- numFacePts = 3;
- for (int j=0; j < cell->GetNumberOfFaces(); j++){
- vtkCell *face = cell->GetFace(j);
- input->GetCellNeighbors(cellId, face->PointIds, cellIds);
- if ( cellIds->GetNumberOfIds() <= 0 || myShowInside ) {
- face->Triangulate(0,pts,coords);
- for (i=0; i < pts->GetNumberOfIds(); i+=3) {
- aNewPts[0] = pts->GetId(i);
- aNewPts[1] = pts->GetId(i+1);
- aNewPts[2] = pts->GetId(i+2);
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
- outputCD->CopyData(cd,cellId,newCellId);
+ aCellType = VTK_TRIANGLE;
+ numFacePts = 3;
+ for (int j=0; j < cell->GetNumberOfFaces(); j++){
+ vtkCell *face = cell->GetFace(j);
+ input->GetCellNeighbors(cellId, face->PointIds, cellIds);
+ bool process = cellIds->GetNumberOfIds() <= 0 ? true : myAppendCoincident3D;
+ if ( process || myShowInside ) {
+ face->Triangulate(0,lpts,coords);
+ for (i=0; i < lpts->GetNumberOfIds(); i+=3) {
+ aNewPts[0] = lpts->GetId(i);
+ aNewPts[1] = lpts->GetId(i+1);
+ aNewPts[2] = lpts->GetId(i+2);
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+ outputCD->CopyData(cd,cellId,newCellId);
}
}
}
- } //3d cell
- cellIds->Delete();
- coords->Delete();
- pts->Delete();
- break;
- }else{
- switch(aCellType){
- case VTK_QUADRATIC_EDGE: {
- aCellType = VTK_POLY_LINE;
- numFacePts = 3;
-
- aNewPts[0] = pts[0];
- aNewPts[2] = pts[1];
- aNewPts[1] = pts[2];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
- break;
- }
- case VTK_QUADRATIC_TRIANGLE: {
- aCellType = VTK_POLYGON;
- numFacePts = 6;
-
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[3];
- aNewPts[2] = pts[1];
- aNewPts[3] = pts[4];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[5];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
- break;
- }
- case VTK_QUADRATIC_QUAD: {
- aCellType = VTK_POLYGON;
- numFacePts = 8;
-
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[4];
- aNewPts[2] = pts[1];
- aNewPts[3] = pts[5];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[6];
- aNewPts[6] = pts[3];
- aNewPts[7] = pts[7];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
- break;
- }
- case VTK_QUADRATIC_TETRA: {
- aCellType = VTK_POLYGON;
- numFacePts = 6;
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[4];
- aNewPts[2] = pts[1];
- aNewPts[3] = pts[5];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[6];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[7];
- aNewPts[2] = pts[3];
- aNewPts[3] = pts[8];
- aNewPts[4] = pts[1];
- aNewPts[5] = pts[4];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[1];
- aNewPts[1] = pts[8];
- aNewPts[2] = pts[3];
- aNewPts[3] = pts[9];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[5];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[2];
- aNewPts[1] = pts[9];
- aNewPts[2] = pts[3];
- aNewPts[3] = pts[7];
- aNewPts[4] = pts[0];
- aNewPts[5] = pts[6];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- break;
- }
+ } //3d nonlinear cell
+ cellIds->Delete();
+ coords->Delete();
+ lpts->Delete();
+ break;
+ } else { // wireframe
+ switch(aCellType) {
+ case VTK_QUADRATIC_EDGE: {
+ vtkIdType arcResult =-1;
+ if(myIsBuildArc) {
+ arcResult = Build1DArc(cellId, input, output, pts,myMaxArcAngle);
+ newCellId = arcResult;
+ }
+ if(!myIsBuildArc || arcResult == -1) {
+ aCellType = VTK_POLY_LINE;
+ numFacePts = 3;
+
+ aNewPts[0] = pts[0];
+ aNewPts[2] = pts[1];
+ aNewPts[1] = pts[2];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ }
+
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+ break;
+ }
+ case VTK_QUADRATIC_TRIANGLE: {
+ if(!myIsBuildArc) {
+ aCellType = VTK_POLYGON;
+ numFacePts = 6;
+
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[3];
+ aNewPts[2] = pts[1];
+ aNewPts[3] = pts[4];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[5];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+ }
+ else
+ BuildArcedPolygon(cellId,input,output,aDimension2VTK2ObjIds);
+ break;
+ }
+ case VTK_BIQUADRATIC_QUAD:
+ case VTK_QUADRATIC_QUAD: {
+ if(!myIsBuildArc) {
+ aCellType = VTK_POLYGON;
+ numFacePts = 8;
+
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[4];
+ aNewPts[2] = pts[1];
+ aNewPts[3] = pts[5];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[6];
+ aNewPts[6] = pts[3];
+ aNewPts[7] = pts[7];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+ }
+ else
+ BuildArcedPolygon(cellId,input,output,aDimension2VTK2ObjIds);
+ break;
+ }
+ case VTK_QUADRATIC_TETRA: {
+ aCellType = VTK_POLYGON;
+ numFacePts = 6;
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[4];
+ aNewPts[2] = pts[1];
+ aNewPts[3] = pts[5];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[6];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[7];
+ aNewPts[2] = pts[3];
+ aNewPts[3] = pts[8];
+ aNewPts[4] = pts[1];
+ aNewPts[5] = pts[4];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[1];
+ aNewPts[1] = pts[8];
+ aNewPts[2] = pts[3];
+ aNewPts[3] = pts[9];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[5];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[2];
+ aNewPts[1] = pts[9];
+ aNewPts[2] = pts[3];
+ aNewPts[3] = pts[7];
+ aNewPts[4] = pts[0];
+ aNewPts[5] = pts[6];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ break;
+ }
case VTK_QUADRATIC_WEDGE: {
aCellType = VTK_POLYGON;
- numFacePts = 6;
+ numFacePts = 6;
//---------------------------------------------------------------
//Face 1
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[6];
- aNewPts[2] = pts[1];
- aNewPts[3] = pts[7];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[8];
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[6];
+ aNewPts[2] = pts[1];
+ aNewPts[3] = pts[7];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[8];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
-
+
//---------------------------------------------------------------
//Face 2
aNewPts[0] = pts[3];
- aNewPts[1] = pts[9];
- aNewPts[2] = pts[4];
- aNewPts[3] = pts[10];
- aNewPts[4] = pts[5];
- aNewPts[5] = pts[11];
+ aNewPts[1] = pts[9];
+ aNewPts[2] = pts[4];
+ aNewPts[3] = pts[10];
+ aNewPts[4] = pts[5];
+ aNewPts[5] = pts[11];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
-
+
//---------------------------------------------------------------
//Face 3
numFacePts = 8;
aNewPts[0] = pts[0];
- aNewPts[1] = pts[8];
- aNewPts[2] = pts[2];
- aNewPts[3] = pts[14];
- aNewPts[4] = pts[5];
- aNewPts[5] = pts[11];
- aNewPts[6] = pts[3];
- aNewPts[7] = pts[12];
+ aNewPts[1] = pts[8];
+ aNewPts[2] = pts[2];
+ aNewPts[3] = pts[14];
+ aNewPts[4] = pts[5];
+ aNewPts[5] = pts[11];
+ aNewPts[6] = pts[3];
+ aNewPts[7] = pts[12];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
//---------------------------------------------------------------
//Face 4
aNewPts[0] = pts[1];
- aNewPts[1] = pts[13];
- aNewPts[2] = pts[4];
- aNewPts[3] = pts[10];
- aNewPts[4] = pts[5];
- aNewPts[5] = pts[14];
- aNewPts[6] = pts[2];
- aNewPts[7] = pts[7];
+ aNewPts[1] = pts[13];
+ aNewPts[2] = pts[4];
+ aNewPts[3] = pts[10];
+ aNewPts[4] = pts[5];
+ aNewPts[5] = pts[14];
+ aNewPts[6] = pts[2];
+ aNewPts[7] = pts[7];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
//---------------------------------------------------------------
//Face 5
aNewPts[0] = pts[0];
- aNewPts[1] = pts[12];
- aNewPts[2] = pts[3];
- aNewPts[3] = pts[9];
- aNewPts[4] = pts[4];
- aNewPts[5] = pts[13];
+ aNewPts[1] = pts[12];
+ aNewPts[2] = pts[3];
+ aNewPts[3] = pts[9];
+ aNewPts[4] = pts[4];
+ aNewPts[5] = pts[13];
aNewPts[6] = pts[1];
aNewPts[7] = pts[6];
newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
outputCD->CopyData(cd,cellId,newCellId);
break;
}
- case VTK_QUADRATIC_HEXAHEDRON: {
- aCellType = VTK_POLYGON;
- numFacePts = 8;
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[8];
- aNewPts[2] = pts[1];
- aNewPts[3] = pts[17];
- aNewPts[4] = pts[5];
- aNewPts[5] = pts[12];
- aNewPts[6] = pts[4];
- aNewPts[7] = pts[16];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[1];
- aNewPts[1] = pts[9];
- aNewPts[2] = pts[2];
- aNewPts[3] = pts[18];
- aNewPts[4] = pts[6];
- aNewPts[5] = pts[13];
- aNewPts[6] = pts[5];
- aNewPts[7] = pts[17];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[2];
- aNewPts[1] = pts[10];
- aNewPts[2] = pts[3];
- aNewPts[3] = pts[19];
- aNewPts[4] = pts[7];
- aNewPts[5] = pts[14];
- aNewPts[6] = pts[6];
- aNewPts[7] = pts[18];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[3];
- aNewPts[1] = pts[11];
- aNewPts[2] = pts[0];
- aNewPts[3] = pts[16];
- aNewPts[4] = pts[4];
- aNewPts[5] = pts[15];
- aNewPts[6] = pts[7];
- aNewPts[7] = pts[19];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[8];
- aNewPts[2] = pts[1];
- aNewPts[3] = pts[9];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[10];
- aNewPts[6] = pts[3];
- aNewPts[7] = pts[11];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[4];
- aNewPts[1] = pts[12];
- aNewPts[2] = pts[5];
- aNewPts[3] = pts[13];
- aNewPts[4] = pts[6];
- aNewPts[5] = pts[14];
- aNewPts[6] = pts[7];
- aNewPts[7] = pts[15];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- break;
- }
- case VTK_QUADRATIC_PYRAMID: {
- aCellType = VTK_POLYGON;
- numFacePts = 6;
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[8];
- aNewPts[2] = pts[3];
- aNewPts[3] = pts[12];
- aNewPts[4] = pts[4];
- aNewPts[5] = pts[9];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[9];
- aNewPts[2] = pts[4];
- aNewPts[3] = pts[10];
- aNewPts[4] = pts[1];
- aNewPts[5] = pts[5];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[1];
- aNewPts[1] = pts[10];
- aNewPts[2] = pts[4];
- aNewPts[3] = pts[11];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[6];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
- aNewPts[0] = pts[2];
- aNewPts[1] = pts[11];
- aNewPts[2] = pts[4];
- aNewPts[3] = pts[12];
- aNewPts[4] = pts[3];
- aNewPts[5] = pts[7];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- //---------------------------------------------------------------
+ case VTK_TRIQUADRATIC_HEXAHEDRON:
+ case VTK_QUADRATIC_HEXAHEDRON: {
+ aCellType = VTK_POLYGON;
numFacePts = 8;
- aNewPts[0] = pts[0];
- aNewPts[1] = pts[5];
- aNewPts[2] = pts[1];
- aNewPts[3] = pts[6];
- aNewPts[4] = pts[2];
- aNewPts[5] = pts[7];
- aNewPts[6] = pts[3];
- aNewPts[7] = pts[8];
-
- newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
- if(myStoreMapping)
- myVTK2ObjIds.push_back(cellId);
-
- outputCD->CopyData(cd,cellId,newCellId);
-
- break;
- }}
- }
- } //switch
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[8];
+ aNewPts[2] = pts[1];
+ aNewPts[3] = pts[17];
+ aNewPts[4] = pts[5];
+ aNewPts[5] = pts[12];
+ aNewPts[6] = pts[4];
+ aNewPts[7] = pts[16];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[1];
+ aNewPts[1] = pts[9];
+ aNewPts[2] = pts[2];
+ aNewPts[3] = pts[18];
+ aNewPts[4] = pts[6];
+ aNewPts[5] = pts[13];
+ aNewPts[6] = pts[5];
+ aNewPts[7] = pts[17];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[2];
+ aNewPts[1] = pts[10];
+ aNewPts[2] = pts[3];
+ aNewPts[3] = pts[19];
+ aNewPts[4] = pts[7];
+ aNewPts[5] = pts[14];
+ aNewPts[6] = pts[6];
+ aNewPts[7] = pts[18];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[3];
+ aNewPts[1] = pts[11];
+ aNewPts[2] = pts[0];
+ aNewPts[3] = pts[16];
+ aNewPts[4] = pts[4];
+ aNewPts[5] = pts[15];
+ aNewPts[6] = pts[7];
+ aNewPts[7] = pts[19];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[8];
+ aNewPts[2] = pts[1];
+ aNewPts[3] = pts[9];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[10];
+ aNewPts[6] = pts[3];
+ aNewPts[7] = pts[11];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[4];
+ aNewPts[1] = pts[12];
+ aNewPts[2] = pts[5];
+ aNewPts[3] = pts[13];
+ aNewPts[4] = pts[6];
+ aNewPts[5] = pts[14];
+ aNewPts[6] = pts[7];
+ aNewPts[7] = pts[15];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ break;
+ }
+ case VTK_QUADRATIC_PYRAMID: {
+ aCellType = VTK_POLYGON;
+ numFacePts = 6;
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[8];
+ aNewPts[2] = pts[3];
+ aNewPts[3] = pts[12];
+ aNewPts[4] = pts[4];
+ aNewPts[5] = pts[9];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[9];
+ aNewPts[2] = pts[4];
+ aNewPts[3] = pts[10];
+ aNewPts[4] = pts[1];
+ aNewPts[5] = pts[5];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[1];
+ aNewPts[1] = pts[10];
+ aNewPts[2] = pts[4];
+ aNewPts[3] = pts[11];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[6];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ aNewPts[0] = pts[2];
+ aNewPts[1] = pts[11];
+ aNewPts[2] = pts[4];
+ aNewPts[3] = pts[12];
+ aNewPts[4] = pts[3];
+ aNewPts[5] = pts[7];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ //---------------------------------------------------------------
+ numFacePts = 8;
+ aNewPts[0] = pts[0];
+ aNewPts[1] = pts[5];
+ aNewPts[2] = pts[1];
+ aNewPts[3] = pts[6];
+ aNewPts[4] = pts[2];
+ aNewPts[5] = pts[7];
+ aNewPts[6] = pts[3];
+ aNewPts[7] = pts[8];
+
+ newCellId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, aDimension2VTK2ObjIds );
+
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ break;
+ } // case VTK_QUADRATIC_PYRAMID:
+ } // switch by type
+ } // end WIREFRAME
+ break;
+ } //switch
} //if visible
} //for all cells
-
+
output->Squeeze();
vtkDebugMacro(<<"Extracted " << input->GetNumberOfPoints() << " points,"
- << output->GetNumberOfCells() << " cells.");
+ << output->GetNumberOfCells() << " cells.");
cell->Delete();
faceIds->Delete();
if ( cellVis )
- {
+ {
delete [] cellVis;
+ }
+
+ // to sort myVTK2ObjIds vector by cell dimension (ascending)
+ if( myStoreMapping && !aDimension2VTK2ObjIds.empty() )
+ {
+ myVTK2ObjIds.clear();
+ for( vtkIdType aDimension = 0; aDimension <= 2; aDimension++ )
+ {
+ TMapOfVectorId::const_iterator anIter = aDimension2VTK2ObjIds.find( aDimension );
+ if( anIter != aDimension2VTK2ObjIds.end() )
+ {
+ const TVectorId& aCellIds = anIter->second;
+ TVectorId::const_iterator anIdIter, anIdIterEnd = aCellIds.end();
+ for( anIdIter = aCellIds.begin(); anIdIter != anIdIterEnd; anIdIter++ )
+ {
+ const vtkIdType aCellId = *anIdIter;
+ myVTK2ObjIds.push_back( aCellId );
+ }
+ }
}
+ }
return 1;
}
+void
+VTKViewer_GeometryFilter
+::InsertId( const vtkIdType theCellId,
+ const vtkIdType theCellType,
+ TVectorId& theVTK2ObjIds,
+ TMapOfVectorId& theDimension2VTK2ObjIds )
+{
+ theVTK2ObjIds.push_back( theCellId );
+
+ int aDimension = 0;
+ switch( theCellType )
+ {
+ case VTK_VERTEX:
+ case VTK_POLY_VERTEX:
+ aDimension = 0;
+ break;
+ case VTK_LINE:
+ case VTK_POLY_LINE:
+ aDimension = 1;
+ break;
+ case VTK_TRIANGLE:
+ case VTK_TRIANGLE_STRIP:
+ case VTK_POLYGON:
+ case VTK_PIXEL:
+ case VTK_QUAD:
+ aDimension = 2;
+ break;
+ }
+
+ TVectorId& aCellIds = theDimension2VTK2ObjIds[ aDimension ];
+ aCellIds.push_back( theCellId );
+}
void
VTKViewer_GeometryFilter
::SetInside(int theShowInside)
{
- if(myShowInside == theShowInside)
+ if(myShowInside == theShowInside)
return;
myShowInside = theShowInside;
}
-void
+void
VTKViewer_GeometryFilter
::SetWireframeMode(int theIsWireframeMode)
{
VTKViewer_GeometryFilter
::SetStoreMapping(int theStoreMapping)
{
- if(myStoreMapping == theStoreMapping)
+ if(myStoreMapping == theStoreMapping)
return;
myStoreMapping = theStoreMapping;
vtkIdType VTKViewer_GeometryFilter::GetElemObjId( int theVtkID )
{
- if( myVTK2ObjIds.empty() || theVtkID > (int)myVTK2ObjIds.size() )
+ if( theVtkID < 0 || theVtkID >= (int)myVTK2ObjIds.size() )
return -1;
-#if defined __GNUC_2__
return myVTK2ObjIds[theVtkID];
-#else
- return myVTK2ObjIds.at(theVtkID);
+}
+
+
+void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
+ vtkUnstructuredGrid* input,
+ vtkPolyData *output,
+ TMapOfVectorId& theDimension2VTK2ObjIds,
+ bool triangulate){
+ vtkIdType aCellType = VTK_POLYGON;
+ vtkIdType *aNewPoints = NULL;
+ vtkIdType aNbPoints = 0;
+ vtkIdType newCellId;
+
+ //Input and output cell data
+ vtkCellData *cd = input->GetCellData();
+ vtkCellData *outputCD = output->GetCellData();
+
+ //Input and output scalars on point data
+ vtkDataArray* inputScalars = input->GetPointData()->GetScalars();
+ vtkDataArray* outputScalars = output->GetPointData()->GetScalars();
+
+ std::vector<vtkPoints*> aCollection;
+ std::vector< std::vector<double> > aScalarCollection;
+
+ vtkCell* aCell = input->GetCell(cellId);
+ switch(aCell->GetCellType()) {
+ case VTK_QUADRATIC_TRIANGLE:
+ {
+ //Get All points from input cell
+ Pnt P0 = CreatePnt( aCell, inputScalars, 0 );
+ Pnt P1 = CreatePnt( aCell, inputScalars, 1 );
+ Pnt P2 = CreatePnt( aCell, inputScalars, 2 );
+ Pnt P3 = CreatePnt( aCell, inputScalars, 3 );
+ Pnt P4 = CreatePnt( aCell, inputScalars, 4 );
+ Pnt P5 = CreatePnt( aCell, inputScalars, 5 );
+
+ VTKViewer_ArcBuilder aBuilder1(P0,P3,P1,myMaxArcAngle); //Build arc using 0, 3 and 1 points
+#ifdef __MYDEBUG__
+ cout << "Quadrangle arc 1 " << ( aBuilder1.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+ VTKViewer_ArcBuilder aBuilder2(P1,P4,P2,myMaxArcAngle); //Build arc using 1, 4 and 2 points
+#ifdef __MYDEBUG__
+ cout << "Quadrangle arc 2 " << ( aBuilder2.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+ VTKViewer_ArcBuilder aBuilder3(P2,P5,P0,myMaxArcAngle); //Build arc using 2, 5 and 0 points
+#ifdef __MYDEBUG__
+ cout << "Quadrangle arc 3 " << ( aBuilder3.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+ aCollection.push_back(aBuilder1.GetPoints());
+ aCollection.push_back(aBuilder2.GetPoints());
+ aCollection.push_back(aBuilder3.GetPoints());
+
+ aScalarCollection.push_back(aBuilder1.GetScalarValues());
+ aScalarCollection.push_back(aBuilder2.GetScalarValues());
+ aScalarCollection.push_back(aBuilder3.GetScalarValues());
+ break;
+ }
+ case VTK_BIQUADRATIC_QUAD:
+ case VTK_QUADRATIC_QUAD:
+ {
+ //Get All points from input cell
+ Pnt P0 = CreatePnt( aCell, inputScalars, 0 );
+ Pnt P1 = CreatePnt( aCell, inputScalars, 1 );
+ Pnt P2 = CreatePnt( aCell, inputScalars, 2 );
+ Pnt P3 = CreatePnt( aCell, inputScalars, 3 );
+ Pnt P4 = CreatePnt( aCell, inputScalars, 4 );
+ Pnt P5 = CreatePnt( aCell, inputScalars, 5 );
+ Pnt P6 = CreatePnt( aCell, inputScalars, 6 );
+ Pnt P7 = CreatePnt( aCell, inputScalars, 7 );
+
+ VTKViewer_ArcBuilder aBuilder1(P0,P4,P1,myMaxArcAngle); //Build arc using 0, 4 and 1 points
+#ifdef __MYDEBUG__
+ cout << "Quadrangle arc 1 " << ( aBuilder1.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
#endif
+
+ VTKViewer_ArcBuilder aBuilder2(P1,P5,P2,myMaxArcAngle); //Build arc using 1, 5 and 2 points
+#ifdef __MYDEBUG__
+ cout << "Quadrangle arc 2 " << ( aBuilder2.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+ VTKViewer_ArcBuilder aBuilder3(P2,P6,P3,myMaxArcAngle); //Build arc using 2, 6 and 3 points
+#ifdef __MYDEBUG__
+ cout << "Quadrangle arc 3 " << ( aBuilder3.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+ VTKViewer_ArcBuilder aBuilder4(P3,P7,P0,myMaxArcAngle); //Build arc using 3, 7 and 0 points
+#ifdef __MYDEBUG__
+ cout << "Quadrangle arc 4 " << ( aBuilder4.GetStatus() == VTKViewer_ArcBuilder::Arc_Done ? "" : "NOT " ) << "done !!!" << endl;
+#endif
+
+ aCollection.push_back(aBuilder1.GetPoints());
+ aCollection.push_back(aBuilder2.GetPoints());
+ aCollection.push_back(aBuilder3.GetPoints());
+ aCollection.push_back(aBuilder4.GetPoints());
+
+ aScalarCollection.push_back(aBuilder1.GetScalarValues());
+ aScalarCollection.push_back(aBuilder2.GetScalarValues());
+ aScalarCollection.push_back(aBuilder3.GetScalarValues());
+ aScalarCollection.push_back(aBuilder4.GetScalarValues());
+ break;
+ }
+ default: //Unsupported cell type
+ return;
+ }
+
+ if(triangulate){
+ const vtkIdType numFacePts = 3;
+ vtkIdList *pts = vtkIdList::New();
+ vtkPoints *coords = vtkPoints::New();
+ aCellType = VTK_TRIANGLE;
+ vtkIdType aNewPts[numFacePts];
+ vtkIdType aTriangleId;
+
+ vtkPolygon *aPlg = vtkPolygon::New();
+ std::map<int, double> aPntId2ScalarValue;
+ aNbPoints = MergevtkPoints(aCollection, aScalarCollection, aPlg->GetPoints(), aPntId2ScalarValue, aNewPoints);
+ aPlg->GetPointIds()->SetNumberOfIds(aNbPoints);
+
+ for(vtkIdType i = 0; i < aNbPoints;i++) {
+ aPlg->GetPointIds()->SetId(i, aNewPoints[i]);
+ }
+
+ aPlg->Triangulate(0,pts,coords);
+
+ for (vtkIdType i=0; i < pts->GetNumberOfIds(); i+=3) {
+ aNewPts[0] = output->GetPoints()->InsertNextPoint(coords->GetPoint(i));
+ aNewPts[1] = output->GetPoints()->InsertNextPoint(coords->GetPoint(i+1));
+ aNewPts[2] = output->GetPoints()->InsertNextPoint(coords->GetPoint(i+2));
+
+ if(outputScalars) {
+ outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i)]);
+ outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+1)]);
+ outputScalars->InsertNextTuple1(aPntId2ScalarValue[pts->GetId(i+2)]);
+ }
+
+ aTriangleId = output->InsertNextCell(aCellType,numFacePts,aNewPts);
+
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, theDimension2VTK2ObjIds );
+ outputCD->CopyData(cd,cellId,aTriangleId);
+ }
+ pts->Delete();
+ coords->Delete();
+ aPlg->Delete();
+ }
+ else {
+ std::map<int, double> aPntId2ScalarValue;
+ aNbPoints = MergevtkPoints(aCollection, aScalarCollection, output->GetPoints(), aPntId2ScalarValue, aNewPoints);
+ if(outputScalars)
+ for(vtkIdType i = 0; i < aNbPoints; i++)
+ outputScalars->InsertNextTuple1(aPntId2ScalarValue[aNewPoints[i]]);
+ newCellId = output->InsertNextCell(aCellType,aNbPoints,aNewPoints);
+ outputCD->CopyData(cd,cellId,newCellId);
+
+ if(myStoreMapping)
+ InsertId( cellId, aCellType, myVTK2ObjIds, theDimension2VTK2ObjIds );
+ }
+
+ if (aNewPoints)
+ delete [] aNewPoints;
+}
+
+
+void VTKViewer_GeometryFilter::SetQuadraticArcMode(bool theFlag)
+{
+ if(myIsBuildArc != theFlag) {
+ myIsBuildArc = theFlag;
+ this->Modified();
+ }
+}
+bool VTKViewer_GeometryFilter::GetQuadraticArcMode() const
+{
+ return myIsBuildArc;
+}
+
+void VTKViewer_GeometryFilter::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle)
+{
+ if(myMaxArcAngle != theMaxAngle) {
+ myMaxArcAngle = theMaxAngle;
+ this->Modified();
+ }
+}
+
+vtkFloatingPointType VTKViewer_GeometryFilter:: GetQuadraticArcAngle() const
+{
+ return myMaxArcAngle;
+}
+
+
+int VTKViewer_GeometryFilter::GetAppendCoincident3D() const {
+ return myAppendCoincident3D;
+}
+
+void VTKViewer_GeometryFilter::SetAppendCoincident3D(int theFlag) {
+ if(myAppendCoincident3D != theFlag){
+ myAppendCoincident3D = theFlag;
+ this->Modified();
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_GEOMETRYFILTER_H
#define VTKVIEWER_GEOMETRYFILTER_H
#include <vtkGeometryFilter.h>
+#include <map>
#include <vector>
#ifdef WIN32
#pragma warning ( disable:4251 )
#endif
+class vtkUnstructuredGrid;
+
/*! \brief This class used same as vtkGeometryFilter. See documentation on VTK for more information.
*/
class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter
* \brief Sets \a myIsWireframeMode flag. \a myIsWireframeMode is changed, call this->Modified().
* \param theIsWireframeMode - used for changing value of \a myIsWireframeMode variable.
*/
+
+ int GetAppendCoincident3D() const;
+ /*! \fn void SetAppendCoincident3D()
+ * \brief Sets \a myAppendCoincident3D flag. If this flag is true, filter append to the
+ result data set coincident 3D elements.
+ */
+
+ void SetAppendCoincident3D(int theFlag);
+ /*! \fn int SetAppendCoincident3D()
+ * \brief Return value of \a myAppendCoincident3D
+ * \retval myAppendCoincident3D
+ */
+
void SetWireframeMode(int theIsWireframeMode);
/*! \fn int GetWireframeMode()
* \brief Return value of \a myIsWireframeMode
*/
virtual vtkIdType GetElemObjId(int theVtkID);
+ virtual void SetQuadraticArcMode(bool theFlag);
+ virtual bool GetQuadraticArcMode() const;
+
+ virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
+ virtual vtkFloatingPointType GetQuadraticArcAngle() const;
+
+ typedef std::vector<vtkIdType> TVectorId;
+ typedef std::map<vtkIdType, TVectorId> TMapOfVectorId;
+
+ static void InsertId( const vtkIdType theCellId,
+ const vtkIdType theCellType,
+ TVectorId& theVTK2ObjIds,
+ TMapOfVectorId& theDimension2VTK2ObjIds );
+
protected:
/*! \fn VTKViewer_GeometryFilter();
* \brief Constructor which sets \a myShowInside = 0 and \a myStoreMapping = 0
* \brief Filter culculation method for data object type is VTK_UNSTRUCTURED_GRID.
*/
int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
-
-private:
- typedef std::vector<vtkIdType> TVectorId;
+
+ void BuildArcedPolygon(vtkIdType cellId,
+ vtkUnstructuredGrid* input,
+ vtkPolyData *output,
+ TMapOfVectorId& theDimension2VTK2ObjIds,
+ bool triangulate = false);
+
private:
TVectorId myVTK2ObjIds;
int myShowInside;
int myStoreMapping;
int myIsWireframeMode;
+ int myAppendCoincident3D;
+
+ vtkFloatingPointType myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees
+ bool myIsBuildArc; // flag for representation 2D quadratic element as arked polygon
};
#ifdef WIN32
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VTKViewer_InteractorStyle.cxx
// Author : Christophe ATTANASIO
-// Module : SALOME
-//
+
#include "VTKViewer_InteractorStyle.h"
#include "VTKViewer_Actor.h"
#include "VTKViewer_RenderWindow.h"
#include "VTKViewer_RenderWindowInteractor.h"
-//#include "SALOME_Actor.h"
-
#include <vtkObjectFactory.h>
#include <vtkMath.h>
#include <vtkCommand.h>
#include <algorithm>
-//#include "utilities.h"
-
-using namespace std;
-
-
/*
static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId){
int anEdgeId = -1;
float aMinDist = 1000000.0, aDist = 0;
for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){
if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){
- int subId; float pcoords[3], closestPoint[3], weights[3];
- aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
- if (aDist < aMinDist) {
- aMinDist = aDist;
- anEdgeId = i;
- }
+ int subId; float pcoords[3], closestPoint[3], weights[3];
+ aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
+ if (aDist < aMinDist) {
+ aMinDist = aDist;
+ anEdgeId = i;
+ }
}
}
}
*\param theWidth - width..
*/
void VTKViewer_InteractorStyle::setPreselectionProp(const double& theRed, const double& theGreen,
- const double& theBlue, const int& theWidth)
+ const double& theBlue, const int& theWidth)
{
if ( myPreSelectionActor->GetProperty() == 0 )
return;
}
double newAngle = atan2((double)(y - this->CurrentRenderer->GetCenter()[1]),
- (double)(x - this->CurrentRenderer->GetCenter()[0]));
+ (double)(x - this->CurrentRenderer->GetCenter()[0]));
double oldAngle = atan2((double)(oldY -this->CurrentRenderer->GetCenter()[1]),
- (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
+ (double)(oldX - this->CurrentRenderer->GetCenter()[0]));
newAngle *= this->RadianToDegree;
oldAngle *= this->RadianToDegree;
*\param y - y coordinate
*/
void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl),
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
myShiftState = shift;
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
*\param y - y coordinate
*/
void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift,
- int x, int y)
+ int x, int y)
{
if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) {
this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
*\param y - y coordinate (not used)
*/
void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
*\param y - y coordinate
*/
void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl,
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
if (this->HasObserver(vtkCommand::MiddleButtonPressEvent))
{
*\param y - y coordinate (not used)
*/
void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
*\param y - y coordinate
*/
void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl,
- int shift,
- int x, int y)
+ int shift,
+ int x, int y)
{
if (this->HasObserver(vtkCommand::RightButtonPressEvent))
{
*\param y - y coordinate (not used)
*/
void VTKViewer_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
}
else {
if (myPoint == myOtherPoint) {
- // process point selection
+ // process point selection
int w, h, x, y;
m_Interactor->GetSize(w, h);
x = myPoint.x();
y = h - myPoint.y() - 1;
this->FindPokedRenderer(x, y);
- m_Interactor->StartPickCallback();
+ m_Interactor->StartPickCallback();
- vtkPicker* aPicker = vtkPicker::SafeDownCast(m_Interactor->GetPicker());
+ vtkPicker* aPicker = vtkPicker::SafeDownCast(m_Interactor->GetPicker());
aPicker->Pick(x, y, 0.0, this->CurrentRenderer);
- SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
+ SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
- int aVtkId = picker->GetCellId();
- if ( aVtkId >= 0 && SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
- int anObjId = SActor->GetElemObjId(aVtkId);
- if(anObjId >= 0){
- Handle(SALOME_InteractiveObject) IO = SActor->getIO();
- if(aSelectionMode != EdgeOfCellSelection) {
- if(CheckDimensionId(aSelectionMode,SActor,anObjId)){
- if (IsSelected(IO,aSel)) {
- // This IO is already in the selection
- aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
- } else {
- if (!myShiftState) {
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
- aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
- aSel->AddIObject( IO, false );
- }
- }
- }else{
- if (!myShiftState) {
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
- int anEdgeId = GetEdgeId(picker,SActor,anObjId);
- if (anEdgeId >= 0) {
- aSel->AddOrRemoveIndex( IO, anObjId, true, false);
- aSel->AddOrRemoveIndex( IO, -anEdgeId-1, true, true );
- aSel->AddIObject( IO, false );
- }
- }
- }
- } else {
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
+ int aVtkId = picker->GetCellId();
+ if ( aVtkId >= 0 && SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
+ int anObjId = SActor->GetElemObjId(aVtkId);
+ if(anObjId >= 0){
+ Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+ if(aSelectionMode != EdgeOfCellSelection) {
+ if(CheckDimensionId(aSelectionMode,SActor,anObjId)){
+ if (IsSelected(IO,aSel)) {
+ // This IO is already in the selection
+ aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+ } else {
+ if (!myShiftState) {
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
+ aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+ aSel->AddIObject( IO, false );
+ }
+ }
+ }else{
+ if (!myShiftState) {
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
+ int anEdgeId = GetEdgeId(picker,SActor,anObjId);
+ if (anEdgeId >= 0) {
+ aSel->AddOrRemoveIndex( IO, anObjId, true, false);
+ aSel->AddOrRemoveIndex( IO, -anEdgeId-1, true, true );
+ aSel->AddIObject( IO, false );
+ }
+ }
+ }
+ } else {
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
} else if ( vtkPointPicker* picker = vtkPointPicker::SafeDownCast(aPicker) ) {
- int aVtkId = picker->GetPointId();
- if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
- if ( SActor && SActor->hasIO() ) {
- int anObjId = SActor->GetNodeObjId(aVtkId);
- if(anObjId >= 0){
- Handle(SALOME_InteractiveObject) IO = SActor->getIO();
- if(IsSelected(IO,aSel)) {
- // This IO is already in the selection
- aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
- } else {
- if(!myShiftState) {
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
- aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
- aSel->AddIObject( IO, false );
- }
- }
- }
- } else {
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
- } else {
- if ( SActor && SActor->hasIO() ) {
- this->PropPicked++;
- Handle(SALOME_InteractiveObject) IO = SActor->getIO();
- if(IsSelected(IO,aSel)) {
- // This IO is already in the selection
- if(myShiftState) {
- aSel->RemoveIObject(IO);
- }
- }
- else {
- if(!myShiftState) {
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
- aSel->AddIObject( IO, false );
- }
- }else{
- // No selection clear all
- this->PropPicked = 0;
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
- }
- m_Interactor->EndPickCallback();
+ int aVtkId = picker->GetPointId();
+ if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
+ if ( SActor && SActor->hasIO() ) {
+ int anObjId = SActor->GetNodeObjId(aVtkId);
+ if(anObjId >= 0){
+ Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+ if(IsSelected(IO,aSel)) {
+ // This IO is already in the selection
+ aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+ } else {
+ if(!myShiftState) {
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
+ aSel->AddOrRemoveIndex( IO, anObjId, myShiftState, false );
+ aSel->AddIObject( IO, false );
+ }
+ }
+ }
+ } else {
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
+ } else {
+ if ( SActor && SActor->hasIO() ) {
+ this->PropPicked++;
+ Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+ if(IsSelected(IO,aSel)) {
+ // This IO is already in the selection
+ if(myShiftState) {
+ aSel->RemoveIObject(IO);
+ }
+ }
+ else {
+ if(!myShiftState) {
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
+ aSel->AddIObject( IO, false );
+ }
+ }else{
+ // No selection clear all
+ this->PropPicked = 0;
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
+ }
+ m_Interactor->EndPickCallback();
} else {
//processing rectangle selection
- QString aComponentDataType = SUIT_Application::getDesktop()->getComponentDataType();
- if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
- m_Interactor->StartPickCallback();
-
- if (!myShiftState) {
- this->PropPicked = 0;
- this->HighlightProp( NULL );
- aSel->ClearIObjects();
- }
-
- // Compute bounds
- // vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
- QRect rect(myPoint, myOtherPoint);
- rect = rect.normalize();
- int w, h;
- m_Interactor->GetSize(w, h);
- int x1, y1, x2, y2;
- x1 = rect.left();
- y1 = h - rect.top() - 1;
- x2 = rect.right();
- y2 = h - rect.bottom() - 1;
-
- switch (aSelectionMode) {
- case NodeSelection: {
- if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(m_Interactor->GetPicker()) ) {
- vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
- aListActors->InitTraversal();
- while (vtkActor* aActor = aListActors->GetNextActor()) {
- if (!aActor->GetVisibility())
- continue;
- if(SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aActor)) {
- if (SActor->hasIO()) {
- Handle(SALOME_InteractiveObject) IO = SActor->getIO();
- if (IO.IsNull())
- continue;
- if (aSelActiveCompOnly && aComponentDataType != IO->getComponentDataType())
- continue;
- if (vtkDataSet* aDataSet = SActor->GetInput()) {
- SALOME_Selection::TContainerOfId anIndices;
- for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
- float aPoint[3];
- aDataSet->GetPoint(i,aPoint);
- if (IsInRect(aPoint,x1,y1,x2,y2)){
- float aDisp[3];
- ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
- if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
- if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
- if(anActorCollection->IsItemPresent(SActor)){
- float aPickedPoint[3];
- aPointPicker->GetMapperPosition(aPickedPoint);
- vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
- if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ){
- int anObjId = SActor->GetNodeObjId(aVtkId);
- anIndices.insert(anObjId);
- }
- }
- }
- }
- }
- }
- if (!anIndices.empty()) {
- aSel->AddOrRemoveIndex(IO, anIndices, true, false);
- aSel->AddIObject(IO, false);
- anIndices.clear();
- }else{
- aSel->RemoveIObject(IO, false);
- }
- }
- }
- }
- }
- }
- break;
- }
- case CellSelection:
- case EdgeOfCellSelection:
- case EdgeSelection:
- case FaceSelection:
- case VolumeSelection:
- {
- vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
- picker->SetTolerance(0.001);
- picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-
- vtkActorCollection* aListActors = picker->GetActors();
- aListActors->InitTraversal();
- while(vtkActor* aActor = aListActors->GetNextActor()) {
- if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
- if (aSActor->hasIO()) {
- Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
- if (aSelActiveCompOnly && aComponentDataType != aIO->getComponentDataType())
- continue;
- VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
- if ( !cellList.empty() ) {
- SALOME_Selection::TContainerOfId anIndexes;
- VTKViewer_CellDataSet::iterator it;
- for ( it = cellList.begin(); it != cellList.end(); ++it ) {
- int aCellId = (*it).cellId;
-
- if ( !IsValid( aSActor, aCellId ) )
- continue;
-
- int anObjId = aSActor->GetElemObjId(aCellId);
- if (anObjId != -1){
- if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
- anIndexes.insert(anObjId);
- }
- }
- }
- aSel->AddOrRemoveIndex(aIO, anIndexes, true, false);
- aSel->AddIObject(aIO, false);
- }
- }
- }
- }
- }
- break;
- case ActorSelection: // objects selection
- {
- vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
- picker->SetTolerance(0.001);
- picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
-
- vtkActorCollection* aListActors = picker->GetActors();
- SALOME_ListIO aListIO;
- aListActors->InitTraversal();
- while(vtkActor* aActor = aListActors->GetNextActor()) {
- if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
- if (aSActor->hasIO()) {
- Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
- if (!IsStored(aIO,aListIO))
- aListIO.Append(aIO);
- }
- }
- }
- if (!aListIO.IsEmpty()) {
- SALOME_ListIteratorOfListIO It(aListIO);
- for(;It.More();It.Next()) {
- Handle(SALOME_InteractiveObject) IOS = It.Value();
- this->PropPicked++;
- aSel->AddIObject( IOS, false );
- }
- }
- } // end case 4
- } //end switch
- m_Interactor->EndPickCallback();
- }
- aActiveStudy->update3dViewers();
+ QString aComponentDataType = SUIT_Application::getDesktop()->getComponentDataType();
+ if(aSelActiveCompOnly && aComponentDataType.isEmpty()) return;
+ m_Interactor->StartPickCallback();
+
+ if (!myShiftState) {
+ this->PropPicked = 0;
+ this->HighlightProp( NULL );
+ aSel->ClearIObjects();
+ }
+
+ // Compute bounds
+ // vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
+ QRect rect(myPoint, myOtherPoint);
+ rect = rect.normalize();
+ int w, h;
+ m_Interactor->GetSize(w, h);
+ int x1, y1, x2, y2;
+ x1 = rect.left();
+ y1 = h - rect.top() - 1;
+ x2 = rect.right();
+ y2 = h - rect.bottom() - 1;
+
+ switch (aSelectionMode) {
+ case NodeSelection: {
+ if ( vtkPointPicker* aPointPicker = vtkPointPicker::SafeDownCast(m_Interactor->GetPicker()) ) {
+ vtkActorCollection* aListActors = this->CurrentRenderer->GetActors();
+ aListActors->InitTraversal();
+ while (vtkActor* aActor = aListActors->GetNextActor()) {
+ if (!aActor->GetVisibility())
+ continue;
+ if(SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aActor)) {
+ if (SActor->hasIO()) {
+ Handle(SALOME_InteractiveObject) IO = SActor->getIO();
+ if (IO.IsNull())
+ continue;
+ if (aSelActiveCompOnly && aComponentDataType != IO->getComponentDataType())
+ continue;
+ if (vtkDataSet* aDataSet = SActor->GetInput()) {
+ SALOME_Selection::TContainerOfId anIndices;
+ for(int i = 0; i < aDataSet->GetNumberOfPoints(); i++) {
+ float aPoint[3];
+ aDataSet->GetPoint(i,aPoint);
+ if (IsInRect(aPoint,x1,y1,x2,y2)){
+ float aDisp[3];
+ ComputeWorldToDisplay(aPoint[0],aPoint[1],aPoint[2],aDisp);
+ if(aPointPicker->Pick(aDisp[0],aDisp[1],0.0,CurrentRenderer)){
+ if(vtkActorCollection *anActorCollection = aPointPicker->GetActors()){
+ if(anActorCollection->IsItemPresent(SActor)){
+ float aPickedPoint[3];
+ aPointPicker->GetMapperPosition(aPickedPoint);
+ vtkIdType aVtkId = aDataSet->FindPoint(aPickedPoint);
+ if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ){
+ int anObjId = SActor->GetNodeObjId(aVtkId);
+ anIndices.insert(anObjId);
+ }
+ }
+ }
+ }
+ }
+ }
+ if (!anIndices.empty()) {
+ aSel->AddOrRemoveIndex(IO, anIndices, true, false);
+ aSel->AddIObject(IO, false);
+ anIndices.clear();
+ }else{
+ aSel->RemoveIObject(IO, false);
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+ }
+ case CellSelection:
+ case EdgeOfCellSelection:
+ case EdgeSelection:
+ case FaceSelection:
+ case VolumeSelection:
+ {
+ vtkSmartPointer<VTKViewer_CellRectPicker> picker = VTKViewer_CellRectPicker::New();
+ picker->SetTolerance(0.001);
+ picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
+
+ vtkActorCollection* aListActors = picker->GetActors();
+ aListActors->InitTraversal();
+ while(vtkActor* aActor = aListActors->GetNextActor()) {
+ if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
+ if (aSActor->hasIO()) {
+ Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
+ if (aSelActiveCompOnly && aComponentDataType != aIO->getComponentDataType())
+ continue;
+ VTKViewer_CellDataSet cellList = picker->GetCellData(aActor);
+ if ( !cellList.empty() ) {
+ SALOME_Selection::TContainerOfId anIndexes;
+ VTKViewer_CellDataSet::iterator it;
+ for ( it = cellList.begin(); it != cellList.end(); ++it ) {
+ int aCellId = (*it).cellId;
+
+ if ( !IsValid( aSActor, aCellId ) )
+ continue;
+
+ int anObjId = aSActor->GetElemObjId(aCellId);
+ if (anObjId != -1){
+ if ( CheckDimensionId(aSelectionMode,aSActor,anObjId) ) {
+ anIndexes.insert(anObjId);
+ }
+ }
+ }
+ aSel->AddOrRemoveIndex(aIO, anIndexes, true, false);
+ aSel->AddIObject(aIO, false);
+ }
+ }
+ }
+ }
+ }
+ break;
+ case ActorSelection: // objects selection
+ {
+ vtkSmartPointer<VTKViewer_RectPicker> picker = VTKViewer_RectPicker::New();
+ picker->SetTolerance(0.001);
+ picker->Pick(x1, y1, 0.0, x2, y2, 0.0, this->CurrentRenderer);
+
+ vtkActorCollection* aListActors = picker->GetActors();
+ SALOME_ListIO aListIO;
+ aListActors->InitTraversal();
+ while(vtkActor* aActor = aListActors->GetNextActor()) {
+ if (SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aActor)) {
+ if (aSActor->hasIO()) {
+ Handle(SALOME_InteractiveObject) aIO = aSActor->getIO();
+ if (!IsStored(aIO,aListIO))
+ aListIO.Append(aIO);
+ }
+ }
+ }
+ if (!aListIO.IsEmpty()) {
+ SALOME_ListIteratorOfListIO It(aListIO);
+ for(;It.More();It.Next()) {
+ Handle(SALOME_InteractiveObject) IOS = It.Value();
+ this->PropPicked++;
+ aSel->AddIObject( IOS, false );
+ }
+ }
+ } // end case 4
+ } //end switch
+ m_Interactor->EndPickCallback();
+ }
+ aActiveStudy->update3dViewers();
}
}
break;
if ( aVtkId >= 0 ) {
int anObjId = SActor->GetElemObjId(aVtkId);
if ( SActor && SActor->hasIO() && IsValid( SActor, aVtkId ) ) {
- bool anIsSameObjId = (mySelectedActor == SActor && myElemId == anObjId);
- bool aResult = anIsSameObjId;
- if(!anIsSameObjId) {
- if(aSelectionMode != EdgeOfCellSelection) {
- aResult = CheckDimensionId(aSelectionMode,SActor,anObjId);
- if(aResult){
- mySelectedActor = SActor;
- myElemId = anObjId;
- m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
- }
- }
- }
- if(aSelectionMode == EdgeOfCellSelection){
- int anEdgeId = GetEdgeId(picker,SActor,anObjId);
- bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
- aResult = anIsSameEdgeId;
- if(!anIsSameEdgeId) {
- aResult = (anEdgeId >= 0);
- if (aResult) {
- mySelectedActor = SActor;
- myEdgeId = anEdgeId;
- myElemId = anObjId;
- m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
- }
- }
- }
- if(aResult) {
- myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
- myPreSelectionActor->SetVisibility(true);
- }
+ bool anIsSameObjId = (mySelectedActor == SActor && myElemId == anObjId);
+ bool aResult = anIsSameObjId;
+ if(!anIsSameObjId) {
+ if(aSelectionMode != EdgeOfCellSelection) {
+ aResult = CheckDimensionId(aSelectionMode,SActor,anObjId);
+ if(aResult){
+ mySelectedActor = SActor;
+ myElemId = anObjId;
+ m_Interactor->setCellData(anObjId,SActor,myPreSelectionActor);
+ }
+ }
+ }
+ if(aSelectionMode == EdgeOfCellSelection){
+ int anEdgeId = GetEdgeId(picker,SActor,anObjId);
+ bool anIsSameEdgeId = (myEdgeId != anEdgeId) && anIsSameObjId;
+ aResult = anIsSameEdgeId;
+ if(!anIsSameEdgeId) {
+ aResult = (anEdgeId >= 0);
+ if (aResult) {
+ mySelectedActor = SActor;
+ myEdgeId = anEdgeId;
+ myElemId = anObjId;
+ m_Interactor->setEdgeData(anObjId,SActor,-anEdgeId-1,myPreSelectionActor);
+ }
+ }
+ }
+ if(aResult) {
+ myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
+ myPreSelectionActor->SetVisibility(true);
+ }
}
}
}
int aVtkId = picker->GetPointId();
if ( aVtkId >= 0 && IsValid( SActor, aVtkId, true ) ) {
if ( SActor && SActor->hasIO() ) {
- int anObjId = SActor->GetNodeObjId(aVtkId);
- bool anIsSameObjId = (mySelectedActor == SActor && myNodeId == anObjId);
- if(!anIsSameObjId) {
- mySelectedActor = SActor;
- myNodeId = anObjId;
- m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
- }
- myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
- myPreSelectionActor->SetVisibility(true);
+ int anObjId = SActor->GetNodeObjId(aVtkId);
+ bool anIsSameObjId = (mySelectedActor == SActor && myNodeId == anObjId);
+ if(!anIsSameObjId) {
+ mySelectedActor = SActor;
+ myNodeId = anObjId;
+ m_Interactor->setPointData(anObjId,SActor,myPreSelectionActor);
+ }
+ myPreSelectionActor->GetProperty()->SetRepresentationToSurface();
+ myPreSelectionActor->SetVisibility(true);
}
}
}
else if ( vtkPicker::SafeDownCast(aPicker) ) {
if ( SActor ) {
if ( myPreViewActor != SActor ) {
- if ( myPreViewActor != NULL ) {
- myPreViewActor->SetPreSelected( false );
- }
- myPreViewActor = SActor;
-
- if ( SActor->hasIO() ) {
- Handle( SALOME_InteractiveObject) IO = SActor->getIO();
- if ( !IsSelected(IO,Sel) ) {
+ if ( myPreViewActor != NULL ) {
+ myPreViewActor->SetPreSelected( false );
+ }
+ myPreViewActor = SActor;
+
+ if ( SActor->hasIO() ) {
+ Handle( SALOME_InteractiveObject) IO = SActor->getIO();
+ if ( !IsSelected(IO,Sel) ) {
// Find All actors with same IO
- vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
- theActors->InitTraversal();
- while( vtkActor *ac = theActors->GetNextActor() ) {
- if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
- if ( anActor->hasIO() ) {
- Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
- if(IO->isSame(IOS)) {
- anActor->SetPreSelected( true );
- }
- }
- }
- }
- }
- }
+ vtkActorCollection* theActors = this->CurrentRenderer->GetActors();
+ theActors->InitTraversal();
+ while( vtkActor *ac = theActors->GetNextActor() ) {
+ if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( ac ) ) {
+ if ( anActor->hasIO() ) {
+ Handle(SALOME_InteractiveObject) IOS = anActor->getIO();
+ if(IO->isSame(IOS)) {
+ anActor->SetPreSelected( true );
+ }
+ }
+ }
+ }
+ }
+ }
}
} else {
myPreViewActor = NULL;
cam->GetFocalPoint(viewFocus);
this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
- viewFocus[2], viewFocus);
+ viewFocus[2], viewFocus);
focalDepth = viewFocus[2];
this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY),
- focalDepth, newPickPoint);
+ focalDepth, newPickPoint);
this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY),
- focalDepth, oldPickPoint);
+ focalDepth, oldPickPoint);
// camera motion is reversed
motionVector[0] = oldPickPoint[0] - newPickPoint[0];
cam->GetFocalPoint(viewFocus);
cam->GetPosition(viewPoint);
cam->SetFocalPoint(motionVector[0] + viewFocus[0],
- motionVector[1] + viewFocus[1],
- motionVector[2] + viewFocus[2]);
+ motionVector[1] + viewFocus[1],
+ motionVector[2] + viewFocus[2]);
cam->SetPosition(motionVector[0] + viewPoint[0],
- motionVector[1] + viewPoint[1],
- motionVector[2] + viewPoint[2]);
+ motionVector[1] + viewPoint[1],
+ motionVector[2] + viewPoint[2]);
}
/*! Checks: is the given Actor within display coordinates?*/
bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor,
- const int left, const int top,
- const int right, const int bottom)
+ const int left, const int top,
+ const int right, const int bottom)
{
vtkFloatingPointType* aBounds = theActor->GetBounds();
vtkFloatingPointType aMin[3], aMax[3];
/*! Checks: is the given Cell within display coordinates?*/
bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell,
- const int left, const int top,
- const int right, const int bottom)
+ const int left, const int top,
+ const int right, const int bottom)
{
vtkFloatingPointType* aBounds = theCell->GetBounds();
vtkFloatingPointType aMin[3], aMax[3];
/*!Checks: is given point \a thePoint in rectangle*/
bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint,
- const int left, const int top,
- const int right, const int bottom)
+ const int left, const int top,
+ const int right, const int bottom)
{
vtkFloatingPointType aPnt[3];
ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VTKViewer_InteractorStyle.h
// Author : Christophe ATTANASIO
class vtkCell;
class vtkRenderWindowInteractor;
+class vtkTDxInteractorStyle;
#include <QObject>
#include <QCursor>
void setTriedron(VTKViewer_Trihedron* theTrihedron);
void setPreselectionProp(const double& theRed = 0, const double& theGreen = 1,
- const double& theBlue = 1, const int& theWidth = 5);
+ const double& theBlue = 1, const int& theWidth = 5);
// Generic event bindings must be overridden in subclasses
void OnMouseMove (int ctrl, int shift, int x, int y);
void Place(const int theX, const int theY);
void TranslateView(int toX, int toY, int fromX, int fromY);
bool IsInRect(vtkActor* theActor,
- const int left, const int top,
- const int right, const int bottom);
+ const int left, const int top,
+ const int right, const int bottom);
bool IsInRect(vtkCell* theCell,
- const int left, const int top,
- const int right, const int bottom);
+ const int left, const int top,
+ const int right, const int bottom);
bool IsInRect(vtkFloatingPointType* thePoint,
- const int left, const int top,
- const int right, const int bottom);
+ const int left, const int top,
+ const int right, const int bottom);
int State;
vtkFloatingPointType MotionFactor;
void startRotate();
void startFitArea();
void startSpin();
+ void SetTDxStyle(vtkTDxInteractorStyle *tdxStyle) {}
bool needsRedrawing();
protected:
+++ /dev/null
-// Copyright (C) 2007-2008 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 FILTER : interactive object for VISU entities implementation
-// File : SALOME_PassThroughFilter.cxx
-// Author : Laurent CORNABE with help of Nicolas REJNERI
-// Module : SALOME
-//
-#include "VTKViewer_PassThroughFilter.h"
-
-#include <vtkCellData.h>
-#include <vtkDataSet.h>
-#include <vtkObjectFactory.h>
-#include <vtkPointData.h>
-#include <vtkInformation.h>
-#include <vtkInformationVector.h>
-
-vtkCxxRevisionMacro(VTKViewer_PassThroughFilter, "$Revision$");
-vtkStandardNewMacro(VTKViewer_PassThroughFilter);
-
-/*! \class VTKViewer_PassThroughFilter
- * Passive filter take a dataset as input and create a dataset as output.\n
- * The form of the input geometry is not changed in these filters, \n
- * only the point attributes (e.g. scalars, vectors, etc.).
- */
-
-/*!Execute method.Output calculation.*/
-int VTKViewer_PassThroughFilter::RequestData(
- vtkInformation *,
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector)
-{
- // get the info objects
- vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
- vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
- // get the input and ouptut
- vtkDataSet *input = vtkDataSet::SafeDownCast(
- inInfo->Get(vtkDataObject::DATA_OBJECT()));
- vtkDataSet *output = vtkDataSet::SafeDownCast(
- outInfo->Get(vtkDataObject::DATA_OBJECT()));
-
- // This has to be here because it initialized all field datas.
- output->CopyStructure( input );
-
- //! Pass all. (data object's field data is passed by the
- //! superclass after this method)
- output->GetPointData()->PassData( input->GetPointData() );
- output->GetCellData()->PassData( input->GetCellData() );
-
- return 1;
-}
-
-/*!Methods invoked by print to print information about the object including superclasses.\n
- * Typically not called by the user (use Print() instead) but used in the hierarchical \n
- * print process to combine the output of several classes.
- *\param os - output stream.
- */
-void VTKViewer_PassThroughFilter::PrintSelf(ostream& os, vtkIndent indent)
-{
- this->Superclass::PrintSelf(os,indent);
-}
+++ /dev/null
-// Copyright (C) 2007-2008 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 VTKVIEWER_PASSTHROUGHFILTER_H
-#define VTKVIEWER_PASSTHROUGHFILTER_H
-
-#include "VTKViewer.h"
-
-#include <vtkDataSetToDataSetFilter.h>
-
-class VTKVIEWER_EXPORT VTKViewer_PassThroughFilter : public vtkDataSetToDataSetFilter
-{
-public:
- vtkTypeRevisionMacro( VTKViewer_PassThroughFilter, vtkDataSetToDataSetFilter );
- void PrintSelf( ostream& os, vtkIndent indent );
-
- /*!Create a new VTKViewer_PassThroughFilter.*/
- static VTKViewer_PassThroughFilter *New();
-
-protected:
- VTKViewer_PassThroughFilter() {};//!< Null body.
- virtual ~VTKViewer_PassThroughFilter() {};//!< Null body.
-
- virtual int RequestData(vtkInformation *, vtkInformationVector **,
- vtkInformationVector *); //generate output data
-
-private:
- VTKViewer_PassThroughFilter( const VTKViewer_PassThroughFilter& ); //!< Not implemented.
- void operator=( const VTKViewer_PassThroughFilter& ); //!< Not implemented.
-};
-
-#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_RenderWindow.h"
#include <QColorDialog>
}
}
+/*! Get paint engine for the scene */
+QPaintEngine* VTKViewer_RenderWindow::paintEngine() const
+{
+ return 0;
+}
+
/*!Emit mouse move event.*/
void VTKViewer_RenderWindow::mouseMoveEvent(QMouseEvent* event)
{
vtkRenderer * theRenderer = theRenderers->GetNextItem();
theRenderer->GetBackground(backint);
- QColor selColor = QColorDialog::getColor ( QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)), NULL );
+ QColor selColor = QColorDialog::getColor ( QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)), NULL );
if ( selColor.isValid() ) {
theRenderer->SetBackground( selColor.red()/255., selColor.green()/255., selColor.blue()/255. );
/* VSR : PAL5420 ---------------------------------------------------
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_RENDERWINDOW_H
#define VTKVIEWER_RENDERWINDOW_H
/*!Get render window pointer.*/
vtkRenderWindow* getRenderWindow() { return myRW; }
+ virtual QPaintEngine* paintEngine() const;
+
protected:
virtual void mouseMoveEvent( QMouseEvent* );
virtual void mousePressEvent( QMouseEvent* );
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_RenderWindowInteractor.h"
#include "VTKViewer_RenderWindow.h"
#include "VTKViewer_InteractorStyle.h"
#include "SUIT_ViewModel.h"
#include "VTKViewer_ViewWindow.h"
-//#include "SUIT_Application.h"
-//#include "SUIT_Desktop.h"
-
-//#include "SALOME_Selection.h"
#include "VTKViewer_Actor.h"
#include "VTKViewer_Algorithm.h"
#include "VTKViewer_Functor.h"
-//#include <stdio.h>
-//#include <stdlib.h>
-//#include <string.h>
-//#include <math.h>
-
// VTK Includes
#include <vtkAssemblyNode.h>
#include <vtkActor.h>
return ;
}
myInteractorStyle->OnLeftButtonDown((event->modifiers() & Qt::ControlModifier),
- (event->modifiers() & Qt::ShiftModifier),
- event->x(), event->y());
+ (event->modifiers() & Qt::ShiftModifier),
+ event->x(), event->y());
}
/*!Reaction on left button releases.\n
return ;
}
myInteractorStyle->OnLeftButtonUp( (event->modifiers() & Qt::ControlModifier),
- (event->modifiers() & Qt::ShiftModifier),
- event->x(), event->y() ) ;
+ (event->modifiers() & Qt::ShiftModifier),
+ event->x(), event->y() ) ;
}
/*!Reaction on middle button pressed.\n
return ;
}
myInteractorStyle->OnMiddleButtonDown((event->modifiers() & Qt::ControlModifier),
- (event->modifiers() & Qt::ShiftModifier),
- event->x(), event->y() ) ;
+ (event->modifiers() & Qt::ShiftModifier),
+ event->x(), event->y() ) ;
}
/*!Reaction on middle button released.\n
return ;
}
myInteractorStyle->OnMiddleButtonUp( (event->modifiers() & Qt::ControlModifier),
- (event->modifiers() & Qt::ShiftModifier),
- event->x(), event->y() ) ;
+ (event->modifiers() & Qt::ShiftModifier),
+ event->x(), event->y() ) ;
}
/*!Reaction on right button pressed.\n
return ;
}
myInteractorStyle->OnRightButtonDown( (event->modifiers() & Qt::ControlModifier),
- (event->modifiers() & Qt::ShiftModifier),
- event->x(), event->y() ) ;
+ (event->modifiers() & Qt::ShiftModifier),
+ event->x(), event->y() ) ;
}
/*!Reaction on right button released.\n
}
bool isOperation = myInteractorStyle->CurrentState() != VTK_INTERACTOR_STYLE_CAMERA_NONE;
myInteractorStyle->OnRightButtonUp( (event->modifiers() & Qt::ControlModifier),
- (event->modifiers() & Qt::ShiftModifier),
- event->x(), event->y() );
+ (event->modifiers() & Qt::ShiftModifier),
+ event->x(), event->y() );
if ( !isOperation )
{
QContextMenuEvent aEvent( QContextMenuEvent::Mouse,
void VTKViewer_RenderWindowInteractor::SetDisplayMode(int theMode) {
if(theMode == 0)
ChangeRepresentationToWireframe();
- else
+ else if (theMode == 1)
ChangeRepresentationToSurface();
+ else if (theMode == 2) {
+ ChangeRepresentationToSurfaceWithEdges();
+ theMode++;
+ }
myDisplayMode = theMode;
}
/*!Change all actors to wireframe*/
void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe()
{
- ChangeRepresentationToWireframe(GetRenderer()->GetActors());
+ using namespace VTK;
+ ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+ ChangeRepresentationToWireframe(aCopy.GetActors());
}
/*!Change all actors to surface*/
void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface()
{
- ChangeRepresentationToSurface(GetRenderer()->GetActors());
+ using namespace VTK;
+ ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+ ChangeRepresentationToSurface(aCopy.GetActors());
+}
+
+/*!Change all actors to surface with edges*/
+void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges()
+{
+ using namespace VTK;
+ ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+ ChangeRepresentationToSurfaceWithEdges(aCopy.GetActors());
}
/*!Change all actors from \a theCollection to wireframe and
{
using namespace VTK;
ForEach<VTKViewer_Actor>(theCollection,
- TSetFunction<VTKViewer_Actor,int>
- (&VTKViewer_Actor::setDisplayMode,0));
+ TSetFunction<VTKViewer_Actor,int>
+ (&VTKViewer_Actor::setDisplayMode,0));
emit RenderWindowModified();
}
{
using namespace VTK;
ForEach<VTKViewer_Actor>(theCollection,
- TSetFunction<VTKViewer_Actor,int>
- (&VTKViewer_Actor::setDisplayMode,1));
+ TSetFunction<VTKViewer_Actor,int>
+ (&VTKViewer_Actor::setDisplayMode,1));
+ emit RenderWindowModified();
+}
+
+/*!Change all actors from \a theCollection to surface with edges and
+ * emit render window modified.
+ */
+void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* theCollection)
+{
+ using namespace VTK;
+ ForEach<VTKViewer_Actor>(theCollection,
+ TSetFunction<VTKViewer_Actor,int>
+ (&VTKViewer_Actor::setDisplayMode,3));
emit RenderWindowModified();
}
void VTKViewer_RenderWindowInteractor::DisplayAll()
{
using namespace VTK;
- vtkActorCollection* aCollection = GetRenderer()->GetActors();
- ForEach<VTKViewer_Actor>(aCollection,TSetVisibility<VTKViewer_Actor>(true));
+ ActorCollectionCopy aCopy(GetRenderer()->GetActors());
+ ForEach<VTKViewer_Actor>(aCopy.GetActors(),TSetVisibility<VTKViewer_Actor>(true));
emit RenderWindowModified() ;
}
{
if ( SActor != 0 )
{
- GetRenderer()->RemoveProp( SActor );
+ GetRenderer()->RemoveViewProp( SActor );
if ( updateViewer )
emit RenderWindowModified();
}
*/
void VTKViewer_RenderWindowInteractor::RemoveAll( const bool updateViewer )
{
+ using namespace VTK;
vtkRenderer* aRenderer = GetRenderer();
- vtkActorCollection* anActors = aRenderer->GetActors();
+ ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
if ( anActors )
{
anActors->InitTraversal();
void VTKViewer_RenderWindowInteractor::Update() {
using namespace VTK;
vtkRenderer* aRen = GetRenderer();
- ForEach<vtkActor>(aRen->GetActors(),TUpdateAction());
+ ActorCollectionCopy aCopy(aRen->GetActors());
+ ForEach<vtkActor>(aCopy.GetActors(),TUpdateAction());
aRen->ResetCamera();
* \li Emit render window modified, if flag \a update - true.
*/
bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
- VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
- TUpdateActor theFun, bool hilight, bool update)
+ VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
+ TUpdateActor theFun, bool hilight, bool update)
{
if(theMapIndex.Extent() == 0) return false;
/*!Sets actors data.*/
void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
- VTKViewer_Actor * theMapActor,
- VTKViewer_Actor * theActor,
- TUpdateActor theFun)
+ VTKViewer_Actor * theMapActor,
+ VTKViewer_Actor * theActor,
+ TUpdateActor theFun)
{
(*theFun)(theMapIndex,theMapActor,theActor);
vtkFloatingPointType aPos[3];
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_RENDERWINDOWINTERACTOR_H
#define VTKVIEWER_RENDERWINDOWINTERACTOR_H
/** @name Selection Management */
//@{
bool highlightCell(const TColStd_IndexedMapOfInteger& MapIndex,
- VTKViewer_Actor* theMapActor,
- bool hilight,
- bool update = true );
+ VTKViewer_Actor* theMapActor,
+ bool hilight,
+ bool update = true );
bool highlightEdge(const TColStd_IndexedMapOfInteger& MapIndex,
- VTKViewer_Actor* theMapActor,
- bool hilight,
- bool update = true );
+ VTKViewer_Actor* theMapActor,
+ bool hilight,
+ bool update = true );
bool highlightPoint(const TColStd_IndexedMapOfInteger& MapIndex,
- VTKViewer_Actor* theMapActor,
- bool hilight,
- bool update = true );
+ VTKViewer_Actor* theMapActor,
+ bool hilight,
+ bool update = true );
void unHighlightSubSelection();
bool unHighlightAll();
//void SetSelectionMode(Selection_Mode mode);
void SetSelectionProp(const double& theRed = 1, const double& theGreen = 1,
- const double& theBlue = 0, const int& theWidth = 5);
+ const double& theBlue = 0, const int& theWidth = 5);
void SetSelectionTolerance(const double& theTolNodes = 0.025, const double& theTolCell = 0.001);
//@}
//@{
void ChangeRepresentationToWireframe();
void ChangeRepresentationToSurface();
+ void ChangeRepresentationToSurfaceWithEdges();
//@}
/** @name Change to wireframe or surface a list of vtkactor*/
//@{
void ChangeRepresentationToWireframe(vtkActorCollection* ListofActors);
void ChangeRepresentationToSurface(vtkActorCollection* ListofActors);
+ void ChangeRepresentationToSurfaceWithEdges(vtkActorCollection* ListofActors);
//@}
/** @name Erase Display functions*/
void setViewWindow( VTKViewer_ViewWindow* theViewWnd );
void setCellData(const int& theIndex,
- VTKViewer_Actor* theMapActor,
- VTKViewer_Actor* theActor) {}
+ VTKViewer_Actor* theMapActor,
+ VTKViewer_Actor* theActor) {}
void setEdgeData(const int& theCellIndex,
- VTKViewer_Actor* theMapActor,
- const int& theEdgeIndex,
- VTKViewer_Actor* theActor ) {} //NB
+ VTKViewer_Actor* theMapActor,
+ const int& theEdgeIndex,
+ VTKViewer_Actor* theActor ) {} //NB
void setPointData(const int& theIndex,
- VTKViewer_Actor* theMapActor,
- VTKViewer_Actor* theActor) {}
+ VTKViewer_Actor* theMapActor,
+ VTKViewer_Actor* theActor) {}
typedef void (*TUpdateActor)(const TColStd_IndexedMapOfInteger& theMapIndex,
- VTKViewer_Actor* theMapActor,
- VTKViewer_Actor* theActor);
+ VTKViewer_Actor* theMapActor,
+ VTKViewer_Actor* theActor);
protected:
VTKViewer_RenderWindowInteractor();
VTKViewer_InteractorStyle* myInteractorStyle;
bool highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
- VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
- TUpdateActor theFun, bool hilight, bool update);
+ VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
+ TUpdateActor theFun, bool hilight, bool update);
void setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
- VTKViewer_Actor* theMapActor,
- VTKViewer_Actor *theActor,
- TUpdateActor theFun);
+ VTKViewer_Actor* theMapActor,
+ VTKViewer_Actor *theActor,
+ TUpdateActor theFun);
/*! Timer used during various mouse events to figure
* out mouse movements.
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME OBJECT : kernel of SALOME component
// File : SALOME_GeometryFilter.cxx
// Author : Michael ZORIN
-// Module : SALOME
-// $Header$
-//
+
#include "VTKViewer_ShrinkFilter.h"
#include <vtkCell.h>
oldId = ptIds->GetId(i);
newId = newPts->InsertNextPoint(pt);
if(myStoreMapping)
- myVTK2ObjIds.push_back(oldId);
+ myVTK2ObjIds.push_back(oldId);
newPtIds->InsertId(i,newId);
outPD->CopyData(pd, oldId, newId);
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_SHRINKFILTER_H
#define VTKVIEWER_SHRINKFILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME FILTER : interactive object for VISU entities implementation
// File : SALOME_Transform.cxx
// Author : Laurent CORNABE with help of Nicolas REJNERI
double aScale[3];
this->GetMatrixScale(aScale);
return (fabs(aScale[0] - 1.0) < EPS &&
- fabs(aScale[1] - 1.0) < EPS &&
- fabs(aScale[2] - 1.0) < EPS);
+ fabs(aScale[1] - 1.0) < EPS &&
+ fabs(aScale[2] - 1.0) < EPS);
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_TRANSFORM_H
#define VTKVIEWER_TRANSFORM_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SALOME FILTER : interactive object for VISU entities implementation
// File : SALOME_TransformFilter.h
// Author : Laurent CORNABE with help of Nicolas REJNERI
vtkPoints *inPts;
vtkPoints *newPts;
- int numPts, numCells;
+ int numPts/*, numCells*/;
vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
vtkCellData *cd=input->GetCellData(), *outCD=output->GetCellData();
output->CopyStructure( input );
inPts = input->GetPoints();
if(!anIsIdentity && inPts){
numPts = inPts->GetNumberOfPoints();
- numCells = input->GetNumberOfCells();
+ // numCells = input->GetNumberOfCells();
newPts = vtkPoints::New();
newPts->Allocate(numPts);
this->UpdateProgress(.2);
}
outPD->PassData(pd);
outCD->PassData(cd);
+ InvokeEvent("VTKViewer_TransformFilter::TransformationFinished");
return 1;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_TRANSFORMFILTER_H
#define VTKVIEWER_TRANSFORMFILTER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_Trihedron.h"
#include "VTKViewer_Actor.h"
+#include "VTKViewer_Algorithm.h"
// VTK Includes
+#include <vtkConfigure.h>
#include <vtkMath.h>
#include <vtkMapper.h>
#include <vtkDataSet.h>
#include <vtkLineSource.h>
#include <vtkConeSource.h>
#include <vtkPolyDataMapper.h>
+#include <vtkPolyDataMapper2D.h>
#include <vtkVectorText.h>
+#include <vtkTextActor.h>
+#include <vtkTextMapper.h>
+#include <vtkTextProperty.h>
+
+// QT includes
+#include <QtGlobal>
vtkStandardNewMacro(VTKViewer_UnScaledActor);
theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]);
vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
- (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
- (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
+ (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
+ (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
int* aSize = theRenderer->GetRenderWindow()->GetSize();
vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
vtkDataSet* aDataSet = GetMapper()->GetInput();
aDataSet->Update();
vtkFloatingPointType aLength = aDataSet->GetLength();
vtkFloatingPointType aPrecision = 1.0E-3;
+ vtkFloatingPointType aZeroTol = 1.0E-12;
vtkFloatingPointType anOldScale = GetScale()[0];
- vtkFloatingPointType aScale;
- if (aSize[1] > aSize[0])
- aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
- else
- aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[1])/vtkFloatingPointType(aSize[0]));
- if(aScale != 0.0&& fabs(aScale - anOldScale)/aScale > aPrecision){
+ vtkFloatingPointType aScale = anOldScale;
+ vtkFloatingPointType aMaxSize = (vtkFloatingPointType)qMax(aSize[1],aSize[0]);
+ if (qAbs(aWinDiag) > aZeroTol && qAbs(aLength) > aZeroTol && qAbs(aMaxSize) > aZeroTol)
+ aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(qMin(aSize[1],aSize[0]))/aMaxSize);
+ if(qAbs(aScale) > aZeroTol && qAbs(aScale - anOldScale)/aScale > aPrecision){
SetScale(aScale);
}
}
vtkStandardNewMacro(VTKViewer_LineActor);
+#ifdef IPAL21440
+vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,vtkTextActor);
+#else
vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor);
+#endif
vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower);
/*!Adds Label and Arrow actors to \a theRenderer.*/
void VTKViewer_LineActor::Render(vtkRenderer *theRenderer)
{
+#ifndef IPAL21440
if(LabelActor && LabelActor->GetVisibility()){
LabelActor->Modified();
LabelActor->Render(theRenderer);
}
+#endif
if(ArrowActor && ArrowActor->GetVisibility()){
ArrowActor->Modified();
ArrowActor->Render(theRenderer);
myLineActor->SetArrowActor(myArrowActor);
/*! \li Initialize the Label pipe-line representation */
+#ifdef IPAL21440
+ myTextMapper = vtkTextMapper::New();
+
+ myLabelActor = vtkTextActor::New();
+ myLabelActor->SetMapper(myTextMapper);
+ myLabelActor->ScaledTextOff();
+ myLabelActor->PickableOff();
+
+ vtkCoordinate* aCoord = vtkCoordinate::New();
+ myLabelActor->GetPositionCoordinate()->SetReferenceCoordinate( aCoord );
+ aCoord->Delete();
+#else
myVectorText = vtkVectorText::New();
myMapper[2] = vtkPolyDataMapper::New();
myLabelActor->SetSize(aLabelActorSize);
myLabelActor->PickableOff();
//myLabelActor->DebugOn();
+#endif
myLineActor->SetLabelActor(myLabelActor);
myMapper[0]->RemoveAllInputs();
myMapper[0]->Delete();
- myVectorText->Delete();
-
/*! \li Destroy of the Arrow pipe-line representation */
myArrowActor->Delete();
/*! \li Destroy of the Line pipe-line representation */
myLineActor->Delete();
+#ifdef IPAL21440
+ myTextMapper->RemoveAllInputs();
+ myTextMapper->Delete();
+#else
+ myVectorText->Delete();
+
myMapper[2]->RemoveAllInputs();
myMapper[2]->Delete();
+#endif
myLineSource->Delete();
}
/*! Set camera for myLabelActor
*/
void VTKViewer_Axis::SetCamera(vtkCamera* theCamera){
+#ifndef IPAL21440
myLabelActor->SetCamera(theCamera);
+#endif
}
-/*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+/*! Sets color for actors: myLineActor,myLabelActor,myArrowActor
*/
-void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){
- myLabelActor->SetProperty(theProperty);
- myArrowActor->SetProperty(theProperty);
- myLineActor->SetProperty(theProperty);
+void VTKViewer_Axis::SetColor(double theRed, double theGreen, double theBlue)
+{
+ // Set color property for arrow and line actors
+ vtkProperty* aProperty = vtkProperty::New();
+ aProperty->SetColor(theRed, theGreen, theBlue);
+
+ myArrowActor->SetProperty(aProperty);
+ myLineActor->SetProperty(aProperty);
+#ifndef IPAL21440
+ myLabelActor->SetProperty(aProperty);
+#endif
+
+ aProperty->Delete();
+
+ // Set color property for label actor
+#ifdef IPAL21440
+ vtkTextProperty* aTextProperty = vtkTextProperty::New();
+ aTextProperty->SetColor(theRed, theGreen, theBlue);
+
+ myLabelActor->SetTextProperty(aTextProperty);
+
+ aTextProperty->Delete();
+#endif
}
/*! Set size of VTKViewer_Axis
myArrowActor->SetOrientation(myRot);
myArrowActor->SetScale(theSize / 10.);
+#ifdef IPAL21440
+ if( vtkCoordinate* aCoord = myLabelActor->GetPositionCoordinate()->GetReferenceCoordinate() )
+ aCoord->SetValue( aPosition );
+#else
myLabelActor->SetPosition(0.0,0.0,0.0);
myLabelActor->AddPosition(aPosition);
+#endif
}
/*! Check if actor belongs to the axis object
{
return theActor == myLineActor ||
theActor == myArrowActor ||
+#ifdef IPAL21440
+ false;
+#else
theActor == myLabelActor;
+#endif
}
/*! \class VTKViewer_XAxis
VTKViewer_XAxis::VTKViewer_XAxis(){
myDir[0] = 1.0; myDir[1] = 0.0; myDir[2] = 0.0;
myRot[0] = 0.0; myRot[1] = 0.0; myRot[2] = 0.0;
+#ifdef IPAL21440
+ myTextMapper->SetInput("X");
+#else
myVectorText->SetText("X");
- vtkProperty* aProperty = vtkProperty::New();
- aProperty->SetColor(1.0,0.0,0.0);
- SetProperty(aProperty);
- aProperty->Delete();
+#endif
+ SetColor(1.0,0.0,0.0);
}
/*! \class VTKViewer_YAxis
{
myDir[0] = 0.0; myDir[1] = 1.0; myDir[2] = 0.0;
myRot[0] = 0.0; myRot[1] = 0.0; myRot[2] = 90.;
+#ifdef IPAL21440
+ myTextMapper->SetInput("Y");
+#else
myVectorText->SetText("Y");
- vtkProperty* aProperty = vtkProperty::New();
- aProperty->SetColor(0.0,1.0,0.0);
- SetProperty(aProperty);
- aProperty->Delete();
+#endif
+ SetColor(0.0,1.0,0.0);
}
/*! \class VTKViewer_ZAxis
{
myDir[0] = 0.0; myDir[1] = 0.0; myDir[2] = 1.0;
myRot[0] = 0.0; myRot[1] = -90; myRot[2] = 0.0;
+#ifdef IPAL21440
+ myTextMapper->SetInput("Z");
+#else
myVectorText->SetText("Z");
- vtkProperty* aProperty = vtkProperty::New();
- aProperty->SetColor(0.0,0.0,1.0);
- SetProperty(aProperty);
- aProperty->Delete();
+#endif
+ SetColor(0.0,0.0,1.0);
}
vtkStandardNewMacro(VTKViewer_Trihedron);
{
//TVisibility aVis = GetVisibility();
//SetVisibility(eOff);
- vtkActorCollection* aCollection = theRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+ vtkActorCollection* aCollection = aCopy.GetActors();
aCollection->InitTraversal();
int aCount = 0;
while(vtkActor* prop = aCollection->GetNextActor()) {
- if( prop->GetVisibility())
+ if( prop->GetVisibility()) {
if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(prop)) {
if(!anActor->IsInfinitive())
- aCount++;
+ aCount++;
}
else if ( !OwnActor( anActor ) ) {
- aCount++;
+ aCount++;
}
//int aCount = theRenderer->VisibleActorCount();
//SetVisibility(aVis);
+ }
}
return aCount;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_TRIHEDRON_H
#define VTKVIEWER_TRIHEDRON_H
class vtkLineSource;
class vtkConeSource;
class vtkVectorText;
+class vtkTextActor;
+class vtkTextMapper;
class VTKViewer_Axis;
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
+// VTKViewer_UnScaledActor is temporarily replaced with simple vtkTextActor
+// This workaround caused by the bug with disappeared labels of the trihedron
+// reproduced after migration from qt-4.4.3 to qt-4.5.2
+#if (VTK_XVERSION < 0x050200)
+#define IPAL21440
+#endif
+
/*! \class vtkFollower
* See <a href="http://www.vtk.org/">vtk documentation</a>
*/
/*!Create new instance of VTKViewer_LineActor.*/
static VTKViewer_LineActor *New();
- /*! Sets Lable actor.
+#ifdef IPAL21440
+ /*! Sets Label actor.
+ * \param theLabelActor - vtkTextActor
+ */
+ void SetLabelActor(vtkTextActor* theLabelActor);
+#else
+ /*! Sets Label actor.
* \param theLabelActor - VTKViewer_UnScaledActor
*/
void SetLabelActor(VTKViewer_UnScaledActor* theLabelActor);
+#endif
/*! Sets Arrow actor.
* \param theLabelActor - VTKViewer_UnScaledActor
}
/*!Label actor pointer*/
+#ifdef IPAL21440
+ vtkTextActor* LabelActor;
+#else
VTKViewer_UnScaledActor* LabelActor;
+#endif
/*!Arrow actor pointer*/
vtkFollower* ArrowActor;
*/
virtual void SetCamera(vtkCamera* theCamera);
- /*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+ /*! Sets color for actors: myLineActor,myLabelActor,myArrowActor
+ * \param theRed - red component of the color
+ * \param theGreen - green component of the color
+ * \param theBlue - blue component of the color
*/
- virtual void SetProperty(vtkProperty* theProperty);
+ virtual void SetColor(double theRed, double theGreen, double theBlue);
/*! Set size of VTKViewer_Axis
*/
/*! Get label actor.
* \retval Return myLabelActor.
*/
+#ifdef IPAL21440
+ virtual vtkTextActor* GetLabel() { return myLabelActor; }
+#else
virtual VTKViewer_UnScaledActor* GetLabel() { return myLabelActor; }
+#endif
/*! Get arrow actor.
* \retval Return myArrowActor
/*! VTKViewer_UnScaledActor actor pointer
*/
+#ifdef IPAL21440
+ vtkTextActor *myLabelActor;
+#else
VTKViewer_UnScaledActor *myLabelActor;
+#endif
/*! \li myMapper[0] - for the Line pipe-line representation
* \li myMapper[1] - for the Arrow pipe-line representation
*/
vtkConeSource *myConeSource;
+#ifdef IPAL21440
+ /*! vtkTextMapper pointer (Label)
+ */
+ vtkTextMapper *myTextMapper;
+#else
/*! VTKViewer_VectorText pointer (Label)
*/
vtkVectorText* myVectorText;
+#endif
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_Utilities.h"
#include "VTKViewer_Actor.h"
+#include "VTKViewer_Algorithm.h"
#include <algorithm>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
-using namespace std;
-
/*!@see vtkRenderer::ResetCamera(vtkFloatingPointType bounds[6]) method*/
void
ResetCamera(vtkRenderer* theRenderer,
- int theUsingZeroFocalPoint)
+ int theUsingZeroFocalPoint)
{
if(!theRenderer)
return;
static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
vtkFloatingPointType aLength = aBounds[1]-aBounds[0];
- aLength = max((aBounds[3]-aBounds[2]),aLength);
- aLength = max((aBounds[5]-aBounds[4]),aLength);
+ aLength = std::max((aBounds[3]-aBounds[2]),aLength);
+ aLength = std::max((aBounds[5]-aBounds[4]),aLength);
if(aLength < MIN_DISTANCE)
return;
vtkFloatingPointType aWidth =
sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) +
- (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
- (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
+ (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
+ (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
if(aWidth < MIN_DISTANCE)
return;
// update the camera
aCamera->SetPosition(aCenter[0]+aDistance*aViewPlaneNormal[0],
- aCenter[1]+aDistance*aViewPlaneNormal[1],
- aCenter[2]+aDistance*aViewPlaneNormal[2]);
+ aCenter[1]+aDistance*aViewPlaneNormal[1],
+ aCenter[2]+aDistance*aViewPlaneNormal[2]);
// find size of the window
int* aWinSize = theRenderer->GetSize();
/*! Compute the bounds of the visible props*/
int
ComputeVisiblePropBounds(vtkRenderer* theRenderer,
- vtkFloatingPointType theBounds[6])
+ vtkFloatingPointType theBounds[6])
{
int aCount = 0;
theBounds[1] = theBounds[3] = theBounds[5] = -VTK_LARGE_FLOAT;
// loop through all props
- vtkActorCollection* aCollection = theRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+ vtkActorCollection* aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while (vtkActor* aProp = aCollection->GetNextActor()) {
// if it's invisible, or has no geometry, we can skip the rest
- if(aProp->GetVisibility() && aProp->GetMapper()){
+ if(aProp->GetVisibility() && aProp->GetMapper() && vtkMath::AreBoundsInitialized(aProp->GetBounds())){
if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(aProp))
if(anActor->IsInfinitive())
- continue;
-
+ continue;
+
vtkFloatingPointType *aBounds = aProp->GetBounds();
static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
// 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[0] > -MAX_DISTANCE && aBounds[1] < MAX_DISTANCE &&
+ aBounds[2] > -MAX_DISTANCE && aBounds[3] < MAX_DISTANCE &&
+ aBounds[4] > -MAX_DISTANCE && aBounds[5] < MAX_DISTANCE )
{
- aCount++;
+ aCount++;
- theBounds[0] = min(aBounds[0],theBounds[0]);
- theBounds[2] = min(aBounds[2],theBounds[2]);
- theBounds[4] = min(aBounds[4],theBounds[4]);
+ theBounds[0] = std::min(aBounds[0],theBounds[0]);
+ theBounds[2] = std::min(aBounds[2],theBounds[2]);
+ theBounds[4] = std::min(aBounds[4],theBounds[4]);
- theBounds[1] = max(aBounds[1],theBounds[1]);
- theBounds[3] = max(aBounds[3],theBounds[3]);
- theBounds[5] = max(aBounds[5],theBounds[5]);
+ theBounds[1] = std::max(aBounds[1],theBounds[1]);
+ theBounds[3] = std::max(aBounds[3],theBounds[3]);
+ theBounds[5] = std::max(aBounds[5],theBounds[5]);
}//not bogus
}
/*!Compute trihedron size.*/
bool
ComputeTrihedronSize( vtkRenderer* theRenderer,
- vtkFloatingPointType& theNewSize,
- const vtkFloatingPointType theSize,
- const vtkFloatingPointType theSizeInPercents )
+ vtkFloatingPointType& theNewSize,
+ const vtkFloatingPointType theSize,
+ const vtkFloatingPointType theSizeInPercents )
{
// calculating diagonal of visible props of the renderer
vtkFloatingPointType bnd[ 6 ];
vtkFloatingPointType aLength = 0;
aLength = bnd[ 1 ]-bnd[ 0 ];
- aLength = max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength );
- aLength = max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength );
+ aLength = std::max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength );
+ aLength = std::max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength );
static vtkFloatingPointType EPS_SIZE = 5.0E-3;
theNewSize = aLength * theSizeInPercents / 100.0;
aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
// iterate through displayed objects and set size if necessary
- vtkActorCollection* anActors = theRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
anActors->InitTraversal();
bool isAny = false;
while(vtkActor* anAct = anActors->GetNextActor())
if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(anAct))
if(anActor->GetVisibility() && !anActor->IsInfinitive())
{
- vtkFloatingPointType *aBounds = anActor->GetBounds();
- if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
- aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
- aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
- isAny = true;
+ vtkFloatingPointType *aBounds = anActor->GetBounds();
+ if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
+ aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
+ aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+ isAny = true;
}
return !isAny;
aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
// iterate through displayed objects and set size if necessary
- vtkActorCollection* anActors = theRenderer->GetActors();
+ VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
+ vtkActorCollection* anActors = aCopy.GetActors();
anActors->InitTraversal();
bool isAny = false;
while(vtkActor* anAct = anActors->GetNextActor())
{
if(anActor->GetVisibility() && !anActor->IsInfinitive())
{
- vtkFloatingPointType *aBounds = anActor->GetBounds();
- if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
- aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
- aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
- {
- for(int i = 0; i < 5; i = i + 2){
- if(aBounds[i] < aNewBndBox[i])
- aNewBndBox[i] = aBounds[i];
- if(aBounds[i+1] > aNewBndBox[i+1])
- aNewBndBox[i+1] = aBounds[i+1];
- }
- isAny = true;
- }
+ vtkFloatingPointType *aBounds = anActor->GetBounds();
+ if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
+ aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
+ aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+ {
+ for(int i = 0; i < 5; i = i + 2){
+ if(aBounds[i] < aNewBndBox[i])
+ aNewBndBox[i] = aBounds[i];
+ if(aBounds[i+1] > aNewBndBox[i+1])
+ aNewBndBox[i+1] = aBounds[i+1];
+ }
+ isAny = true;
+ }
}
}
}
static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
vtkFloatingPointType aLength = aNewBndBox[1]-aNewBndBox[0];
- aLength = max((aNewBndBox[3]-aNewBndBox[2]),aLength);
- aLength = max((aNewBndBox[5]-aNewBndBox[4]),aLength);
+ aLength = std::max((aNewBndBox[3]-aNewBndBox[2]),aLength);
+ aLength = std::max((aNewBndBox[5]-aNewBndBox[4]),aLength);
if(aLength < MIN_DISTANCE)
return false;
vtkFloatingPointType aWidth =
sqrt((aNewBndBox[1]-aNewBndBox[0])*(aNewBndBox[1]-aNewBndBox[0]) +
- (aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) +
- (aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4]));
+ (aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) +
+ (aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4]));
if(aWidth < MIN_DISTANCE)
return false;
vtkFloatingPointType aBounds[6];
int aCount = ComputeVisiblePropBounds(theRenderer,aBounds);
printf("aNewBndBox[0] = %f, aNewBndBox[1] = %f,\naNewBndBox[2] = %f, aNewBndBox[3] = %f,\naNewBndBox[4] = %f, aNewBndBox[5] = %f\n",
- aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]);
+ aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]);
printf("aCount = %d\n",aCount);
if(aCount){
vtkFloatingPointType aWidth =
sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) +
- (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
- (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
+ (aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
+ (aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
if(aWidth < MIN_DISTANCE)
return false;
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_UTILITIES_H
#define VTKVIEWER_UTILITIES_H
extern
void
ResetCamera(vtkRenderer* theRenderer,
- int theUsingZeroFocalPoint = false);
+ int theUsingZeroFocalPoint = false);
VTKVIEWER_EXPORT
extern
int
ComputeVisiblePropBounds(vtkRenderer* theRenderer,
- vtkFloatingPointType theBounds[6]);
+ vtkFloatingPointType theBounds[6]);
VTKVIEWER_EXPORT
extern
extern
bool
ComputeTrihedronSize(vtkRenderer* theRenderer,
- vtkFloatingPointType& theNewSize,
- const vtkFloatingPointType theSize,
- const vtkFloatingPointType theSizeInPercents);
+ vtkFloatingPointType& theNewSize,
+ const vtkFloatingPointType theSize,
+ const vtkFloatingPointType theSizeInPercents);
VTKVIEWER_EXPORT
extern
VTKVIEWER_EXPORT
extern
bool ComputeBBCenter(vtkRenderer* theRenderer,
- vtkFloatingPointType theCenter[3]);
+ vtkFloatingPointType theCenter[3]);
#endif
+++ /dev/null
-/*=========================================================================
-
- Program: Visualization Toolkit
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
- All rights reserved.
- See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notice for more information.*/
-
-// Modified by Open CASCADE SAS (www.opencascade.com)
-
-// VTKViewer_VectorText.cxx is a copy of vtkVectorText.cxx file.
-// Purpose of copying: to remove linking to libHybrid.so VTK library
-
-#include "VTKViewer_VectorText.h"
-
-#include "vtkCellArray.h"
-#include "vtkObjectFactory.h"
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-using namespace std;
-
-vtkCxxRevisionMacro(VTKViewer_VectorText, "$Revision$");
-vtkStandardNewMacro(VTKViewer_VectorText);
-
-char *VTK_VECTOR_TEXT_33 = (char *) "11 0.438482 "
-"0.28000 -0.07186 0.43164 -0.07143 0.27689 0.07714 0.43472 0.07714 0.32000 0.20134 "
-"0.40000 0.20243 0.31429 0.20550 0.27277 0.76857 0.43848 0.76857 0.27693 1.02571 "
-"0.43429 1.02615 7 2 1 3 2 0 1 7 6 5 6 4 5 8 "
-"7 5 7 8 9 10 9 8 "
-;
-
-char *VTK_VECTOR_TEXT_34 = (char *) "21 0.615625 "
-"0.25714 0.63563 0.32571 0.63563 0.50286 0.63642 0.25143 0.63946 0.33143 0.63840 "
-"0.33462 0.64286 0.49673 0.64286 0.57714 0.63757 0.58093 0.64286 0.21335 0.84286 "
-"0.36680 0.84286 0.46177 0.84286 0.61522 0.84286 0.21295 1.02000 0.46134 1.02000 "
-"0.61563 1.02000 0.36571 1.02307 0.46550 1.02571 0.21714 1.02615 0.36000 1.02723 "
-"0.61143 1.02615 17 3 5 9 7 6 2 4 5 1 6 8 12 0 1 5 6 "
-"12 11 3 0 5 7 8 6 11 12 14 13 9 10 10 9 5 15 14 12 19 "
-"18 10 18 13 10 17 14 20 14 15 20 16 19 10 "
-;
-
-char *VTK_VECTOR_TEXT_35 = (char *) "43 0.974539 "
-"0.22286 -0.09100 0.32571 -0.09236 0.56832 -0.08857 0.67429 -0.09201 0.28193 0.22000 "
-"0.39470 0.22000 0.63009 0.22000 0.15385 0.23143 0.27429 0.22723 0.40571 0.22723 "
-"0.62286 0.22723 0.74857 0.22680 0.97454 0.23143 0.15385 0.33429 0.97454 0.33429 "
-"0.30344 0.34000 0.65201 0.34000 0.77084 0.34000 0.42286 0.34010 0.42034 0.34571 "
-"0.36041 0.60286 0.70748 0.60286 0.82034 0.60286 0.47429 0.60626 0.15385 0.61429 "
-"0.35429 0.61009 0.70286 0.60951 0.82857 0.61009 0.97454 0.61429 0.15385 0.71714 "
-"0.37714 0.72134 0.50286 0.72191 0.72571 0.72134 0.85143 0.72156 0.97143 0.72025 "
-"0.38605 0.72857 0.49823 0.72857 0.73335 0.72857 0.84613 0.72857 0.45143 1.04160 "
-"0.55735 1.04286 0.80000 1.04243 0.90521 1.04286 43 6 2 3 5 0 1 0 5 4 18 "
-"9 10 11 6 3 4 9 8 13 8 15 17 6 11 9 4 5 13 7 8 17 "
-"12 14 8 9 15 15 19 20 16 6 17 12 17 11 18 10 16 10 6 16 21 "
-"16 17 18 19 9 15 9 19 20 30 25 23 20 19 34 33 28 29 24 25 29 "
-"25 30 27 21 22 33 21 27 20 23 30 22 21 17 33 27 28 31 26 32 35 "
-"30 23 32 38 37 31 35 23 21 32 26 26 31 23 32 21 38 41 37 38 36 "
-"35 31 38 21 33 40 39 36 42 41 38 39 35 36 "
-;
-
-char *VTK_VECTOR_TEXT_36 = (char *) "73 0.921518 "
-"0.52571 -0.22882 0.59429 -0.22991 0.52000 -0.09942 0.60571 -0.09385 0.40571 -0.07057 "
-"0.72730 -0.06571 0.33143 -0.03465 0.80571 -0.01813 0.51429 0.01891 0.52152 0.02571 "
-"0.60571 0.02014 0.84571 0.02168 0.25669 0.04286 0.66857 0.03800 0.44571 0.04535 "
-"0.70984 0.06571 0.74535 0.10571 0.74857 0.11079 0.74902 0.11143 0.37057 0.12857 "
-"0.90538 0.12857 0.20823 0.15143 0.35748 0.16286 0.77395 0.16857 0.35429 0.17310 "
-"0.35177 0.18000 0.78134 0.21429 0.92152 0.21429 0.19580 0.22571 0.33480 0.25429 "
-"0.77395 0.29429 0.91177 0.32286 0.76000 0.32921 0.72571 0.36972 0.89355 0.37429 "
-"0.64690 0.40857 0.65143 0.40706 0.64000 0.41109 0.60571 0.41986 0.52109 0.43714 "
-"0.85714 0.43270 0.38857 0.49216 0.79429 0.48902 0.72571 0.52437 0.30454 0.54571 "
-"0.60260 0.56286 0.52043 0.58571 0.26286 0.59570 0.46857 0.59800 0.39429 0.65095 "
-"0.22857 0.67295 0.36823 0.70000 0.75429 0.77624 0.21907 0.78571 0.35891 0.78571 "
-"0.89184 0.79714 0.37714 0.85001 0.72571 0.86144 0.87470 0.86571 0.24571 0.89016 "
-"0.68571 0.90956 0.44000 0.92036 0.60571 0.94469 0.83179 0.94571 0.28000 0.94629 "
-"0.51429 0.94891 0.34286 1.00607 0.75429 1.01579 0.38286 1.02784 0.52043 1.06571 "
-"0.60260 1.06571 0.52260 1.12286 0.60043 1.12286 75 3 8 2 2 8 4 19 12 6 13 11 15 9 8 10 3 2 1 8 "
-"3 10 5 13 10 15 11 16 7 13 5 4 14 6 2 0 1 5 10 3 12 "
-"22 21 14 4 8 13 7 11 11 18 16 20 23 18 18 17 16 20 18 11 19 "
-"6 14 28 21 29 26 23 20 12 19 22 25 22 24 21 22 25 21 25 29 26 "
-"27 30 27 26 20 31 32 30 31 30 27 40 33 32 37 43 38 34 32 31 38 "
-"39 9 40 32 34 38 9 10 43 33 42 37 36 43 39 38 43 42 33 40 35 "
-"36 37 33 43 36 39 45 46 48 41 39 45 39 43 41 48 44 47 51 50 46 "
-"62 65 48 39 46 44 49 47 49 44 48 54 53 50 51 47 49 53 56 59 53 "
-"54 56 66 64 56 55 58 52 58 57 52 54 50 51 59 56 64 67 60 63 60 "
-"57 63 66 61 68 61 66 56 68 65 69 65 62 69 62 46 45 63 57 58 62 "
-"60 67 68 61 65 71 70 72 70 62 67 62 70 69 71 69 70 "
-;
-
-char *VTK_VECTOR_TEXT_37 = (char *) "81 1.409911 "
-"0.46713 -0.11143 0.57143 -0.11215 1.19429 -0.11252 1.10286 -0.10252 1.26444 -0.09429 "
-"1.05143 -0.07759 1.31429 -0.06384 1.14857 -0.01538 1.18857 -0.01807 0.98857 -0.01364 "
-"1.22286 -0.00771 1.36784 -0.00286 1.11302 0.00286 1.26436 0.03143 1.07787 0.04857 "
-"0.95748 0.05429 1.39681 0.06571 1.28680 0.09429 1.05866 0.14000 1.40991 0.14571 "
-"0.94134 0.15143 0.94134 0.21429 1.29295 0.21429 1.06134 0.23714 1.40723 0.23714 "
-"0.95748 0.30000 1.39387 0.30000 1.07787 0.30571 1.27429 0.30371 1.09561 0.33429 "
-"1.23429 0.35465 1.36616 0.36286 1.13143 0.36327 1.16571 0.37277 1.20571 0.36899 "
-"1.00045 0.38571 1.32000 0.41543 1.06857 0.44498 1.24571 0.45681 0.48000 0.46420 "
-"1.15429 0.46723 0.38857 0.47462 0.55016 0.48286 0.60000 0.51330 0.30286 0.52704 "
-"0.43429 0.56177 0.47429 0.55907 0.26857 0.57284 0.50857 0.56943 0.65355 0.57429 "
-"0.39873 0.58000 0.55007 0.60857 0.24530 0.62571 0.36359 0.62571 0.68252 0.64286 "
-"0.56680 0.64857 0.23050 0.69429 0.34437 0.71714 0.57866 0.72286 0.69563 0.72286 "
-"0.22705 0.79143 0.34705 0.81429 0.69295 0.81429 0.56891 0.85429 0.67959 0.87714 "
-"0.24530 0.88286 0.36359 0.88286 0.38132 0.91143 0.54286 0.90975 0.52000 0.93179 "
-"0.65465 0.93429 0.41714 0.94041 0.47429 0.94950 0.29143 0.96914 0.60571 0.99258 "
-"0.32000 0.99868 0.38286 1.03395 0.53714 1.03184 1.06857 1.04249 1.17287 1.04286 "
-"0.48000 1.04395 79 0 1 78 10 4 6 2 8 3 9 14 15 4 "
-"10 8 3 7 5 7 3 8 10 6 13 12 5 7 5 12 9 4 8 2 13 "
-"16 17 17 19 22 14 9 12 15 18 20 11 13 6 13 11 16 17 16 19 18 "
-"15 14 21 20 18 21 23 25 22 26 28 23 21 18 24 22 19 25 27 35 35 "
-"29 37 22 24 26 28 31 30 27 25 23 31 28 26 27 29 35 36 30 31 38 "
-"34 30 38 33 34 37 32 40 32 33 40 38 30 36 32 37 29 40 33 38 42 "
-"46 39 47 53 52 48 43 51 39 46 41 41 50 44 56 57 60 45 41 46 42 "
-"48 46 48 42 43 50 41 45 53 47 44 51 49 55 54 55 49 53 44 50 49 "
-"51 43 55 54 58 59 58 54 57 56 52 57 52 53 60 61 65 58 62 63 57 "
-"61 60 62 64 63 65 66 73 66 65 61 73 66 75 58 59 62 63 64 68 70 "
-"69 68 67 75 66 70 68 64 76 71 72 75 67 76 74 69 70 71 76 67 69 "
-"77 72 72 77 80 77 69 74 76 72 80 79 78 1 "
-;
-
-char *VTK_VECTOR_TEXT_38 = (char *) "76 1.126291 "
-"0.58857 -0.08966 1.03429 -0.09235 0.48000 -0.08395 0.66286 -0.07673 0.40000 -0.05914 "
-"0.72000 -0.05641 0.98286 -0.05473 0.35429 -0.03393 0.78857 -0.01678 1.12629 0.00857 "
-"0.29143 0.02168 0.52571 0.02991 0.57714 0.02764 0.62286 0.03756 0.46857 0.04645 "
-"0.87429 0.05495 0.69714 0.07393 0.42132 0.08286 1.04571 0.07868 0.24486 0.08857 "
-"0.75011 0.11714 0.22327 0.14000 0.37927 0.14571 0.78349 0.16286 0.96893 0.16286 "
-"0.96571 0.16717 0.96457 0.16857 0.95937 0.18000 0.35580 0.22571 0.20991 0.25429 "
-"0.36319 0.28857 0.86286 0.29600 1.02437 0.31143 0.22645 0.32857 0.40418 0.36286 "
-"0.40571 0.36454 0.41330 0.37429 1.05421 0.40857 0.28418 0.42571 0.92000 0.44119 "
-"0.53714 0.46770 0.37143 0.50250 0.66758 0.54000 0.46406 0.55714 0.78704 0.62571 "
-"0.59429 0.63146 0.37714 0.68444 0.69296 0.70000 0.85355 0.71714 0.35681 0.73429 "
-"0.50200 0.75143 0.49756 0.76286 0.49502 0.76857 0.72891 0.76857 0.86966 0.76857 "
-"0.34748 0.82000 0.73295 0.82000 0.48764 0.82571 0.87236 0.83143 0.49714 0.86089 "
-"0.35849 0.87143 0.71429 0.87650 0.52000 0.89555 0.69714 0.89846 0.37964 0.91714 "
-"0.84657 0.91714 0.55429 0.92073 0.65714 0.92498 0.60000 0.93277 0.81868 0.95714 "
-"0.42857 0.97582 0.76571 1.00436 0.51429 1.02723 0.72000 1.02723 0.59429 1.04437 "
-"0.64571 1.04395 78 7 17 10 3 13 0 "
-"2 14 4 6 18 15 17 7 4 9 18 "
-"6 9 6 1 8 16 5 0 12 2 "
-"17 4 14 2 11 14 12 0 13 13 5 "
-"16 15 24 20 16 8 20 13 3 5 "
-"2 12 11 10 17 19 21 28 29 15 20 "
-"8 20 24 23 40 23 31 24 25 26 "
-"19 22 21 31 23 27 22 19 17 18 24 "
-"15 28 21 22 29 30 33 31 32 39 "
-"23 24 26 30 29 28 23 26 27 33 30 "
-"38 32 31 27 38 36 41 38 34 36 "
-"34 38 30 36 34 35 39 32 37 42 40 "
-"31 40 41 36 42 44 47 45 43 40 "
-"40 43 41 50 46 43 50 49 46 45 40 "
-"42 48 53 47 45 42 47 49 52 55 "
-"53 48 56 50 43 45 57 60 55 52 50 "
-"51 49 50 52 48 47 44 54 56 48 "
-"56 65 61 60 59 64 59 60 57 65 56 "
-"58 52 57 55 64 59 70 58 56 54 "
-"59 62 70 68 74 72 65 69 61 70 66 "
-"72 63 71 67 63 61 69 70 62 66 "
-"67 73 68 71 63 69 73 67 71 68 72 "
-"66 74 68 75 75 68 73 "
-;
-
-char *VTK_VECTOR_TEXT_39 = (char *) "10 0.364197 "
-"0.25143 0.63563 0.24571 0.63946 0.32571 0.63757 0.32950 0.64286 0.21034 0.83714 "
-"0.36379 0.83714 0.20991 1.02000 0.36420 1.02000 0.21408 1.02571 0.36000 1.02615 8 1 0 3 "
-"2 3 0 1 3 4 7 6 4 5 4 "
-"3 7 4 5 8 6 9 6 7 9 "
-;
-
-char *VTK_VECTOR_TEXT_40 = (char *) "19 0.595731 "
-"0.50857 -0.39522 0.59429 -0.39447 0.44000 -0.30784 0.51787 -0.24857 0.32530 -0.09429 "
-"0.43748 -0.05429 0.26899 0.06571 0.38134 0.20286 0.23580 0.27714 0.37605 0.38000 "
-"0.23848 0.41429 0.39320 0.53429 0.27177 0.59714 0.43748 0.71143 0.47216 0.80286 "
-"0.36086 0.82000 0.45714 0.97936 0.59573 1.04286 0.50857 1.04395 17 2 3 4 0 3 2 3 "
-"0 1 6 4 5 3 5 4 6 7 8 7 6 5 9 10 8 9 8 7 10 "
-"11 12 10 9 11 12 13 15 12 11 13 14 15 13 16 15 14 17 18 16 17 "
-"16 14 "
-;
-
-char *VTK_VECTOR_TEXT_41 = (char *) "19 0.598482 "
-"0.24000 -0.39447 0.33143 -0.39258 0.40616 -0.28857 0.31641 -0.24857 0.48784 -0.14000 "
-"0.39681 -0.05429 0.55538 0.03143 0.45295 0.20286 0.59580 0.23714 0.59848 0.37429 "
-"0.45823 0.38000 0.44723 0.49429 0.56252 0.59714 0.41714 0.64134 0.47343 0.82000 "
-"0.34857 0.83301 0.37714 0.97936 0.23855 1.04286 0.32571 1.04395 17 0 1 3 2 3 1 3 "
-"4 5 3 2 4 5 6 7 6 5 4 7 8 10 8 9 10 11 10 9 8 "
-"7 6 11 12 13 13 14 15 12 11 9 14 13 12 15 16 17 16 15 14 16 "
-"18 17 "
-;
-
-char *VTK_VECTOR_TEXT_42 = (char *) "34 0.685300 "
-"0.33143 0.58250 0.33714 0.58223 0.53714 0.58250 0.54286 0.58194 0.36213 0.61429 "
-"0.25587 0.63714 0.25266 0.64286 0.62655 0.64286 0.25393 0.64857 0.43429 0.73293 "
-"0.44000 0.73049 0.36715 0.78000 0.50714 0.78000 0.35429 0.78613 0.63429 0.80816 "
-"0.19309 0.82571 0.68389 0.82571 0.19177 0.83143 0.68530 0.83143 0.38857 0.86213 "
-"0.39523 0.86571 0.48000 0.86242 0.47660 0.86571 0.34657 0.88286 0.58857 0.90823 "
-"0.22286 0.92522 0.22857 0.92848 0.64571 0.92816 0.65143 0.92675 0.49295 1.02000 "
-"0.38134 1.03714 0.38550 1.04286 0.49143 1.04021 0.48571 1.04437 32 2 12 10 8 4 11 "
-"8 5 4 8 6 5 4 0 1 2 3 "
-"12 0 4 5 12 9 10 9 11 4 "
-"19 11 21 14 24 12 26 25 17 16 18 "
-"14 13 23 15 19 21 20 11 19 13 "
-"33 31 30 24 21 12 12 21 9 21 11 "
-"9 26 17 23 12 3 7 27 24 18 "
-"13 19 23 23 17 15 20 21 22 18 24 "
-"14 28 27 18 33 30 20 29 20 22 "
-"29 33 20 32 33 29 "
-;
-
-char *VTK_VECTOR_TEXT_43 = (char *) "20 0.952768 "
-"0.52836 0.10571 0.64878 0.10571 0.52420 0.11143 0.65295 0.11143 0.52420 0.39714 "
-"0.65295 0.39714 0.22857 0.40546 0.52000 0.40329 0.66286 0.40437 0.95168 0.40857 "
-"0.22437 0.52286 0.95277 0.52286 0.22857 0.52900 0.52311 0.53429 0.65403 0.53429 "
-"0.94857 0.52900 0.52528 0.82571 0.65186 0.82571 0.53143 0.82991 0.64571 0.82991 18 1 2 0 1 3 2 "
-"4 2 3 5 4 3 12 6 7 14 4 "
-"8 9 15 8 8 4 5 9 11 15 "
-"12 7 13 6 12 10 7 4 13 14 8 "
-"15 17 19 18 14 13 4 17 18 16 "
-"17 16 13 17 13 14 "
-;
-
-char *VTK_VECTOR_TEXT_44 = (char *) "23 0.432768 "
-"0.30286 -0.28607 0.30857 -0.28726 0.33714 -0.27355 0.36571 -0.25275 0.27329 -0.23714 "
-"0.38670 -0.23143 0.30286 -0.21582 0.39914 -0.21429 0.32115 -0.19714 0.41355 -0.18571 "
-"0.33800 -0.16857 0.42327 -0.15714 0.34605 -0.14571 0.43277 -0.10000 0.35580 -0.08286 "
-"0.35472 -0.07714 0.28571 -0.07295 0.34857 -0.07295 0.28000 -0.06878 0.27957 0.07714 "
-"0.43168 0.07714 0.28571 0.08134 0.42857 0.08025 21 0 6 4 0 "
-"1 2 0 2 6 3 6 2 8 5 10 5 7 10 6 5 8 5 6 3 10 "
-"7 12 9 12 7 12 13 14 11 12 9 12 11 13 18 17 19 17 21 19 15 "
-"14 13 15 13 17 21 17 22 17 20 22 18 16 17 20 17 13 "
-;
-
-char *VTK_VECTOR_TEXT_45 = (char *) "8 0.606146 "
-"0.19118 0.26000 0.19429 0.25689 0.60000 0.25580 0.60615 0.26000 0.19118 0.38571 "
-"0.60615 0.38571 0.19429 0.38882 0.60000 0.38991 6 6 1 2 6 0 "
-"1 6 2 7 6 4 0 7 2 3 "
-"5 7 3 "
-;
-
-char *VTK_VECTOR_TEXT_46 = (char *) "13 0.432768 "
-"0.28571 -0.07295 0.42286 -0.07295 0.42857 -0.07186 0.27848 -0.06571 0.28000 -0.06878 "
-"0.43277 -0.06571 0.27848 0.07143 0.43277 0.07143 0.27957 0.07714 0.43168 0.07714 "
-"0.28571 0.08134 0.42286 0.08134 0.42857 0.08025 11 0 "
-"3 4 3 0 1 8 6 10 5 1 2 3 1 5 6 3 5 6 7 11 6 "
-"5 7 10 6 11 9 12 11 9 11 7 "
-;
-
-char *VTK_VECTOR_TEXT_47 = (char *) "5 0.562348 "
-"0.14389 -0.08857 0.14857 -0.09256 0.25004 -0.08857 0.56235 1.04286 0.46286 1.04358 3 2 0 1 4 0 2 3 "
-"4 2 "
-;
-
-char *VTK_VECTOR_TEXT_48 = (char *) "53 0.926804 "
-"0.53714 -0.09009 0.59429 -0.09009 0.66857 -0.07673 0.43429 -0.06723 0.73143 -0.05070 "
-"0.34286 -0.00972 0.80571 0.01025 0.54857 0.02152 0.61714 0.02891 0.30241 0.03714 "
-"0.65714 0.04645 0.46857 0.05007 0.42473 0.08857 0.70286 0.08454 0.26645 0.10000 "
-"0.86943 0.11143 0.39955 0.12286 0.73800 0.13429 0.23748 0.18000 0.37034 0.19714 "
-"0.76252 0.20286 0.91236 0.26000 0.21866 0.26571 0.35621 0.26571 0.77823 0.28857 "
-"0.34437 0.40286 0.92680 0.40286 0.20420 0.40857 0.78705 0.54000 0.20723 0.58000 "
-"0.92420 0.58571 0.35277 0.64286 0.22177 0.69429 0.76571 0.72437 0.89966 0.74000 "
-"0.37756 0.76286 0.74498 0.79143 0.26073 0.82571 0.85927 0.84857 0.42473 0.85429 "
-"0.70439 0.85429 0.46286 0.88902 0.66286 0.89007 0.30241 0.90000 0.51009 0.91143 "
-"0.58286 0.91823 0.80725 0.92857 0.77714 0.95829 0.38350 0.98000 0.71429 0.99927 "
-"0.46286 1.01681 0.65714 1.01959 0.53714 1.02991 53 2 8 1 0 7 3 5 16 9 2 10 8 0 "
-"1 8 7 0 8 12 16 5 11 3 7 3 12 5 15 20 17 11 12 3 13 "
-"6 17 6 13 4 9 16 14 10 4 13 14 19 18 4 10 2 15 17 6 19 "
-"14 16 21 24 20 23 18 19 22 25 27 24 26 28 23 22 18 21 20 15 26 "
-"24 21 22 23 25 29 27 25 29 31 32 28 30 33 31 29 25 30 28 26 32 "
-"35 37 46 40 36 30 34 33 32 31 35 43 39 48 43 37 35 38 36 33 38 "
-"33 34 42 40 49 48 41 50 39 43 35 47 40 46 46 36 38 41 44 50 45 "
-"52 44 42 51 45 41 48 39 49 40 47 50 44 52 52 45 51 42 49 51 "
-;
-
-char *VTK_VECTOR_TEXT_49 = (char *) "11 0.708571 "
-"0.58286 -0.07186 0.70857 -0.07186 0.30857 0.62908 0.31429 0.62657 0.38286 0.65641 "
-"0.30785 0.75143 0.57714 0.77731 0.47429 0.85616 0.56384 0.94000 0.62857 1.02915 "
-"0.70857 1.02882 9 6 0 1 2 4 5 7 5 4 2 3 4 6 "
-"8 7 6 7 4 10 8 6 10 6 1 10 9 8 "
-;
-
-char *VTK_VECTOR_TEXT_50 = (char *) "43 0.914286 "
-"0.18857 -0.06878 0.91429 -0.06878 0.18748 -0.04286 0.19849 0.00857 0.91429 0.05164 "
-"0.38142 0.06000 0.22943 0.07714 0.46286 0.15868 0.30286 0.17832 0.38286 0.25813 "
-"0.58413 0.43143 0.78286 0.44454 0.67543 0.52286 0.85355 0.53429 0.72045 0.58000 "
-"0.89756 0.62571 0.75470 0.64286 0.35168 0.70000 0.91236 0.70000 0.77295 0.71143 "
-"0.21403 0.71714 0.77295 0.74571 0.22605 0.79143 0.37143 0.79804 0.90244 0.80857 "
-"0.75429 0.81228 0.38902 0.83143 0.24359 0.84286 0.73143 0.84689 0.42454 0.87143 "
-"0.86607 0.88857 0.68000 0.89070 0.28000 0.90629 0.49143 0.90823 0.58857 0.91866 "
-"0.82857 0.93555 0.31597 0.94571 0.37714 0.98784 0.76000 0.98657 0.44571 1.01470 "
-"0.69143 1.01470 0.53714 1.02991 0.62857 1.02723 41 3 2 0 3 5 6 1 5 0 5 "
-"3 0 1 4 5 6 5 8 7 8 5 9 8 7 9 7 10 11 10 7 10 "
-"11 12 12 11 14 16 15 18 16 18 19 13 14 11 14 13 16 21 24 25 15 "
-"16 13 21 19 18 23 27 22 17 23 22 24 21 18 27 23 32 17 22 20 31 "
-"42 34 30 28 25 26 32 23 40 31 38 35 28 30 36 32 26 29 36 26 34 "
-"41 33 33 37 29 36 29 37 33 39 37 30 25 24 28 38 31 38 28 35 39 "
-"33 41 31 40 42 41 34 42 "
-;
-
-char *VTK_VECTOR_TEXT_51 = (char *) "68 0.927232 "
-"0.52571 -0.09009 0.63429 -0.08395 0.45143 -0.07756 0.37143 -0.04498 0.74286 -0.04771 "
-"0.30857 0.00132 0.81714 0.00439 0.54286 0.02152 0.60000 0.02420 0.64661 0.03714 "
-"0.27429 0.03952 0.46857 0.04073 0.42857 0.06759 0.70857 0.07561 0.88213 0.08286 "
-"0.23429 0.10772 0.38812 0.11714 0.74535 0.11714 0.91109 0.14571 0.77823 0.19143 "
-"0.20764 0.20857 0.92723 0.22571 0.34286 0.23215 0.78437 0.27143 0.92723 0.27714 "
-"0.75429 0.36430 0.89927 0.38571 0.72571 0.40132 0.86857 0.43270 0.67429 0.43927 "
-"0.48000 0.45284 0.48571 0.44966 0.54857 0.46152 0.60000 0.46109 0.83429 0.46686 "
-"0.72693 0.52286 0.49034 0.55714 0.49714 0.56395 0.78857 0.56473 0.58286 0.57109 "
-"0.82857 0.60921 0.67429 0.61616 0.70400 0.64857 0.85294 0.65429 0.72680 0.70571 "
-"0.87009 0.72286 0.35429 0.72298 0.22175 0.74571 0.72991 0.76286 0.72151 0.80286 "
-"0.86244 0.80857 0.38857 0.82064 0.69143 0.85832 0.84571 0.85587 0.26241 0.87143 "
-"0.43429 0.87829 0.64571 0.89641 0.48571 0.90723 0.29330 0.91714 0.60571 0.91252 "
-"0.53143 0.91823 0.80384 0.92286 0.36000 0.97750 0.73143 0.98213 0.44571 1.01681 "
-"0.65714 1.01470 0.52000 1.02991 0.60000 1.02723 66 3 11 "
-"5 9 8 1 1 8 0 4 9 1 "
-"9 4 13 7 0 8 6 13 4 17 13 "
-"6 2 11 3 2 0 7 5 16 10 "
-"12 5 11 10 16 15 11 2 7 16 5 "
-"12 17 14 19 14 17 6 20 15 22 "
-"19 18 23 22 15 16 14 18 19 21 23 "
-"18 23 26 25 23 21 24 26 28 25 "
-"30 32 36 25 34 27 35 32 33 35 29 "
-"27 25 28 34 29 35 33 26 23 24 "
-"37 36 32 39 32 35 35 27 34 37 32 "
-"39 30 31 32 39 35 41 38 41 35 "
-"38 42 41 40 42 38 42 40 44 40 43 "
-"44 44 43 48 45 48 43 47 46 54 "
-"49 48 50 50 48 45 49 53 52 63 52 "
-"61 53 49 50 46 51 54 58 54 51 "
-"58 55 62 62 55 64 66 57 60 61 52 "
-"53 55 58 51 59 67 60 52 63 56 "
-"56 65 59 55 57 64 64 57 66 65 56 "
-"63 67 66 60 67 59 65 "
-;
-
-char *VTK_VECTOR_TEXT_52 = (char *) "18 0.920000 "
-"0.64571 -0.07295 0.64000 -0.06878 0.77143 -0.06878 0.77403 0.18571 0.16265 0.19143 "
-"0.63429 0.18882 0.92000 0.19408 0.15891 0.31143 0.91735 0.31143 0.29653 0.31714 "
-"0.63740 0.31714 0.77714 0.31403 0.16571 0.32228 0.16616 0.32286 0.63429 0.79380 "
-"0.77186 1.02000 0.66857 1.02282 0.76571 1.02420 18 2 1 0 1 3 5 1 2 "
-"3 3 10 5 9 4 5 4 9 7 "
-"6 11 3 8 11 6 7 9 13 15 16 "
-"14 9 5 10 7 13 12 13 14 16 "
-"11 10 3 14 13 9 14 10 11 15 17 "
-"16 15 14 11 "
-;
-
-char *VTK_VECTOR_TEXT_53 = (char *) "54 0.932946 "
-"0.52571 -0.09009 0.61714 -0.08665 0.44571 -0.07673 0.73143 -0.05179 0.35429 -0.03759 "
-"0.78914 -0.01429 0.30286 0.00241 0.53714 0.02152 0.62857 0.03184 0.84115 0.03714 "
-"0.46857 0.03927 0.66286 0.04645 0.26286 0.04921 0.42286 0.06759 0.71429 0.08439 "
-"0.88045 0.09429 0.23343 0.10000 0.38812 0.10571 0.74535 0.12286 0.35748 0.16857 "
-"0.77294 0.18000 0.91681 0.18000 0.20420 0.20857 0.34286 0.22376 0.78705 0.23714 "
-"0.93295 0.27143 0.79009 0.31714 0.93252 0.33429 0.77714 0.38420 0.91681 0.42000 "
-"0.34857 0.43034 0.75641 0.43143 0.23088 0.44857 0.72000 0.47868 0.40000 0.48400 "
-"0.68000 0.50784 0.86902 0.51714 0.46857 0.52437 0.53143 0.53848 0.57714 0.53848 "
-"0.58857 0.53621 0.60000 0.53580 0.82286 0.56972 0.38494 0.59714 0.77714 0.60535 "
-"0.48571 0.64244 0.69714 0.64327 0.56571 0.65848 0.61714 0.65848 0.43891 0.87714 "
-"0.44571 0.88395 0.88043 0.88857 0.88043 1.00857 0.33714 1.01182 52 7 1 "
-"8 7 0 1 7 2 0 2 10 4 "
-"6 13 12 3 8 1 3 11 8 10 2 "
-"7 4 13 6 11 3 14 19 16 12 "
-"3 5 14 9 14 5 10 13 4 22 19 "
-"23 18 15 20 17 12 13 15 14 9 "
-"14 15 18 19 12 17 25 26 24 20 21 "
-"24 21 20 15 22 16 19 25 24 21 "
-"26 25 27 29 28 26 29 26 27 43 37 "
-"45 36 31 29 34 32 30 31 36 33 "
-"31 28 29 32 34 43 48 47 41 45 38 "
-"47 42 33 36 41 39 40 38 39 47 "
-"37 38 45 47 39 41 44 33 42 43 34 "
-"37 46 33 44 35 46 41 33 46 35 "
-"46 48 41 32 43 53 43 49 53 49 50 "
-"53 53 50 52 50 51 52 "
-;
-
-char *VTK_VECTOR_TEXT_54 = (char *) "70 0.927232 "
-"0.55429 -0.09009 0.66857 -0.08034 0.43429 -0.06213 0.75429 -0.04607 0.34857 -0.00972 "
-"0.81143 -0.00439 0.59429 0.02152 0.51339 0.03143 0.85188 0.04286 0.67429 0.04645 "
-"0.46286 0.05579 0.27384 0.07714 0.41714 0.09597 0.73143 0.09597 0.89355 0.11714 "
-"0.38771 0.14000 0.91177 0.16857 0.77294 0.17429 0.22816 0.18571 0.36530 0.19714 "
-"0.78705 0.24857 0.92680 0.25429 0.35320 0.26000 0.78665 0.30571 0.20420 0.31143 "
-"0.35320 0.31143 0.92723 0.31714 0.36657 0.37429 0.77395 0.37429 0.75429 0.41841 "
-"0.39179 0.42571 0.89756 0.44286 0.72000 0.46418 0.43429 0.47258 0.19891 0.50571 "
-"0.33714 0.50495 0.48000 0.50213 0.66857 0.50086 0.86241 0.50571 0.55429 0.52134 "
-"0.61143 0.51866 0.80403 0.56857 0.42286 0.58821 0.74286 0.60943 0.34134 0.63143 "
-"0.50857 0.62823 0.68000 0.63252 0.57714 0.64134 0.21563 0.66000 0.77714 0.74697 "
-"0.37502 0.75714 0.90966 0.76286 0.25673 0.80286 0.41901 0.83143 0.73143 0.85191 "
-"0.45143 0.86686 0.87343 0.87714 0.30036 0.88286 0.68000 0.89514 0.50286 0.90086 "
-"0.51429 0.90530 0.52000 0.90784 0.60571 0.91866 0.83846 0.92857 0.35429 0.94384 "
-"0.40571 0.98150 0.76000 0.99229 0.49143 1.01748 0.68571 1.02041 0.56571 1.02991 70 "
-"2 10 4 6 1 9 3 5 13 0 7 "
-"2 3 9 1 1 6 0 9 3 13 "
-"7 0 6 10 2 7 20 26 23 4 12 "
-"11 13 8 17 4 10 12 11 19 18 "
-"17 21 20 15 11 12 11 15 19 16 17 "
-"14 18 22 24 8 14 17 8 13 5 "
-"24 35 34 22 18 19 20 21 26 28 23 "
-"26 21 17 16 24 27 35 24 22 25 "
-"28 31 29 31 28 26 24 25 27 32 41 "
-"37 30 35 27 34 44 48 35 33 42 "
-"43 37 41 46 39 40 32 29 38 38 29 "
-"31 33 35 30 33 36 42 42 36 45 "
-"45 39 47 36 39 45 37 46 40 41 32 "
-"38 46 37 43 47 39 46 44 34 35 "
-"48 50 52 48 44 50 49 56 54 57 53 "
-"64 57 52 50 54 66 58 51 56 49 "
-"62 69 61 53 57 50 61 59 60 59 65 "
-"55 65 64 55 58 68 62 55 64 53 "
-"66 54 63 63 54 56 65 59 67 69 62 "
-"68 67 59 61 69 67 61 68 58 66 "
-;
-
-char *VTK_VECTOR_TEXT_55 = (char *) "17 0.923788 "
-"0.37143 -0.07186 0.50286 -0.07186 0.36723 -0.06571 0.37335 0.02000 0.52991 0.11143 "
-"0.40379 0.18571 0.59787 0.35143 0.47387 0.41429 0.66857 0.51873 0.53355 0.55143 "
-"0.63384 0.72857 0.80893 0.76286 0.74359 0.88286 0.21714 0.88546 0.92379 0.91143 "
-"0.21403 1.00857 0.92311 1.00857 15 3 0 1 2 0 3 3 4 5 4 3 1 6 7 5 6 5 4 9 "
-"7 6 10 9 8 8 9 6 10 11 12 11 10 8 15 13 12 12 14 16 15 "
-"12 16 11 14 12 "
-;
-
-char *VTK_VECTOR_TEXT_56 = (char *) "83 0.926804 "
-"0.53143 -0.08966 0.62857 -0.08665 0.45143 -0.07605 0.73714 -0.05641 0.38857 -0.05343 "
-"0.34286 -0.02616 0.79429 -0.02250 0.28571 0.02445 0.58857 0.02152 0.50857 0.02823 "
-"0.85258 0.03143 0.66937 0.04286 0.45143 0.05070 0.71429 0.07296 0.41143 0.07868 "
-"0.24000 0.09016 0.89927 0.10571 0.37669 0.12286 0.76613 0.14000 0.21462 0.15714 "
-"0.35849 0.16286 0.92109 0.17429 0.78705 0.22000 0.34437 0.22571 0.20420 0.27143 "
-"0.92680 0.27143 0.78437 0.28286 0.34748 0.28857 0.77143 0.32947 0.91470 0.33429 "
-"0.21714 0.34118 0.37502 0.36286 0.73296 0.39143 0.89057 0.39143 0.24359 0.40286 "
-"0.41883 0.41429 0.69143 0.42722 0.27275 0.44286 0.85714 0.43841 0.46286 0.44371 "
-"0.50286 0.45748 0.63429 0.45470 0.58286 0.46420 0.80507 0.48286 0.33143 0.49007 "
-"0.40456 0.52286 0.72693 0.52286 0.32000 0.57616 0.54857 0.57580 0.62286 0.58319 "
-"0.82082 0.58571 0.49714 0.58657 0.66286 0.60073 0.28527 0.61429 0.44571 0.61582 "
-"0.70439 0.63714 0.85759 0.63714 0.25756 0.67143 0.72657 0.67143 0.39849 0.68286 "
-"0.87470 0.68286 0.74134 0.72857 0.38705 0.73429 0.88109 0.76857 0.24764 0.77429 "
-"0.73395 0.79714 0.39470 0.80286 0.87177 0.82000 0.71641 0.83714 0.27216 0.86571 "
-"0.44000 0.87296 0.84486 0.88286 0.66286 0.89179 0.48000 0.90086 0.61714 0.91184 "
-"0.54286 0.91823 0.31846 0.93429 0.80571 0.93555 0.38286 0.98616 0.72000 0.99800 "
-"0.43429 1.01008 0.53143 1.02991 0.61714 1.02723 85 0 "
-"9 2 12 4 2 1 8 0 6 11 3 5 14 7 9 0 8 8 1 11 4 "
-"12 5 13 11 6 1 3 11 12 2 9 5 12 14 13 10 18 7 17 15 10 "
-"13 6 15 20 19 7 14 17 18 16 22 16 18 10 20 15 17 19 23 24 16 "
-"21 22 22 25 26 23 19 20 24 27 30 25 22 21 27 24 23 31 34 30 31 "
-"37 34 29 28 26 31 30 27 29 26 25 33 28 29 28 33 32 36 32 43 37 "
-"31 44 40 45 39 44 39 45 43 32 38 35 44 31 42 48 40 44 35 39 41 "
-"46 42 36 46 41 32 33 38 48 42 49 46 36 43 48 45 40 42 46 49 51 "
-"45 48 49 46 52 47 54 53 52 46 55 53 59 57 45 54 47 45 51 54 50 "
-"55 46 59 53 54 50 58 55 58 50 61 57 62 64 61 63 65 56 61 50 57 "
-"59 62 60 61 56 64 66 69 63 67 65 64 62 66 63 61 60 71 68 65 76 "
-"69 66 72 68 77 71 65 67 76 70 78 70 76 66 74 82 75 80 78 70 79 "
-"72 77 74 72 79 80 73 75 80 75 81 68 71 77 73 80 70 82 81 75 82 "
-"74 79 "
-;
-
-char *VTK_VECTOR_TEXT_57 = (char *) "72 0.927232 "
-"0.50286 -0.09009 0.56000 -0.09009 0.42857 -0.07673 0.64571 -0.07395 0.36000 -0.04771 "
-"0.74286 -0.02616 0.28759 0.01429 0.51429 0.02152 0.57143 0.02420 0.80115 0.02571 "
-"0.47429 0.02891 0.42857 0.05007 0.64000 0.04943 0.24930 0.07714 0.39314 0.08286 "
-"0.85229 0.10000 0.70902 0.11143 0.37057 0.12286 0.22177 0.17429 0.34857 0.18947 "
-"0.75109 0.19714 0.89395 0.20286 0.75429 0.20739 0.75681 0.21429 0.90966 0.27143 "
-"0.50286 0.30152 0.42857 0.31605 0.61714 0.31462 0.37714 0.33787 0.70286 0.35759 "
-"0.78705 0.37429 0.32000 0.37846 0.58286 0.42152 0.50286 0.42891 0.63429 0.43184 "
-"0.78286 0.43630 0.92723 0.43714 0.26286 0.44350 0.45143 0.45107 0.68571 0.45750 "
-"0.41587 0.47714 0.23787 0.48857 0.74498 0.52286 0.36359 0.55143 0.21522 0.55714 "
-"0.92680 0.56286 0.76571 0.57009 0.34437 0.63143 0.77823 0.63714 0.20462 0.69429 "
-"0.77866 0.69429 0.91236 0.70000 0.35429 0.74118 0.76571 0.76404 0.21756 0.77429 "
-"0.38286 0.80921 0.87343 0.82571 0.40759 0.84286 0.72571 0.84118 0.24527 0.84857 "
-"0.69143 0.87527 0.84000 0.88221 0.47429 0.89641 0.28571 0.90975 0.63429 0.90784 "
-"0.54857 0.91866 0.33143 0.95527 0.76000 0.96331 0.39629 0.99714 0.68571 1.00437 "
-"0.49714 1.02723 0.57714 1.02991 72 3 8 1 2 11 4 0 7 2 "
-"8 3 12 4 14 6 0 1 8 6 17 "
-"13 10 2 7 7 0 8 5 12 3 "
-"12 5 16 2 10 11 4 11 14 5 9 "
-"16 18 13 19 16 15 20 15 23 20 "
-"6 14 17 13 17 19 21 23 15 22 20 "
-"23 23 24 30 16 9 15 23 21 24 "
-"25 32 26 27 32 25 38 28 26 43 41 "
-"37 34 29 39 33 26 32 29 34 27 "
-"30 36 35 34 32 27 36 30 24 28 38 "
-"31 31 38 37 35 39 29 38 26 33 "
-"39 35 42 42 35 36 40 37 38 44 41 "
-"43 42 36 46 44 47 49 43 37 40 "
-"48 46 45 36 45 46 51 50 48 52 54 "
-"49 47 44 43 50 51 53 51 48 45 "
-"59 54 52 59 55 63 52 49 47 53 61 "
-"58 56 53 51 55 59 52 53 56 61 "
-"66 63 57 55 57 63 62 68 57 58 67 "
-"60 67 58 61 68 66 57 60 69 64 "
-"68 62 70 60 67 69 64 71 65 65 70 "
-"62 70 65 71 64 69 71 "
-;
-
-char *VTK_VECTOR_TEXT_58 = (char *) "14 0.432768 "
-"0.28571 -0.07295 0.42857 -0.07186 0.28000 -0.06878 0.43277 -0.06571 0.27957 0.07714 "
-"0.28571 0.08134 0.42857 0.08025 0.27957 0.57429 0.28571 0.57009 0.43168 0.57429 "
-"0.27848 0.71714 0.43277 0.71714 0.28265 0.72286 0.42857 0.72329 10 "
-"2 5 4 2 0 5 0 3 5 6 5 "
-"3 0 1 3 7 8 10 10 11 13 "
-"9 10 8 12 10 13 11 10 9 "
-;
-
-char *VTK_VECTOR_TEXT_59 = (char *) "18 0.432768 "
-"0.30857 -0.28726 0.36571 -0.25275 0.27323 -0.23714 0.39543 -0.22000 0.32384 -0.19143 "
-"0.33756 -0.16857 0.42327 -0.15714 0.43277 -0.10000 0.35472 -0.07714 0.28571 -0.07295 "
-"0.34857 -0.07295 0.28000 -0.06878 0.27957 0.07714 0.43168 0.07714 0.27957 0.57429 "
-"0.43168 0.57429 0.28265 0.72286 0.42857 0.72329 14 2 1 4 5 4 3 0 1 "
-"2 5 6 8 3 4 1 6 5 3 "
-"6 7 8 11 10 12 12 10 13 8 7 "
-"10 11 9 10 13 10 7 17 16 15 "
-"15 16 14 "
-;
-
-char *VTK_VECTOR_TEXT_60 = (char *) "11 0.952690 "
-"0.94857 0.09939 0.95269 0.10571 0.95236 0.22571 0.22894 0.40857 0.38919 0.46571 "
-"0.38919 0.47143 0.22748 0.52857 0.23192 0.53429 0.95098 0.70571 0.95216 0.83143 "
-"0.94857 0.83523 9 4 0 2 5 7 6 4 3 0 0 1 2 7 "
-"8 10 4 5 3 5 6 3 8 9 10 7 5 8 "
-;
-
-char *VTK_VECTOR_TEXT_61 = (char *) "12 0.952768 "
-"0.22857 0.23975 0.94857 0.23975 0.22437 0.35714 0.95277 0.35714 0.22857 0.36329 "
-"0.94857 0.36329 0.22857 0.57385 0.94857 0.57385 0.22437 0.58000 0.95277 0.58000 "
-"0.22857 0.69740 0.94857 0.69740 8 0 4 "
-"2 0 1 5 4 0 5 3 5 1 "
-"11 7 9 10 6 7 10 7 11 8 6 "
-"10 "
-;
-
-char *VTK_VECTOR_TEXT_62 = (char *) "11 0.952360 "
-"0.23429 0.09914 0.22857 0.10169 0.22748 0.22571 0.23192 0.23143 0.95116 0.40857 "
-"0.79073 0.46571 0.79073 0.47143 0.95236 0.52857 0.22897 0.70571 0.22857 0.83287 "
-"0.23429 0.83563 9 1 0 2 3 2 0 3 0 5 4 7 5 4 "
-"5 0 6 5 7 6 10 8 8 10 9 10 6 7 "
-;
-
-char *VTK_VECTOR_TEXT_63 = (char *) "45 0.918074 "
-"0.47429 -0.07186 0.62021 -0.07143 0.47118 0.07714 0.62329 0.07714 0.49979 0.19714 "
-"0.62021 0.19714 0.49563 0.20286 0.49563 0.27714 0.63681 0.31714 0.50816 0.34571 "
-"0.65714 0.36350 0.53669 0.41429 0.70857 0.42384 0.57868 0.47143 0.82857 0.53597 "
-"0.86902 0.58571 0.73258 0.62000 0.90437 0.65429 0.76086 0.66000 0.77522 0.70000 "
-"0.91580 0.70000 0.34857 0.71338 0.21034 0.73429 0.77866 0.75143 0.91807 0.76857 "
-"0.22605 0.80857 0.76571 0.80375 0.38286 0.82144 0.73714 0.85191 0.25098 0.87143 "
-"0.89143 0.86730 0.43597 0.88857 0.86812 0.90571 0.67429 0.90616 0.48571 0.91800 "
-"0.62857 0.92538 0.29296 0.93429 0.54857 0.93277 0.81143 0.96670 0.35429 0.98821 "
-"0.76571 0.99800 0.44571 1.02891 0.69714 1.02680 0.53143 1.04395 0.60000 1.04437 41 2 1 3 2 0 1 7 6 4 7 4 5 8 9 7 11 10 13 8 "
-"7 5 8 10 11 9 8 11 13 12 16 12 13 10 14 16 12 14 15 16 16 "
-"15 18 17 18 15 17 23 19 17 19 18 20 23 17 29 27 36 26 32 28 21 "
-"25 22 26 23 24 27 29 25 24 23 20 36 31 39 28 40 33 30 26 24 35 "
-"44 37 31 36 27 27 25 21 31 34 41 42 33 40 28 38 40 39 31 41 38 "
-"28 32 26 30 32 42 35 33 41 34 43 43 37 44 34 37 43 44 35 42 "
-;
-
-char *VTK_VECTOR_TEXT_64 = (char *) "114 1.632597 "
-"0.92571 -0.39563 1.16571 -0.38109 0.74857 -0.37236 0.65143 -0.34613 1.33143 -0.33070 "
-"0.54286 -0.29914 0.86286 -0.27866 1.06286 -0.28134 1.45650 -0.26000 0.73714 -0.25387 "
-"1.21143 -0.25387 0.43429 -0.22384 0.62286 -0.21216 1.32144 -0.20857 1.55582 -0.17429 "
-"0.53714 -0.16099 0.52571 -0.15258 0.53143 -0.15669 0.33714 -0.11650 1.45143 -0.11561 "
-"0.46286 -0.09260 0.80000 -0.07295 1.20571 -0.07252 1.09714 -0.06891 0.71429 -0.06252 "
-"1.49714 -0.06187 1.63260 -0.06000 0.29629 -0.04857 1.29714 -0.04498 0.90857 -0.03629 "
-"1.03384 -0.02571 0.62857 -0.01582 0.40486 -0.00857 0.59429 0.01873 1.41143 0.03296 "
-"0.82857 0.03907 0.77714 0.04327 1.01143 0.04414 1.20000 0.05050 1.16989 0.06571 "
-"1.25143 0.06086 0.90857 0.06821 0.72000 0.07561 0.54771 0.09429 1.15580 0.09429 "
-"0.24420 0.10000 0.35748 0.11143 0.96000 0.10725 0.68527 0.11714 1.33841 0.11714 "
-"1.51579 0.15714 0.66177 0.17429 1.41355 0.20286 1.03514 0.20857 0.65295 0.23143 "
-"0.22437 0.23714 0.51277 0.23714 0.33563 0.24857 1.45355 0.27714 1.07177 0.31143 "
-"1.58478 0.31143 0.65966 0.32857 1.48319 0.36857 0.53184 0.39714 0.23277 0.40286 "
-"0.34478 0.40857 1.60420 0.42571 1.08420 0.44286 0.71514 0.48857 0.25184 0.49429 "
-"1.49295 0.49429 0.57229 0.50000 1.60109 0.52857 1.05714 0.54144 0.75846 0.55143 "
-"0.38645 0.55714 1.47681 0.58571 1.01143 0.59527 0.81714 0.60331 1.58605 0.60857 "
-"1.12878 0.61429 0.65714 0.62418 0.86286 0.62319 0.96571 0.62151 0.92571 0.62991 "
-"0.42857 0.64350 1.44571 0.66730 0.32359 0.67714 1.06048 0.68286 0.74857 0.69641 "
-"1.15429 0.71588 1.28235 0.71714 1.00571 0.71800 0.82857 0.73109 0.92000 0.74152 "
-"1.52657 0.75143 0.51275 0.75714 0.37669 0.76286 1.38286 0.76132 0.59493 0.82571 "
-"1.30857 0.82821 1.45561 0.84857 0.47429 0.87296 0.73143 0.89681 1.18286 0.89580 "
-"1.08571 0.92395 1.37143 0.92400 0.92000 0.93580 0.58286 0.95188 1.30857 0.96371 "
-"0.71429 1.00899 1.18286 1.01470 0.92000 1.04437 1.01143 1.04395 114 0 6 2 1 7 0 6 0 7 "
-"7 1 10 2 9 3 3 12 5 9 2 "
-"6 10 4 13 4 10 1 15 5 12 "
-"5 15 11 13 8 19 12 3 9 8 13 "
-"4 11 20 18 11 15 16 17 16 15 "
-"14 19 8 26 25 14 20 11 16 22 38 "
-"23 25 19 14 23 39 30 30 39 37 "
-"27 46 45 18 32 27 32 18 20 21 36 "
-"24 35 29 41 24 42 31 29 35 21 "
-"22 28 40 38 22 40 34 49 40 33 31 "
-"48 36 21 35 37 47 41 33 48 43 "
-"43 51 56 44 37 39 34 40 28 47 37 "
-"53 50 52 34 38 39 23 52 49 34 "
-"37 44 53 27 32 46 42 24 36 48 31 "
-"42 37 41 29 45 57 55 53 44 59 "
-"51 54 56 52 50 58 58 60 62 43 48 "
-"51 45 46 57 56 61 63 64 55 57 "
-"91 80 44 60 58 50 62 66 70 56 54 "
-"61 44 80 67 59 44 67 71 63 61 "
-"64 65 69 67 80 73 65 64 57 66 62 "
-"60 68 71 61 71 68 81 69 75 87 "
-"72 70 66 74 81 68 77 73 80 70 79 "
-"76 75 69 65 83 77 88 87 85 97 "
-"81 74 89 89 78 93 86 76 79 70 72 "
-"79 74 78 89 88 77 80 75 85 87 "
-"82 84 94 91 90 80 86 95 98 78 82 "
-"93 92 83 88 93 82 94 84 83 92 "
-"94 84 92 97 96 102 95 86 79 102 99 "
-"108 95 101 98 96 97 85 96 99 102 "
-"98 101 100 103 108 99 100 109 104 106 100 "
-"101 108 103 110 105 113 107 100 106 109 "
-"104 111 105 107 112 110 111 104 109 113 105 "
-"111 112 107 113 107 110 103 "
-;
-
-char *VTK_VECTOR_TEXT_65 = (char *) "13 1.155731 "
-"0.14455 -0.07143 1.00000 -0.07252 1.15573 -0.07143 0.29143 -0.07103 0.40981 0.25429 "
-"0.86857 0.25754 0.45714 0.37713 0.82478 0.38000 0.45462 0.38571 0.58538 0.73429 "
-"0.63429 0.90068 0.56000 1.02454 0.71429 1.02644 13 5 "
-"1 2 0 8 11 6 4 5 12 10 7 0 3 4 0 4 8 6 5 7 6 "
-"8 4 7 5 2 8 9 11 9 10 11 12 7 2 11 10 12 "
-;
-
-char *VTK_VECTOR_TEXT_66 = (char *) "48 1.081090 "
-"0.25714 -0.07186 0.78286 -0.06723 0.86857 -0.04899 0.93714 -0.02045 1.00725 0.03714 "
-"0.39957 0.06000 0.73143 0.05621 0.80571 0.06891 1.04213 0.08857 0.87555 0.10571 "
-"1.06437 0.14000 0.91070 0.15143 1.08109 0.22000 0.93295 0.22571 0.93252 0.26571 "
-"1.07177 0.32286 0.90857 0.34064 1.04616 0.38571 0.86857 0.38686 0.79429 0.42252 "
-"0.39957 0.43143 1.01296 0.43143 0.69714 0.43563 0.97143 0.46686 0.88197 0.51143 "
-"0.40571 0.56437 0.72000 0.56705 0.39848 0.57429 0.96956 0.58571 0.80571 0.58930 "
-"0.84686 0.62000 0.99641 0.62571 0.86943 0.65429 1.02437 0.70571 0.88420 0.71143 "
-"1.02665 0.76857 0.87429 0.79232 1.01673 0.82000 0.84000 0.84984 0.77714 0.88538 "
-"0.98607 0.88857 0.39957 0.89429 0.71429 0.89580 0.93143 0.95296 0.85714 0.99756 "
-"0.80000 1.01470 0.25714 1.02615 0.70857 1.02680 50 1 6 0 2 7 1 "
-"0 20 46 7 2 9 1 7 6 20 27 "
-"46 9 4 11 4 9 3 2 3 9 "
-"11 10 13 8 11 4 10 11 8 12 13 "
-"10 14 17 16 14 15 17 16 21 18 "
-"14 13 12 15 14 12 23 18 21 5 0 "
-"6 19 26 22 18 24 19 16 17 21 "
-"24 18 23 26 19 29 19 24 29 25 22 "
-"26 22 25 20 30 29 24 32 28 31 "
-"28 32 30 32 31 34 0 5 20 34 35 "
-"36 33 34 31 28 30 24 36 40 38 "
-"38 44 39 35 37 36 34 33 35 25 27 "
-"20 27 41 46 40 36 37 43 38 40 "
-"39 45 42 42 47 41 38 43 44 45 39 "
-"44 47 46 41 47 42 45 "
-;
-
-char *VTK_VECTOR_TEXT_67 = (char *) "56 1.186046 "
-"0.69143 -0.08966 0.80000 -0.08705 0.60000 -0.07823 0.50857 -0.05070 0.93143 -0.05216 "
-"0.45714 -0.02486 1.00000 -0.01473 0.39597 0.02000 0.69714 0.03563 0.74857 0.03563 "
-"0.62286 0.04899 0.82286 0.04899 1.08000 0.05597 0.57143 0.06784 0.88000 0.07229 "
-"0.32571 0.10064 0.93143 0.10759 0.49143 0.11901 1.13800 0.14000 0.45600 0.15714 "
-"0.28930 0.16286 0.99641 0.18571 0.41502 0.22571 1.18605 0.27714 0.24319 0.28857 "
-"1.04571 0.31105 0.38244 0.32857 0.22748 0.36286 0.36723 0.44286 0.21866 0.52857 "
-"0.36991 0.55714 0.22705 0.60857 1.02857 0.69469 0.40657 0.71143 1.16694 0.72857 "
-"0.26286 0.74089 0.44187 0.78000 1.13927 0.80857 0.97143 0.80914 0.48000 0.82725 "
-"0.31750 0.84286 0.93714 0.85011 0.53143 0.86784 0.89143 0.88331 1.07582 0.90571 "
-"0.64000 0.91252 0.64571 0.91335 0.65714 0.91563 0.38286 0.91868 0.78857 0.91823 "
-"1.00571 0.96902 0.50286 0.99756 0.93143 1.01070 0.58286 1.02680 0.70286 1.04705 "
-"0.80000 1.04437 54 "
-"1 9 0 0 8 2 14 6 16 4 14 "
-"11 24 20 22 7 17 15 2 10 3 "
-"8 10 2 9 1 11 0 9 8 4 11 "
-"1 3 13 5 12 16 6 10 13 3 "
-"5 13 7 7 13 17 22 20 15 16 12 "
-"21 14 4 6 19 15 17 23 25 18 "
-"22 15 19 25 21 18 18 21 12 27 28 "
-"29 27 24 26 26 24 22 28 27 26 "
-"29 30 31 30 29 28 33 35 31 35 33 "
-"40 33 31 30 34 37 32 48 42 51 "
-"36 40 33 40 36 48 38 44 41 44 38 "
-"37 32 37 38 48 39 42 36 39 48 "
-"54 53 47 45 51 42 49 43 52 50 41 "
-"44 47 45 46 41 50 43 45 53 51 "
-"49 54 47 53 45 47 49 55 54 55 49 "
-"52 52 43 50 "
-;
-
-char *VTK_VECTOR_TEXT_68 = (char *) "34 1.167232 "
-"0.26286 -0.07186 0.70286 -0.07252 0.80000 -0.06109 0.89714 -0.03355 0.99555 0.02571 "
-"0.40528 0.06000 0.72571 0.05891 1.03582 0.06571 0.79547 0.07143 0.88000 0.10893 "
-"1.08150 0.12857 0.92115 0.14571 0.96657 0.21429 1.13966 0.26571 0.99470 0.28857 "
-"1.16420 0.39714 1.01823 0.43714 1.16723 0.52857 1.01823 0.53429 1.15277 0.64286 "
-"1.00000 0.65848 0.97714 0.72375 1.11216 0.77429 0.94286 0.78057 0.87429 0.84902 "
-"1.06607 0.85429 0.81714 0.87865 0.40528 0.89429 0.69143 0.89807 0.97714 0.94616 "
-"0.90857 0.98657 0.81143 1.01580 0.26286 1.02615 0.70286 1.02680 34 2 6 1 5 0 1 "
-"8 3 9 3 8 2 0 27 32 6 2 "
-"8 5 1 6 4 7 11 4 9 3 "
-"9 4 11 11 10 12 11 7 10 13 14 "
-"12 14 15 16 13 12 10 16 17 18 "
-"14 13 15 18 19 20 17 16 15 18 17 "
-"19 22 21 20 21 22 23 29 24 23 "
-"22 20 19 26 24 30 0 5 27 25 23 "
-"22 29 23 25 30 24 29 26 31 28 "
-"31 26 30 33 32 27 28 33 27 33 28 "
-"31 "
-;
-
-char *VTK_VECTOR_TEXT_69 = (char *) "15 1.080000 "
-"0.26857 -0.07186 1.08000 -0.06878 1.08000 0.05164 0.41100 0.06000 0.41100 0.42571 "
-"1.01143 0.43100 1.01563 0.55143 0.41714 0.55866 1.01143 0.55757 0.40991 0.56857 "
-"0.41100 0.89429 1.05143 0.89957 1.05563 1.02000 0.26857 1.02615 1.05143 1.02615 13 0 4 13 1 3 0 1 2 3 0 "
-"3 4 7 5 8 5 7 4 6 8 5 4 9 13 7 9 4 9 10 13 11 "
-"14 10 14 13 10 12 14 11 "
-;
-
-char *VTK_VECTOR_TEXT_70 = (char *) "12 1.005714 "
-"0.26857 -0.07186 0.40571 -0.07186 0.40991 0.42000 0.41714 0.42723 0.92615 0.43143 "
-"0.92615 0.55143 0.41714 0.55563 0.40991 0.56286 0.41100 0.89429 1.00571 0.90265 "
-"1.00571 1.02307 0.26857 1.02615 10 0 2 "
-"11 2 7 11 2 0 1 6 4 5 "
-"4 6 3 3 6 2 7 2 6 7 8 "
-"11 11 8 10 8 9 10 "
-;
-
-char *VTK_VECTOR_TEXT_71 = (char *) "60 1.234286 "
-"0.82286 -0.08966 0.65714 -0.07866 0.93143 -0.07335 0.56571 -0.05387 1.05143 -0.03355 "
-"0.48000 -0.01514 1.12000 0.00073 0.74286 0.03866 0.83429 0.04177 0.38857 0.05044 "
-"0.65143 0.05470 0.92571 0.06319 1.23260 0.07714 0.34857 0.09302 0.54286 0.10150 "
-"1.03429 0.11229 0.50286 0.13044 1.09252 0.15714 0.44421 0.19714 0.27429 0.21629 "
-"0.24252 0.31143 0.39320 0.31143 0.77714 0.36243 1.09143 0.35773 0.22748 0.39714 "
-"0.37605 0.40286 0.77295 0.48286 0.77714 0.48900 1.23429 0.48900 0.22437 0.51143 "
-"0.37295 0.51714 0.23320 0.59143 0.39748 0.65429 1.09143 0.68617 1.08571 0.69099 "
-"0.42073 0.71714 1.21977 0.72286 0.27387 0.73429 1.06286 0.75301 0.30645 0.80286 "
-"0.47616 0.80286 1.02286 0.82127 1.18498 0.82571 0.54286 0.86150 0.34857 0.86629 "
-"0.94286 0.88371 1.14857 0.88793 0.61143 0.89580 0.86286 0.91184 0.40168 0.92286 "
-"0.70857 0.91866 0.80000 0.92134 1.09714 0.94384 0.45714 0.96436 0.53714 1.00498 "
-"1.00000 1.00371 0.93714 1.02613 0.62857 1.03252 0.73714 1.04705 0.84571 1.04395 58 0 7 1 14 5 3 5 14 "
-"9 2 8 0 1 10 3 0 8 7 "
-"8 2 11 18 13 9 17 6 12 10 1 "
-"7 4 11 2 13 18 19 23 17 12 "
-"15 6 17 4 6 15 16 9 14 11 4 "
-"15 14 3 10 19 21 20 18 9 16 "
-"30 31 29 23 27 22 25 24 20 22 27 "
-"26 21 19 18 25 20 21 23 28 27 "
-"28 23 12 29 24 25 30 29 25 31 32 "
-"37 38 33 36 37 32 39 32 31 30 "
-"35 39 32 34 33 38 39 40 44 38 46 "
-"41 38 42 46 40 39 35 44 40 49 "
-"53 43 54 43 49 40 42 38 36 43 47 "
-"54 52 41 46 41 52 45 43 53 49 "
-"54 47 57 50 57 47 45 56 48 55 45 "
-"52 48 59 51 57 50 58 50 51 58 "
-"56 45 55 58 51 59 59 48 56 "
-;
-
-char *VTK_VECTOR_TEXT_72 = (char *) "16 1.125714 "
-"0.26857 -0.07186 0.40571 -0.07186 0.98857 -0.07295 0.98286 -0.06878 1.12571 -0.06878 "
-"0.40991 0.43714 0.41714 0.44437 0.97714 0.44329 0.41714 0.57277 0.97714 0.57385 "
-"0.40991 0.58000 0.98550 1.02571 1.12571 1.02307 0.26857 1.02615 0.40571 1.02615 "
-"1.12000 1.02723 14 4 9 7 0 5 13 5 10 13 "
-"5 0 1 8 7 9 9 4 11 10 5 "
-"8 6 8 5 4 3 2 7 8 6 "
-"14 13 10 12 15 11 3 4 7 4 12 "
-"11 "
-;
-
-char *VTK_VECTOR_TEXT_73 = (char *) "4 0.428571 "
-"0.42592 -0.07143 0.28571 -0.06878 0.28836 1.02571 0.42857 1.02307 2 1 3 2 3 1 0 "
-;
-
-char *VTK_VECTOR_TEXT_74 = (char *) "27 0.790089 "
-"0.45143 -0.09009 0.50857 -0.09009 0.37714 -0.07756 0.58404 -0.07714 0.33143 -0.06086 "
-"0.64000 -0.05641 0.26489 -0.01429 0.71429 -0.00117 0.46286 0.03866 0.53714 0.04706 "
-"0.74902 0.04857 0.41714 0.04899 0.57772 0.06571 0.21143 0.06772 0.37016 0.07714 "
-"0.34498 0.11143 0.77252 0.11143 0.62371 0.11714 0.18705 0.16286 0.32462 0.17429 "
-"0.64420 0.22571 0.79009 0.23143 0.18546 0.23714 0.31472 0.25429 0.64836 1.02571 "
-"0.78857 1.02307 0.78286 1.02723 25 10 "
-"12 7 4 2 11 0 1 8 3 8 1 11 2 8 0 8 2 8 3 9 9 "
-"3 12 4 14 6 7 12 5 3 5 12 6 15 13 12 10 17 14 4 11 13 "
-"19 18 6 14 15 22 19 23 17 16 20 13 15 19 16 17 10 22 18 19 21 "
-"20 16 20 21 24 25 26 24 21 25 24 "
-;
-
-char *VTK_VECTOR_TEXT_75 = (char *) "17 1.155019 "
-"0.25714 -0.07186 0.39429 -0.07186 1.15502 -0.07143 0.97143 -0.07140 0.89527 0.28857 "
-"0.89143 0.29371 0.89098 0.29429 0.39848 0.30000 0.57714 0.47913 0.40000 0.49126 "
-"0.68956 0.56857 0.68571 0.57371 0.68527 0.57429 1.13216 1.02571 0.25714 1.02615 "
-"0.39429 1.02615 0.94857 1.02680 15 0 9 14 0 7 9 3 10 8 3 6 10 9 8 16 4 5 6 7 "
-"0 1 3 4 6 16 8 12 10 11 12 4 3 2 8 10 12 9 7 8 13 "
-"16 12 15 14 9 "
-;
-
-char *VTK_VECTOR_TEXT_76 = (char *) "7 0.941339 "
-"0.25714 -0.07186 0.93714 -0.07186 0.94134 0.04857 0.39957 0.06000 0.93714 0.05472 "
-"0.25714 1.02615 0.39429 1.02615 5 3 0 1 0 3 5 2 4 1 3 1 4 6 5 3 "
-;
-
-char *VTK_VECTOR_TEXT_77 = (char *) "19 1.302857 "
-"0.39164 -0.07143 0.71429 -0.07186 1.17143 -0.07295 0.25714 -0.06878 0.84000 -0.06947 "
-"1.16571 -0.06878 1.30286 -0.06878 0.78286 0.09751 0.78857 0.09751 1.16000 0.83018 "
-"0.40000 0.84467 0.52151 0.88286 0.52000 0.88739 0.51748 0.89429 0.47580 1.02000 "
-"0.25979 1.02571 1.11429 1.02285 1.30286 1.02307 0.46857 1.02680 17 3 10 15 5 6 9 6 "
-"5 2 1 11 10 4 8 1 1 7 11 9 16 8 1 8 7 9 8 4 10 "
-"18 15 13 11 12 10 3 0 10 13 18 16 9 17 10 11 13 13 14 18 6 "
-"17 9 "
-;
-
-char *VTK_VECTOR_TEXT_78 = (char *) "14 1.125714 "
-"0.26286 -0.07186 0.39429 -0.07186 0.98286 -0.07295 1.12571 -0.06878 0.98286 0.17231 "
-"0.72045 0.31143 0.71678 0.31714 0.72000 0.31207 0.40000 0.78092 0.99122 1.02571 "
-"1.12571 1.02307 0.26286 1.02615 0.40571 1.02644 1.12000 1.02723 12 "
-"0 8 11 8 0 1 4 3 9 3 4 "
-"2 4 5 2 6 7 5 12 6 4 "
-"4 6 5 6 12 8 10 13 9 8 12 "
-"11 3 10 9 "
-;
-
-char *VTK_VECTOR_TEXT_79 = (char *) "63 1.267054 "
-"0.70286 -0.08966 0.77714 -0.08966 0.61143 -0.07605 0.89714 -0.06823 0.97143 -0.04073 "
-"0.49143 -0.03229 1.05650 0.00857 0.42286 0.01107 0.70857 0.03605 0.77143 0.03605 "
-"0.63429 0.04899 0.84571 0.04899 1.12725 0.07143 0.35044 0.07714 0.92716 0.08286 "
-"0.54857 0.08535 0.49143 0.12704 1.17465 0.13429 1.01296 0.15143 0.28571 0.17016 "
-"0.43955 0.18571 1.21184 0.20286 0.40784 0.23714 1.08086 0.26000 1.24613 0.30000 "
-"0.23109 0.31143 1.10665 0.34571 0.36764 0.36857 0.21295 0.43143 1.11848 0.43714 "
-"1.26705 0.43714 0.36193 0.51143 1.11848 0.51714 0.21563 0.54571 0.36991 0.59143 "
-"1.25522 0.61429 1.09966 0.63714 0.23236 0.64857 1.23681 0.68857 1.07070 0.71714 "
-"0.41143 0.73016 0.26645 0.75143 1.20486 0.76857 0.45561 0.79714 1.02286 0.79270 "
-"0.98857 0.82956 0.31429 0.83650 1.16045 0.84286 0.53143 0.86150 0.92000 0.87800 "
-"0.35582 0.88857 0.63429 0.90764 0.85143 0.90613 1.10286 0.90956 0.71429 0.92134 "
-"0.79429 0.91866 0.43493 0.95714 1.04000 0.95964 0.52000 1.00498 0.96000 1.00327 "
-"0.89714 1.02613 0.63429 1.03866 0.77714 1.04705 63 0 8 2 1 9 0 8 10 2 2 10 5 9 1 11 5 "
-"16 7 11 3 14 3 11 1 3 4 14 6 14 4 7 16 13 10 15 5 0 "
-"9 8 16 5 15 14 6 18 13 20 19 12 18 6 18 17 23 17 21 23 20 "
-"22 19 18 12 17 23 21 26 25 19 22 13 16 20 25 27 28 27 25 22 21 "
-"24 26 30 29 26 32 35 36 30 26 24 33 34 37 32 29 30 28 31 33 31 "
-"28 27 34 33 31 36 38 39 35 32 30 41 37 34 38 42 39 41 40 46 35 "
-"38 36 39 47 44 40 43 46 53 45 44 46 43 50 45 57 49 40 41 34 56 "
-"50 43 49 59 52 48 56 43 57 45 53 53 44 47 56 48 58 39 42 47 58 "
-"51 61 59 49 57 51 58 48 55 52 60 62 54 55 59 60 52 61 54 62 54 "
-"61 51 62 55 60 "
-;
-
-char *VTK_VECTOR_TEXT_80 = (char *) "31 1.098661 "
-"0.26286 -0.07186 0.40000 -0.07186 0.40420 0.36857 0.41143 0.37580 0.73714 0.37621 "
-"0.88571 0.40034 0.98343 0.44857 0.41143 0.50420 0.72571 0.50420 0.40420 0.51143 "
-"1.04045 0.51143 0.82947 0.52286 0.88571 0.55296 0.91678 0.58571 1.08252 0.59714 "
-"0.93966 0.63143 1.09866 0.68286 0.94966 0.72857 0.93355 0.79143 1.08530 0.80857 "
-"0.90857 0.83270 0.86857 0.86893 1.05927 0.87143 0.40528 0.89429 0.82286 0.88899 "
-"0.74857 0.89807 1.02439 0.92286 0.96000 0.97641 0.89143 1.00538 0.26286 1.02615 "
-"0.74286 1.02680 31 0 9 29 0 2 9 2 7 9 7 3 8 12 11 5 5 11 4 4 "
-"8 3 3 7 2 2 0 1 11 8 4 13 12 6 10 13 6 6 12 5 14 "
-"15 10 15 14 17 13 10 15 16 17 14 17 19 18 19 17 16 18 19 20 20 "
-"27 21 22 20 19 9 23 29 30 25 24 25 30 23 27 20 26 20 22 26 28 "
-"24 21 28 21 27 30 29 23 30 24 28 "
-;
-
-char *VTK_VECTOR_TEXT_81 = (char *) "66 1.276398 "
-"1.23429 -0.15444 1.13714 -0.11188 0.76571 -0.09009 0.64571 -0.08437 0.84000 -0.08034 "
-"0.58286 -0.07034 1.27640 -0.06000 0.93143 -0.05470 0.46857 -0.02322 1.00000 -0.02293 "
-"0.38857 0.03330 0.76000 0.03563 0.68000 0.03866 0.83547 0.04857 1.09814 0.04857 "
-"0.61714 0.05177 0.87591 0.06571 0.55429 0.07800 0.80000 0.10784 0.49143 0.12132 "
-"0.30857 0.12350 0.74115 0.12857 0.98286 0.13189 1.17355 0.14571 0.42857 0.19207 "
-"0.86857 0.19927 0.26286 0.20486 1.05355 0.22000 0.77714 0.23134 0.39277 0.26000 "
-"1.23177 0.27714 0.23387 0.28286 1.08823 0.30571 0.36420 0.36286 0.20991 0.40286 "
-"0.35580 0.43714 1.25866 0.43714 1.11009 0.44286 0.20723 0.51714 1.25252 0.58000 "
-"0.36420 0.59714 1.09823 0.60857 0.23470 0.67714 0.38857 0.68947 1.21184 0.73429 "
-"1.05143 0.73841 0.42902 0.76857 0.28821 0.80286 1.00571 0.80413 1.17188 0.81429 "
-"0.96000 0.84670 0.51429 0.85473 0.34473 0.88286 1.12000 0.88413 0.57714 0.89070 "
-"0.88571 0.89070 0.64571 0.91252 0.76571 0.92093 0.42857 0.95759 1.03429 0.95864 "
-"0.50286 0.99927 0.96571 0.99800 0.60000 1.03252 0.86857 1.03184 0.69714 1.04705 "
-"0.77143 1.04665 66 0 6 1 "
-"13 7 16 14 9 1 9 16 7 3 15 "
-"5 16 9 14 11 4 13 11 2 4 "
-"7 13 4 12 3 11 2 11 3 15 3 "
-"12 5 17 8 8 19 10 10 19 20 "
-"14 1 6 5 15 17 20 29 26 19 8 "
-"17 21 18 28 22 16 14 16 25 18 "
-"22 14 27 24 20 19 16 22 25 26 29 "
-"31 18 25 28 14 23 27 27 30 32 "
-"30 27 23 31 33 34 20 24 29 37 32 "
-"30 33 31 29 34 33 38 36 37 30 "
-"35 38 33 37 39 41 38 40 42 37 36 "
-"39 41 44 45 40 38 35 42 43 47 "
-"44 41 39 46 47 43 43 42 40 47 46 "
-"52 45 49 48 59 50 48 52 51 58 "
-"53 48 49 61 50 59 50 61 55 58 51 "
-"60 51 52 46 49 45 44 59 48 53 "
-"57 64 56 60 54 62 55 63 57 51 54 "
-"60 54 56 62 62 56 64 63 55 61 "
-"63 65 57 57 65 64 "
-;
-
-char *VTK_VECTOR_TEXT_82 = (char *) "46 1.225355 "
-"0.26857 -0.07186 0.40571 -0.07186 1.05143 -0.07215 1.22359 -0.07143 1.22535 -0.06571 "
-"1.17465 0.01429 1.17143 0.01936 1.17098 0.02000 0.84571 0.24343 1.00571 0.27650 "
-"0.76571 0.34698 0.91832 0.37429 0.73143 0.37678 0.40991 0.40857 0.68000 0.40437 "
-"0.41714 0.41580 0.62286 0.41538 0.84226 0.42571 0.92571 0.44706 0.99429 0.47502 "
-"1.07582 0.54000 0.41714 0.54420 0.40991 0.55143 0.80000 0.54764 0.88000 0.56538 "
-"1.11641 0.60286 0.94286 0.60439 0.96784 0.63714 1.13823 0.67714 0.98966 0.69429 "
-"0.99277 0.74571 1.14134 0.75143 0.97143 0.81493 1.12823 0.82000 0.93143 0.86115 "
-"1.10498 0.87714 0.89143 0.88498 0.40991 0.90000 0.41714 0.90723 0.78857 0.90723 "
-"1.07011 0.92857 1.01714 0.97579 0.97143 0.99865 0.87429 1.02109 0.26857 1.02615 "
-"0.80571 1.02723 46 2 9 8 3 5 2 0 37 "
-"44 5 7 2 5 6 7 3 4 5 "
-"2 7 9 18 23 17 11 8 9 8 11 "
-"10 0 22 37 11 17 10 21 16 23 "
-"21 15 16 23 10 17 19 24 18 23 18 "
-"24 23 12 10 15 21 13 0 21 22 "
-"16 14 23 23 14 12 20 26 19 26 20 "
-"27 24 19 26 27 25 29 28 30 29 "
-"31 30 28 25 27 20 30 33 32 28 29 "
-"25 33 30 31 32 40 34 35 32 33 "
-"0 1 13 0 13 21 41 34 40 43 36 "
-"42 38 39 45 32 35 40 42 34 41 "
-"34 42 36 36 43 39 44 38 45 43 45 "
-"39 37 38 44 "
-;
-
-char *VTK_VECTOR_TEXT_83 = (char *) "69 1.081090 "
-"0.71429 -0.08966 0.53714 -0.07866 0.82286 -0.07101 0.46286 -0.05959 0.38857 -0.02616 "
-"0.94286 -0.01678 0.33714 0.01044 0.64000 0.03866 0.73143 0.04177 1.00571 0.03883 "
-"0.56000 0.05177 0.28527 0.06571 0.50857 0.06930 0.83587 0.07143 1.04086 0.08857 "
-"0.88127 0.10000 0.43429 0.11330 0.24486 0.13429 0.92613 0.15714 1.07177 0.16286 "
-"0.38771 0.16857 0.94134 0.21429 0.36319 0.22571 0.21563 0.23714 1.08109 0.26571 "
-"0.21403 0.27714 0.93294 0.27714 0.34857 0.28916 0.91011 0.31714 1.06816 0.32857 "
-"0.84000 0.36943 1.04486 0.38000 0.76571 0.39673 0.98286 0.45241 0.53143 0.45748 "
-"0.42857 0.49343 0.92571 0.49070 0.37143 0.52535 0.82857 0.53109 0.31044 0.58000 "
-"0.53143 0.60899 0.43429 0.65616 0.26244 0.67143 0.39891 0.71143 0.90857 0.71084 "
-"0.25295 0.72286 1.04615 0.72286 0.39320 0.76857 0.40359 0.80857 1.03109 0.81429 "
-"0.26327 0.82000 0.87429 0.81493 0.45143 0.86956 0.82286 0.87258 0.28930 0.88286 "
-"0.98812 0.90000 0.50857 0.90041 0.76571 0.90151 0.57714 0.91563 0.67429 0.91866 "
-"0.95443 0.94000 0.35429 0.96099 0.89143 0.98784 0.40000 0.99188 0.83429 1.01470 "
-"0.50286 1.03184 0.74857 1.03823 0.57143 1.04437 0.67429 1.04705 67 2 "
-"8 0 0 7 1 6 4 16 6 16 11 0 8 7 7 10 1 8 2 13 5 "
-"15 13 1 10 3 10 12 3 9 15 5 4 3 12 15 14 18 5 13 2 14 "
-"15 9 16 4 12 21 24 26 18 19 21 11 20 17 20 11 16 17 22 23 19 "
-"18 14 22 17 20 25 23 27 23 22 27 24 21 19 26 31 28 28 33 30 24 "
-"29 26 30 38 32 26 29 31 34 32 38 33 28 31 34 40 35 33 36 30 39 "
-"43 42 38 30 36 41 37 35 40 34 38 37 41 39 41 35 40 50 48 54 39 "
-"41 43 44 46 49 45 42 43 45 47 50 48 50 47 60 51 55 47 45 43 51 "
-"60 53 54 48 61 44 49 51 55 51 49 48 52 61 56 63 52 57 66 59 61 "
-"52 63 63 56 65 62 53 60 53 64 57 53 62 64 59 66 58 65 58 67 58 "
-"65 56 66 57 64 67 58 68 68 58 66 "
-;
-
-char *VTK_VECTOR_TEXT_84 = (char *) "8 1.045714 "
-"0.54286 -0.07186 0.68000 -0.07186 0.53757 0.89429 0.68528 0.89429 0.17714 0.90265 "
-"1.04571 0.90265 0.17979 1.02571 1.04571 1.02307 6 0 3 2 3 0 "
-"1 6 4 2 6 3 7 6 2 3 "
-"3 5 7 "
-;
-
-char *VTK_VECTOR_TEXT_85 = (char *) "32 1.126804 "
-"0.65714 -0.09009 0.77143 -0.08705 0.53143 -0.07034 0.85714 -0.07101 0.47429 -0.05070 "
-"0.94286 -0.03629 0.38286 0.00704 1.02286 0.02445 0.65714 0.04437 0.78857 0.05320 "
-"0.33669 0.06000 0.58286 0.05748 0.84000 0.06823 0.52000 0.08535 1.07070 0.08857 "
-"0.89714 0.10154 0.46857 0.13025 1.09966 0.15714 0.29143 0.15866 0.94899 0.17429 "
-"0.43177 0.19714 0.27320 0.24286 0.97252 0.26000 1.12680 0.33429 0.26437 0.34000 "
-"0.40991 0.34000 0.98134 0.34571 0.98550 1.02571 1.12571 1.02307 0.26857 1.02615 "
-"0.40571 1.02615 1.12000 1.02723 30 3 9 1 10 20 18 8 0 "
-"1 0 11 2 7 15 5 0 8 11 "
-"8 1 9 9 3 12 13 4 2 5 12 "
-"3 15 7 19 16 10 6 12 5 15 "
-"4 13 6 13 2 11 21 18 20 13 16 "
-"6 19 17 22 17 19 14 7 14 19 "
-"10 16 20 25 24 21 23 26 22 23 22 "
-"17 25 21 20 24 25 29 30 29 25 "
-"28 31 27 26 23 27 23 28 27 "
-;
-
-char *VTK_VECTOR_TEXT_86 = (char *) "8 1.148571 "
-"0.57714 -0.07025 0.72571 -0.06947 0.64571 0.06079 0.65143 0.06062 0.15429 1.02560 "
-"0.30286 1.02531 1.00571 1.02531 1.14857 1.02560 6 0 2 4 3 2 "
-"0 3 7 6 1 3 0 3 1 7 "
-"2 5 4 "
-;
-
-char *VTK_VECTOR_TEXT_87 = (char *) "14 1.568063 "
-"0.45143 -0.07186 0.60000 -0.07017 1.13143 -0.06912 1.27429 -0.06912 0.52571 0.09707 "
-"1.20000 0.09787 1.13673 0.38000 0.86857 0.88103 0.16571 1.02562 0.78286 1.02446 "
-"1.42857 1.02446 1.56806 1.02571 0.30857 1.02615 0.95429 1.02615 12 "
-"2 6 7 6 2 5 1 4 0 7 9 "
-"4 11 10 5 3 5 2 8 0 4 "
-"13 7 6 9 7 13 7 4 1 11 5 "
-"3 12 8 4 "
-;
-
-char *VTK_VECTOR_TEXT_88 = (char *) "14 1.141168 "
-"0.15194 -0.07143 1.14117 -0.07143 0.32000 -0.07106 0.97143 -0.07140 0.65143 0.37795 "
-"0.74607 0.49429 0.56517 0.50000 0.74286 0.49909 0.74219 0.50000 0.65714 0.61727 "
-"0.20016 1.02571 0.96000 1.02568 1.11260 1.02571 0.36571 1.02644 12 "
-"0 2 6 3 5 4 5 6 4 5 8 "
-"6 5 3 1 5 7 8 4 6 2 "
-"9 6 8 12 11 8 6 13 10 13 6 "
-"9 11 9 8 "
-;
-
-char *VTK_VECTOR_TEXT_89 = (char *) "12 1.145205 "
-"0.71164 -0.07143 0.57143 -0.06878 0.56891 0.39143 0.71787 0.39714 0.65143 0.51441 "
-"0.43179 0.85429 0.42857 0.85936 0.42812 0.86000 0.15284 1.02571 0.32000 1.02535 "
-"0.98286 1.02464 1.14521 1.02571 10 3 2 "
-"1 3 1 0 4 2 3 2 9 8 "
-"11 10 4 5 2 4 5 6 7 2 7 "
-"9 2 5 7 11 4 3 "
-;
-
-char *VTK_VECTOR_TEXT_90 = (char *) "11 1.040000 "
-"0.17714 -0.07186 1.04000 -0.06878 1.04000 0.05164 0.17395 0.06000 0.34602 0.06000 "
-"0.84777 0.89429 0.24000 0.89957 1.02395 0.90000 0.23580 1.02000 1.02286 1.02307 "
-"0.24000 1.02615 9 0 4 3 1 4 0 1 2 4 3 4 5 5 "
-"7 9 4 7 5 5 10 6 10 5 9 6 10 8 "
-;
-
-char *VTK_VECTOR_TEXT_91 = (char *) "8 0.541339 "
-"0.24528 -0.37429 0.54025 -0.37429 0.54025 -0.27143 0.38227 -0.26571 0.38286 0.91454 "
-"0.54134 0.92286 0.24836 1.02571 0.53714 1.02615 6 0 4 6 3 1 "
-"2 1 3 0 0 3 4 5 7 4 "
-"6 4 7 "
-;
-
-char *VTK_VECTOR_TEXT_92 = (char *) "5 0.564685 "
-"0.46286 -0.09182 0.56000 -0.09256 0.56469 -0.08857 0.14713 1.04286 0.24571 1.04358 3 0 4 3 0 2 4 0 "
-"1 2 "
-;
-
-char *VTK_VECTOR_TEXT_93 = (char *) "9 0.465968 "
-"0.17100 -0.37429 0.46597 -0.37429 0.17100 -0.27143 0.32571 -0.26723 0.33295 -0.26000 "
-"0.33143 0.91201 0.17143 0.91979 0.16991 1.02000 0.46286 1.02615 7 2 0 3 1 "
-"3 0 1 4 3 5 4 1 7 6 8 5 8 6 8 5 1 "
-;
-
-char *VTK_VECTOR_TEXT_94 = (char *) "11 0.817005 "
-"0.18389 0.44857 0.18857 0.44458 0.32000 0.44686 0.68571 0.44746 0.81143 0.44445 "
-"0.81700 0.44857 0.49714 0.88224 0.50286 0.88224 0.44571 1.04090 0.55429 1.04168 "
-"0.45143 1.04437 9 0 2 6 0 6 8 7 3 5 4 5 3 2 "
-"0 1 10 7 9 10 8 6 10 6 7 9 7 5 "
-;
-
-char *VTK_VECTOR_TEXT_95 = (char *) "4 1.011860 "
-"0.11957 -0.37429 1.01186 -0.37429 0.11957 -0.28857 1.01186 -0.28857 2 2 1 3 2 0 1 "
-;
-
-char *VTK_VECTOR_TEXT_96 = (char *) "11 0.486571 "
-"0.38857 0.82420 0.48000 0.82420 0.48403 0.82571 0.37714 0.82989 0.38286 0.82575 "
-"0.48657 0.83143 0.21296 1.02571 0.38771 1.02571 0.21412 1.03143 0.38286 1.03106 "
-"0.37714 1.03295 9 5 1 2 0 3 4 3 10 6 0 1 5 7 "
-"3 0 8 6 10 7 0 5 3 7 10 10 7 9 "
-;
-
-char *VTK_VECTOR_TEXT_97 = (char *) "70 0.929303 "
-"0.44000 -0.09009 0.50286 -0.08966 0.36571 -0.07756 0.57143 -0.07907 0.92716 -0.07143 "
-"0.79429 -0.07106 0.92930 -0.06571 0.62857 -0.06151 0.30857 -0.05514 0.27429 -0.03258 "
-"0.68000 -0.03629 0.90748 -0.00857 0.48000 0.01580 0.53143 0.01621 0.42768 0.02571 "
-"0.76571 0.02129 0.22073 0.03143 0.61804 0.03714 0.89866 0.03714 0.37130 0.06000 "
-"0.20613 0.06571 0.68000 0.07330 0.34538 0.10000 0.71429 0.10809 0.19580 0.11714 "
-"0.89295 0.13429 0.33907 0.15714 0.74538 0.16857 0.20319 0.19714 0.36000 0.20914 "
-"0.75580 0.22000 0.40000 0.24371 0.22812 0.25429 0.44571 0.26041 0.66286 0.29891 "
-"0.28000 0.31258 0.75848 0.31714 0.75429 0.32399 0.33714 0.34657 0.38857 0.36538 "
-"0.68571 0.41320 0.75772 0.43714 0.35289 0.48286 0.22093 0.50000 0.22857 0.49470 "
-"0.89252 0.50571 0.75580 0.51143 0.22857 0.53547 0.37800 0.54571 0.74286 0.55301 "
-"0.88680 0.56286 0.71429 0.58893 0.41714 0.59330 0.42228 0.59714 0.25800 0.60286 "
-"0.42286 0.59759 0.65143 0.61959 0.48000 0.62193 0.86498 0.62571 0.53143 0.62950 "
-"0.59429 0.62950 0.28187 0.63714 0.84571 0.65486 0.33714 0.68436 0.80571 0.69007 "
-"0.37915 0.70571 0.72571 0.72538 0.45714 0.72966 0.54286 0.74152 0.62286 0.74152 70 "
-"3 13 1 5 4 15 4 11 15 19 8 "
-"2 13 3 7 13 0 1 14 0 12 "
-"20 22 24 0 14 2 12 0 13 13 7 "
-"17 11 4 6 19 2 14 17 10 21 "
-"7 10 17 11 18 15 16 22 20 8 19 "
-"9 15 23 21 15 21 10 23 25 27 "
-"9 19 16 19 22 16 23 15 25 24 26 "
-"28 27 25 30 25 15 18 30 25 36 "
-"32 28 26 26 24 22 29 32 26 39 38 "
-"31 38 35 29 32 29 35 31 38 29 "
-"39 34 40 33 39 31 39 33 34 36 41 "
-"37 40 37 41 37 40 34 41 36 25 "
-"41 45 46 43 44 47 47 48 54 48 47 "
-"44 50 49 46 41 25 45 50 46 45 "
-"42 48 44 49 64 51 52 53 55 52 65 "
-"63 65 52 55 52 61 48 52 63 61 "
-"58 49 50 49 58 62 69 60 56 49 62 "
-"64 54 48 61 57 67 65 57 65 55 "
-"51 66 56 69 59 60 66 51 64 68 67 "
-"57 59 69 57 69 68 57 69 56 66 "
-;
-
-char *VTK_VECTOR_TEXT_98 = (char *) "49 0.932518 "
-"0.61143 -0.09009 0.50286 -0.07823 0.36000 -0.07186 0.24000 -0.06878 0.72000 -0.06213 "
-"0.45714 -0.05914 0.77143 -0.03188 0.36571 0.01806 0.59429 0.02193 0.83543 0.02571 "
-"0.52000 0.02823 0.66857 0.04645 0.46857 0.05179 0.42704 0.08857 0.72956 0.10000 "
-"0.88784 0.10571 0.39216 0.14000 0.75641 0.14000 0.91470 0.18000 0.37462 0.19143 "
-"0.78665 0.23714 0.36152 0.28857 0.93252 0.29429 0.79236 0.36857 0.93252 0.37429 "
-"0.36420 0.38000 0.77294 0.47714 0.39216 0.50000 0.90899 0.50000 0.42473 0.55143 "
-"0.73143 0.55546 0.88657 0.55714 0.45883 0.58571 0.67429 0.60498 0.50857 0.61641 "
-"0.63429 0.62252 0.56571 0.62991 0.37714 0.64118 0.83429 0.63841 0.37315 0.64857 "
-"0.80571 0.66686 0.74286 0.70784 0.46857 0.71355 0.68571 0.72899 0.56571 0.74109 "
-"0.61714 0.74152 0.24265 1.02571 0.37143 1.02307 0.36571 1.02723 49 3 25 46 5 1 10 5 12 7 8 0 4 11 6 14 11 "
-"4 6 0 8 1 2 7 3 8 4 11 10 1 8 21 3 19 12 13 7 12 "
-"5 10 14 9 17 9 14 6 17 15 20 16 7 13 15 18 20 15 17 9 3 "
-"7 19 22 20 18 20 22 23 28 26 23 22 24 23 25 3 21 30 43 33 39 "
-"46 25 28 23 24 27 39 25 26 31 30 7 16 19 31 26 28 37 32 42 39 "
-"27 37 40 30 38 29 37 27 38 30 31 35 33 43 32 34 42 35 45 36 37 "
-"29 32 42 34 36 45 35 43 43 30 41 41 30 40 36 45 44 42 36 44 47 "
-"48 46 39 47 46 "
-;
-
-char *VTK_VECTOR_TEXT_99 = (char *) "58 0.894057 "
-"0.53143 -0.08966 0.59429 -0.08966 0.45714 -0.07673 0.68000 -0.07294 0.72571 -0.05343 "
-"0.37714 -0.04331 0.33714 -0.01543 0.78857 -0.01011 0.58286 0.02152 0.29143 0.03016 "
-"0.49625 0.03143 0.62857 0.03034 0.83107 0.03714 0.45714 0.04943 0.69270 0.06571 "
-"0.26241 0.07143 0.85714 0.07873 0.40457 0.09429 0.72722 0.10571 0.37629 0.14000 "
-"0.74437 0.14000 0.22899 0.14571 0.37184 0.15143 0.36930 0.15714 0.88571 0.15295 "
-"0.89406 0.19714 0.76571 0.21540 0.21034 0.22571 0.34705 0.25429 0.20420 0.36286 "
-"0.34478 0.36857 0.21673 0.45429 0.36252 0.47143 0.75429 0.47269 0.88058 0.48857 "
-"0.88319 0.49429 0.38371 0.52286 0.23849 0.52857 0.72000 0.55200 0.86437 0.55714 "
-"0.43025 0.58000 0.69714 0.58127 0.28527 0.61429 0.47429 0.60943 0.48571 0.61387 "
-"0.83473 0.61429 0.49143 0.61641 0.63429 0.62041 0.54857 0.62950 0.58857 0.62991 "
-"0.81296 0.64286 0.32168 0.65429 0.35429 0.67964 0.76571 0.68535 0.44571 0.72327 "
-"0.67429 0.72816 0.53714 0.74109 0.60000 0.74109 56 2 13 5 0 8 2 11 4 14 "
-"1 8 0 3 11 1 15 23 21 2 10 "
-"13 11 8 1 11 3 4 7 14 4 "
-"10 2 8 14 7 18 17 6 13 6 5 "
-"13 17 15 9 18 12 20 7 12 18 "
-"17 9 6 16 20 12 24 20 16 19 15 "
-"17 15 19 23 23 19 22 27 28 29 "
-"26 20 24 26 24 25 21 28 27 28 21 "
-"23 29 30 31 28 30 29 31 32 37 "
-"39 38 33 34 39 33 32 31 30 37 32 "
-"36 55 49 47 37 36 42 51 42 36 "
-"34 35 39 45 41 38 52 40 43 46 43 "
-"44 50 41 45 56 49 57 40 51 36 "
-"51 40 52 45 38 39 52 43 54 47 41 "
-"53 54 46 48 56 48 49 53 41 50 "
-"54 48 56 54 43 46 57 49 55 55 47 "
-"53 "
-;
-
-char *VTK_VECTOR_TEXT_100 = (char *) "48 0.885714 "
-"0.51429 -0.09009 0.56571 -0.08966 0.62857 -0.07673 0.76571 -0.07186 0.88571 -0.06878 "
-"0.41143 -0.06486 0.67429 -0.05641 0.36000 -0.03669 0.30286 0.01025 0.76000 0.01806 "
-"0.53714 0.02152 0.49714 0.02891 0.60571 0.02891 0.68127 0.07143 0.41714 0.07561 "
-"0.23787 0.10571 0.71579 0.11143 0.38241 0.11714 0.74135 0.16286 0.21395 0.16857 "
-"0.74286 0.16739 0.74538 0.17429 0.34605 0.20286 0.76420 0.27714 0.19277 0.28857 "
-"0.33295 0.28857 0.19277 0.36286 0.76152 0.38571 0.33563 0.39714 0.73355 0.50000 "
-"0.22135 0.51143 0.36784 0.51714 0.69714 0.55841 0.42286 0.58686 0.26857 0.60793 "
-"0.63429 0.60943 0.48571 0.62151 0.56571 0.62950 0.74857 0.64048 0.75269 0.64857 "
-"0.30857 0.65582 0.65714 0.71355 0.40571 0.71756 0.50286 0.74109 0.55429 0.74152 "
-"0.75693 1.02571 0.88571 1.02307 0.88000 1.02723 48 0 11 5 12 6 13 "
-"1 2 12 7 14 8 10 0 1 14 7 "
-"5 10 1 12 6 12 2 0 10 11 "
-"8 17 15 9 16 13 14 5 11 4 9 "
-"3 6 9 13 9 4 18 16 9 18 "
-"15 22 19 17 8 14 22 15 17 20 18 "
-"21 21 18 4 19 25 24 21 4 23 "
-"25 19 22 26 24 25 26 28 30 39 27 "
-"4 26 25 28 39 38 29 29 38 32 "
-"27 39 29 30 31 34 32 38 35 31 30 "
-"28 40 34 31 36 42 33 23 4 27 "
-"35 41 37 33 40 31 40 33 42 41 35 "
-"38 42 36 43 37 43 36 44 37 41 "
-"37 44 43 46 47 45 39 4 45 4 46 "
-"45 "
-;
-
-char *VTK_VECTOR_TEXT_101 = (char *) "65 0.934539 "
-"0.54857 -0.09009 0.61143 -0.09009 0.45714 -0.07462 0.71429 -0.07101 0.40571 -0.05641 "
-"0.77714 -0.04331 0.33714 -0.01543 0.82857 -0.00670 0.29714 0.02154 0.56000 0.02152 "
-"0.60571 0.02193 0.49714 0.03563 0.68159 0.04286 0.88150 0.05429 0.45714 0.05514 "
-"0.26286 0.06636 0.72000 0.06759 0.40457 0.10000 0.91216 0.11143 0.77229 0.13429 "
-"0.37057 0.15143 0.22034 0.15714 0.36613 0.16286 0.92834 0.16286 0.36359 0.16857 "
-"0.91429 0.16966 0.79429 0.18111 0.35177 0.20286 0.20462 0.22571 0.33866 0.28286 "
-"0.34286 0.28900 0.93454 0.29429 0.19848 0.35714 0.93295 0.39714 0.34857 0.40134 "
-"0.78857 0.40134 0.34134 0.40857 0.79580 0.40857 0.20462 0.41429 0.35429 0.47261 "
-"0.22327 0.49429 0.91429 0.48975 0.77143 0.50661 0.38857 0.54057 0.74857 0.54629 "
-"0.40725 0.56286 0.25714 0.57001 0.71429 0.58154 0.87070 0.58571 0.45143 0.59759 "
-"0.68000 0.60498 0.29296 0.62000 0.49143 0.61681 0.63429 0.62252 0.54857 0.62950 "
-"0.59429 0.62991 0.33311 0.66000 0.81143 0.65543 0.77143 0.68607 0.41143 0.70930 "
-"0.72000 0.71355 0.45714 0.72605 0.66857 0.73050 0.54286 0.74152 0.60000 0.74152 65 0 9 11 10 "
-"1 3 10 3 12 5 12 3 17 8 6 10 0 1 0 11 2 4 14 6 0 "
-"10 9 7 16 5 5 16 12 14 2 11 16 7 19 14 4 2 15 8 17 26 "
-"18 25 17 6 14 15 27 21 7 13 19 23 25 18 20 15 17 26 19 18 18 "
-"19 13 24 20 22 15 20 24 15 24 27 21 27 28 28 29 32 33 37 35 29 "
-"28 27 32 29 38 35 34 30 40 39 46 33 35 30 31 33 30 36 38 29 36 "
-"29 34 37 41 42 40 38 36 30 34 29 39 40 36 41 37 33 46 43 51 51 "
-"49 56 42 48 44 48 42 41 44 48 47 49 51 45 43 46 39 56 49 59 50 "
-"62 53 57 47 48 64 55 53 45 51 43 55 63 54 58 47 57 62 50 60 59 "
-"52 61 59 49 52 47 60 50 61 54 63 60 47 58 61 52 54 64 53 62 55 "
-"64 63 "
-;
-
-char *VTK_VECTOR_TEXT_102 = (char *) "24 0.617143 "
-"0.28000 -0.07186 0.40571 -0.07186 0.27472 0.61429 0.41100 0.61429 0.16571 0.61957 "
-"0.56000 0.61957 0.56420 0.71714 0.16571 0.72329 0.27472 0.72857 0.41100 0.72857 "
-"0.56000 0.72329 0.41034 0.83143 0.27580 0.86000 0.43429 0.89555 0.28613 0.91714 "
-"0.46286 0.91294 0.50286 0.92134 0.60000 0.91830 0.31107 0.96857 0.34286 1.00099 "
-"0.38857 1.02784 0.61714 1.03086 0.46286 1.04395 0.52571 1.04437 22 0 3 2 "
-"3 0 1 4 8 7 9 3 5 2 3 "
-"8 5 6 10 4 2 8 9 8 3 "
-"8 11 12 11 8 9 12 11 14 9 5 "
-"10 13 19 18 13 18 14 13 14 11 "
-"23 15 16 15 23 22 21 23 17 15 20 "
-"13 19 13 20 20 15 22 23 16 17 "
-;
-
-char *VTK_VECTOR_TEXT_103 = (char *) "71 0.892518 "
-"0.46857 -0.39295 0.56571 -0.39563 0.66286 -0.37959 0.35429 -0.36200 0.74286 -0.34616 "
-"0.28571 -0.31868 0.80368 -0.30000 0.50857 -0.28437 0.62286 -0.27395 0.44571 -0.27101 "
-"0.23387 -0.24286 0.84657 -0.24286 0.69200 -0.23714 0.38171 -0.23143 0.72150 -0.20286 "
-"0.87177 -0.18000 0.34916 -0.15714 0.74899 -0.14000 0.22286 -0.13957 0.50857 -0.07295 "
-"0.56000 -0.07295 0.43429 -0.05959 0.65143 -0.05070 0.37143 -0.03355 0.69714 -0.02527 "
-"0.89252 -0.00857 0.74857 0.01873 0.75042 0.02000 0.75756 0.02000 0.75429 0.02333 "
-"0.29143 0.03381 0.53143 0.03866 0.57143 0.03907 0.47429 0.05216 0.64000 0.05787 "
-"0.41714 0.08704 0.68000 0.08439 0.23216 0.12857 0.38036 0.12857 0.72784 0.14000 "
-"0.35277 0.18571 0.20530 0.20857 0.75538 0.20857 0.19320 0.28286 0.33295 0.29429 "
-"0.76991 0.35714 0.19277 0.37429 0.33563 0.40857 0.75109 0.47143 0.35109 0.47714 "
-"0.21143 0.47832 0.72784 0.52286 0.23787 0.55143 0.39044 0.55143 0.69868 0.56286 "
-"0.66286 0.59393 0.27107 0.60857 0.45143 0.60498 0.48571 0.62041 0.56571 0.62991 "
-"0.57714 0.62764 0.58286 0.62723 0.76571 0.63477 0.32000 0.66384 0.68571 0.70213 "
-"0.39429 0.71229 0.77408 0.72286 0.88878 0.72286 0.62857 0.72816 0.46857 0.73580 "
-"0.56000 0.74152 71 1 7 0 8 4 12 2 8 1 0 "
-"9 3 7 1 8 5 13 10 9 0 7 13 5 3 8 2 4 6 14 12 6 "
-"12 4 11 15 17 11 14 6 13 3 9 14 11 17 10 16 18 16 10 13 17 "
-"25 28 23 21 33 22 32 20 32 19 20 35 23 33 19 31 21 23 35 30 31 "
-"19 32 32 22 34 26 29 36 17 15 25 33 21 31 26 36 24 24 34 22 26 "
-"27 29 36 34 24 36 29 39 30 38 37 39 28 25 39 29 28 37 40 41 38 "
-"40 37 30 35 38 39 25 42 44 46 43 44 43 41 44 41 40 42 25 45 67 "
-"51 48 46 47 50 67 48 45 47 46 44 50 49 52 49 50 47 67 62 51 62 "
-"54 51 56 52 49 54 62 55 55 64 61 60 61 59 53 56 49 56 53 63 63 "
-"57 65 65 58 69 65 57 58 70 59 61 59 69 58 64 55 62 67 45 25 67 "
-"66 62 63 53 57 68 70 61 59 70 69 64 68 61 "
-;
-
-char *VTK_VECTOR_TEXT_104 = (char *) "27 0.889502 "
-"0.24571 -0.07186 0.37143 -0.07186 0.76000 -0.07186 0.88571 -0.07186 0.37605 0.40286 "
-"0.37756 0.40857 0.75538 0.46000 0.88950 0.47714 0.38899 0.48286 0.74538 0.51714 "
-"0.88152 0.54571 0.42439 0.55143 0.72000 0.56914 0.47429 0.59355 0.68000 0.60331 "
-"0.85996 0.61429 0.53143 0.61748 0.61143 0.62379 0.37714 0.63983 0.81714 0.67296 "
-"0.45714 0.70045 0.77714 0.70213 0.50857 0.72437 0.68571 0.73538 0.58857 0.74152 "
-"0.24571 1.02615 0.37143 1.02615 25 0 "
-"4 25 4 18 25 6 2 3 9 6 7 7 6 3 18 8 11 18 11 13 9 "
-"15 12 12 19 14 10 9 7 18 13 20 8 4 5 15 9 10 4 0 1 18 "
-"4 8 17 24 16 19 21 14 14 23 17 20 16 22 16 20 13 19 12 15 17 "
-"23 24 23 14 21 24 22 16 18 26 25 "
-;
-
-char *VTK_VECTOR_TEXT_105 = (char *) "8 0.377143 "
-"0.25143 -0.07186 0.37714 -0.07186 0.25143 0.72329 0.37714 0.72329 0.25143 0.87403 "
-"0.37714 0.87403 0.25143 1.02615 0.37714 1.02615 4 3 2 0 3 0 "
-"1 4 5 6 7 6 5 "
-;
-
-char *VTK_VECTOR_TEXT_106 = (char *) "18 0.375625 "
-"0.14857 -0.39563 0.22286 -0.39252 0.07383 -0.38000 0.26857 -0.37914 0.31429 -0.34989 "
-"0.34036 -0.31714 0.18857 -0.27462 0.10286 -0.26950 0.36109 -0.26571 0.22331 -0.24857 "
-"0.37563 -0.16857 0.24152 -0.16286 0.24571 0.72329 0.37143 0.72329 0.24571 0.87403 "
-"0.37143 0.87403 0.24571 1.02615 0.37143 1.02615 14 1 6 0 3 6 1 4 6 "
-"3 9 10 11 7 0 6 7 2 0 "
-"9 5 8 5 9 4 6 4 9 9 8 "
-"10 11 10 12 13 12 10 14 15 16 "
-"17 16 15 "
-;
-
-char *VTK_VECTOR_TEXT_107 = (char *) "15 0.897876 "
-"0.37450 -0.07143 0.89788 -0.07143 0.24571 -0.06878 0.73714 -0.07035 0.38004 0.24286 "
-"0.68421 0.25429 0.68045 0.26000 0.68000 0.26064 0.46857 0.32924 0.38286 0.40888 "
-"0.57152 0.42571 0.69714 0.72283 0.86359 0.72286 0.24836 1.02571 0.37714 1.02307 13 2 9 13 4 2 0 5 8 3 5 "
-"3 1 5 6 7 9 14 13 11 9 10 5 7 8 7 10 8 8 9 4 12 "
-"11 10 9 8 10 2 4 9 "
-;
-
-char *VTK_VECTOR_TEXT_108 = (char *) "4 0.371429 "
-"0.36878 -0.07143 0.24000 -0.06878 0.24265 1.02571 0.37143 1.02307 2 1 3 2 3 1 0 "
-;
-
-char *VTK_VECTOR_TEXT_109 = (char *) "45 1.318074 "
-"0.24571 -0.07186 0.37143 -0.07186 0.72000 -0.07295 1.18857 -0.07186 1.31429 -0.07186 "
-"0.71429 -0.06878 0.84571 -0.06878 0.37866 0.37429 0.84723 0.40286 0.85335 0.46000 "
-"0.39109 0.48286 0.71277 0.48286 1.18437 0.48286 1.31807 0.52286 0.87787 0.53429 "
-"0.41143 0.53493 1.17395 0.54000 0.43582 0.56857 0.68784 0.56857 1.14857 0.58403 "
-"0.93143 0.59188 0.66286 0.59829 0.82857 0.60801 0.51009 0.61429 0.36571 0.61924 "
-"0.63429 0.61470 1.09714 0.61580 1.29355 0.62000 0.56000 0.62420 1.00571 0.62152 "
-"1.06286 0.62379 0.41311 0.67143 0.78857 0.66975 1.25561 0.67714 0.90857 0.68902 "
-"0.74286 0.70784 1.20571 0.71355 0.35735 0.72286 0.24571 0.72329 0.50286 0.72498 "
-"0.99429 0.73109 1.16000 0.73109 0.67429 0.73470 0.57714 0.74109 1.05143 0.74152 43 6 5 2 0 7 38 8 11 5 7 0 1 8 5 6 12 3 4 12 "
-"13 16 9 11 8 15 17 24 11 22 18 22 20 34 11 9 22 14 22 9 13 "
-"12 4 24 17 31 7 10 38 10 15 24 16 27 19 32 21 18 24 37 38 20 "
-"22 14 10 24 38 27 16 13 31 23 39 26 41 30 30 40 29 32 18 22 41 "
-"19 36 34 29 40 19 41 26 36 19 33 23 31 17 35 21 32 29 34 20 39 "
-"28 43 33 19 27 43 28 42 25 42 28 28 39 23 42 25 21 42 21 35 44 "
-"30 41 30 44 40 "
-;
-
-char *VTK_VECTOR_TEXT_110 = (char *) "38 0.889911 "
-"0.24571 -0.07186 0.37143 -0.07186 0.75429 -0.07186 0.88571 -0.07186 0.24152 -0.06571 "
-"0.37563 -0.06571 0.75009 -0.06571 0.88991 -0.06571 0.37605 0.40286 0.37866 0.41429 "
-"0.38134 0.44857 0.74665 0.48286 0.88950 0.48286 0.39849 0.51143 0.73229 0.54000 "
-"0.88420 0.54000 0.43011 0.56286 0.46286 0.58893 0.69714 0.58725 0.87008 0.59143 "
-"0.51580 0.61429 0.65143 0.61343 0.36571 0.62031 0.56571 0.62420 0.60571 0.62379 "
-"0.61714 0.62152 0.62286 0.62109 0.83955 0.64857 0.40725 0.66571 0.79429 0.69179 "
-"0.45714 0.70213 0.24152 0.71714 0.75429 0.71355 0.35735 0.72286 0.24571 0.72329 "
-"0.52571 0.73050 0.68571 0.73538 0.58857 0.74152 36 1 4 0 "
-"3 6 2 1 5 4 3 7 6 6 12 "
-"11 11 15 14 6 7 12 22 16 28 "
-"10 8 9 13 22 10 10 22 8 8 4 "
-"5 15 11 12 8 22 4 14 15 19 "
-"14 19 18 25 26 24 16 22 13 16 17 "
-"28 30 28 17 27 18 19 32 23 24 "
-"29 18 27 30 20 35 18 32 21 31 4 "
-"22 20 30 17 32 26 21 32 24 26 "
-"32 18 29 34 31 33 33 31 22 35 23 "
-"37 23 35 20 36 23 32 37 23 36 "
-;
-
-char *VTK_VECTOR_TEXT_111 = (char *) "65 0.938661 "
-"0.53143 -0.08966 0.59429 -0.09009 0.69143 -0.07101 0.41143 -0.06213 0.76571 -0.03759 "
-"0.34857 -0.02821 0.81714 -0.00099 0.29143 0.02154 0.54286 0.02193 0.60571 0.02420 "
-"0.50857 0.02823 0.64571 0.03563 0.86331 0.04857 0.45143 0.05216 0.25714 0.06636 "
-"0.70857 0.07330 0.89229 0.09429 0.40000 0.09597 0.22771 0.12286 0.38036 0.12286 "
-"0.37714 0.12793 0.37669 0.12857 0.75473 0.12857 0.76657 0.15143 0.77101 0.16286 "
-"0.77355 0.16857 0.92319 0.18000 0.20764 0.18571 0.34816 0.19714 0.78605 0.20857 "
-"0.33563 0.26000 0.19320 0.28286 0.93823 0.28857 0.79848 0.29429 0.33295 0.36286 "
-"0.93866 0.37429 0.19580 0.39714 0.79538 0.39714 0.35277 0.47143 0.92319 0.47143 "
-"0.21184 0.48286 0.77143 0.48947 0.23216 0.54000 0.38742 0.54000 0.89927 0.54000 "
-"0.74286 0.54057 0.71429 0.57275 0.42286 0.57813 0.87678 0.58000 0.27429 0.60984 "
-"0.48571 0.61580 0.64571 0.61580 0.54286 0.62950 0.58857 0.62950 0.60000 0.62723 "
-"0.60571 0.62680 0.83225 0.63714 0.31025 0.64857 0.34857 0.67864 0.75429 0.69641 "
-"0.40000 0.70784 0.45143 0.72605 0.68571 0.72538 0.53714 0.74152 0.60000 0.74109 65 11 4 15 8 "
-"0 1 17 7 5 11 2 4 2 9 1 8 1 9 0 8 10 0 10 3 2 "
-"11 9 3 13 5 10 13 3 6 12 22 6 15 4 15 6 22 18 28 27 17 "
-"5 13 14 19 18 16 23 22 19 7 17 7 19 14 18 19 21 24 23 25 25 "
-"23 16 19 20 21 16 22 12 26 29 25 27 30 31 26 25 16 28 18 21 29 "
-"26 33 30 27 28 31 34 36 33 32 35 26 32 33 34 31 30 33 35 37 40 "
-"36 34 37 39 41 40 38 42 39 37 35 47 57 43 38 40 34 43 49 42 46 "
-"45 56 39 44 41 41 48 45 43 57 49 41 44 48 43 42 38 57 47 58 54 "
-"55 53 56 45 48 50 60 47 64 63 53 64 55 62 53 63 52 59 62 51 61 "
-"60 50 64 53 55 51 62 55 52 61 50 59 46 56 61 52 63 46 59 51 58 "
-"47 60 "
-;
-
-char *VTK_VECTOR_TEXT_112 = (char *) "49 0.935625 "
-"0.24571 -0.37740 0.37454 -0.37429 0.56000 -0.08966 0.66857 -0.07966 0.47429 -0.06657 "
-"0.75429 -0.04331 0.37584 -0.00286 0.80571 -0.00704 0.38286 0.00159 0.59429 0.02152 "
-"0.52000 0.02891 0.63429 0.02992 0.85964 0.05429 0.45143 0.06725 0.70857 0.07330 "
-"0.39787 0.13429 0.39514 0.14000 0.39216 0.14571 0.76213 0.14571 0.90538 0.14571 "
-"0.37462 0.19714 0.78327 0.20857 0.92680 0.22571 0.36379 0.27143 0.36152 0.28286 "
-"0.79580 0.29429 0.93563 0.30000 0.36379 0.36857 0.79580 0.36857 0.92680 0.43714 "
-"0.78286 0.45547 0.38286 0.47232 0.75429 0.52921 0.41714 0.54057 0.88571 0.56444 "
-"0.44571 0.57582 0.69143 0.59964 0.51429 0.62213 0.65143 0.62213 0.36571 0.63051 "
-"0.56571 0.63563 0.82704 0.64857 0.45714 0.70784 0.74857 0.70657 0.24571 0.72329 "
-"0.36000 0.72329 0.51429 0.73177 0.69143 0.72899 0.62286 0.74152 49 0 1 6 0 24 44 3 9 2 2 10 4 3 11 9 4 "
-"13 8 10 2 9 11 5 14 11 3 5 7 14 5 4 10 13 14 12 18 14 "
-"7 12 0 20 24 15 8 13 8 15 6 19 18 12 18 19 21 21 22 25 24 "
-"27 44 17 15 16 22 21 19 28 25 26 22 26 25 6 15 17 29 30 28 23 "
-"24 20 20 6 17 29 28 26 30 34 32 27 31 44 0 6 20 31 39 44 32 "
-"41 36 41 32 34 31 33 39 42 37 46 39 35 42 34 30 29 39 33 35 38 "
-"47 40 35 37 42 47 38 43 40 46 37 43 36 41 39 45 44 46 40 48 48 "
-"40 47 38 36 43 "
-;
-
-char *VTK_VECTOR_TEXT_113 = (char *) "52 0.885714 "
-"0.76000 -0.37740 0.88571 -0.37740 0.56571 -0.09009 0.45143 -0.07673 0.65143 -0.06784 "
-"0.36000 -0.03188 0.70857 -0.03465 0.75580 -0.00286 0.74857 0.00454 0.29714 0.02418 "
-"0.54286 0.02152 0.57714 0.02193 0.58857 0.02420 0.59429 0.02462 0.47429 0.03927 "
-"0.64571 0.04371 0.43302 0.06571 0.70670 0.09429 0.23914 0.11143 0.38607 0.11714 "
-"0.38286 0.12221 0.38241 0.12286 0.75008 0.17429 0.21101 0.19143 0.34748 0.20857 "
-"0.76723 0.25429 0.19848 0.26000 0.76723 0.27143 0.33605 0.28286 0.76991 0.28857 "
-"0.19580 0.37429 0.33866 0.40286 0.75429 0.45277 0.21101 0.47143 0.35429 0.47832 "
-"0.73143 0.51301 0.39846 0.56286 0.69296 0.56857 0.25669 0.58571 0.45143 0.60902 "
-"0.61714 0.62213 0.49143 0.62723 0.76571 0.62602 0.29330 0.63714 0.56571 0.63522 "
-"0.72403 0.67143 0.36571 0.69641 0.66286 0.71355 0.77408 0.72286 0.88571 0.72329 "
-"0.44571 0.72966 0.56000 0.74152 52 29 27 25 "
-"49 42 32 22 7 25 3 13 11 2 13 "
-"3 4 13 2 6 15 4 11 13 12 "
-"3 14 5 13 4 15 10 3 11 15 6 "
-"8 14 3 10 15 8 17 24 23 18 "
-"5 16 9 17 8 22 14 16 5 9 19 "
-"18 19 20 21 18 19 21 42 35 32 "
-"7 22 8 16 19 9 49 48 42 7 0 "
-"1 24 18 21 23 24 26 26 28 30 "
-"28 26 24 30 31 33 34 33 31 31 30 "
-"28 33 34 38 49 29 25 36 43 38 "
-"49 25 7 35 42 37 37 45 40 45 37 "
-"42 29 49 32 45 47 40 39 43 36 "
-"46 39 50 40 47 44 43 39 46 36 38 "
-"34 41 44 51 41 50 39 49 7 1 "
-"50 41 51 51 44 47 "
-;
-
-char *VTK_VECTOR_TEXT_114 = (char *) "24 0.667686 "
-"0.24571 -0.07186 0.37143 -0.07186 0.24152 -0.06571 0.37563 -0.06571 0.37563 0.38000 "
-"0.39748 0.50000 0.41964 0.54571 0.44740 0.57429 0.61714 0.57787 0.62286 0.57880 "
-"0.48000 0.59294 0.57714 0.59395 0.51429 0.60134 0.36571 0.61385 0.41868 0.68857 "
-"0.66769 0.69429 0.66542 0.70000 0.24152 0.71714 0.35735 0.72286 0.24571 0.72329 "
-"0.46286 0.72436 0.60000 0.73109 0.51429 0.74109 0.55429 0.74109 22 1 2 0 "
-"1 3 2 4 2 3 5 6 13 5 13 "
-"17 21 11 15 2 4 17 4 5 17 "
-"6 7 13 18 17 13 7 10 14 13 7 "
-"14 14 12 20 11 21 12 9 15 11 "
-"12 14 10 19 17 18 20 12 22 8 9 "
-"11 21 15 16 22 12 23 23 12 21 "
-;
-
-char *VTK_VECTOR_TEXT_115 = (char *) "63 0.849502 "
-"0.56000 -0.09009 0.46286 -0.08705 0.65143 -0.07395 0.37143 -0.06723 0.70444 -0.05429 "
-"0.33143 -0.04943 0.76057 -0.02000 0.28571 -0.01813 0.79582 0.01429 0.50286 0.02152 "
-"0.55429 0.02152 0.56571 0.02379 0.57714 0.02420 0.24571 0.02636 0.64000 0.04200 "
-"0.41714 0.04371 0.22200 0.06571 0.38286 0.06725 0.68384 0.07714 0.83580 0.08286 "
-"0.69927 0.10000 0.34200 0.12286 0.84950 0.14000 0.71009 0.15714 0.19109 0.16286 "
-"0.19370 0.16857 0.32000 0.18615 0.69864 0.19143 0.84723 0.20286 0.65714 0.22784 "
-"0.83641 0.24286 0.80956 0.28857 0.34286 0.32371 0.75429 0.33641 0.30286 0.34421 "
-"0.69143 0.36327 0.25714 0.38445 0.22645 0.43714 0.41143 0.44538 0.37587 0.46571 "
-"0.35885 0.48286 0.21295 0.49429 0.69143 0.50460 0.34478 0.51714 0.81977 0.52286 "
-"0.67514 0.55143 0.35216 0.56286 0.22034 0.56857 0.64000 0.59465 0.38286 0.59829 "
-"0.79429 0.61016 0.24000 0.61573 0.42857 0.62041 0.58286 0.62252 0.48571 0.62991 "
-"0.74689 0.67143 0.28571 0.67258 0.70286 0.70045 0.33714 0.70613 0.38857 0.72538 "
-"0.61714 0.73050 0.47429 0.74109 0.54286 0.74109 61 2 12 0 10 1 12 12 2 14 14 4 6 7 17 13 0 "
-"12 1 4 14 2 11 10 12 15 3 1 3 15 5 9 1 10 14 6 18 15 "
-"1 9 17 5 15 6 8 18 5 17 7 21 16 13 16 21 24 18 8 20 23 "
-"28 27 21 13 17 19 22 23 26 25 21 21 25 24 20 19 23 19 20 8 28 "
-"23 22 27 33 29 28 30 27 31 27 30 27 31 33 29 38 32 35 29 33 29 "
-"35 38 34 38 36 32 38 34 36 40 37 39 36 38 41 43 47 43 41 37 36 "
-"39 40 50 45 42 43 37 40 47 46 51 46 47 43 53 60 54 45 57 48 52 "
-"58 49 45 55 57 51 49 56 49 51 46 50 42 44 48 57 53 56 49 58 55 "
-"45 50 52 59 58 59 52 61 52 54 61 60 53 57 61 54 62 62 54 60 "
-;
-
-char *VTK_VECTOR_TEXT_116 = (char *) "24 0.551972 "
-"0.42286 -0.08395 0.48000 -0.08437 0.55197 -0.07143 0.33714 -0.05914 0.29901 -0.02571 "
-"0.28041 0.00857 0.44571 0.04816 0.44453 0.04857 0.53714 0.04344 0.44000 0.05008 "
-"0.41057 0.07714 0.26748 0.10000 0.40152 0.11714 0.26597 0.61429 0.40260 0.61429 "
-"0.17143 0.61957 0.53450 0.62000 0.53866 0.71714 0.53450 0.72286 0.17143 0.72329 "
-"0.26597 0.72857 0.40260 0.72857 0.26748 0.91714 0.40000 0.99545 22 10 5 4 "
-"6 7 9 10 4 3 10 3 9 8 6 "
-"1 6 9 1 5 10 11 8 1 2 "
-"0 9 3 11 12 13 0 1 9 10 12 "
-"11 17 18 16 14 13 12 21 14 16 "
-"18 21 16 22 20 23 20 13 14 15 20 "
-"19 15 13 20 20 14 21 23 20 21 "
-;
-
-char *VTK_VECTOR_TEXT_117 = (char *) "38 0.884197 "
-"0.48571 -0.09009 0.53714 -0.09009 0.41714 -0.07673 0.77143 -0.07295 0.88000 -0.07186 "
-"0.63518 -0.06571 0.76571 -0.06878 0.88420 -0.06571 0.34857 -0.04771 0.70857 -0.01846 "
-"0.29901 -0.00857 0.27429 0.02730 0.52000 0.02723 0.56000 0.02764 0.47339 0.03714 "
-"0.76000 0.03684 0.61714 0.04135 0.43943 0.05429 0.65143 0.05787 0.41330 0.07714 "
-"0.25143 0.08437 0.69143 0.08704 0.39343 0.10571 0.38899 0.11714 0.71473 0.11714 "
-"0.38645 0.12286 0.73294 0.15714 0.23848 0.17429 0.37563 0.17429 0.75009 0.26000 "
-"0.23848 0.71714 0.37295 0.71714 0.75009 0.71714 0.88420 0.71714 0.24265 0.72286 "
-"0.36878 0.72286 0.75429 0.72329 0.88000 0.72329 36 6 3 15 "
-"3 7 15 3 4 7 8 17 10 2 14 "
-"17 2 17 8 5 13 1 19 11 10 "
-"9 16 5 12 1 13 0 12 2 12 0 "
-"1 9 18 16 13 5 16 14 2 12 "
-"11 22 20 21 18 9 15 21 9 21 15 "
-"24 20 28 27 11 19 22 24 7 26 "
-"19 10 17 24 15 7 25 22 23 20 22 "
-"25 20 25 28 26 7 29 31 30 27 "
-"33 29 7 34 31 35 34 30 31 31 27 "
-"28 36 33 37 32 29 33 36 32 33 "
-;
-
-char *VTK_VECTOR_TEXT_118 = (char *) "12 0.884203 "
-"0.45714 -0.06947 0.58857 -0.07103 0.52000 0.09808 0.52571 0.09808 0.47580 0.23714 "
-"0.16151 0.71714 0.88420 0.71714 0.16427 0.72286 0.30286 0.71951 0.74857 0.72090 "
-"0.88145 0.72286 0.29714 0.72395 10 4 0 "
-"2 0 4 5 3 2 0 1 3 0 "
-"3 6 9 8 11 5 9 6 10 7 5 "
-"11 8 5 4 3 1 6 "
-;
-
-char *VTK_VECTOR_TEXT_119 = (char *) "14 1.231638 "
-"0.39429 -0.07215 0.52571 -0.07215 0.97714 -0.07252 0.84571 -0.06947 0.45714 0.10650 "
-"0.46286 0.10650 0.92000 0.12073 0.69143 0.52785 0.15122 0.72286 0.28571 0.72090 "
-"0.62857 0.72243 0.76193 0.72286 1.23164 0.72286 1.10857 0.72329 12 "
-"2 6 3 0 4 8 3 6 7 5 0 "
-"1 12 13 6 5 4 0 7 10 5 "
-"11 10 7 7 5 1 11 7 6 4 9 "
-"8 12 6 2 "
-;
-
-char *VTK_VECTOR_TEXT_120 = (char *) "17 0.882498 "
-"0.15697 -0.07143 0.88073 -0.07143 0.15473 -0.06571 0.31429 -0.07035 0.72571 -0.07140 "
-"0.88250 -0.06571 0.52000 0.22529 0.52571 0.22529 0.60332 0.33429 0.43534 0.34000 "
-"0.51429 0.45005 0.17188 0.71714 0.86812 0.71714 0.17412 0.72286 0.86588 0.72286 "
-"0.32571 0.72395 0.71429 0.72395 15 1 5 4 2 6 9 8 6 7 3 2 0 4 8 7 6 2 3 4 "
-"5 8 8 10 6 10 9 6 15 11 9 16 10 8 15 9 10 12 16 8 13 "
-"11 15 16 12 14 "
-;
-
-char *VTK_VECTOR_TEXT_121 = (char *) "16 0.888063 "
-"0.34286 -0.39563 0.24000 -0.38043 0.41714 -0.37641 0.45714 -0.34956 0.50436 -0.29429 "
-"0.32000 -0.26680 0.22286 -0.25766 0.36652 -0.25429 0.54371 -0.22000 0.41293 -0.21429 "
-"0.46848 -0.07714 0.53714 0.09292 0.16998 0.72286 0.30857 0.71999 0.76000 0.72246 "
-"0.88806 0.72286 14 2 7 0 0 5 1 5 0 7 "
-"6 1 5 3 7 2 7 3 9 3 4 "
-"9 9 8 10 9 4 8 10 11 12 "
-"11 15 14 11 8 15 11 10 8 11 13 "
-"12 "
-;
-
-char *VTK_VECTOR_TEXT_122 = (char *) "17 0.872768 "
-"0.17714 -0.07295 0.86857 -0.07186 0.17143 -0.06878 0.87277 -0.06571 0.17146 0.03714 "
-"0.34212 0.03714 0.87277 0.03714 0.34132 0.04286 0.44000 0.04327 0.86857 0.04329 "
-"0.20571 0.61689 0.67062 0.62000 0.84991 0.64286 0.20152 0.71714 0.84991 0.71714 "
-"0.20571 0.72329 0.84571 0.72329 15 2 0 4 0 1 9 0 5 4 1 3 9 5 0 8 5 7 4 0 "
-"9 8 3 6 9 12 14 11 11 14 16 11 16 10 12 11 7 11 4 7 10 "
-"15 13 15 10 16 "
-;
-
-char *VTK_VECTOR_TEXT_123 = (char *) "39 0.611429 "
-"0.61143 -0.39454 0.46857 -0.38420 0.40000 -0.34154 0.61143 -0.27975 0.35748 -0.27143 "
-"0.52000 -0.26992 0.47787 -0.23143 0.46748 -0.19143 0.34134 -0.18000 0.46395 0.04286 "
-"0.33563 0.05429 0.45184 0.14571 0.32109 0.16286 0.29143 0.21832 0.42286 0.22716 "
-"0.25143 0.24943 0.18857 0.26528 0.39429 0.26698 0.31413 0.32286 0.18857 0.38615 "
-"0.25143 0.40073 0.41188 0.40286 0.29143 0.42775 0.43514 0.44286 0.32823 0.49429 "
-"0.45866 0.52286 0.34134 0.60286 0.46705 0.80857 0.34478 0.84857 0.47748 0.87143 "
-"0.35748 0.91143 0.50286 0.90821 0.50793 0.91143 0.50857 0.91188 0.61143 0.92814 "
-"0.40571 0.99511 0.46857 1.03294 0.53143 1.04437 0.61143 1.04329 37 0 3 5 6 2 5 2 6 4 0 5 1 2 "
-"1 5 4 7 8 7 4 6 8 9 10 10 11 12 9 8 7 11 10 9 12 "
-"17 13 12 14 17 14 12 11 18 15 13 16 15 20 18 13 17 16 20 19 15 "
-"18 20 21 22 18 22 21 24 22 20 18 24 25 26 23 24 21 25 24 23 26 "
-"27 28 27 26 25 28 29 30 29 28 27 30 29 35 31 32 33 36 31 33 31 "
-"36 29 36 33 37 34 38 37 35 29 36 34 37 33 "
-;
-
-char *VTK_VECTOR_TEXT_124 = (char *) "4 0.388571 "
-"0.28571 -0.39454 0.38857 -0.39563 0.28571 1.04329 0.38857 1.04437 2 3 2 0 3 0 1 "
-;
-
-char *VTK_VECTOR_TEXT_125 = (char *) "35 0.606299 "
-"0.17714 -0.39454 0.31429 -0.38613 0.39429 -0.33832 0.17714 -0.27975 0.27429 -0.26784 "
-"0.43681 -0.26000 0.31070 -0.23714 0.44950 -0.19714 0.32723 -0.15714 0.45295 0.04857 "
-"0.33295 0.11714 0.46857 0.16404 0.35387 0.19714 0.51429 0.23258 0.56000 0.25681 "
-"0.39429 0.26403 0.60630 0.26571 0.47702 0.32857 0.41714 0.36742 0.60571 0.38615 "
-"0.54857 0.39927 0.50171 0.43143 0.36086 0.43714 0.46748 0.50000 0.32991 0.56857 "
-"0.45252 0.78571 0.32723 0.80286 0.31748 0.87143 0.29143 0.90893 0.43470 0.91714 "
-"0.17714 0.92814 0.41629 0.95714 0.36571 1.01107 0.32000 1.03294 0.17714 1.04329 33 4 3 0 2 4 1 6 7 8 1 4 0 2 6 4 5 "
-"6 2 6 5 7 8 9 10 9 8 7 10 11 12 15 13 17 11 10 9 12 "
-"11 15 13 14 17 13 15 11 20 17 14 20 14 16 19 20 16 21 17 20 17 "
-"21 18 22 23 24 22 18 21 23 22 21 25 26 24 25 24 23 29 27 26 29 "
-"26 25 27 31 28 31 27 29 32 28 31 28 33 30 33 34 30 33 28 32 "
-;
-
-char *VTK_VECTOR_TEXT_126 = (char *) "25 0.971429 "
-"0.73714 0.34462 0.20759 0.35143 0.21143 0.34662 0.81143 0.34723 0.66857 0.35756 "
-"0.86857 0.36135 0.25143 0.38115 0.90857 0.38086 0.52000 0.41580 0.32571 0.42723 "
-"0.97140 0.43143 0.37143 0.43866 0.42286 0.44093 0.79429 0.49009 0.21028 0.50000 "
-"0.72571 0.49681 0.86286 0.50930 0.25714 0.54115 0.92571 0.54759 0.32571 0.57470 "
-"0.50286 0.57621 0.96571 0.58154 0.97143 0.58073 0.38857 0.58680 0.44000 0.58723 23 1 17 14 8 4 15 13 5 7 6 1 2 5 "
-"13 3 1 6 17 3 13 0 16 10 18 15 4 0 13 7 16 15 0 13 8 "
-"20 12 12 20 11 9 17 6 10 16 7 17 9 19 22 21 18 11 20 24 11 "
-"19 9 20 8 15 11 24 23 22 18 10 11 23 19 "
-;
-
-
-/*! Construct object with no string set and backing enabled.*/
-VTKViewer_VectorText::VTKViewer_VectorText()
-{
- this->Text = NULL;
-
- this->Letters[33] = VTK_VECTOR_TEXT_33;
- this->Letters[34] = VTK_VECTOR_TEXT_34;
- this->Letters[35] = VTK_VECTOR_TEXT_35;
- this->Letters[36] = VTK_VECTOR_TEXT_36;
- this->Letters[37] = VTK_VECTOR_TEXT_37;
- this->Letters[38] = VTK_VECTOR_TEXT_38;
- this->Letters[39] = VTK_VECTOR_TEXT_39;
- this->Letters[40] = VTK_VECTOR_TEXT_40;
- this->Letters[41] = VTK_VECTOR_TEXT_41;
- this->Letters[42] = VTK_VECTOR_TEXT_42;
- this->Letters[43] = VTK_VECTOR_TEXT_43;
- this->Letters[44] = VTK_VECTOR_TEXT_44;
- this->Letters[45] = VTK_VECTOR_TEXT_45;
- this->Letters[46] = VTK_VECTOR_TEXT_46;
- this->Letters[47] = VTK_VECTOR_TEXT_47;
- this->Letters[48] = VTK_VECTOR_TEXT_48;
- this->Letters[49] = VTK_VECTOR_TEXT_49;
- this->Letters[50] = VTK_VECTOR_TEXT_50;
- this->Letters[51] = VTK_VECTOR_TEXT_51;
- this->Letters[52] = VTK_VECTOR_TEXT_52;
- this->Letters[53] = VTK_VECTOR_TEXT_53;
- this->Letters[54] = VTK_VECTOR_TEXT_54;
- this->Letters[55] = VTK_VECTOR_TEXT_55;
- this->Letters[56] = VTK_VECTOR_TEXT_56;
- this->Letters[57] = VTK_VECTOR_TEXT_57;
- this->Letters[58] = VTK_VECTOR_TEXT_58;
- this->Letters[59] = VTK_VECTOR_TEXT_59;
- this->Letters[60] = VTK_VECTOR_TEXT_60;
- this->Letters[61] = VTK_VECTOR_TEXT_61;
- this->Letters[62] = VTK_VECTOR_TEXT_62;
- this->Letters[63] = VTK_VECTOR_TEXT_63;
- this->Letters[64] = VTK_VECTOR_TEXT_64;
- this->Letters[65] = VTK_VECTOR_TEXT_65;
- this->Letters[66] = VTK_VECTOR_TEXT_66;
- this->Letters[67] = VTK_VECTOR_TEXT_67;
- this->Letters[68] = VTK_VECTOR_TEXT_68;
- this->Letters[69] = VTK_VECTOR_TEXT_69;
- this->Letters[70] = VTK_VECTOR_TEXT_70;
- this->Letters[71] = VTK_VECTOR_TEXT_71;
- this->Letters[72] = VTK_VECTOR_TEXT_72;
- this->Letters[73] = VTK_VECTOR_TEXT_73;
- this->Letters[74] = VTK_VECTOR_TEXT_74;
- this->Letters[75] = VTK_VECTOR_TEXT_75;
- this->Letters[76] = VTK_VECTOR_TEXT_76;
- this->Letters[77] = VTK_VECTOR_TEXT_77;
- this->Letters[78] = VTK_VECTOR_TEXT_78;
- this->Letters[79] = VTK_VECTOR_TEXT_79;
- this->Letters[80] = VTK_VECTOR_TEXT_80;
- this->Letters[81] = VTK_VECTOR_TEXT_81;
- this->Letters[82] = VTK_VECTOR_TEXT_82;
- this->Letters[83] = VTK_VECTOR_TEXT_83;
- this->Letters[84] = VTK_VECTOR_TEXT_84;
- this->Letters[85] = VTK_VECTOR_TEXT_85;
- this->Letters[86] = VTK_VECTOR_TEXT_86;
- this->Letters[87] = VTK_VECTOR_TEXT_87;
- this->Letters[88] = VTK_VECTOR_TEXT_88;
- this->Letters[89] = VTK_VECTOR_TEXT_89;
- this->Letters[90] = VTK_VECTOR_TEXT_90;
- this->Letters[91] = VTK_VECTOR_TEXT_91;
- this->Letters[92] = VTK_VECTOR_TEXT_92;
- this->Letters[93] = VTK_VECTOR_TEXT_93;
- this->Letters[94] = VTK_VECTOR_TEXT_94;
- this->Letters[95] = VTK_VECTOR_TEXT_95;
- this->Letters[96] = VTK_VECTOR_TEXT_96;
- this->Letters[97] = VTK_VECTOR_TEXT_97;
- this->Letters[98] = VTK_VECTOR_TEXT_98;
- this->Letters[99] = VTK_VECTOR_TEXT_99;
- this->Letters[100] = VTK_VECTOR_TEXT_100;
- this->Letters[101] = VTK_VECTOR_TEXT_101;
- this->Letters[102] = VTK_VECTOR_TEXT_102;
- this->Letters[103] = VTK_VECTOR_TEXT_103;
- this->Letters[104] = VTK_VECTOR_TEXT_104;
- this->Letters[105] = VTK_VECTOR_TEXT_105;
- this->Letters[106] = VTK_VECTOR_TEXT_106;
- this->Letters[107] = VTK_VECTOR_TEXT_107;
- this->Letters[108] = VTK_VECTOR_TEXT_108;
- this->Letters[109] = VTK_VECTOR_TEXT_109;
- this->Letters[110] = VTK_VECTOR_TEXT_110;
- this->Letters[111] = VTK_VECTOR_TEXT_111;
- this->Letters[112] = VTK_VECTOR_TEXT_112;
- this->Letters[113] = VTK_VECTOR_TEXT_113;
- this->Letters[114] = VTK_VECTOR_TEXT_114;
- this->Letters[115] = VTK_VECTOR_TEXT_115;
- this->Letters[116] = VTK_VECTOR_TEXT_116;
- this->Letters[117] = VTK_VECTOR_TEXT_117;
- this->Letters[118] = VTK_VECTOR_TEXT_118;
- this->Letters[119] = VTK_VECTOR_TEXT_119;
- this->Letters[120] = VTK_VECTOR_TEXT_120;
- this->Letters[121] = VTK_VECTOR_TEXT_121;
- this->Letters[122] = VTK_VECTOR_TEXT_122;
- this->Letters[123] = VTK_VECTOR_TEXT_123;
- this->Letters[124] = VTK_VECTOR_TEXT_124;
- this->Letters[125] = VTK_VECTOR_TEXT_125;
- this->Letters[126] = VTK_VECTOR_TEXT_126;
-
-}
-
-/*!Calculate output.*/
-void VTKViewer_VectorText::Execute()
-{
- vtkPolyData *output = this->GetOutput();
- vtkPoints *newPoints;
- vtkCellArray *newPolys;
- int ptOffset = 0;
- int aPoint, i;
- int pos = 0;
- float xpos = 0;
- float ypos = 0;
- int ptCount, triCount;
- char *aLetter;
- float width;
- float ftmp[3];
-
- if (this->Text == NULL)
- {
- vtkErrorMacro (<< "Text is not set!");
- return;
- }
-
- // Set things up; allocate memory
- newPoints = vtkPoints::New();
- newPolys = vtkCellArray::New();
- ftmp[2] = 0.0;
-
- // Create Text
- while (this->Text[pos])
- {
- switch (this->Text[pos])
- {
- case 32:
- xpos += 0.4;
- break;
-
- case 10:
- ypos -= 1.4;
- xpos = 0;
- break;
-
- default:
- // if we have a valid character
- if ((this->Text[pos] > 32)&&(this->Text[pos] < 127))
- {
- // add the result to our output
- aLetter = this->Letters[this->Text[pos]];
- ptCount = strtol(aLetter,&aLetter,10);
- width = strtod(aLetter,&aLetter);
- for (i = 0; i < ptCount; i++)
- {
- ftmp[0] = strtod(aLetter,&aLetter);
- ftmp[1] = strtod(aLetter,&aLetter);
- ftmp[0] += xpos;
- ftmp[1] += ypos;
- newPoints->InsertNextPoint(ftmp);
- }
- triCount = strtol(aLetter,&aLetter,10);
- for (i = 0; i < triCount; i++)
- {
- newPolys->InsertNextCell(3);
- aPoint = strtol(aLetter,&aLetter,10);
- newPolys->InsertCellPoint(aPoint + ptOffset);
- aPoint = strtol(aLetter,&aLetter,10);
- newPolys->InsertCellPoint(aPoint + ptOffset);
- aPoint = strtol(aLetter,&aLetter,10);
- newPolys->InsertCellPoint(aPoint + ptOffset);
- }
- ptOffset += ptCount;
- xpos += width;
- }
- break;
- }
- pos++;
- }
-
- //
- // Update ourselves and release memory
- //
- output->SetPoints(newPoints);
- newPoints->Delete();
-
- output->SetPolys(newPolys);
- newPolys->Delete();
-}
-
-/*!
- Print text to stream
- \param os - stream
- \param indent
-*/
-void VTKViewer_VectorText::PrintSelf(ostream& os, vtkIndent indent)
-{
- this->Superclass::PrintSelf(os,indent);
-
- os << indent << "Text: " << (this->Text ? this->Text : "(none)") << "\n";
-}
-
-/*!Destructor.*/
-VTKViewer_VectorText::~VTKViewer_VectorText()
-{
- if (this->Text)
- {
- delete [] this->Text;
- }
-}
+++ /dev/null
-/*=========================================================================
-
- Program: Visualization Toolkit
- Module: $RCSfile$
- Language: C++
- Date: $Date$
- Version: $Revision$
-
- Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
- All rights reserved.
- See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the above copyright notice for more information.*/
-
-// .NAME vtkVectorText - create polygonal text
-// .SECTION Description
-
-// vtkVectorText generates vtkPolyData from an input text string. Besides the
-// ASCII alphanumeric characters a-z, A-Z, 0-9, vtkVectorText also supports
-// ASCII punctuation marks. (The supported ASCII character set are the codes
-// (33-126) inclusive.) The only control character supported is the line feed
-// character "\n", which advances to a new line.
-//
-// To use thie class, you normally couple it with a vtkPolyDataMapper and a
-// vtkActor. In this case you would use the vtkActor's transformation methods
-// to position, orient, and scale the text. You may also wish to use a
-// vtkFollower to orient the text so that it always faces the camera.
-
-// .SECTION See Also
-// vtkTextMapper vtkCaptionActor2D
-
-// VTKViewer_VectorText.h is a copy of vtkVectorText.h file.
-// Purpose of copying: to remove linking to libHybrid.so VTK library
-
-// Modified by Open CASCADE SAS (www.opencascade.com)
-
-#ifndef __VTKViewer_VectorText_h
-#define __VTKViewer_VectorText_h
-
-#include "vtkPolyDataSource.h"
-/*!Generates vtkPolyData from an input text string.
- *@see vtkVectorText
- */
-class VTKViewer_VectorText : public vtkPolyDataSource
-{
-public:
- static VTKViewer_VectorText *New();
- vtkTypeRevisionMacro(VTKViewer_VectorText,vtkPolyDataSource);
- void PrintSelf(ostream& os, vtkIndent indent);
-
- // Description:
- // Set/Get the text to be drawn.
- vtkSetStringMacro(Text);
- vtkGetStringMacro(Text);
-
-protected:
- VTKViewer_VectorText();
- ~VTKViewer_VectorText();
-
- //! Main method, which calculate output
- virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
-
- char *Text;
- char *Letters[127];
-
-};
-
-#endif
-
-
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_ViewManager.h"
#include "VTKViewer_ViewModel.h"
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_VIEWMANAGER_H
#define VTKVIEWER_VIEWMANAGER_H
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_ViewModel.h"
#include "VTKViewer_ViewWindow.h"
#include "VTKViewer_ViewManager.h"
#include "VTKViewer_RenderWindowInteractor.h"
+#include "QtxBackgroundTool.h"
#include "SUIT_ViewWindow.h"
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include <QMouseEvent>
#include <QToolBar>
+// VSR: Uncomment below line to allow texture background support in VTK viewer
+#define VTK_ENABLE_TEXTURED_BACKGROUND
+
bool _InitializeVtkWarningsCall()
{
char* isOn = getenv( "VTK_WARNINGS_IS_ON" );
/*!Constructor.Sets background color to black.*/
VTKViewer_Viewer::VTKViewer_Viewer()
: SUIT_ViewModel(),
-myBgColor( Qt::black )
+ myDefaultBackground( Qtx::BackgroundData( Qt::black ) )
{
}
{
}
-/*!Gets background color.*/
+/*! Get data for supported background modes: gradient types, identifiers and supported image formats */
+QString VTKViewer_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QIntList& txtList )
+{
+ gradList << tr( "GT_HORIZONTALGRADIENT" )
+ << tr( "GT_VERTICALGRADIENT" )
+ << tr( "GT_FIRSTDIAGONALGRADIENT" )
+ << tr( "GT_SECONDDIAGONALGRADIENT" )
+ << tr( "GT_FIRSTCORNERGRADIENT" )
+ << tr( "GT_SECONDCORNERGRADIENT" )
+ << tr( "GT_THIRDCORNERGRADIENT" )
+ << tr( "GT_FOURTHCORNERGRADIENT" );
+ idList << HorizontalGradient
+ << VerticalGradient
+ << FirstDiagonalGradient
+ << SecondDiagonalGradient
+ << FirstCornerGradient
+ << SecondCornerGradient
+ << ThirdCornerGradient
+ << FourthCornerGradient;
+#ifdef VTK_ENABLE_TEXTURED_BACKGROUND
+ txtList << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
+#endif
+ return tr("BG_IMAGE_FILES");
+}
+
+/*!Gets background color [obsolete]*/
QColor VTKViewer_Viewer::backgroundColor() const
{
- return myBgColor;
+ return background().color();
}
-/*!Sets background color.*/
+/*!Sets background color [obsolete]*/
void VTKViewer_Viewer::setBackgroundColor( const QColor& c )
{
- if ( c.isValid() )
- myBgColor = c;
+ Qtx::BackgroundData bg = background();
+ bg.setColor( c );
+ setBackground( bg );
+}
+
+/*!Gets default background data.*/
+Qtx::BackgroundData VTKViewer_Viewer::background() const
+{
+ return myDefaultBackground;
+}
+
+/*!Sets default background data.*/
+void VTKViewer_Viewer::setBackground( const Qtx::BackgroundData& theBackground )
+{
+ myDefaultBackground = theBackground.isValid() ? theBackground : Qtx::BackgroundData( Qt::black );
}
/*!Create new instance of VTKViewer_ViewWindow, sets background color and return pointer to it.*/
SUIT_ViewWindow* VTKViewer_Viewer::createView( SUIT_Desktop* theDesktop )
{
VTKViewer_ViewWindow* vw = new VTKViewer_ViewWindow( theDesktop, this );
- vw->setBackgroundColor( myBgColor );
+ vw->setBackground( myDefaultBackground );
return vw;
}
void VTKViewer_Viewer::contextMenuPopup(QMenu* thePopup)
{
thePopup->addAction( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
- thePopup->addAction( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+ thePopup->addAction( tr( "MEN_CHANGE_BACKGROUND" ), this, SLOT( onChangeBackground() ) );
thePopup->addSeparator();
}
/*!On change back ground color event.*/
-void VTKViewer_Viewer::onChangeBgColor()
+void VTKViewer_Viewer::onChangeBackground()
{
VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
if ( !aView )
return;
- QColor aColor = QColorDialog::getColor( aView->backgroundColor(), aView);
- if ( aColor.isValid() )
- aView->setBackgroundColor(aColor);
+ // get supported gradient types
+ QStringList gradList;
+ QIntList idList, txtList;
+ QString formats = backgroundData( gradList, idList, txtList );
+
+ // invoke dialog box
+ Qtx::BackgroundData bgData = QtxBackgroundDialog::getBackground( aView->background(), // initial background
+ aView, // parent for dialog box
+ txtList, // allowed texture modes
+ true, // enable solid color mode
+ true, // enable gradient mode
+ false, // disable custom gradient mode
+ !txtList.isEmpty(), // enable texture mode
+ gradList, // gradient names
+ idList, // gradient identifiers
+ formats ); // image formats
+
+ // set chosen background data to the viewer
+ if ( bgData.isValid() )
+ aView->setBackground( bgData );
}
/*!On show tool bar event.*/
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_VIEWMODEL_H
#define VTKVIEWER_VIEWMODEL_H
#include "VTKViewer.h"
+#include "Qtx.h"
#include "SUIT_ViewModel.h"
#include <QColor>
Q_OBJECT
public:
+ /*! supported gradient types */
+ enum {
+ HorizontalGradient,
+ VerticalGradient,
+ FirstDiagonalGradient,
+ SecondDiagonalGradient,
+ FirstCornerGradient,
+ SecondCornerGradient,
+ ThirdCornerGradient,
+ FourthCornerGradient,
+ LastGradient = FourthCornerGradient,
+ };
+
/*!Initialize type of viewer.*/
- static QString Type() { return "VTKViewer"; }
+ static QString Type() { return "VTKViewer"; }
+ static QString backgroundData( QStringList&, QIntList&, QIntList& );
VTKViewer_Viewer();
virtual ~VTKViewer_Viewer();
virtual QString getType() const { return Type(); }
public:
- void enableSelection(bool isEnabled);
+ void enableSelection(bool isEnabled);
/*!Checks: is selection enabled*/
- bool isSelectionEnabled() const { return mySelectionEnabled; }
+ bool isSelectionEnabled() const { return mySelectionEnabled; }
- void enableMultiselection(bool isEnable);
+ void enableMultiselection(bool isEnable);
/*!Checks: is multi selection enabled*/
- bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
+ bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
- int getSelectionCount() const;
+ int getSelectionCount() const;
- QColor backgroundColor() const;
- void setBackgroundColor( const QColor& );
+ QColor backgroundColor() const; // obsolete
+ void setBackgroundColor( const QColor& ); // obsolete
+ Qtx::BackgroundData background() const;
+ void setBackground( const Qtx::BackgroundData& );
signals:
- void selectionChanged();
+ void selectionChanged();
protected slots:
- void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
+ void onMousePress( SUIT_ViewWindow*, QMouseEvent* );
+ void onMouseMove( SUIT_ViewWindow*, QMouseEvent* );
+ void onMouseRelease( SUIT_ViewWindow*, QMouseEvent* );
- void onDumpView();
- void onShowToolbar();
- void onChangeBgColor();
+ void onDumpView();
+ void onShowToolbar();
+ void onChangeBackground();
private:
- QColor myBgColor;
- bool mySelectionEnabled;
- bool myMultiSelectionEnabled;
+ Qtx::BackgroundData myDefaultBackground;
+ bool mySelectionEnabled;
+ bool myMultiSelectionEnabled;
};
#endif
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "VTKViewer_ViewWindow.h"
#include "VTKViewer_ViewModel.h"
#include "VTKViewer_RenderWindow.h"
#include "VTKViewer_Trihedron.h"
#include "VTKViewer_Transform.h"
#include "VTKViewer_Utilities.h"
+#include "VTKViewer_Texture.h"
+#include "VTKViewer_OpenGLRenderer.h"
#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Tools.h>
#include <SUIT_ResourceMgr.h>
+#include <QFileInfo>
#include <QImage>
-#include <vtkRenderer.h>
#include <vtkCamera.h>
+#include <vtkJPEGReader.h>
+#include <vtkBMPReader.h>
+#include <vtkTIFFReader.h>
+#include <vtkPNGReader.h>
+#include <vtkMetaImageReader.h>
+#include <vtkImageMapToColors.h>
+#include <vtkTexture.h>
#include <QtxToolBar.h>
#include <QtxMultiAction.h>
/*! Construction*/
VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
VTKViewer_Viewer* theModel,
- VTKViewer_InteractorStyle* iStyle,
- VTKViewer_RenderWindowInteractor* rw )
+ VTKViewer_InteractorStyle* iStyle,
+ VTKViewer_RenderWindowInteractor* rw )
: SUIT_ViewWindow( theDesktop )
{
myModel = theModel;
myTrihedron = VTKViewer_Trihedron::New();
myTransform = VTKViewer_Transform::New();
- myRenderer = vtkRenderer::New() ;
+ myRenderer = VTKViewer_OpenGLRenderer::New() ;
myTrihedron->AddToRender( myRenderer );
myRenderer->LightFollowCameraOn();
myRenderer->TwoSidedLightingOn();
- // Set BackgroundColor
- QString BgrColorRed = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorRed");
- QString BgrColorGreen = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorGreen");
- QString BgrColorBlue = "0";//SUIT_CONFIG->getSetting("VTKViewer:BackgroundColorBlue");
-
- if( !BgrColorRed.isEmpty() && !BgrColorGreen.isEmpty() && !BgrColorBlue.isEmpty() )
- myRenderer->SetBackground( BgrColorRed.toInt()/255., BgrColorGreen.toInt()/255., BgrColorBlue.toInt()/255. );
- else
- myRenderer->SetBackground( 0, 0, 0 );
-
// Create an interactor.
myRWInteractor = rw ? rw : VTKViewer_RenderWindowInteractor::New();
myRWInteractor->SetRenderWindow( myRenderWindow->getRenderWindow() );
setCentralWidget( myRenderWindow );
myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
+ myToolBar->setFloatable( false );
createActions();
createToolBar();
this, SIGNAL(contextMenuRequested( QContextMenuEvent * )) );
+ // set default background
+ setBackground( Qtx::BackgroundData( Qt::black ) );
+ // reset view
onResetView();
}
connect(aAction, SIGNAL(activated()), this, SLOT(onRightView()));
myActionsMap[ RightId ] = aAction;
+ // \li Rotate anticlockwise
+ aAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ANTICLOCKWISE" ) ),
+ tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this);
+ aAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
+ myActionsMap[ AntiClockWiseId ] = aAction;
+
+ // \li Rotate clockwise
+ aAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_CLOCKWISE" ) ),
+ tr( "MNU_CLOCKWISE_VIEW" ), 0, this);
+ aAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
+ myActionsMap[ ClockWiseId ] = aAction;
+
//! \li Reset
aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
tr( "MNU_RESET_VIEW" ), 0, this);
aViewsAction->insertAction( myActionsMap[RightId] );
myToolBar->addAction( aViewsAction );
+ myToolBar->addAction( myActionsMap[AntiClockWiseId] );
+ myToolBar->addAction( myActionsMap[ClockWiseId] );
+
myToolBar->addAction( myActionsMap[ResetId] );
}
onFitAll();
}
+/*!
+ \brief Rotate view 90 degrees clockwise
+*/
+void VTKViewer_ViewWindow::onClockWiseView()
+{
+ vtkCamera* aCamera = myRenderer->GetActiveCamera();
+ aCamera->Roll(-90);
+ aCamera->OrthogonalizeViewUp();
+ Repaint();
+}
+
+/*!
+ \brief Rotate view 90 degrees conterclockwise
+*/
+void VTKViewer_ViewWindow::onAntiClockWiseView()
+{
+ vtkCamera* aCamera = myRenderer->GetActiveCamera();
+ aCamera->Roll(90);
+ aCamera->OrthogonalizeViewUp();
+ Repaint();
+}
+
/*!On reset view slot.*/
void VTKViewer_ViewWindow::onResetView()
{
Repaint();
}
-/*!Set background of the viewport*/
-void VTKViewer_ViewWindow::setBackgroundColor( const QColor& color )
+/*!Set background color of the viewport [obsolete]*/
+void VTKViewer_ViewWindow::setBackgroundColor( const QColor& c )
{
- if ( myRenderer )
- myRenderer->SetBackground( color.red()/255., color.green()/255., color.blue()/255. );
+ Qtx::BackgroundData bg = background();
+ bg.setColor( c );
+ setBackground( bg );
}
-/*!Returns background of the viewport*/
+/*!Returns background color of the viewport [obsolete]*/
QColor VTKViewer_ViewWindow::backgroundColor() const
{
- vtkFloatingPointType backint[3];
- if ( myRenderer ) {
- myRenderer->GetBackground( backint );
- return QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255));
+ return background().color();
+}
+
+/*!Set background of the viewport*/
+void VTKViewer_ViewWindow::setBackground( const Qtx::BackgroundData& bgData )
+{
+ bool ok = false;
+
+ if ( bgData.isValid() ) {
+ switch ( bgData.mode() ) {
+ case Qtx::ColorBackground:
+ {
+ QColor c = bgData.color();
+ if ( c.isValid() ) {
+ // show solid-colored background
+ getRenderer()->SetTexturedBackground( false ); // cancel texture mode
+ getRenderer()->SetGradientBackground( false ); // cancel gradient mode
+ getRenderer()->SetBackground( c.red()/255.0,
+ c.green()/255.0,
+ c.blue()/255.0 ); // set background color
+ ok = true;
+ }
+ break;
+ }
+ case Qtx::SimpleGradientBackground:
+ {
+ QColor c1, c2;
+ int type = bgData.gradient( c1, c2 );
+ if ( c1.isValid() )
+ {
+ if ( !c2.isValid() )
+ c2 = c1;
+
+ // show two-color gradient background
+ getRenderer()->SetTexturedBackground( false ); // cancel texture mode
+ getRenderer()->SetGradientBackground( true ); // switch to gradient mode
+
+ VTKViewer_OpenGLRenderer* aRenderer =
+ VTKViewer_OpenGLRenderer::SafeDownCast( getRenderer() );
+ if( aRenderer )
+ {
+ aRenderer->SetGradientType( type );
+ aRenderer->SetBackground( c1.redF(), c1.greenF(), c1.blueF() );
+ aRenderer->SetBackground2( c2.redF(), c2.greenF(), c2.blueF() );
+ ok = true;
+ }
+ }
+ break;
+ }
+ case Qtx::CustomGradientBackground:
+ {
+ // NOT IMPLEMENTED YET
+ getRenderer()->SetTexturedBackground( false ); // cancel texture mode
+ getRenderer()->SetGradientBackground( false ); // cancel gradient mode
+ // .........
+ break;
+ }
+ default:
+ break;
+ }
+ if ( bgData.isTextureShown() ) {
+ QString fileName;
+ int textureMode = bgData.texture( fileName );
+ QFileInfo fi( fileName );
+ if ( !fileName.isEmpty() && fi.exists() ) {
+ // read texture from file
+ QString extension = fi.suffix().toLower();
+ vtkImageReader2* aReader = 0;
+ if ( extension == "jpg" || extension == "jpeg" )
+ aReader = vtkJPEGReader::New();
+ else if ( extension == "bmp" )
+ aReader = vtkBMPReader::New();
+ else if ( extension == "tif" || extension == "tiff" )
+ aReader = vtkTIFFReader::New();
+ else if ( extension == "png" )
+ aReader = vtkPNGReader::New();
+ else if ( extension == "mhd" || extension == "mha" )
+ aReader = vtkMetaImageReader::New();
+ if ( aReader ) {
+ // create texture
+ aReader->SetFileName( fi.absoluteFilePath().toLatin1().constData() );
+ aReader->Update();
+
+ VTKViewer_Texture* aTexture = VTKViewer_Texture::New();
+ vtkImageMapToColors* aMap = 0;
+ vtkAlgorithmOutput* anOutput;
+ /*
+ // special processing for BMP reader
+ vtkBMPReader* aBMPReader = (vtkBMPReader*)aReader;
+ if ( aBMPReader ) {
+ // Special processing for BMP file
+ aBMPReader->SetAllow8BitBMP(1);
+
+ aMap = vtkImageMapToColors::New();
+ aMap->SetInputConnection( aBMPReader->GetOutputPort() );
+ aMap->SetLookupTable( (vtkScalarsToColors*)aBMPReader->GetLookupTable() );
+ aMap->SetOutputFormatToRGB();
+
+ anOutput = aMap->GetOutputPort();
+ }
+ else {
+ }
+ */
+ anOutput = aReader->GetOutputPort( 0 );
+ aTexture->SetInputConnection( anOutput );
+ // set texture mode
+ // VSR: Currently, VTK only supports Stretch mode, so below code will give
+ // the same results for all modes
+ switch ( textureMode ) {
+ case Qtx::TileTexture:
+ aTexture->RepeatOn();
+ aTexture->EdgeClampOff();
+ aTexture->InterpolateOff();
+ break;
+ case Qtx::StretchTexture:
+ aTexture->RepeatOff();
+ aTexture->EdgeClampOff();
+ aTexture->InterpolateOn();
+ break;
+ case Qtx::CenterTexture:
+ default:
+ aTexture->RepeatOff();
+ aTexture->EdgeClampOn();
+ aTexture->InterpolateOff();
+ break;
+ }
+ // show textured background
+ getRenderer()->SetTexturedBackground( true ); // switch to texture mode
+ getRenderer()->SetBackgroundTexture( aTexture ); // set texture image
+
+ // clean-up resources
+ if ( aMap )
+ aMap->Delete();
+ aReader->Delete();
+ aTexture->Delete();
+ ok = true;
+ }
+ }
+ }
}
- return palette().color( backgroundRole() );
+
+ if ( ok )
+ myBackground = bgData;
+}
+
+/*!Returns background of the viewport*/
+Qtx::BackgroundData VTKViewer_ViewWindow::background() const
+{
+ return myBackground;
}
/*!Repaint window. If \a theUpdateTrihedron is true - recalculate trihedron.*/
QString retStr;
retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e*%.12e",
- pos[0], pos[1], pos[2], focalPnt[0], focalPnt[1], focalPnt[2], viewUp[0], viewUp[1],
- viewUp[2], parScale, scale[0], scale[1], scale[2] );
+ pos[0], pos[1], pos[2], focalPnt[0], focalPnt[1], focalPnt[2], viewUp[0], viewUp[1],
+ viewUp[2], parScale, scale[0], scale[1], scale[2] );
return retStr;
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef VTKVIEWER_VIEWWINDOW_H
#define VTKVIEWER_VIEWWINDOW_H
public:
VTKViewer_ViewWindow( SUIT_Desktop*, VTKViewer_Viewer*,
VTKViewer_InteractorStyle* = 0,
- VTKViewer_RenderWindowInteractor* = 0 );
+ VTKViewer_RenderWindowInteractor* = 0 );
virtual ~VTKViewer_ViewWindow();
/*!Gets tool bar.*/
- QToolBar* getToolBar() { return myToolBar; }
+ QToolBar* getToolBar() { return myToolBar; }
- void setBackgroundColor( const QColor& );
- QColor backgroundColor() const;
+ void setBackgroundColor( const QColor& ); // obsolete
+ QColor backgroundColor() const; // obsolete
+ void setBackground( const Qtx::BackgroundData& );
+ Qtx::BackgroundData background() const;
/*!Gets renderer.*/
vtkRenderer* getRenderer() { return myRenderer; }
/*!Gets render window.*/
- VTKViewer_RenderWindow* getRenderWindow() { return myRenderWindow; }
+ VTKViewer_RenderWindow* getRenderWindow() { return myRenderWindow; }
/*!Gets render window interactor.*/
VTKViewer_RenderWindowInteractor* getRWInteractor() { return myRWInteractor; }
bool isTrihedronDisplayed();
void onBottomView();
void onLeftView();
void onRightView();
+ void onClockWiseView();
+ void onAntiClockWiseView();
void onResetView();
void onFitAll();
void activateZoom();
private:
enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId,
- FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, TrihedronShowId };
+ FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
+ ResetId, TrihedronShowId };
typedef QMap<int, QtxAction*> ActionsMap;
void createActions();
ActionsMap myActionsMap;
double myCurScale;
+ Qtx::BackgroundData myBackground;
friend class VTKViewer_RenderWindowInteractor;
};
+++ /dev/null
-# Copyright (C) 2007-2008 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 SALOMEGUI : implementation of desktop and GUI kernel
-# File : SALOMEGUI_icons.po
-# Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "ICON_VTKVIEWER_VIEW_BACK"
-msgstr "view_back.png"
-
-msgid "ICON_VTKVIEWER_VIEW_BOTTOM"
-msgstr "view_bottom.png"
-
-msgid "ICON_VTKVIEWER_VIEW_FITALL"
-msgstr "view_fitall.png"
-
-msgid "ICON_VTKVIEWER_VIEW_FITAREA"
-msgstr "view_fitarea.png"
-
-msgid "ICON_VTKVIEWER_VIEW_FRONT"
-msgstr "view_front.png"
-
-msgid "ICON_VTKVIEWER_VIEW_GLOBALPAN"
-msgstr "view_glpan.png"
-
-msgid "ICON_VTKVIEWER_VIEW_LEFT"
-msgstr "view_left.png"
-
-msgid "ICON_VTKVIEWER_VIEW_PAN"
-msgstr "view_pan.png"
-
-msgid "ICON_VTKVIEWER_VIEW_RESET"
-msgstr "view_reset.png"
-
-msgid "ICON_VTKVIEWER_VIEW_RIGHT"
-msgstr "view_right.png"
-
-msgid "ICON_VTKVIEWER_VIEW_ROTATION_POINT"
-msgstr "view_rotation_point.png"
-
-msgid "ICON_VTKVIEWER_VIEW_ROTATE"
-msgstr "view_rotate.png"
-
-msgid "ICON_VTKVIEWER_VIEW_TOP"
-msgstr "view_top.png"
-
-msgid "ICON_VTKVIEWER_VIEW_ZOOM"
-msgstr "view_zoom.png"
-
-msgid "ICON_VTKVIEWER_VIEW_TRIHEDRON"
-msgstr "view_triedre.png"
-
-msgid "ICON_VTKVIEWER_VIEW_DUMP"
-msgstr "view_camera_dump.png"
-
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
+ <message>
+ <source>ICON_VERTEX_MARKER_1</source>
+ <translation>marker_1.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_2</source>
+ <translation>marker_2.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_3</source>
+ <translation>marker_3.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_4</source>
+ <translation>marker_4.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_5</source>
+ <translation>marker_5.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_6</source>
+ <translation>marker_6.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_7</source>
+ <translation>marker_7.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_8</source>
+ <translation>marker_8.png</translation>
+ </message>
+ <message>
+ <source>ICON_VERTEX_MARKER_9</source>
+ <translation>marker_9.png</translation>
+ </message>
<message>
<source>ICON_VTKVIEWER_VIEW_GLOBALPAN</source>
<translation>vtk_view_glpan.png</translation>
<source>ICON_VTKVIEWER_VIEW_TRIHEDRON</source>
<translation>vtk_view_triedre.png</translation>
</message>
+ <message>
+ <source>ICON_VTKVIEWER_VIEW_CLOCKWISE</source>
+ <translation>occ_view_clockwise.png</translation>
+ </message>
+ <message>
+ <source>ICON_VTKVIEWER_VIEW_ANTICLOCKWISE</source>
+ <translation>occ_view_anticlockwise.png</translation>
+ </message>
</context>
</TS>
+++ /dev/null
-# Copyright (C) 2007-2008 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 SALOMEGUI : implementation of desktop and GUI kernel
-# File : SALOMEGUI_msg_en.po
-# Module : SALOME
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: example-Qt-message-extraction\n"
-"POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 2005-05-31 13:25+0400\n"
-"Last-Translator: \n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-msgid "LBL_TOOLBAR_LABEL"
-msgstr "View Operations"
-
-msgid "DSC_FRONT_VIEW"
-msgstr "Front View"
-
-msgid "MNU_FRONT_VIEW"
-msgstr "Front"
-
-msgid "DSC_BACK_VIEW"
-msgstr "Back View"
-
-msgid "MNU_BACK_VIEW"
-msgstr "Back"
-
-msgid "DSC_TOP_VIEW"
-msgstr "Top View"
-
-msgid "MNU_TOP_VIEW"
-msgstr "Top"
-
-msgid "DSC_BOTTOM_VIEW"
-msgstr "Bottom View"
-
-msgid "MNU_BOTTOM_VIEW"
-msgstr "Bottom"
-
-msgid "DSC_LEFT_VIEW"
-msgstr "Left View"
-
-msgid "MNU_LEFT_VIEW"
-msgstr "Left"
-
-msgid "DSC_RIGHT_VIEW"
-msgstr "Right View"
-
-msgid "MNU_RIGHT_VIEW"
-msgstr "Right"
-
-msgid "DSC_RESET_VIEW"
-msgstr "Reset View Point"
-
-msgid "MNU_RESET_VIEW"
-msgstr "Reset"
-
-msgid "DSC_FITALL"
-msgstr "Fit all objects inside the view frame"
-
-msgid "MNU_FITALL"
-msgstr "Fit All"
-
-msgid "DSC_FITRECT"
-msgstr "Fit area within the view frame"
-
-msgid "MNU_FITRECT"
-msgstr "Fit Area"
-
-msgid "DSC_ZOOM_VIEW"
-msgstr "Zoom the view"
-
-msgid "MNU_ZOOM_VIEW"
-msgstr "Zoom"
-
-msgid "DSC_PAN_VIEW"
-msgstr "Panning the view"
-
-msgid "MNU_PAN_VIEW"
-msgstr "Panning"
-
-msgid "DSC_GLOBALPAN_VIEW"
-msgstr "Selection of a new center of the view"
-
-msgid "MNU_GLOBALPAN_VIEW"
-msgstr "Global Panning"
-
-msgid "DSC_ROTATE_VIEW"
-msgstr "Rotation of the point of view around the scene center"
-
-msgid "MNU_ROTATE_VIEW"
-msgstr "Rotation"
-
-msgid "DSC_DUMP_VIEW"
-msgstr "Saves the active view in the image file"
-
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "VTK_IMAGE_FILES"
-msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
-
-msgid "INF_APP_DUMP_VIEW"
-msgstr "Dump view"
-
-msgid "ERR_DOC_CANT_SAVE_FILE"
-msgstr "Cannot save file"
-
-msgid "ERROR"
-msgstr "Error"
-
-msgid "VTKViewer_Viewer::MEN_DUMP_VIEW"
-msgstr "Dump view..."
-
-msgid "VTKViewer_Viewer::MEN_SHOW_TOOLBAR"
-msgstr "Show toolbar"
-
-msgid "VTKViewer_Viewer::MEN_CHANGE_BACKGROUD"
-msgstr "Change background..."
-
-msgid "VTKViewer_ViewManager::VTK_VIEW_TITLE"
-msgstr "VTK scene:%M - viewer:%V"
-
-msgid "MNU_SHOW_TRIHEDRON"
-msgstr "Show/Hide trihedron"
-
-msgid "DSC_SHOW_TRIHEDRON"
-msgstr "Show/Hide trihedron in the current view"
-<!DOCTYPE TS><TS>
-<!--
- Copyright (C) 2007-2008 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
-
--->
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
+ <message>
+ <source>DSC_ANTICLOCKWISE_VIEW</source>
+ <translation>Rotate view counterclockwise</translation>
+ </message>
+ <message>
+ <source>DSC_CLOCKWISE_VIEW</source>
+ <translation>Rotate View Clockwise</translation>
+ </message>
+ <message>
+ <source>MNU_ANTICLOCKWISE_VIEW</source>
+ <translation>Rotate counterclockwise</translation>
+ </message>
+ <message>
+ <source>MNU_CLOCKWISE_VIEW</source>
+ <translation>Rotate clockwise</translation>
+ </message>
<message>
<source>MNU_FRONT_VIEW</source>
<translation>Front</translation>
<translation>Back View</translation>
</message>
</context>
+<context>
+ <name>VTKViewer_MarkerDlg</name>
+ <message>
+ <source>SET_MARKER_TLT</source>
+ <translation>Set Point Marker</translation>
+ </message>
+</context>
+<context>
+ <name>VTKViewer_MarkerWidget</name>
+ <message>
+ <source>STANDARD_MARKER</source>
+ <translation>Standard</translation>
+ </message>
+ <message>
+ <source>CUSTOM_MARKER</source>
+ <translation>Custom</translation>
+ </message>
+ <message>
+ <source>TYPE</source>
+ <translation>Type:</translation>
+ </message>
+ <message>
+ <source>SCALE</source>
+ <translation>Scale:</translation>
+ </message>
+ <message>
+ <source>CUSTOM</source>
+ <translation>Texture:</translation>
+ </message>
+ <message>
+ <source>BROWSE</source>
+ <translation>Browse...</translation>
+ </message>
+ <message>
+ <source>LOAD_TEXTURE_TLT</source>
+ <translation>Load Texture</translation>
+ </message>
+</context>
<context>
<name>VTKViewer_ViewManager</name>
<message>
<translation>Show Toolbar</translation>
</message>
<message>
- <source>MEN_CHANGE_BACKGROUD</source>
+ <source>MEN_CHANGE_BACKGROUND</source>
<translation>Change Background...</translation>
</message>
+ <message>
+ <source>GT_HORIZONTALGRADIENT</source>
+ <translation>Horizontal gradient</translation>
+ </message>
+ <message>
+ <source>GT_VERTICALGRADIENT</source>
+ <translation>Vertical gradient</translation>
+ </message>
+ <message>
+ <source>GT_FIRSTDIAGONALGRADIENT</source>
+ <translation>First diagonal gradient</translation>
+ </message>
+ <message>
+ <source>GT_SECONDDIAGONALGRADIENT</source>
+ <translation>Second diagonal gradient</translation>
+ </message>
+ <message>
+ <source>GT_FIRSTCORNERGRADIENT</source>
+ <translation>First corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_SECONDCORNERGRADIENT</source>
+ <translation>Second corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_THIRDCORNERGRADIENT</source>
+ <translation>Third corner gradient</translation>
+ </message>
+ <message>
+ <source>GT_FOURTHCORNERGRADIENT</source>
+ <translation>Fourth corner gradient</translation>
+ </message>
+ <message>
+ <source>BG_IMAGE_FILES</source>
+ <translation>Image files (*.png *.jpg *.jpeg *.bmp *.tif *.tiff *.mhd *.mha)</translation>
+ </message>
</context>
</TS>
+++ /dev/null
-# Copyright (C) 2007-2008 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
-#
-
-TEMPLATE = subdirs
-CONFIG += ordered
-
-SUBDIRS = Qtx
-SUBDIRS += DDS
-SUBDIRS += QDS
-SUBDIRS += SUIT
-SUBDIRS += SUITApp
-SUBDIRS += STD
-SUBDIRS += CAF
-SUBDIRS += CAM
-SUBDIRS += LogWindow
-SUBDIRS += PyInterp
-SUBDIRS += PyConsole
-SUBDIRS += Prs
-SUBDIRS += OBJECT
-SUBDIRS += GLViewer
-SUBDIRS += VTKViewer
-SUBDIRS += SVTK
-SUBDIRS += OCCViewer
-SUBDIRS += SOCC
-SUBDIRS += Plot2d
-SUBDIRS += SPlot2d
-SUBDIRS += SUPERVGraph
-SUBDIRS += QxGraph
-SUBDIRS += Event
-SUBDIRS += LightApp
-SUBDIRS += ResExporter
-SUBDIRS += TOOLSGUI
-SUBDIRS += SalomeApp
-SUBDIRS += Session