From 9a9e013a0096c679edc8a2b4c9799eaa22772ce5 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 3 Apr 2006 07:09:44 +0000 Subject: [PATCH] Porting on Mandriva 64 --- adm_local/unix/config_files/check_opengl.m4 | 187 +++++++++++------- adm_local/unix/config_files/check_pyqt.m4 | 35 ++-- adm_local/unix/config_files/check_qt.m4 | 13 +- adm_local/unix/config_files/check_qwt.m4 | 5 +- adm_local/unix/config_files/check_sip.m4 | 37 ++-- adm_local/unix/config_files/check_vtk.m4 | 27 ++- adm_local/unix/make_conclude.in | 19 +- src/GLViewer/GLViewer_Drawer.cxx | 8 +- src/GLViewer/Makefile.in | 2 +- src/Qtx/QtxMainWindow.cxx | 2 +- src/RegistryDisplay/RegWidget.cxx | 24 ++- src/SVTK/SALOME_Actor.cxx | 49 ++--- src/SVTK/SALOME_Actor.h | 6 +- src/SVTK/SVTK_Actor.cxx | 2 +- src/SVTK/SVTK_CubeAxesActor2D.cxx | 51 +++-- src/SVTK/SVTK_CubeAxesDlg.cxx | 4 +- src/SVTK/SVTK_DeviceActor.cxx | 18 +- src/SVTK/SVTK_DeviceActor.h | 20 +- src/SVTK/SVTK_InteractorStyle.cxx | 2 +- src/SVTK/SVTK_MainWindow.cxx | 2 +- src/SVTK/SVTK_RectPicker.cxx | 65 +++--- src/SVTK/SVTK_RectPicker.h | 29 ++- src/SVTK/SVTK_Renderer.cxx | 8 +- src/SVTK/SVTK_Renderer.h | 4 +- src/SVTK/SVTK_View.cxx | 10 +- src/TOOLSGUI/ToolsGUI_RegWidget.cxx | 26 ++- src/VTKViewer/Makefile.in | 4 - src/VTKViewer/VTKViewer_Actor.cxx | 36 ++-- src/VTKViewer/VTKViewer_Actor.h | 36 ++-- src/VTKViewer/VTKViewer_ConvexTool.cxx | 86 ++++---- src/VTKViewer/VTKViewer_ConvexTool.h | 6 +- .../VTKViewer_ExtractUnstructuredGrid.cxx | 6 +- src/VTKViewer/VTKViewer_GeometryFilter.cxx | 2 +- src/VTKViewer/VTKViewer_InteractorStyle.cxx | 34 ++-- src/VTKViewer/VTKViewer_InteractorStyle.h | 6 +- src/VTKViewer/VTKViewer_RenderWindow.cxx | 2 +- .../VTKViewer_RenderWindowInteractor.cxx | 2 +- src/VTKViewer/VTKViewer_ShrinkFilter.cxx | 4 +- src/VTKViewer/VTKViewer_Trihedron.cxx | 28 +-- src/VTKViewer/VTKViewer_Trihedron.h | 16 +- src/VTKViewer/VTKViewer_Utilities.cxx | 54 ++--- src/VTKViewer/VTKViewer_Utilities.h | 12 +- src/VTKViewer/VTKViewer_ViewWindow.cxx | 16 +- 43 files changed, 567 insertions(+), 438 deletions(-) diff --git a/adm_local/unix/config_files/check_opengl.m4 b/adm_local/unix/config_files/check_opengl.m4 index dd43d25a0..0552a4bb5 100644 --- a/adm_local/unix/config_files/check_opengl.m4 +++ b/adm_local/unix/config_files/check_opengl.m4 @@ -22,122 +22,171 @@ dnl AC_DEFUN([CHECK_OPENGL],[ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl +AC_REQUIRE([AC_LINKER_OPTIONS])dnl + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + AC_ARG_WITH(opengl, - [ --with-opengl=DIR root directory path of OpenGL installation ], - [ - opengl_dir="$withval" - local_opengl=yes - ], [ - dirs="/usr/lib /usr/local/lib /opt/graphics/OpenGL/lib /usr/openwin/lib /usr/X11R6/lib" - ])dnl + [AC_HELP_STRING([--with-opengl=DIR],[root directory path of OpenGL installation])], + [opengl_dir="$withval"], + [dirs="/usr/lib${LIB_LOCATION_SUFFIX} /usr/local/lib${LIB_LOCATION_SUFFIX} /opt/graphics/OpenGL/lib${LIB_LOCATION_SUFFIX} /usr/openwin/lib${LIB_LOCATION_SUFFIX} /usr/X11R6/lib${LIB_LOCATION_SUFFIX}"])dnl AC_CHECKING(for OpenGL) - -AC_SUBST(OGL_INCLUDES) -AC_SUBST(OGL_LIBS) +AC_CHECKING(for OpenGL headers) OGL_INCLUDES="" OGL_LIBS="" OpenGL_ok=no +OpenGL_libs_ok=no +OpenGL_headers_ok=no dnl openGL headers - # by default - -if test "x$local_opengl" = "xyes" ; then - if test -f "${opengl_dir}/include/GL/gl.h" ; then - OpenGL_ok=yes - OGL_INCLUDES="-I${opengl_dir}/include" - if test "x${opengl_dir}" = "x/usr" - then - OGL_LIBS="" - else - OGL_LIBS="-L${opengl_dir}/lib" - fi - AC_MSG_RESULT(select OpenGL distribution in ${opengl_dir}) - else - AC_MSG_RESULT(no gl.h header file in ${opengl_dir}/include/GL) - fi +if test "x${opengl_dir}" != "x" ; then + AC_MSG_RESULT(for opengl_dir: $opengl_dir) + AC_CHECK_HEADER([${opengl_dir}/include/GL/gl.h], + [OpenGL_headers_ok=yes; OGL_INCLUDES="-I${opengl_dir}/include"], + [OpenGL_headers_ok=no]) + if test "x${OpenGL_headers_ok}" = "xyes" ; then + AC_CHECKING(for default OpenGL library) + if test "x${opengl_dir}" = "x/usr" ; then + OGL_LIBS="" + else + OGL_LIBS="-L${opengl_dir}/lib" + fi + LDFLAGS_old="$LDFLAGS" + LDFLAGS="$LDFLAGS $OGL_LIBS" + AC_CHECK_LIB([GL], + [glBegin], + [OpenGL_libs_ok=yes], + [OpenGL_libs_ok=no]) + if test "x${OpenGL_libs_ok}" = "xyes" ; then + AC_TRY_LINK([], + [], + [OpenGL_libs_ok=yes ; OpenGL_ok=yes; OGL_LIBS="$OGL_LIBS -lGL"], + [OpenGL_libs_ok=no]) + fi + LDFLAGS="$LDFLAGS_old" + fi fi -if test "x$OpenGL_ok" = "xno" -then - AC_CHECK_HEADERS(GL/gl.h, [OpenGL_ok=yes]) +if test "x${OpenGL_headers_ok}" = "xno" ; then + AC_CHECK_HEADER(GL/gl.h, + [OpenGL_headers_ok=yes], + [OpenGL_headers_ok=no]) fi -if test "x$OpenGL_ok" = "xno" -then # under SunOS ? +if test "x${OpenGL_headers_ok}" = "xno" ; then AC_CHECK_HEADERS(/usr/openwin/share/include/GL/glxmd.h, - [OpenGL_ok=yes] - OGL_INCLUDES="-I/usr/openwin/share/include/") + [OpenGL_headers_ok=yes; OGL_INCLUDES="-I/usr/openwin/share/include/"], + [OpenGL_headers_ok=no]) fi -if test "x$OpenGL_ok" = "xno" -then # under IRIX ? +if test "x${OpenGL_headers_ok}" = "xno" ; then AC_CHECK_HEADERS(/opt/graphics/OpenGL/include/GL/glxmd.h, - [OpenGL_ok=yes] - OGL_INCLUDES="-I/opt/graphics/OpenGL/include") + [OpenGL_headers_ok=yes; OGL_INCLUDES="-I/opt/graphics/OpenGL/include"], + [OpenGL_headers_ok=no]) fi -if test "x$OpenGL_ok" = "xno" -then + # some linux OpenGL servers hide the includes in /usr/X11R6/include/GL +if test "x${OpenGL_headers_ok}" = "xno" ; then AC_CHECK_HEADERS(/usr/X11R6/include/GL/gl.h, - [OpenGL_ok=yes] - OGL_INCLUDES="-I/usr/X11R6/include") + [OpenGL_headers_ok=yes; OGL_INCLUDES="-I/usr/X11R6/include"], + [OpenGL_headers_ok=no]) fi -if test "x$OpenGL_ok" = "xyes" -then +if test "x${OpenGL_headers_ok}" = "xyes" ; then AC_CHECKING(for OpenGL library) - OpenGL_ok=no - for i in $dirs; do - if test -r "$i/libGL.so"; then -dnl AC_MSG_RESULT(in $i) - if test "x$i" = "x/usr/lib" - then + for idir in $dirs; do + if test -r "${idir}/libGL.so"; then + AC_MSG_RESULT(in ${idir}) + if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then OGL_LIBS="" else - OGL_LIBS="-L$i" + OGL_LIBS="-L${idir}" fi break fi -# under IRIX ? - if test -r "$i/libGL.sl"; then -dnl AC_MSG_RESULT(in $i) - if test "x$i" = "x/usr/lib" - then + # under IRIX ? + if test -r "${idir}/libGL.sl"; then + AC_MSG_RESULT(in ${idir}) + if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then OGL_LIBS="" else - OGL_LIBS="-L$i" + OGL_LIBS="-L${idir}" fi break fi done LDFLAGS_old="$LDFLAGS" LDFLAGS="$LDFLAGS $OGL_LIBS" - AC_CHECK_LIB(GL,glBegin,OpenGL_ok=yes,OpenGL_ok=no) + AC_CHECK_LIB([GL], + [glBegin], + [OpenGL_libs_ok=yes], + [OpenGL_libs_ok=no]) + if test "x${OpenGL_libs_ok}" = "xyes" ; then + AC_TRY_LINK([], + [], + [OpenGL_libs_ok=yes ; OGL_LIBS="$OGL_LIBS -lGL"], + [OpenGL_libs_ok=no]) + fi LDFLAGS="$LDFLAGS_old" fi -if test "x$OpenGL_ok" = "xyes" ; then - OGL_LIBS="$OGL_LIBS -lGL" +if test "x${OpenGL_libs_ok}" = "xyes" ; then + for idir in $dirs; do + if test -r "${idir}/libGLU.so"; then + AC_MSG_RESULT(in ${idir}) + if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then + OGL_LIBS="" + else + OGL_LIBS="-L${idir}" + fi + break + fi + # under IRIX ? + if test -r "${idir}/libGLU.sl"; then + AC_MSG_RESULT(in ${idir}) + if test "x${idir}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then + OGL_LIBS="" + else + OGL_LIBS="-L${idir}" + fi + break + fi + done + LDFLAGS_old="$LDFLAGS" + LDFLAGS="$LDFLAGS $OGL_LIBS" + AC_CHECK_LIB([GLU], + [gluBeginSurface], + [OpenGL_libs_ok=yes], + [OpenGL_libs_ok=no]) + if test "x${OpenGL_libs_ok}" = "xyes" ; then + AC_TRY_LINK([], + [], + [OpenGL_libs_ok=yes ; OGL_LIBS="$OGL_LIBS -lGLU"], + [OpenGL_libs_ok=no]) + fi + LDFLAGS="$LDFLAGS_old" fi +if test "x${OpenGL_headers_ok}" = "xyes" ; then + if test "x${OpenGL_libs_ok}" = "xyes" ; then + OpenGL_ok=yes + fi +fi -OpenGLU_ok=no -LDFLAGS_old="$LDFLAGS" -LDFLAGS="$LDFLAGS $OGL_LIBS" -AC_CHECK_LIB(GLU,gluBeginSurface,OpenGLU_ok=yes,OpenGLU_ok=no) -LDFLAGS="$LDFLAGS_old" +AC_MSG_RESULT(for OpenGL_headers_ok: $OpenGL_headers_ok) +AC_MSG_RESULT(for OpenGL_libs_ok: $OpenGL_libs_ok) +AC_MSG_RESULT(for OpenGL_ok: $OpenGL_ok) -if test "x$OpenGLU_ok" = "xyes" ; then - OGL_LIBS="$OGL_LIBS -lGLU" -fi +AC_SUBST(OGL_INCLUDES) +AC_SUBST(OGL_LIBS) -# Save cache -AC_CACHE_SAVE +AC_LANG_RESTORE ])dnl diff --git a/adm_local/unix/config_files/check_pyqt.m4 b/adm_local/unix/config_files/check_pyqt.m4 index ee024efaf..7be124e24 100644 --- a/adm_local/unix/config_files/check_pyqt.m4 +++ b/adm_local/unix/config_files/check_pyqt.m4 @@ -4,6 +4,7 @@ AC_DEFUN([CHECK_PYQT],[ AC_REQUIRE([CHECK_PYTHON])dnl AC_REQUIRE([CHECK_QT])dnl AC_REQUIRE([CHECK_SIP])dnl +AC_REQUIRE([AC_LINKER_OPTIONS])dnl AC_LANG_SAVE AC_LANG_CPLUSPLUS @@ -119,15 +120,15 @@ if test "x${PYQTDIR}" != "x"; then fi fi if test "x$pyqt_lib_ok" == "xno"; then - dnl try {PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages - if test -d {PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages; then - AC_CHECK_FILE(${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) + dnl try {PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages + if test -d {PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages; then + AC_CHECK_FILE(${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then - PYQT_LIBS="-L${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages -lqtcmodule" + PYQT_LIBS="-L${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule" else - AC_CHECK_FILE(${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) + AC_CHECK_FILE(${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then - PYQT_LIBS="-L${PYQTDIR}/lib/python${PYTHON_VERSION}/site-packages" + PYQT_LIBS="-L${PYQTDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages" fi fi fi @@ -160,30 +161,30 @@ if test "x$pyqt_lib_ok" == "xno"; then fi fi if test "x$pyqt_lib_ok" == "xno"; then - dnl try ${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages + dnl try ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages if test "x${PYTHONHOME}" != "x"; then - if test -d ${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages ; then - AC_CHECK_FILE(${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) + if test -d ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then + AC_CHECK_FILE(${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then - PYQT_LIBS="-L${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages -lqtcmodule" + PYQT_LIBS="-L${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule" else - AC_CHECK_FILE(${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) + AC_CHECK_FILE(${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then - PYQT_LIBS="-L${PYTHONHOME}/lib/python${PYTHON_VERSION}/site-packages" + PYQT_LIBS="-L${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages" fi fi fi fi fi if test "x$pyqt_lib_ok" == "xno"; then - dnl try /usr/lib/python${PYTHON_VERSION}/site-packages - AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) + dnl try /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages + AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libqtcmodule.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then - PYQT_LIBS="-L/usr/lib/python${PYTHON_VERSION}/site-packages -lqtcmodule" + PYQT_LIBS="-L/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lqtcmodule" else - AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) + AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/qt.so,pyqt_lib_ok=yes,pyqt_lib_ok=no) if test "x$pyqt_lib_ok" == "xyes"; then - PYQT_LIBS="-L/usr/lib/python${PYTHON_VERSION}/site-packages" + PYQT_LIBS="-L/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages" fi fi fi diff --git a/adm_local/unix/config_files/check_qt.m4 b/adm_local/unix/config_files/check_qt.m4 index ab2869c21..ba72a02d4 100644 --- a/adm_local/unix/config_files/check_qt.m4 +++ b/adm_local/unix/config_files/check_qt.m4 @@ -26,8 +26,14 @@ AC_REQUIRE([AC_PROG_CXX])dnl AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([AC_PROG_CXXCPP])dnl AC_REQUIRE([CHECK_OPENGL])dnl +AC_REQUIRE([AC_LINKER_OPTIONS])dnl AC_CHECKING(for QT) + +if test "x$OpenGL_ok" != "xyes" ; then + AC_MSG_WARN(Qt needs OpenGL correct configuration, check configure output) +fi + qt_ok=yes AC_LANG_SAVE @@ -117,7 +123,7 @@ then then LIBS="$LIBS -lqt-mt $OGL_LIBS" else - LIBS="$LIBS -L$QTDIR/lib -lqt-mt $OGL_LIBS" + LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt $OGL_LIBS" fi CXXFLAGS_old=$CXXFLAGS @@ -145,8 +151,8 @@ then QT_LIBS=" -lqt-mt" QT_MT_LIBS=" -lqt-mt" else - QT_LIBS="-L$QTDIR/lib -lqt-mt" - QT_MT_LIBS="-L$QTDIR/lib -lqt-mt" + QT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt" + QT_MT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt" fi fi @@ -160,6 +166,7 @@ AC_SUBST(UIC) AC_SUBST(QT_ROOT) AC_SUBST(QT_INCLUDES) +AC_SUBST(QT_MT_INCLUDES) AC_SUBST(QT_LIBS) AC_SUBST(QT_MT_LIBS) AC_SUBST(QT_VERS) diff --git a/adm_local/unix/config_files/check_qwt.m4 b/adm_local/unix/config_files/check_qwt.m4 index 13bf90914..d9bc23fbf 100644 --- a/adm_local/unix/config_files/check_qwt.m4 +++ b/adm_local/unix/config_files/check_qwt.m4 @@ -2,6 +2,7 @@ dnl Copyright (C) 2003 CEA/DEN, EDF R&D AC_DEFUN([CHECK_QWT],[ AC_REQUIRE([CHECK_QT])dnl +AC_REQUIRE([AC_LINKER_OPTIONS])dnl AC_CHECKING(for qwt) @@ -26,7 +27,7 @@ if test -z $QWTHOME; then exits_ok=no if test "x$exits_ok" = "xno"; then for d in /usr/local /usr ; do - AC_CHECK_FILE(${d}/lib/libqwt.so,exits_ok=yes,exits_ok=no) + AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exits_ok=yes,exits_ok=no) if test "x$exits_ok" = "xyes"; then QWTHOME=$d AC_MSG_RESULT(libqwt.so detected in $d/lib) @@ -91,7 +92,7 @@ then then LIBS="$LIBS -lqt-mt" else - LIBS="$LIBS -L$QTDIR/lib -lqt-mt" + LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt" fi if test "x$QWTHOME" = "x/usr" then diff --git a/adm_local/unix/config_files/check_sip.m4 b/adm_local/unix/config_files/check_sip.m4 index 245f2382e..83af9a907 100644 --- a/adm_local/unix/config_files/check_sip.m4 +++ b/adm_local/unix/config_files/check_sip.m4 @@ -3,6 +3,7 @@ dnl Copyright (C) 2003 CEA/DEN, EDF R&D AC_DEFUN([CHECK_SIP],[ AC_REQUIRE([CHECK_PYTHON])dnl AC_REQUIRE([CHECK_QT])dnl +AC_REQUIRE([AC_LINKER_OPTIONS])dnl sip_ok=yes @@ -110,44 +111,44 @@ else fi if test "x$sip_lib_ok" == "xno" ; then - dnl look for (lib)sip.so in ${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages - if test -d ${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages ; then - AC_CHECK_FILE(${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no) + dnl look for (lib)sip.so in ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages + if test -d ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then + AC_CHECK_FILE(${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no) if test "x$sip_lib_ok" == "xyes" ; then - SIP_LIBS="-L${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages -lsip" + SIP_LIBS="-L${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lsip" else - AC_CHECK_FILE(${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no) + AC_CHECK_FILE(${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no) if test "x$sip_lib_ok" == "xyes" ; then - SIP_LIBS="-L${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages" + SIP_LIBS="-L${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages" fi fi fi fi fi if test "x$sip_lib_ok" == "xno" ; then - dnl look for (lib)sip.so in ${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages - if test -d ${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages ; then - AC_CHECK_FILE(${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no) + dnl look for (lib)sip.so in ${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages + if test -d ${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then + AC_CHECK_FILE(${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no) if test "x$sip_lib_ok" == "xyes" ; then - SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages -lsip" + SIP_LIBS="-L${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lsip" else - AC_CHECK_FILE(${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no) + AC_CHECK_FILE(${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no) if test "x$sip_lib_ok" == "xyes" ; then - SIP_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/site-packages" + SIP_LIBS="-L${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages" fi fi fi fi if test "x$sip_lib_ok" == "xno" ; then - dnl look for (lib)sip.so in /usr/lib/python${PYTHON_VERSION}/site-packages - if test -d /usr/lib/python${PYTHON_VERSION}/site-packages ; then - AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no) + dnl look for (lib)sip.so in /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages + if test -d /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages ; then + AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/libsip.so,sip_lib_ok=yes,sip_lib_ok=no) if test "x$sip_lib_ok" == "xyes" ; then - SIP_LIBS="-L$/usr/lib/python${PYTHON_VERSION}/site-packages -lsip" + SIP_LIBS="-L$/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages -lsip" else - AC_CHECK_FILE(/usr/lib/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no) + AC_CHECK_FILE(/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages/sip.so,sip_lib_ok=yes,sip_lib_ok=no) if test "x$sip_lib_ok" == "xyes" ; then - SIP_LIBS="-L/usr/lib/python${PYTHON_VERSION}/site-packages" + SIP_LIBS="-L/usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages" fi fi fi diff --git a/adm_local/unix/config_files/check_vtk.m4 b/adm_local/unix/config_files/check_vtk.m4 index df9245b5d..ce56911f4 100644 --- a/adm_local/unix/config_files/check_vtk.m4 +++ b/adm_local/unix/config_files/check_vtk.m4 @@ -25,6 +25,7 @@ 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_CHECKING(for VTK) @@ -41,13 +42,11 @@ VTKPY_MODULES="" vtk_ok=no -AC_PATH_X - -if test "x$OpenGL_ok" != "xyes" -then - AC_MSG_WARN(vtk needs OpenGL correct configuration, check configure output) +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" @@ -86,8 +85,8 @@ fi if test ! -z $VTKHOME then LOCAL_INCLUDES="-I$VTKHOME/include/vtk $LOCAL_INCLUDES" - LOCAL_LIBS="-L$VTKHOME/lib/vtk $LOCAL_LIBS" - TRY_LINK_LIBS="-L$VTKHOME/lib/vtk $TRY_LINK_LIBS" + LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk -L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk/python $LOCAL_LIBS" + TRY_LINK_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk -L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk/python $TRY_LINK_LIBS" fi dnl vtk headers @@ -115,10 +114,10 @@ AC_CHECK_HEADER(vtkPlane.h,vtk_ok="yes",vtk_ok="no") dnl VTKPY_MODULES="$VTKHOME/python" AC_CACHE_VAL(salome_cv_lib_vtk,[ - AC_TRY_LINK( -#include "vtkPlane.h" -, vtkPlane *p = vtkPlane::New();, - eval "salome_cv_lib_vtk=yes",eval "salome_cv_lib_vtk=no") + 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" @@ -136,13 +135,11 @@ else VTK_MT_LIBS="$LOCAL_LIBS" fi -AC_MSG_RESULT("for vtk: $vtk_ok") +AC_MSG_RESULT(for vtk: $vtk_ok) AC_LANG_RESTORE # Save cache AC_CACHE_SAVE -])dnl - - +])dnl \ No newline at end of file diff --git a/adm_local/unix/make_conclude.in b/adm_local/unix/make_conclude.in index c79350747..58b0b8f39 100644 --- a/adm_local/unix/make_conclude.in +++ b/adm_local/unix/make_conclude.in @@ -89,7 +89,7 @@ $(LIB_BUILD_SO): $(top_builddir)/lib/salome/%.so: %.so ln -sf $(CURDIR)/$< $@ || true $(LIB): $(LIB_OBJ) - @$(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) + $(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) @@ -111,10 +111,10 @@ 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))) +BIN_OBJ_C = $(patsubst %.c, %.lo, $(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))) +BIN_OBJ_CC = $(patsubst %.cc, %.lo, $(filter %.cc, $(BIN_SRC))) +BIN_OBJ_CXX = $(patsubst %.cxx, %.lo, $(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) @@ -127,7 +127,7 @@ $(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/ ln -sf $(CURDIR)/$< $@ $(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN) + $(LT) --mode=link $(CXX) -rpath $(libdir) -o $@ $^ $(CXXFLAGS) $(CPPFLAGS) $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN) # copy python scripts in $(top_builddir)/bin/salome # @@ -205,7 +205,8 @@ $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir): 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); \ + echo "($(LT_INSTALL_LIB) '$$f' '$(libdir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_LIB) "$$f" "$(libdir)/$$f" || exit 1); \ fi; \ done @if ! test -z $(LIB_SWIG) ; then \ @@ -213,13 +214,15 @@ install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir fi; @for f in X $(BIN); do \ if test $$f != X; then \ - ($(LT_INSTALL_PROG) $$f $(bindir)/. || exit 1); \ + echo "($(LT_INSTALL_PROG) '$$f' '$(bindir)/$f' || exit 1)"; \ + ($(LT_INSTALL_PROG) "$$f" "$(bindir)/$f" || 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); \ + echo "($(LT_INSTALL_PROG) '$$f' '$(bindir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_PROG) "$$f" "$(bindir)/$$f" || exit 1); \ fi; \ done # Install exported includes in includedir diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index 9a0f3ef6b..b63cdda60 100644 --- a/src/GLViewer/GLViewer_Drawer.cxx +++ b/src/GLViewer/GLViewer_Drawer.cxx @@ -160,7 +160,7 @@ bool GLViewer_TexFont::generateTexture() aFindFont.myIsItal = myQFont.italic(); aFindFont.myIsUndl = myQFont.underline(); aFindFont.myPointSize = myQFont.pointSize(); - aFindFont.myViewPortId = (int)QGLContext::currentContext(); + aFindFont.myViewPortId = size_t(QGLContext::currentContext()); if( TexFontBase.contains( aFindFont ) ) { @@ -421,7 +421,7 @@ static GLuint displayListBase( QFont* theFont ) return aList; } - aFindFont.myViewPortId = (int)aCont; + aFindFont.myViewPortId = size_t(aCont); if ( GLViewer_TexFont::BitmapFontCache.contains( aFindFont ) ) aList = GLViewer_TexFont::BitmapFontCache[aFindFont]; @@ -431,7 +431,7 @@ static GLuint displayListBase( QFont* theFont ) QMap::iterator it = GLViewer_TexFont::BitmapFontCache.begin(); for ( ; it != GLViewer_TexFont::BitmapFontCache.end(); ++it ) { - if ( it.key().myViewPortId == (int)aCont && it.data() > listBase ) + if ( it.key().myViewPortId == size_t(aCont) && it.data() > listBase ) listBase = it.data(); } listBase += 256; @@ -810,7 +810,7 @@ void GLViewer_Drawer::drawGLText( QString text, float x, float y, { QFont aFont( myFont ); if( smallFont ) - aFont.setPointSize( aFont.pointSize() * 0.8 ); + aFont.setPointSize( int(aFont.pointSize() * 0.8) ); GLfloat scale = textScale() > 0. ? textScale() : 1.; diff --git a/src/GLViewer/Makefile.in b/src/GLViewer/Makefile.in index d921dd294..ef505528f 100644 --- a/src/GLViewer/Makefile.in +++ b/src/GLViewer/Makefile.in @@ -98,6 +98,6 @@ CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) LDFLAGS+=$(QT_MT_LIBS) $(CAS_KERNEL) -LIBS+= -L${GUI_ROOT_DIR}/lib/salome -lsuit -L/usr/X11R6/lib -lGLU +LIBS+= -L${GUI_ROOT_DIR}/lib/salome -lsuit -L/usr/X11R6/lib@LIB_LOCATION_SUFFIX@ -lGLU @CONCLUDE@ diff --git a/src/Qtx/QtxMainWindow.cxx b/src/Qtx/QtxMainWindow.cxx index b8968ef8c..5f7ce9a2e 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -246,7 +246,7 @@ void QtxMainWindow::customEvent( QCustomEvent* e ) { QMainWindow::customEvent( e ); - int mode = (int)e->data(); + size_t mode = size_t(e->data()); switch ( mode ) { case WS_Normal: diff --git a/src/RegistryDisplay/RegWidget.cxx b/src/RegistryDisplay/RegWidget.cxx index 0425cc268..b57256445 100755 --- a/src/RegistryDisplay/RegWidget.cxx +++ b/src/RegistryDisplay/RegWidget.cxx @@ -353,8 +353,10 @@ QString RegWidget::setlongText( const Registry::Infos &c_info) a.append( QString( " )
" ) + tr( "in directory" ) + QString( " " )); a.append( BOLD( c_info.cdir ) ); + time_t aTime; a.append( QString( "
" ) + tr( "begins" ) + QString( " " ) ); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; a.append( BOLD( t1 ) ); delete [] t1; @@ -362,7 +364,8 @@ QString RegWidget::setlongText( const Registry::Infos &c_info) if (c_info.tc_hello != 0 ) { - char * t2 = (char * )duplicate(ctime(&c_info.tc_hello)); + 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 ) ); @@ -371,7 +374,8 @@ QString RegWidget::setlongText( const Registry::Infos &c_info) } if ((c_info.tc_end - c_info.difftime) != 0) { - char * t3 = (char * )duplicate(ctime(&c_info.tc_end)); + 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 ) ); @@ -459,6 +463,7 @@ void RegWidget::InfoHistory() _history->clear(); try { + time_t aTime; _serverhistory = _VarComponents->history(); for (CORBA::ULong i=0; i<_serverhistory->length(); i++) { @@ -466,9 +471,11 @@ void RegWidget::InfoHistory() ASSERT( c_info.name!=NULL); QString a; a.setNum(int(c_info.pid)); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; - char * t2 = (char * )duplicate(ctime(&c_info.tc_end)); + aTime = time_t(c_info.tc_end); + char * t2 = (char * )duplicate(ctime(&aTime)); t2 [strlen(t2) -1 ] = ' '; QListViewItem * item = new QListViewItem(_history, QString(c_info.name),\ a, QString(c_info.pwname), QString(c_info.machine), \ @@ -499,6 +506,7 @@ void RegWidget::InfoReg() _clients->clear(); try { + time_t aTime; _serverclients = _VarComponents->getall(); for (CORBA::ULong i=0; i<_serverclients->length(); i++) { @@ -506,9 +514,11 @@ void RegWidget::InfoReg() ASSERT( c_info.name!=NULL); QString a; a.setNum(int(c_info.pid)); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; - char * t2 = (char * )duplicate(ctime(&c_info.tc_hello)); + aTime = time_t(c_info.tc_hello); + char * t2 = (char * )duplicate(ctime(&aTime)); t2 [strlen(t2) -1 ] = ' '; QListViewItem * item = new QListViewItem(_clients, QString(c_info.name),\ a, QString(c_info.pwname), QString(c_info.machine), \ diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 7b803a5b6..65073f127 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -83,12 +83,13 @@ namespace { int anEdgeId = 0; if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) { - float aPickPosition[3]; + vtkFloatingPointType aPickPosition[3]; thePicker->GetPickPosition(aPickPosition); - float aMinDist = 1000000.0, aDist = 0; + 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; float pcoords[3], closestPoint[3], weights[3]; + int subId; + vtkFloatingPointType pcoords[3], closestPoint[3], weights[3]; aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights); if (aDist < aMinDist) { aMinDist = aDist; @@ -267,7 +268,9 @@ SALOME_Actor void SALOME_Actor -::SetPosition(float _arg1, float _arg2, float _arg3) +::SetPosition(vtkFloatingPointType _arg1, + vtkFloatingPointType _arg2, + vtkFloatingPointType _arg3) { Superclass::SetPosition(_arg1,_arg2,_arg3); @@ -279,7 +282,7 @@ SALOME_Actor void SALOME_Actor -::SetPosition(float _arg[3]) +::SetPosition(vtkFloatingPointType _arg[3]) { SetPosition(_arg[0],_arg[1],_arg[2]); } @@ -353,7 +356,7 @@ void SALOME_Actor ::highlight(bool theIsHighlight) { - float aBounds[6]; + vtkFloatingPointType aBounds[6]; GetInput()->GetBounds(aBounds); myOutline->SetBounds(aBounds); myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight ); @@ -377,9 +380,9 @@ SALOME_Actor Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode; bool anIsChanged = (mySelectionMode != aSelectionMode); - float x = theSelectionEvent->myX; - float y = theSelectionEvent->myY; - float z = 0.0; + vtkFloatingPointType x = theSelectionEvent->myX; + vtkFloatingPointType y = theSelectionEvent->myY; + vtkFloatingPointType z = 0.0; if( !theIsHighlight ) { SetPreSelected( false ); @@ -522,9 +525,9 @@ SALOME_Actor if ( !theIsHighlight ) return true; - float x = theSelectionEvent->myX; - float y = theSelectionEvent->myY; - float z = 0.0; + vtkFloatingPointType x = theSelectionEvent->myX; + vtkFloatingPointType y = theSelectionEvent->myY; + vtkFloatingPointType z = 0.0; if( !theSelectionEvent->myIsRectangle ) { switch(aSelectionMode){ @@ -591,16 +594,16 @@ SALOME_Actor break; } }else{ - float xLast = theSelectionEvent->myLastX; - float yLast = theSelectionEvent->myLastY; - float zLast = 0.0; + vtkFloatingPointType xLast = theSelectionEvent->myLastX; + vtkFloatingPointType yLast = theSelectionEvent->myLastY; + vtkFloatingPointType zLast = 0.0; - float x1 = x < xLast ? x : xLast; - float y1 = y < yLast ? y : yLast; - float z1 = z < zLast ? z : zLast; - float x2 = x > xLast ? x : xLast; - float y2 = y > yLast ? y : yLast; - float z2 = z > zLast ? z : zLast; + vtkFloatingPointType x1 = x < xLast ? x : xLast; + vtkFloatingPointType y1 = y < yLast ? y : yLast; + vtkFloatingPointType z1 = z < zLast ? z : zLast; + vtkFloatingPointType x2 = x > xLast ? x : xLast; + vtkFloatingPointType y2 = y > yLast ? y : yLast; + vtkFloatingPointType z2 = z > zLast ? z : zLast; switch(aSelectionMode){ case NodeSelection: { @@ -636,8 +639,8 @@ SALOME_Actor } case ActorSelection : { - float aPnt[3]; - float* aBounds = GetBounds(); + vtkFloatingPointType aPnt[3]; + vtkFloatingPointType* aBounds = GetBounds(); bool anIsPicked = true; for( int i = 0; i <= 1; i++ ) { diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index d377ff633..3539e4b73 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -100,12 +100,14 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor //! Apply additional position virtual void - SetPosition(float _arg1, float _arg2, float _arg3); + SetPosition(vtkFloatingPointType _arg1, + vtkFloatingPointType _arg2, + vtkFloatingPointType _arg3); //! Apply additional position virtual void - SetPosition(float _arg[3]); + SetPosition(vtkFloatingPointType _arg[3]); //---------------------------------------------------------------------------- //! Visibility management diff --git a/src/SVTK/SVTK_Actor.cxx b/src/SVTK/SVTK_Actor.cxx index 337075bb1..bc13af9f0 100644 --- a/src/SVTK/SVTK_Actor.cxx +++ b/src/SVTK/SVTK_Actor.cxx @@ -151,7 +151,7 @@ SVTK_Actor aPoints->SetNumberOfPoints(aNbOfParts); for(int i = 0; i < aNbOfParts; i++){ int aPartId = theMapIndex( i+1 ); - if(float* aCoord = theMapActor->GetNodeCoord(aPartId)){ + if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){ aPoints->SetPoint(i,aCoord); myUnstructuredGrid->InsertNextCell(VTK_VERTEX,1,&i); } diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 3fdcf72f3..f64dfbc07 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -198,8 +198,13 @@ int SVTK_CubeAxesActor2D::RenderOverlay(vtkViewport *viewport) return renderedSomething; } -static void ChangeValues(float* aArray1,float* aArray2,float *aRange1,float* aRange2,bool theY){ - float tmp=-1000; +static void ChangeValues(vtkFloatingPointType* aArray1, + vtkFloatingPointType* aArray2, + vtkFloatingPointType *aRange1, + vtkFloatingPointType* aRange2, + bool theY) +{ + vtkFloatingPointType tmp=-1000; if (!theY){ for (int i=0; i<4; i++){ tmp = aArray1[i]; aArray1[i] = aArray2[i]; aArray2[i] = tmp; @@ -223,9 +228,15 @@ static void ChangeValues(float* aArray1,float* aArray2,float *aRange1,float* aRa } } -static void ChangeArrays(float* xCoords,float* yCoords,float* zCoords, - float* xRange,float* yRange,float* zRange, - const int xAxes,const int yAxes, const int zAxes) +static void ChangeArrays(vtkFloatingPointType* xCoords, + 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); @@ -249,8 +260,8 @@ static void ChangeArrays(float* xCoords,float* yCoords,float* zCoords, // with the boundary of the viewport (minus borders). int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) { - float bounds[6], slope = 0.0, minSlope, num, den; - float pts[8][3], d2, d2Min, min; + vtkFloatingPointType bounds[6], slope = 0.0, minSlope, num, den; + vtkFloatingPointType pts[8][3], d2, d2Min, min; int i, idx = 0; int xIdx, yIdx = 0, zIdx = 0, zIdx2, renderedSomething=0; int xAxes = 0, yAxes, zAxes; @@ -308,7 +319,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) } else { - float e1[2], e2[2], e3[2]; + vtkFloatingPointType e1[2], e2[2], e3[2]; // Find distance to origin d2Min = VTK_LARGE_FLOAT; @@ -401,7 +412,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) } // Setup the axes for plotting - float xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2]; + vtkFloatingPointType xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2]; this->AdjustAxes(pts, bounds, idx, xIdx, yIdx, zIdx, zIdx2, xAxes, yAxes, zAxes, xCoords, yCoords, zCoords, xRange, yRange, zRange); @@ -449,7 +460,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) #else for(i=0;iInsertNextValue(val); } // YCoords coordinates for Y grid @@ -459,7 +470,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) #else for(i=0;iInsertNextValue(val); } // ZCoords coordinates for Z grid @@ -469,7 +480,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) #else for(i=0;iInsertNextValue(val); } @@ -485,8 +496,8 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) rgrid->Delete(); - float aCPosition[3]; - float aCDirection[3]; + vtkFloatingPointType aCPosition[3]; + vtkFloatingPointType aCDirection[3]; this->Camera->GetPosition(aCPosition); this->Camera->GetDirectionOfProjection(aCDirection); @@ -494,12 +505,12 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) bool replaceXY=false; bool replaceYZ=false; bool replaceXZ=false; - float p[6][3]; // centers of planes - float vecs[6][3]; // 6 vectors from camera position to centers + vtkFloatingPointType p[6][3]; // centers of planes + vtkFloatingPointType vecs[6][3]; // 6 vectors from camera position to centers - float aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2; - float aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2; - float aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2; + vtkFloatingPointType aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2; + vtkFloatingPointType aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2; + vtkFloatingPointType aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2; // plane XY p[0][0] = aMiddleX; // plane X=0.5 Y=0.5 Z=0 @@ -555,7 +566,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) YCoords->Delete(); ZCoords->Delete(); - float color[3]; + vtkFloatingPointType color[3]; this->GetProperty()->GetColor(color); this->wireActorXY->GetProperty()->SetColor(color); diff --git a/src/SVTK/SVTK_CubeAxesDlg.cxx b/src/SVTK/SVTK_CubeAxesDlg.cxx index 57c9e5694..b26734e5d 100644 --- a/src/SVTK/SVTK_CubeAxesDlg.cxx +++ b/src/SVTK/SVTK_CubeAxesDlg.cxx @@ -248,7 +248,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) vtkTextProperty* aTitleProp = theActor->GetTitleTextProperty(); if (aTitleProp !=0) { - float c[ 3 ]; + vtkFloatingPointType c[ 3 ]; aTitleProp->GetColor(c); aTitleColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); aTitleFontFamily = aTitleProp->GetFontFamily(); @@ -276,7 +276,7 @@ bool SVTK_AxisWidget::ReadData(vtkAxisActor2D* theActor) vtkTextProperty* aLabelsProp = theActor->GetLabelTextProperty(); if (aLabelsProp !=0) { - float c[ 3 ]; + vtkFloatingPointType c[ 3 ]; aLabelsProp->GetColor(c); aLabelsColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255)); aLabelsFontFamily = aLabelsProp->GetFontFamily(); diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index be959115c..e9da753f5 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -243,7 +243,7 @@ SVTK_DeviceActor } } -float +vtkFloatingPointType SVTK_DeviceActor ::GetShrinkFactor() { @@ -252,7 +252,7 @@ SVTK_DeviceActor void SVTK_DeviceActor -::SetShrinkFactor(float theValue) +::SetShrinkFactor(vtkFloatingPointType theValue) { myShrinkFilter->SetShrinkFactor(theValue); } @@ -318,14 +318,14 @@ SVTK_DeviceActor return myRepresentation; } -float +vtkFloatingPointType SVTK_DeviceActor ::GetDefaultPointSize() { return 5; } -float +vtkFloatingPointType SVTK_DeviceActor ::GetDefaultLineWidth() { @@ -356,7 +356,7 @@ SVTK_DeviceActor return theVtkID; } -float* +vtkFloatingPointType* SVTK_DeviceActor ::GetNodeCoord(int theObjID) { @@ -386,7 +386,7 @@ SVTK_DeviceActor { if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - float aFactor, aUnit; + vtkFloatingPointType aFactor, aUnit; vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); @@ -404,7 +404,8 @@ SVTK_DeviceActor void SVTK_DeviceActor -::SetPolygonOffsetParameters(float factor, float units) +::SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; @@ -412,7 +413,8 @@ SVTK_DeviceActor void SVTK_DeviceActor -::GetPolygonOffsetParameters(float& factor, float& units) +::GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index f8a49bc36..2606aa471 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -95,7 +95,7 @@ class SVTK_DeviceActor: public vtkLODActor GetNodeObjId(int theVtkID); virtual - float* + vtkFloatingPointType* GetNodeCoord(int theObjID); virtual @@ -118,12 +118,12 @@ class SVTK_DeviceActor: public vtkLODActor /** @name For shrink mamnagement purpose */ //@{ - float + vtkFloatingPointType GetShrinkFactor(); virtual void - SetShrinkFactor(float value); + SetShrinkFactor(vtkFloatingPointType value); virtual void @@ -153,11 +153,11 @@ class SVTK_DeviceActor: public vtkLODActor GetRepresentation(); virtual - float + vtkFloatingPointType GetDefaultPointSize(); virtual - float + vtkFloatingPointType GetDefaultLineWidth(); bool @@ -190,11 +190,13 @@ class SVTK_DeviceActor: public vtkLODActor bool myIsShrunk; bool myIsResolveCoincidentTopology; - float myPolygonOffsetFactor; - float myPolygonOffsetUnits; + vtkFloatingPointType myPolygonOffsetFactor; + vtkFloatingPointType myPolygonOffsetUnits; - void SetPolygonOffsetParameters(float factor, float units); - void GetPolygonOffsetParameters(float& factor, float& units); + void SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units); + void GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units); SVTK_DeviceActor(); ~SVTK_DeviceActor(); diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index b6711c6a7..f442fd9b1 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -1089,7 +1089,7 @@ SVTK_InteractorStyle { vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera(); double viewFocus[4], focalDepth, viewPoint[3]; - float newPickPoint[4], oldPickPoint[4], motionVector[3]; + vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3]; cam->GetFocalPoint(viewFocus); this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1], diff --git a/src/SVTK/SVTK_MainWindow.cxx b/src/SVTK/SVTK_MainWindow.cxx index 145aa9aa5..77bc71317 100644 --- a/src/SVTK/SVTK_MainWindow.cxx +++ b/src/SVTK/SVTK_MainWindow.cxx @@ -207,7 +207,7 @@ QColor SVTK_MainWindow ::BackgroundColor() { - float aBackgroundColor[3]; + vtkFloatingPointType aBackgroundColor[3]; getRenderer()->GetBackground(aBackgroundColor); return QColor(int(aBackgroundColor[0]*255), int(aBackgroundColor[1]*255), diff --git a/src/SVTK/SVTK_RectPicker.cxx b/src/SVTK/SVTK_RectPicker.cxx index 775782e80..0d3eb9ad6 100644 --- a/src/SVTK/SVTK_RectPicker.cxx +++ b/src/SVTK/SVTK_RectPicker.cxx @@ -52,7 +52,7 @@ namespace { //---------------------------------------------------------------------------- inline - float + vtkFloatingPointType GetZ(float* theZPtr, int theSelection[4], int theDX, @@ -67,13 +67,13 @@ namespace int Check(float* theZPtr, int theSelection[4], - float theTolerance, - float theDZ, + vtkFloatingPointType theTolerance, + vtkFloatingPointType theDZ, int theDX, int theDY) { int aRet = 0; - float aZ = -1.0; + vtkFloatingPointType aZ = -1.0; if(theDX >= theSelection[0] && theDX <= theSelection[2] && theDY >= theSelection[1] && theDY <= theSelection[3]) { @@ -98,7 +98,7 @@ namespace vtkDataSet *theInput, SVTK_RectPicker::TVectorIds& theVisibleIds, SVTK_RectPicker::TVectorIds& theInVisibleIds, - float theTolerance) + vtkFloatingPointType theTolerance) { theVisibleIds.clear(); theInVisibleIds.clear(); @@ -134,10 +134,10 @@ namespace */ for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){ // perform conversion - float aX[4] = {1.0, 1.0, 1.0, 1.0}; + vtkFloatingPointType aX[4] = {1.0, 1.0, 1.0, 1.0}; theInput->GetPoint(aPntId,aX); - float aView[4]; + vtkFloatingPointType aView[4]; aMatrix->MultiplyPoint(aX,aView); if(aView[3] == 0.0) continue; @@ -146,7 +146,7 @@ namespace aView[2]/aView[3]); theRenderer->ViewToDisplay(); - float aDX[3]; + vtkFloatingPointType aDX[3]; theRenderer->GetDisplayPoint(aDX); // check whether visible and in selection window @@ -212,8 +212,8 @@ namespace //---------------------------------------------------------------------------- inline void - GetCenter(const float theBounds[6], - float theCenter[3]) + GetCenter(const vtkFloatingPointType theBounds[6], + vtkFloatingPointType theCenter[3]) { theCenter[0] = (theBounds[1] + theBounds[0]) / 2.0; theCenter[1] = (theBounds[3] + theBounds[2]) / 2.0; @@ -225,7 +225,7 @@ namespace vtkRenderer *theRenderer, vtkDataSet *theInput, SVTK_RectPicker::TVectorIds& theVectorIds, - float theTolerance) + vtkFloatingPointType theTolerance) { theVectorIds.clear(); @@ -260,14 +260,14 @@ namespace for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){ vtkCell* aCell = theInput->GetCell(aCellId); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; aCell->GetBounds(aBounds); - float aCenter[3]; + vtkFloatingPointType aCenter[3]; GetCenter(aBounds,aCenter); - float aView[4]; - float aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0}; + vtkFloatingPointType aView[4]; + vtkFloatingPointType aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0}; aMatrix->MultiplyPoint(aX,aView); if(aView[3] == 0.0) @@ -278,7 +278,7 @@ namespace aView[2]/aView[3]); theRenderer->ViewToDisplay(); - float aDX[3]; + vtkFloatingPointType aDX[3]; theRenderer->GetDisplayPoint(aDX); // check whether visible and in selection window @@ -306,16 +306,16 @@ namespace //---------------------------------------------------------------------------- void CalculatePickPosition(vtkRenderer *theRenderer, - float theSelectionX, - float theSelectionY, - float theSelectionZ, - float thePickPosition[3]) + vtkFloatingPointType theSelectionX, + vtkFloatingPointType theSelectionY, + vtkFloatingPointType theSelectionZ, + vtkFloatingPointType thePickPosition[3]) { // Convert the selection point into world coordinates. // theRenderer->SetDisplayPoint(theSelectionX, theSelectionY, theSelectionZ); theRenderer->DisplayToWorld(); - float* aWorldCoords = theRenderer->GetWorldPoint(); + vtkFloatingPointType* aWorldCoords = theRenderer->GetWorldPoint(); if ( aWorldCoords[3] != 0.0 ) { for (int i=0; i < 3; i++) { thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3]; @@ -341,7 +341,10 @@ SVTK_RectPicker int SVTK_RectPicker -::Pick(float, float, float, vtkRenderer*) +::Pick(vtkFloatingPointType, + vtkFloatingPointType, + vtkFloatingPointType, + vtkRenderer*) { return 0; } @@ -349,7 +352,9 @@ SVTK_RectPicker //---------------------------------------------------------------------------- int SVTK_RectPicker -::Pick(float theSelection[3], float theSelection2[3], vtkRenderer *theRenderer) +::Pick(vtkFloatingPointType theSelection[3], + vtkFloatingPointType theSelection2[3], + vtkRenderer *theRenderer) { return Pick(theSelection[0], theSelection[1], theSelection[2], theSelection2[0], theSelection2[1], theSelection2[2], @@ -359,8 +364,12 @@ SVTK_RectPicker //---------------------------------------------------------------------------- int SVTK_RectPicker -::Pick(float theSelectionX, float theSelectionY, float theSelectionZ, - float theSelectionX2, float theSelectionY2, float theSelectionZ2, +::Pick(vtkFloatingPointType theSelectionX, + vtkFloatingPointType theSelectionY, + vtkFloatingPointType theSelectionZ, + vtkFloatingPointType theSelectionX2, + vtkFloatingPointType theSelectionY2, + vtkFloatingPointType theSelectionZ2, vtkRenderer *theRenderer) { // Initialize picking process @@ -374,14 +383,14 @@ SVTK_RectPicker // vtkCamera* aCamera = theRenderer->GetActiveCamera(); - float aCameraFP[4]; + vtkFloatingPointType aCameraFP[4]; aCamera->GetFocalPoint(aCameraFP); aCameraFP[3] = 1.0; theRenderer->SetWorldPoint(aCameraFP); theRenderer->WorldToDisplay(); - float* aDisplayCoords = theRenderer->GetDisplayPoint(); - float aSelectionZ = aDisplayCoords[2]; + vtkFloatingPointType* aDisplayCoords = theRenderer->GetDisplayPoint(); + vtkFloatingPointType aSelectionZ = aDisplayCoords[2]; this->SelectionPoint[0] = theSelectionX; this->SelectionPoint[1] = theSelectionY; diff --git a/src/SVTK/SVTK_RectPicker.h b/src/SVTK/SVTK_RectPicker.h index a9837c2d9..e994f7132 100644 --- a/src/SVTK/SVTK_RectPicker.h +++ b/src/SVTK/SVTK_RectPicker.h @@ -40,7 +40,7 @@ class vtkRenderer; /*! \class vtkAbstractPropPicker * \brief For more information see VTK documentation */ -/*! \class VTKViewer_RectPicker +/*! \class SVTK_RectPicker * \brief Rectangular picker class. */ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker @@ -56,8 +56,8 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker as fraction of rendering window size. (Rendering window size is measured across diagonal.) */ - vtkSetMacro(Tolerance,float); - vtkGetMacro(Tolerance,float); + vtkSetMacro(Tolerance,vtkFloatingPointType); + vtkGetMacro(Tolerance,vtkFloatingPointType); //! Use these methods to pick points or points and cells vtkSetMacro(PickPoints,int); @@ -66,12 +66,18 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker virtual int - Pick(float theSelectionX, float theSelectionY, float theSelectionZ, - float theSelectionX2, float theSelectionY2, float theSelectionZ2, + Pick(vtkFloatingPointType theSelectionX, + vtkFloatingPointType theSelectionY, + vtkFloatingPointType theSelectionZ, + vtkFloatingPointType theSelectionX2, + vtkFloatingPointType theSelectionY2, + vtkFloatingPointType theSelectionZ2, vtkRenderer *theRenderer); int - Pick(float theSelection[3], float theSelection2[3], vtkRenderer *theRenderer); + Pick(vtkFloatingPointType theSelection[3], + vtkFloatingPointType theSelection2[3], + vtkRenderer *theRenderer); typedef std::vector TVectorIds; typedef std::map TVectorIdsMap; @@ -87,16 +93,16 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker ~SVTK_RectPicker(); //! tolerance for computation (% of window) - float Tolerance; + vtkFloatingPointType Tolerance; //! use the following to control picking mode int PickPoints; //! second rectangle selection point in window (pixel) coordinates - float SelectionPoint2[3]; + vtkFloatingPointType SelectionPoint2[3]; //! second rectangle selection point in world coordinates - float PickPosition2[3]; + vtkFloatingPointType PickPosition2[3]; TVectorIdsMap myPointIdsMap; TVectorIdsMap myCellIdsMap; @@ -104,7 +110,10 @@ class SVTK_EXPORT SVTK_RectPicker : public vtkAbstractPropPicker private: virtual int - Pick(float, float, float, vtkRenderer*); + Pick(vtkFloatingPointType, + vtkFloatingPointType, + vtkFloatingPointType, + vtkRenderer*); }; #endif diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 8302903a3..113e7da55 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -334,7 +334,7 @@ SVTK_Renderer inline bool -CheckBndBox(const float theBounds[6]) +CheckBndBox(const vtkFloatingPointType theBounds[6]) { if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT && theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT && @@ -350,7 +350,7 @@ SVTK_Renderer bool aTDisplayed = IsTrihedronDisplayed(); bool aCDisplayed = IsCubeAxesDisplayed(); - float aNewBndBox[6]; + vtkFloatingPointType aNewBndBox[6]; aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; @@ -380,7 +380,7 @@ SVTK_Renderer if(anActor->IsResizable()) anActor->SetSize(0.5*aSize); if(anActor->GetVisibility() && !anActor->IsInfinitive()){ - float *aBounds = anActor->GetBounds(); + vtkFloatingPointType *aBounds = anActor->GetBounds(); if(CheckBndBox(aBounds)) for(int i = 0; i < 5; i = i + 2){ if(aBounds[i] < aNewBndBox[i]) @@ -540,7 +540,7 @@ SVTK_Renderer else myCubeAxes->VisibilityOff(); - static float aCoeff = 3.0; + static vtkFloatingPointType aCoeff = 3.0; aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale()); } diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index 5532ea852..d59364396 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -209,7 +209,7 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject //---------------------------------------------------------------------------- // Priority at which events are processed - float myPriority; + vtkFloatingPointType myPriority; // Used to process events vtkSmartPointer myEventCallbackCommand; @@ -244,7 +244,7 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject vtkSmartPointer myTrihedron; int myTrihedronSize; bool myIsTrihedronRelative; - float myBndBox[6]; + vtkFloatingPointType myBndBox[6]; }; #endif diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 966ff2340..f16de8862 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -503,11 +503,11 @@ SVTK_View ::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject, float theTrans) { - float anOpacity = 1.0 - theTrans; + vtkFloatingPointType anOpacity = 1.0 - theTrans; using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), - TSetFunction + TSetFunction (&SALOME_Actor::SetOpacity,anOpacity)); } @@ -517,12 +517,12 @@ SVTK_View ::SetColor(const Handle(SALOME_InteractiveObject)& theIObject, const QColor& theColor) { - float aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; + vtkFloatingPointType aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.}; using namespace SVTK; ForEachIf(getRenderer()->GetActors(), TIsSameIObject(theIObject), - TSetFunction + TSetFunction (&SALOME_Actor::SetColor,aColor)); } @@ -536,7 +536,7 @@ SVTK_View Find(getRenderer()->GetActors(), TIsSameIObject(theIObject)); if(anActor){ - float r,g,b; + vtkFloatingPointType r,g,b; anActor->GetColor(r,g,b); return QColor(int(r*255),int(g*255),int(b*255)); } diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index b36f8fdda..481aa64a3 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -356,9 +356,11 @@ QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info) a.append( BOLD( QString::number( int( c_info.uid ) ) ) ); a.append( QString( " )
" ) + tr( "in directory" ) + QString( " " )); a.append( BOLD( c_info.cdir ) ); - + + time_t aTime; a.append( QString( "
" ) + tr( "begins" ) + QString( " " ) ); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; a.append( BOLD( t1 ) ); delete [] t1; @@ -366,7 +368,8 @@ QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info) if (c_info.tc_hello != 0 ) { - char * t2 = (char * )duplicate(ctime(&c_info.tc_hello)); + 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 ) ); @@ -375,7 +378,8 @@ QString ToolsGUI_RegWidget::setlongText( const Registry::Infos &c_info) } if ((c_info.tc_end - c_info.difftime) != 0) { - char * t3 = (char * )duplicate(ctime(&c_info.tc_end)); + 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 ) ); @@ -463,6 +467,7 @@ void ToolsGUI_RegWidget::InfoHistory() _history->clear(); try { + time_t aTime; _serverhistory = _VarComponents->history(); for (CORBA::ULong i=0; i<_serverhistory->length(); i++) { @@ -470,9 +475,11 @@ void ToolsGUI_RegWidget::InfoHistory() ASSERT( c_info.name!=NULL); QString a; a.setNum(int(c_info.pid)); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; - char * t2 = (char * )duplicate(ctime(&c_info.tc_end)); + aTime = time_t(c_info.tc_end); + char * t2 = (char * )duplicate(ctime(&aTime)); t2 [strlen(t2) -1 ] = ' '; QListViewItem * item = new QListViewItem(_history, QString(c_info.name),\ a, QString(c_info.pwname), QString(c_info.machine), \ @@ -503,6 +510,7 @@ void ToolsGUI_RegWidget::InfoReg() _clients->clear(); try { + time_t aTime; _serverclients = _VarComponents->getall(); for (CORBA::ULong i=0; i<_serverclients->length(); i++) { @@ -510,9 +518,11 @@ void ToolsGUI_RegWidget::InfoReg() ASSERT( c_info.name!=NULL); QString a; a.setNum(int(c_info.pid)); - char * t1 = (char * )duplicate(ctime(&c_info.tc_start)); + aTime = time_t(c_info.tc_start); + char * t1 = (char * )duplicate(ctime(&aTime)); t1 [strlen(t1) -1 ] = ' '; - char * t2 = (char * )duplicate(ctime(&c_info.tc_hello)); + aTime = time_t(c_info.tc_hello); + char * t2 = (char * )duplicate(ctime(&aTime)); t2 [strlen(t2) -1 ] = ' '; QListViewItem * item = new QListViewItem(_clients, QString(c_info.name),\ a, QString(c_info.pwname), QString(c_info.machine), \ diff --git a/src/VTKViewer/Makefile.in b/src/VTKViewer/Makefile.in index dd5f7ea29..61b2e7daf 100755 --- a/src/VTKViewer/Makefile.in +++ b/src/VTKViewer/Makefile.in @@ -13,7 +13,6 @@ VPATH=.:@srcdir@:@srcdir@/resources # header files EXPORT_HEADERS= VTKViewer_Actor.h \ - VTKViewer_CellRectPicker.h \ VTKViewer_ExtractUnstructuredGrid.h \ VTKViewer_ConvexTool.h \ VTKViewer_Filter.h \ @@ -23,7 +22,6 @@ EXPORT_HEADERS= VTKViewer_Actor.h \ VTKViewer.h \ VTKViewer_InteractorStyle.h \ VTKViewer_PassThroughFilter.h \ - VTKViewer_RectPicker.h \ VTKViewer_RenderWindow.h \ VTKViewer_RenderWindowInteractor.h \ VTKViewer_ShrinkFilter.h \ @@ -47,14 +45,12 @@ PO_FILES = \ LIB = libVTKViewer.la LIB_SRC= VTKViewer_Actor.cxx \ - VTKViewer_CellRectPicker.cxx \ VTKViewer_ExtractUnstructuredGrid.cxx \ VTKViewer_Filter.cxx \ VTKViewer_GeometryFilter.cxx \ VTKViewer_AppendFilter.cxx \ VTKViewer_InteractorStyle.cxx \ VTKViewer_PassThroughFilter.cxx \ - VTKViewer_RectPicker.cxx \ VTKViewer_RenderWindow.cxx \ VTKViewer_RenderWindowInteractor.cxx \ VTKViewer_ShrinkFilter.cxx \ diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index d2f72e2b8..471f2e767 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -200,7 +200,7 @@ VTKViewer_Actor { if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); - float aFactor, aUnit; + vtkFloatingPointType aFactor, aUnit; vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit); vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); @@ -225,7 +225,8 @@ VTKViewer_Actor void VTKViewer_Actor -::SetPolygonOffsetParameters(float factor, float units) +::SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units) { myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; @@ -233,7 +234,8 @@ VTKViewer_Actor void VTKViewer_Actor -::GetPolygonOffsetParameters(float& factor, float& units) +::GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units) { factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; @@ -241,7 +243,7 @@ VTKViewer_Actor //---------------------------------------------------------------------------- -float +vtkFloatingPointType VTKViewer_Actor ::GetShrinkFactor() { @@ -359,7 +361,7 @@ VTKViewer_Actor return theVtkID; } -float* +vtkFloatingPointType* VTKViewer_Actor ::GetNodeCoord(int theObjID) { @@ -408,7 +410,7 @@ bool VTKViewer_Actor ::IsInfinitive() { - static float MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; if(myIsInfinite || GetLength() < MIN_DISTANCE) return true; @@ -417,7 +419,7 @@ VTKViewer_Actor } -float* +vtkFloatingPointType* VTKViewer_Actor ::GetBounds() { @@ -427,7 +429,7 @@ VTKViewer_Actor void VTKViewer_Actor -::GetBounds(float theBounds[6]) +::GetBounds(vtkFloatingPointType theBounds[6]) { Superclass::GetBounds(theBounds); } @@ -450,7 +452,7 @@ VTKViewer_Actor void VTKViewer_Actor -::SetSize( const float ) +::SetSize( const vtkFloatingPointType ) {} @@ -462,13 +464,13 @@ VTKViewer_Actor //---------------------------------------------------------------------------- void VTKViewer_Actor -::SetOpacity(float theOpacity) +::SetOpacity(vtkFloatingPointType theOpacity) { myOpacity = theOpacity; GetProperty()->SetOpacity(theOpacity); } -float +vtkFloatingPointType VTKViewer_Actor ::GetOpacity() { @@ -478,23 +480,27 @@ VTKViewer_Actor void VTKViewer_Actor -::SetColor(float r,float g,float b) +::SetColor(vtkFloatingPointType r, + vtkFloatingPointType g, + vtkFloatingPointType b) { GetProperty()->SetColor(r,g,b); } void VTKViewer_Actor -::SetColor(const float theRGB[3]) +::SetColor(const vtkFloatingPointType theRGB[3]) { SetColor(theRGB[0],theRGB[1],theRGB[2]); } void VTKViewer_Actor -::GetColor(float& r,float& g,float& b) +::GetColor(vtkFloatingPointType& r, + vtkFloatingPointType& g, + vtkFloatingPointType& b) { - float aColor[3]; + vtkFloatingPointType aColor[3]; GetProperty()->GetColor(aColor); r = aColor[0]; g = aColor[1]; diff --git a/src/VTKViewer/VTKViewer_Actor.h b/src/VTKViewer/VTKViewer_Actor.h index 55711a8c0..37d109da6 100755 --- a/src/VTKViewer/VTKViewer_Actor.h +++ b/src/VTKViewer/VTKViewer_Actor.h @@ -77,27 +77,31 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Change opacity virtual void - SetOpacity(float theOpacity); + SetOpacity(vtkFloatingPointType theOpacity); //! Get current opacity virtual - float + vtkFloatingPointType GetOpacity(); //! Change color virtual void - SetColor(float r,float g,float b); + SetColor(vtkFloatingPointType r, + vtkFloatingPointType g, + vtkFloatingPointType b); //! Get current color virtual void - GetColor(float& r,float& g,float& b); + GetColor(vtkFloatingPointType& r, + vtkFloatingPointType& g, + vtkFloatingPointType& b); //! Change color virtual void - SetColor(const float theRGB[3]); + SetColor(const vtkFloatingPointType theRGB[3]); //---------------------------------------------------------------------------- // For selection mapping purpose @@ -108,7 +112,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Get coordinates of a node for given object index virtual - float* + vtkFloatingPointType* GetNodeCoord(int theObjID); //! Maps VTK index of a cell to corresponding object index @@ -184,12 +188,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! To calcualte current bounding box virtual - float* + vtkFloatingPointType* GetBounds(); //! To calcualte current bounding box void - GetBounds(float bounds[6]); + GetBounds(vtkFloatingPointType bounds[6]); //---------------------------------------------------------------------------- virtual @@ -202,7 +206,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor virtual void - SetSize( const float ); + SetSize( const vtkFloatingPointType ); virtual void @@ -215,11 +219,13 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Set ResolveCoincidentTopology parameters void - SetPolygonOffsetParameters(float factor, float units); + SetPolygonOffsetParameters(vtkFloatingPointType factor, + vtkFloatingPointType units); //! Get current ResolveCoincidentTopology parameters void - GetPolygonOffsetParameters(float& factor, float& units); + GetPolygonOffsetParameters(vtkFloatingPointType& factor, + vtkFloatingPointType& units); virtual void @@ -228,7 +234,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //---------------------------------------------------------------------------- //! Get current shrink factor virtual - float + vtkFloatingPointType GetShrinkFactor(); //! Is the actor is shrunkable @@ -295,12 +301,12 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor protected: //---------------------------------------------------------------------------- bool myIsResolveCoincidentTopology; - float myPolygonOffsetFactor; - float myPolygonOffsetUnits; + vtkFloatingPointType myPolygonOffsetFactor; + vtkFloatingPointType myPolygonOffsetUnits; std::string myName; - float myOpacity; + vtkFloatingPointType myOpacity; int myDisplayMode; bool myIsInfinite; diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index 464b27ce0..a709d20c2 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -52,11 +52,11 @@ namespace struct TPolygon { TConnectivities myConnectivities; - float myOrigin[3]; - float myNormal[3]; + vtkFloatingPointType myOrigin[3]; + vtkFloatingPointType myNormal[3]; TPolygon(const TConnectivities& theConnectivities, - float theOrigin[3], - float theNormal[3]): + vtkFloatingPointType theOrigin[3], + vtkFloatingPointType theNormal[3]): myConnectivities(theConnectivities) { myOrigin[0] = theOrigin[0]; @@ -121,9 +121,9 @@ VTKViewer_Triangulator return true; // To calculate the bary center of the cell - float aCellCenter[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aCellCenter[3] = {0.0, 0.0, 0.0}; { - float aPntCoord[3]; + vtkFloatingPointType aPntCoord[3]; for (int aPntId = 0; aPntId < aNumPts; aPntId++) { aPoints->GetPoint(GetPointId(aPntId),aPntCoord); //cout<<"\taPntId = "<GetPoint(aNewPts[0],aCoord[0]); aPoints->GetPoint(aNewPts[1],aCoord[1]); aPoints->GetPoint(aNewPts[2],aCoord[2]); // To calculate plane normal - float aVector01[3] = { aCoord[1][0] - aCoord[0][0], - aCoord[1][1] - aCoord[0][1], - aCoord[1][2] - aCoord[0][2] }; + vtkFloatingPointType aVector01[3] = { aCoord[1][0] - aCoord[0][0], + aCoord[1][1] - aCoord[0][1], + aCoord[1][2] - aCoord[0][2] }; - float aVector02[3] = { aCoord[2][0] - aCoord[0][0], - aCoord[2][1] - aCoord[0][1], - aCoord[2][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] }; // To calculate the normal for the triangle - float aNormal[3]; + vtkFloatingPointType aNormal[3]; vtkMath::Cross(aVector02,aVector01,aNormal); vtkMath::Normalize(aNormal); // To calculate what points belong to the plane // To calculate bounds of the point set - float aCenter[3] = {0.0, 0.0, 0.0}; + 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++){ - float aPntCoord[3]; + vtkFloatingPointType aPntCoord[3]; vtkIdType aPntId = *anIter; aPoints->GetPoint(aPntId,aPntCoord); - float aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]); + vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]); //cout<<"\t\taPntId = "< TSortedPointIds; + typedef std::map TSortedPointIds; TSortedPointIds aSortedPointIds; TPointIds::const_iterator anIter = aPointIds.begin(); TPointIds::const_iterator anEndIter = aPointIds.end(); for(; anIter != anEndIter; anIter++){ - float aPntCoord[3]; + vtkFloatingPointType aPntCoord[3]; vtkIdType aPntId = *anIter; aPoints->GetPoint(aPntId,aPntCoord); - float aVector[3] = { aPntCoord[0] - aCenter[0], - aPntCoord[1] - aCenter[1], - aPntCoord[2] - aCenter[2] }; + vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0], + aPntCoord[1] - aCenter[1], + aPntCoord[2] - aCenter[2] }; vtkMath::Normalize(aVector); - float aCross[3]; + vtkFloatingPointType aCross[3]; vtkMath::Cross(aVector,aVector0,aCross); bool aGreaterThanPi = vtkMath::Dot(aCross,aNormal) < 0; - float aCosinus = vtkMath::Dot(aVector,aVector0); + vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0); if(aCosinus > 1.0) aCosinus = 1.0; if(aCosinus < -1.0) aCosinus = -1.0; - static float a2Pi = 2.0 * vtkMath::Pi(); - float anAngle = acos(aCosinus); + static vtkFloatingPointType a2Pi = 2.0 * vtkMath::Pi(); + vtkFloatingPointType anAngle = acos(aCosinus); //cout<<"\t\t\taPntId = "<GetPoint(anId,aPntCoord); - float aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord); + vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord); //cout<<"\t\taPntId = "<GetPointId(thePointId); } -float +vtkFloatingPointType VTKViewer_OrderedTriangulator ::GetCellLength() { @@ -506,7 +506,7 @@ VTKViewer_DelaunayTriangulator vtkIdType aNumPts; myInput->GetCellPoints(myCellId,aNumPts,myPointIds); { - float aPntCoord[3]; + vtkFloatingPointType aPntCoord[3]; myPoints->SetNumberOfPoints(aNumPts); vtkPoints *anInputPoints = myInput->GetPoints(); for (int aPntId = 0; aPntId < aNumPts; aPntId++) { @@ -535,7 +535,7 @@ VTKViewer_DelaunayTriangulator return thePointId; } -float +vtkFloatingPointType VTKViewer_DelaunayTriangulator ::GetCellLength() { diff --git a/src/VTKViewer/VTKViewer_ConvexTool.h b/src/VTKViewer/VTKViewer_ConvexTool.h index f56a502b4..02feafe41 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.h +++ b/src/VTKViewer/VTKViewer_ConvexTool.h @@ -80,7 +80,7 @@ class VTKVIEWER_EXPORT VTKViewer_Triangulator GetPointId(vtkIdType thePointId) = 0; virtual - float + vtkFloatingPointType GetCellLength() = 0; virtual @@ -127,7 +127,7 @@ class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangul GetPointId(vtkIdType thePointId); virtual - float + vtkFloatingPointType GetCellLength(); virtual @@ -180,7 +180,7 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu GetPointId(vtkIdType thePointId); virtual - float + vtkFloatingPointType GetCellLength(); virtual diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx index 19672b782..a7cc37e52 100755 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -234,7 +234,7 @@ void VTKViewer_ExtractUnstructuredGrid::Execute(){ } } if((aNbElems = aConnectivity->GetNumberOfCells())){ - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbElems); aConnectivity->InitTraversal(); @@ -323,7 +323,7 @@ void VTKViewer_ExtractUnstructuredGrid::Execute(){ } } if((aNbElems = aConnectivity->GetNumberOfCells())){ - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbElems); aConnectivity->InitTraversal(); diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index 83d6093ce..fa43f9b39 100755 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -136,7 +136,7 @@ VTKViewer_GeometryFilter char *cellVis; vtkIdType newCellId; int faceId, *faceVerts, numFacePts; - float *x; + vtkFloatingPointType *x; int PixelConvert[4], aNewPts[VTK_CELL_SIZE]; // ghost cell stuff unsigned char updateLevel = (unsigned char)(output->GetUpdateGhostLevel()); diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.cxx b/src/VTKViewer/VTKViewer_InteractorStyle.cxx index 1f69e6085..b4937f9e7 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyle.cxx @@ -30,10 +30,8 @@ #include "VTKViewer_Actor.h" #include "VTKViewer_Utilities.h" #include "VTKViewer_Trihedron.h" -#include "VTKViewer_RectPicker.h" #include "VTKViewer_ViewWindow.h" #include "VTKViewer_RenderWindow.h" -#include "VTKViewer_CellRectPicker.h" #include "VTKViewer_RenderWindowInteractor.h" //#include "SALOME_Actor.h" @@ -1366,17 +1364,17 @@ void VTKViewer_InteractorStyle::Place(const int theX, const int theY) void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY) { vtkCamera *cam = this->CurrentRenderer->GetActiveCamera(); - double viewFocus[4], focalDepth, viewPoint[3]; - float newPickPoint[4], oldPickPoint[4], motionVector[3]; + vtkFloatingPointType viewFocus[4], focalDepth, viewPoint[3]; + vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3]; cam->GetFocalPoint(viewFocus); this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1], viewFocus[2], viewFocus); focalDepth = viewFocus[2]; - this->ComputeDisplayToWorld(double(toX), double(toY), + this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY), focalDepth, newPickPoint); - this->ComputeDisplayToWorld(double(fromX),double(fromY), + this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY), focalDepth, oldPickPoint); // camera motion is reversed @@ -1400,17 +1398,17 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor, const int left, const int top, const int right, const int bottom) { - float* aBounds = theActor->GetBounds(); - float aMin[3], aMax[3]; + vtkFloatingPointType* aBounds = theActor->GetBounds(); + vtkFloatingPointType aMin[3], aMax[3]; ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin); ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax); if (aMin[0] > aMax[0]) { - float aBuf = aMin[0]; + vtkFloatingPointType aBuf = aMin[0]; aMin[0] = aMax[0]; aMax[0] = aBuf; } if (aMin[1] > aMax[1]) { - float aBuf = aMin[1]; + vtkFloatingPointType aBuf = aMin[1]; aMin[1] = aMax[1]; aMax[1] = aBuf; } @@ -1424,17 +1422,17 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, const int left, const int top, const int right, const int bottom) { - float* aBounds = theCell->GetBounds(); - float aMin[3], aMax[3]; + vtkFloatingPointType* aBounds = theCell->GetBounds(); + vtkFloatingPointType aMin[3], aMax[3]; ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin); ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax); if (aMin[0] > aMax[0]) { - float aBuf = aMin[0]; + vtkFloatingPointType aBuf = aMin[0]; aMin[0] = aMax[0]; aMax[0] = aBuf; } if (aMin[1] > aMax[1]) { - float aBuf = aMin[1]; + vtkFloatingPointType aBuf = aMin[1]; aMin[1] = aMax[1]; aMax[1] = aBuf; } @@ -1443,11 +1441,11 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, } /*!Checks: is given point \a thePoint in rectangle*/ -bool VTKViewer_InteractorStyle::IsInRect(float* thePoint, - const int left, const int top, - const int right, const int bottom) +bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint, + const int left, const int top, + const int right, const int bottom) { - float aPnt[3]; + vtkFloatingPointType aPnt[3]; ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt); return ((aPnt[0]>left) && (aPnt[0]bottom) && (aPnt[1]GetRenderers(); theRenderers->InitTraversal(); diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index daf93e15c..dd97fad54 100755 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -698,7 +698,7 @@ void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfIn TUpdateActor theFun) { (*theFun)(theMapIndex,theMapActor,theActor); - float aPos[3]; + vtkFloatingPointType aPos[3]; theMapActor->GetPosition(aPos); theActor->SetPosition(aPos); } diff --git a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx index c65699a9a..c485a7092 100755 --- a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx +++ b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx @@ -55,13 +55,13 @@ void VTKViewer_ShrinkFilter::Execute() int i, j, numIds, abort=0; vtkIdType cellId, numCells, numPts; vtkIdType oldId, newId; - float center[3], *p, pt[3]; + vtkFloatingPointType center[3], *p, pt[3]; vtkPointData *pd, *outPD;; vtkIdList *ptIds, *newPtIds; vtkDataSet *input= this->GetInput(); vtkUnstructuredGrid *output = this->GetOutput(); vtkIdType tenth; - float decimal; + vtkFloatingPointType decimal; vtkDebugMacro(<<"Shrinking cells"); diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index a6670cb87..38401e6d6 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -44,7 +44,7 @@ VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() Bounds[1] = Bounds[3] = Bounds[5] = -VTK_LARGE_FLOAT; } -float* +vtkFloatingPointType* VTKViewer_UnScaledActor ::GetBounds() { @@ -65,19 +65,19 @@ void VTKViewer_UnScaledActor::SetSize(int theSize) void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer) { if(theRenderer){ - float P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; + vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]); theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]); - float 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])); + 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])); int* aSize = theRenderer->GetRenderWindow()->GetSize(); - float aWinDiag = sqrt(float(aSize[0]*aSize[0]+aSize[1]*aSize[1])); + vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1])); vtkDataSet* aDataSet = GetMapper()->GetInput(); - float aLength = aDataSet->GetLength(); - float aPrecision = 1.0E-3; - float anOldScale = GetScale()[0]; - float aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(float(aSize[0])/float(aSize[1])); + vtkFloatingPointType aLength = aDataSet->GetLength(); + vtkFloatingPointType aPrecision = 1.0E-3; + vtkFloatingPointType anOldScale = GetScale()[0]; + vtkFloatingPointType aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1])); if(fabs(aScale - anOldScale)/aScale > aPrecision){ SetScale(aScale); } @@ -224,9 +224,9 @@ void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){ myLineActor->SetProperty(theProperty); } -void VTKViewer_Axis::SetSize(float theSize) +void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize) { - float aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize}; + vtkFloatingPointType aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize}; myLineSource->SetPoint2(aPosition); myArrowActor->SetPosition(0.0,0.0,0.0); @@ -324,7 +324,7 @@ VTKViewer_Trihedron::VTKViewer_Trihedron() myAxis[0] = VTKViewer_XAxis::New(); myAxis[1] = VTKViewer_YAxis::New(); myAxis[2] = VTKViewer_ZAxis::New(); - static float aSize = 100; + static vtkFloatingPointType aSize = 100; SetSize(aSize); } @@ -336,7 +336,7 @@ VTKViewer_Trihedron::~VTKViewer_Trihedron() myAxis[i]->Delete(); } -void VTKViewer_Trihedron::SetSize(float theSize) +void VTKViewer_Trihedron::SetSize(vtkFloatingPointType theSize) { mySize = theSize; for(int i = 0; i < 3; i++) diff --git a/src/VTKViewer/VTKViewer_Trihedron.h b/src/VTKViewer/VTKViewer_Trihedron.h index e40e3bc90..56e790205 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.h +++ b/src/VTKViewer/VTKViewer_Trihedron.h @@ -52,7 +52,7 @@ public: /*!Create new instance of VTKViewer_UnScaledActor.*/ static VTKViewer_UnScaledActor *New(); - virtual float* GetBounds(); + virtual vtkFloatingPointType* GetBounds(); virtual void SetSize(int theSize); virtual void Render(vtkRenderer *theRenderer); @@ -133,14 +133,14 @@ public: static VTKViewer_Trihedron *New(); /*!Sets size of trihedron. - * \param theSize - float value + * \param theSize - vtkFloatingPointType value */ - virtual void SetSize(float theSize); + virtual void SetSize(vtkFloatingPointType theSize); /*! Get size of trihedron. - * \retval mySize - float value + * \retval mySize - vtkFloatingPointType value */ - virtual float GetSize() { return mySize;} + virtual vtkFloatingPointType GetSize() { return mySize;} enum TVisibility{eOff, eOn, eOnlyLineOn}; @@ -182,7 +182,7 @@ protected: VTKViewer_Axis* myAxis[3]; /*! Common size for trihedron, for each axis.*/ - float mySize; + vtkFloatingPointType mySize; }; //**************************************************************** @@ -225,7 +225,7 @@ public: /*! Set size of VTKViewer_Axis */ - virtual void SetSize(float theSize); + virtual void SetSize(vtkFloatingPointType theSize); /*! Get label actor. * \retval Return myLabelActor. @@ -248,7 +248,7 @@ protected: /*! \var myRot[3] * Orientation vector */ - float myDir[3], myRot[3]; + vtkFloatingPointType myDir[3], myRot[3]; /*! VTKViewer_LineActor actor pointer */ diff --git a/src/VTKViewer/VTKViewer_Utilities.cxx b/src/VTKViewer/VTKViewer_Utilities.cxx index 723eea3fc..2ae150952 100755 --- a/src/VTKViewer/VTKViewer_Utilities.cxx +++ b/src/VTKViewer/VTKViewer_Utilities.cxx @@ -26,7 +26,7 @@ #include "VTKViewer_Utilities.h" -/*!@see vtkRenderer::ResetCamera(float bounds[6]) method*/ +/*!@see vtkRenderer::ResetCamera(vtkFloatingPointType bounds[6]) method*/ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) { if(!theRenderer) @@ -36,20 +36,20 @@ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) if(!aCamera) return; - float aBounds[6]; + vtkFloatingPointType aBounds[6]; int aCount = ComputeVisiblePropBounds(theRenderer,aBounds); if(theUsingZeroFocalPoint || aCount){ - static float MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; - float aLength = aBounds[1]-aBounds[0]; + vtkFloatingPointType aLength = aBounds[1]-aBounds[0]; aLength = max((aBounds[3]-aBounds[2]),aLength); aLength = max((aBounds[5]-aBounds[4]),aLength); if(aLength < MIN_DISTANCE) return; - float aWidth = + 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])); @@ -57,10 +57,10 @@ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) if(aWidth < MIN_DISTANCE) return; - double aViewPlaneNormal[3]; + vtkFloatingPointType aViewPlaneNormal[3]; aCamera->GetViewPlaneNormal(aViewPlaneNormal); - float aCenter[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0}; if(!theUsingZeroFocalPoint){ aCenter[0] = (aBounds[0] + aBounds[1])/2.0; aCenter[1] = (aBounds[2] + aBounds[3])/2.0; @@ -68,11 +68,11 @@ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) } aCamera->SetFocalPoint(aCenter[0],aCenter[1],aCenter[2]); - double aViewAngle = aCamera->GetViewAngle(); - float aDistance = 2.0*aWidth/tan(aViewAngle*vtkMath::Pi()/360.0); + vtkFloatingPointType aViewAngle = aCamera->GetViewAngle(); + vtkFloatingPointType aDistance = 2.0*aWidth/tan(aViewAngle*vtkMath::Pi()/360.0); // check view-up vector against view plane normal - double aViewUp[3]; + vtkFloatingPointType aViewUp[3]; aCamera->GetViewUp(aViewUp); if(fabs(vtkMath::Dot(aViewUp,aViewPlaneNormal)) > 0.999) aCamera->SetViewUp(-aViewUp[2], aViewUp[0], aViewUp[1]); @@ -85,7 +85,7 @@ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) // find size of the window int* aWinSize = theRenderer->GetSize(); if(aWinSize[0] < aWinSize[1]) - aWidth *= float(aWinSize[1])/float(aWinSize[0]); + aWidth *= vtkFloatingPointType(aWinSize[1])/vtkFloatingPointType(aWinSize[0]); if(theUsingZeroFocalPoint) aWidth *= sqrt(2.0); @@ -97,9 +97,9 @@ void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint) } /*! Compute the bounds of the visible props*/ -int ComputeVisiblePropBounds(vtkRenderer* theRenderer, float theBounds[6]) +int ComputeVisiblePropBounds(vtkRenderer* theRenderer, vtkFloatingPointType theBounds[6]) { - float *bounds; + vtkFloatingPointType *bounds; int aCount=0; theBounds[0] = theBounds[2] = theBounds[4] = VTK_LARGE_FLOAT; @@ -153,7 +153,7 @@ int ComputeVisiblePropBounds(vtkRenderer* theRenderer, float theBounds[6]) return aCount; } -/*!@see vtkRenderer::ResetCameraClippingRange(float bounds[6]) method*/ +/*!@see vtkRenderer::ResetCameraClippingRange(vtkFloatingPointType bounds[6]) method*/ void ResetCameraClippingRange(vtkRenderer* theRenderer) { if(!theRenderer || !theRenderer->VisibleActorCount()) return; @@ -164,28 +164,28 @@ void ResetCameraClippingRange(vtkRenderer* theRenderer) } // Find the plane equation for the camera view plane - double vn[3]; + vtkFloatingPointType vn[3]; anActiveCamera->GetViewPlaneNormal(vn); - double position[3]; + vtkFloatingPointType position[3]; anActiveCamera->GetPosition(position); - float bounds[6]; + vtkFloatingPointType bounds[6]; theRenderer->ComputeVisiblePropBounds(bounds); - double center[3]; + vtkFloatingPointType center[3]; center[0] = (bounds[0] + bounds[1])/2.0; center[1] = (bounds[2] + bounds[3])/2.0; center[2] = (bounds[4] + bounds[5])/2.0; - double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + + vtkFloatingPointType width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) + (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) + (bounds[5]-bounds[4])*(bounds[5]-bounds[4])); - double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) + + vtkFloatingPointType distance = sqrt((position[0]-center[0])*(position[0]-center[0]) + (position[1]-center[1])*(position[1]-center[1]) + (position[2]-center[2])*(position[2]-center[2])); - float range[2] = {distance - width/2.0, distance + width/2.0}; + vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0}; // Do not let the range behind the camera throw off the calculation. if (range[0] < 0.0) range[0] = 0.0; @@ -194,23 +194,25 @@ void ResetCameraClippingRange(vtkRenderer* theRenderer) } /*!Compute trihedron size.*/ -bool ComputeTrihedronSize( vtkRenderer* theRenderer,double& theNewSize, - const double theSize, const float theSizeInPercents ) +bool ComputeTrihedronSize( vtkRenderer* theRenderer, + vtkFloatingPointType& theNewSize, + const vtkFloatingPointType theSize, + const vtkFloatingPointType theSizeInPercents ) { // calculating diagonal of visible props of the renderer - float bnd[ 6 ]; + vtkFloatingPointType bnd[ 6 ]; if ( ComputeVisiblePropBounds( theRenderer, bnd ) == 0 ) { bnd[ 1 ] = bnd[ 3 ] = bnd[ 5 ] = 100; bnd[ 0 ] = bnd[ 2 ] = bnd[ 4 ] = 0; } - float aLength = 0; + vtkFloatingPointType aLength = 0; aLength = bnd[ 1 ]-bnd[ 0 ]; aLength = max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength ); aLength = max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength ); - static float EPS_SIZE = 5.0E-3; + static vtkFloatingPointType EPS_SIZE = 5.0E-3; theNewSize = aLength * theSizeInPercents / 100.0; // if the new trihedron size have sufficient difference, then apply the value diff --git a/src/VTKViewer/VTKViewer_Utilities.h b/src/VTKViewer/VTKViewer_Utilities.h index 6341e885d..59afa34ef 100755 --- a/src/VTKViewer/VTKViewer_Utilities.h +++ b/src/VTKViewer/VTKViewer_Utilities.h @@ -23,11 +23,15 @@ class vtkRenderer; -VTKVIEWER_EXPORT extern void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint = false); -VTKVIEWER_EXPORT extern int ComputeVisiblePropBounds(vtkRenderer* theRenderer, float theBounds[6]); +VTKVIEWER_EXPORT extern void ResetCamera(vtkRenderer* theRenderer, + int theUsingZeroFocalPoint = false); +VTKVIEWER_EXPORT extern int ComputeVisiblePropBounds(vtkRenderer* theRenderer, + vtkFloatingPointType theBounds[6]); VTKVIEWER_EXPORT extern void ResetCameraClippingRange(vtkRenderer* theRenderer); -VTKVIEWER_EXPORT extern bool ComputeTrihedronSize(vtkRenderer* theRenderer, double& theNewSize, - const double theSize, const float theSizeInPercents); +VTKVIEWER_EXPORT extern bool ComputeTrihedronSize(vtkRenderer* theRenderer, + vtkFloatingPointType& theNewSize, + const vtkFloatingPointType theSize, + const vtkFloatingPointType theSizeInPercents); #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) diff --git a/src/VTKViewer/VTKViewer_ViewWindow.cxx b/src/VTKViewer/VTKViewer_ViewWindow.cxx index 144590803..b61b62cd7 100755 --- a/src/VTKViewer/VTKViewer_ViewWindow.cxx +++ b/src/VTKViewer/VTKViewer_ViewWindow.cxx @@ -387,7 +387,7 @@ void VTKViewer_ViewWindow::onResetView() ::ResetCamera(myRenderer,true); if(aTriedronIsVisible) myTrihedron->VisibilityOn(); else myTrihedron->VisibilityOff(); - static float aCoeff = 3.0; + static vtkFloatingPointType aCoeff = 3.0; aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale()); Repaint(); } @@ -409,7 +409,7 @@ void VTKViewer_ViewWindow::setBackgroundColor( const QColor& color ) /*!Returns background of the viewport*/ QColor VTKViewer_ViewWindow::backgroundColor() const { - float backint[3]; + vtkFloatingPointType backint[3]; if ( myRenderer ) { myRenderer->GetBackground( backint ); return QColor(int(backint[0]*255), int(backint[1]*255), int(backint[2]*255)); @@ -443,11 +443,11 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){ int aVisibleNum = myTrihedron->GetVisibleActorCount(myRenderer); if(aVisibleNum){ // calculating diagonal of visible props of the renderer - float bnd[6]; + vtkFloatingPointType bnd[6]; myTrihedron->VisibilityOff(); ::ComputeVisiblePropBounds(myRenderer,bnd); myTrihedron->VisibilityOn(); - float aLength = 0; + vtkFloatingPointType aLength = 0; static bool CalcByDiag = false; if(CalcByDiag){ aLength = sqrt((bnd[1]-bnd[0])*(bnd[1]-bnd[0])+ @@ -459,13 +459,13 @@ void VTKViewer_ViewWindow::onAdjustTrihedron(){ aLength = max((bnd[5]-bnd[4]),aLength); } - static float aSizeInPercents = 105; + static vtkFloatingPointType aSizeInPercents = 105; QString aSetting;// = SUIT_CONFIG->getSetting("Viewer:TrihedronSize"); if(!aSetting.isEmpty()) aSizeInPercents = aSetting.toFloat(); - static float EPS_SIZE = 5.0E-3; - float aSize = myTrihedron->GetSize(); - float aNewSize = aLength*aSizeInPercents/100.0; + static vtkFloatingPointType EPS_SIZE = 5.0E-3; + vtkFloatingPointType aSize = myTrihedron->GetSize(); + vtkFloatingPointType aNewSize = aLength*aSizeInPercents/100.0; // if the new trihedron size have sufficient difference, then apply the value if(fabs(aNewSize-aSize) > aSize*EPS_SIZE || fabs(aNewSize-aSize) > aNewSize*EPS_SIZE){ myTrihedron->SetSize(aNewSize); -- 2.39.2