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
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
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
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
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
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
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
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)
AC_DEFUN([CHECK_QWT],[
AC_REQUIRE([CHECK_QT])dnl
+AC_REQUIRE([AC_LINKER_OPTIONS])dnl
AC_CHECKING(for qwt)
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)
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
AC_DEFUN([CHECK_SIP],[
AC_REQUIRE([CHECK_PYTHON])dnl
AC_REQUIRE([CHECK_QT])dnl
+AC_REQUIRE([AC_LINKER_OPTIONS])dnl
sip_ok=yes
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
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)
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"
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
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"
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
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)
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)
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
#
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 \
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
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 ) )
{
return aList;
}
- aFindFont.myViewPortId = (int)aCont;
+ aFindFont.myViewPortId = size_t(aCont);
if ( GLViewer_TexFont::BitmapFontCache.contains( aFindFont ) )
aList = GLViewer_TexFont::BitmapFontCache[aFindFont];
QMap<GLViewer_TexFindId, GLuint>::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;
{
QFont aFont( myFont );
if( smallFont )
- aFont.setPointSize( aFont.pointSize() * 0.8 );
+ aFont.setPointSize( int(aFont.pointSize() * 0.8) );
GLfloat scale = textScale() > 0. ? textScale() : 1.;
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@
{
QMainWindow::customEvent( e );
- int mode = (int)e->data();
+ size_t mode = size_t(e->data());
switch ( mode )
{
case WS_Normal:
a.append( QString( " )<br> " ) + tr( "in directory" ) + QString( " " ));
a.append( BOLD( c_info.cdir ) );
+ time_t aTime;
a.append( QString( "<br>" ) + 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;
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 ) );
}
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 ) );
_history->clear();
try
{
+ time_t aTime;
_serverhistory = _VarComponents->history();
for (CORBA::ULong i=0; i<_serverhistory->length(); i++)
{
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), \
_clients->clear();
try
{
+ time_t aTime;
_serverclients = _VarComponents->getall();
for (CORBA::ULong i=0; i<_serverclients->length(); i++)
{
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), \
{
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;
void
SALOME_Actor
-::SetPosition(float _arg1, float _arg2, float _arg3)
+::SetPosition(vtkFloatingPointType _arg1,
+ vtkFloatingPointType _arg2,
+ vtkFloatingPointType _arg3)
{
Superclass::SetPosition(_arg1,_arg2,_arg3);
void
SALOME_Actor
-::SetPosition(float _arg[3])
+::SetPosition(vtkFloatingPointType _arg[3])
{
SetPosition(_arg[0],_arg[1],_arg[2]);
}
SALOME_Actor
::highlight(bool theIsHighlight)
{
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
GetInput()->GetBounds(aBounds);
myOutline->SetBounds(aBounds);
myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight );
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 );
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){
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: {
}
case ActorSelection :
{
- float aPnt[3];
- float* aBounds = GetBounds();
+ vtkFloatingPointType aPnt[3];
+ vtkFloatingPointType* aBounds = GetBounds();
bool anIsPicked = true;
for( int i = 0; i <= 1; i++ ) {
//! 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
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);
}
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;
}
}
-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);
// 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;
}
else
{
- float e1[2], e2[2], e3[2];
+ vtkFloatingPointType e1[2], e2[2], e3[2];
// Find distance to origin
d2Min = VTK_LARGE_FLOAT;
}
// 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);
#else
for(i=0;i<numOfLabelsX;i++){
#endif
- float val = bounds[0]+i*(bounds[1]-bounds[0])/(numOfLabelsX-1);
+ vtkFloatingPointType val = bounds[0]+i*(bounds[1]-bounds[0])/(numOfLabelsX-1);
XCoords->InsertNextValue(val);
}
// YCoords coordinates for Y grid
#else
for(i=0;i<numOfLabelsX;i++){
#endif
- float val = bounds[2]+i*(bounds[3]-bounds[2])/(numOfLabelsY-1);
+ vtkFloatingPointType val = bounds[2]+i*(bounds[3]-bounds[2])/(numOfLabelsY-1);
YCoords->InsertNextValue(val);
}
// ZCoords coordinates for Z grid
#else
for(i=0;i<numOfLabelsZ;i++){
#endif
- float val = bounds[4]+i*(bounds[5]-bounds[4])/(numOfLabelsZ-1);
+ vtkFloatingPointType val = bounds[4]+i*(bounds[5]-bounds[4])/(numOfLabelsZ-1);
ZCoords->InsertNextValue(val);
}
rgrid->Delete();
- float aCPosition[3];
- float aCDirection[3];
+ vtkFloatingPointType aCPosition[3];
+ vtkFloatingPointType aCDirection[3];
this->Camera->GetPosition(aCPosition);
this->Camera->GetDirectionOfProjection(aCDirection);
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
YCoords->Delete();
ZCoords->Delete();
- float color[3];
+ vtkFloatingPointType color[3];
this->GetProperty()->GetColor(color);
this->wireActorXY->GetProperty()->SetColor(color);
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();
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();
}
}
-float
+vtkFloatingPointType
SVTK_DeviceActor
::GetShrinkFactor()
{
void
SVTK_DeviceActor
-::SetShrinkFactor(float theValue)
+::SetShrinkFactor(vtkFloatingPointType theValue)
{
myShrinkFilter->SetShrinkFactor(theValue);
}
return myRepresentation;
}
-float
+vtkFloatingPointType
SVTK_DeviceActor
::GetDefaultPointSize()
{
return 5;
}
-float
+vtkFloatingPointType
SVTK_DeviceActor
::GetDefaultLineWidth()
{
return theVtkID;
}
-float*
+vtkFloatingPointType*
SVTK_DeviceActor
::GetNodeCoord(int theObjID)
{
{
if(myIsResolveCoincidentTopology){
int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
- float aFactor, aUnit;
+ vtkFloatingPointType aFactor, aUnit;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
void
SVTK_DeviceActor
-::SetPolygonOffsetParameters(float factor, float units)
+::SetPolygonOffsetParameters(vtkFloatingPointType factor,
+ vtkFloatingPointType units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
void
SVTK_DeviceActor
-::GetPolygonOffsetParameters(float& factor, float& units)
+::GetPolygonOffsetParameters(vtkFloatingPointType& factor,
+ vtkFloatingPointType& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
GetNodeObjId(int theVtkID);
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(int theObjID);
virtual
/** @name For shrink mamnagement purpose */
//@{
- float
+ vtkFloatingPointType
GetShrinkFactor();
virtual
void
- SetShrinkFactor(float value);
+ SetShrinkFactor(vtkFloatingPointType value);
virtual
void
GetRepresentation();
virtual
- float
+ vtkFloatingPointType
GetDefaultPointSize();
virtual
- float
+ vtkFloatingPointType
GetDefaultLineWidth();
bool
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();
{
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],
SVTK_MainWindow
::BackgroundColor()
{
- float aBackgroundColor[3];
+ vtkFloatingPointType aBackgroundColor[3];
getRenderer()->GetBackground(aBackgroundColor);
return QColor(int(aBackgroundColor[0]*255),
int(aBackgroundColor[1]*255),
{
//----------------------------------------------------------------------------
inline
- float
+ vtkFloatingPointType
GetZ(float* theZPtr,
int theSelection[4],
int theDX,
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])
{
vtkDataSet *theInput,
SVTK_RectPicker::TVectorIds& theVisibleIds,
SVTK_RectPicker::TVectorIds& theInVisibleIds,
- float theTolerance)
+ vtkFloatingPointType theTolerance)
{
theVisibleIds.clear();
theInVisibleIds.clear();
*/
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;
aView[2]/aView[3]);
theRenderer->ViewToDisplay();
- float aDX[3];
+ vtkFloatingPointType aDX[3];
theRenderer->GetDisplayPoint(aDX);
// check whether visible and in selection window
//----------------------------------------------------------------------------
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;
vtkRenderer *theRenderer,
vtkDataSet *theInput,
SVTK_RectPicker::TVectorIds& theVectorIds,
- float theTolerance)
+ vtkFloatingPointType theTolerance)
{
theVectorIds.clear();
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)
aView[2]/aView[3]);
theRenderer->ViewToDisplay();
- float aDX[3];
+ vtkFloatingPointType aDX[3];
theRenderer->GetDisplayPoint(aDX);
// check whether visible and in selection window
//----------------------------------------------------------------------------
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];
int
SVTK_RectPicker
-::Pick(float, float, float, vtkRenderer*)
+::Pick(vtkFloatingPointType,
+ vtkFloatingPointType,
+ vtkFloatingPointType,
+ vtkRenderer*)
{
return 0;
}
//----------------------------------------------------------------------------
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],
//----------------------------------------------------------------------------
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
//
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;
/*! \class vtkAbstractPropPicker
* \brief For more information see <a href="http://www.vtk.org/">VTK documentation
*/
-/*! \class VTKViewer_RectPicker
+/*! \class SVTK_RectPicker
* \brief Rectangular picker class.
*/
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);
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<vtkIdType> TVectorIds;
typedef std::map<vtkActor*,TVectorIds> TVectorIdsMap;
~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;
private:
virtual
int
- Pick(float, float, float, vtkRenderer*);
+ Pick(vtkFloatingPointType,
+ vtkFloatingPointType,
+ vtkFloatingPointType,
+ vtkRenderer*);
};
#endif
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 &&
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;
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])
else
myCubeAxes->VisibilityOff();
- static float aCoeff = 3.0;
+ static vtkFloatingPointType aCoeff = 3.0;
aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale());
}
//----------------------------------------------------------------------------
// Priority at which events are processed
- float myPriority;
+ vtkFloatingPointType myPriority;
// Used to process events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
vtkSmartPointer<VTKViewer_Trihedron> myTrihedron;
int myTrihedronSize;
bool myIsTrihedronRelative;
- float myBndBox[6];
+ vtkFloatingPointType myBndBox[6];
};
#endif
::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject,
float theTrans)
{
- float anOpacity = 1.0 - theTrans;
+ vtkFloatingPointType anOpacity = 1.0 - theTrans;
using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,float>
+ TSetFunction<SALOME_Actor,vtkFloatingPointType>
(&SALOME_Actor::SetOpacity,anOpacity));
}
::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<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,const float*>
+ TSetFunction<SALOME_Actor,const vtkFloatingPointType*>
(&SALOME_Actor::SetColor,aColor));
}
Find<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(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));
}
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( " " ) );
- 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;
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 ) );
}
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 ) );
_history->clear();
try
{
+ time_t aTime;
_serverhistory = _VarComponents->history();
for (CORBA::ULong i=0; i<_serverhistory->length(); i++)
{
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), \
_clients->clear();
try
{
+ time_t aTime;
_serverclients = _VarComponents->getall();
for (CORBA::ULong i=0; i<_serverclients->length(); i++)
{
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), \
# header files
EXPORT_HEADERS= VTKViewer_Actor.h \
- VTKViewer_CellRectPicker.h \
VTKViewer_ExtractUnstructuredGrid.h \
VTKViewer_ConvexTool.h \
VTKViewer_Filter.h \
VTKViewer.h \
VTKViewer_InteractorStyle.h \
VTKViewer_PassThroughFilter.h \
- VTKViewer_RectPicker.h \
VTKViewer_RenderWindow.h \
VTKViewer_RenderWindowInteractor.h \
VTKViewer_ShrinkFilter.h \
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 \
{
if(myIsResolveCoincidentTopology){
int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
- float aFactor, aUnit;
+ vtkFloatingPointType aFactor, aUnit;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
void
VTKViewer_Actor
-::SetPolygonOffsetParameters(float factor, float units)
+::SetPolygonOffsetParameters(vtkFloatingPointType factor,
+ vtkFloatingPointType units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
void
VTKViewer_Actor
-::GetPolygonOffsetParameters(float& factor, float& units)
+::GetPolygonOffsetParameters(vtkFloatingPointType& factor,
+ vtkFloatingPointType& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VTKViewer_Actor
::GetShrinkFactor()
{
return theVtkID;
}
-float*
+vtkFloatingPointType*
VTKViewer_Actor
::GetNodeCoord(int theObjID)
{
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;
}
-float*
+vtkFloatingPointType*
VTKViewer_Actor
::GetBounds()
{
void
VTKViewer_Actor
-::GetBounds(float theBounds[6])
+::GetBounds(vtkFloatingPointType theBounds[6])
{
Superclass::GetBounds(theBounds);
}
void
VTKViewer_Actor
-::SetSize( const float )
+::SetSize( const vtkFloatingPointType )
{}
//----------------------------------------------------------------------------
void
VTKViewer_Actor
-::SetOpacity(float theOpacity)
+::SetOpacity(vtkFloatingPointType theOpacity)
{
myOpacity = theOpacity;
GetProperty()->SetOpacity(theOpacity);
}
-float
+vtkFloatingPointType
VTKViewer_Actor
::GetOpacity()
{
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];
//! 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
//! 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
//! To calcualte current bounding box
virtual
- float*
+ vtkFloatingPointType*
GetBounds();
//! To calcualte current bounding box
void
- GetBounds(float bounds[6]);
+ GetBounds(vtkFloatingPointType bounds[6]);
//----------------------------------------------------------------------------
virtual
virtual
void
- SetSize( const float );
+ SetSize( const vtkFloatingPointType );
virtual
void
//! 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
//----------------------------------------------------------------------------
//! Get current shrink factor
virtual
- float
+ vtkFloatingPointType
GetShrinkFactor();
//! Is the actor is shrunkable
protected:
//----------------------------------------------------------------------------
bool myIsResolveCoincidentTopology;
- float myPolygonOffsetFactor;
- float myPolygonOffsetUnits;
+ vtkFloatingPointType myPolygonOffsetFactor;
+ vtkFloatingPointType myPolygonOffsetUnits;
std::string myName;
- float myOpacity;
+ vtkFloatingPointType myOpacity;
int myDisplayMode;
bool myIsInfinite;
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];
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 = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}\n";
aCellCenter[2] /= aNumPts;
}
- float aCellLength = GetCellLength();
+ vtkFloatingPointType aCellLength = GetCellLength();
int aNumFaces = GetNumFaces();
- static float EPS = 1.0E-2;
- float aDistEps = aCellLength * EPS;
+ static vtkFloatingPointType EPS = 1.0E-2;
+ vtkFloatingPointType aDistEps = aCellLength * EPS;
//cout<<"\taCellLength = "<<aCellLength<<"; aDistEps = "<<aDistEps<<"\n";
// To initialize set of points that belong to the cell
if(!anIsObserved){
// To get coordinates of the points of the traingle face
- float aCoord[3][3];
+ vtkFloatingPointType aCoord[3][3];
aPoints->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 = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
if(fabs(aDist) < aDistEps){
aPointIds.insert(aPntId);
}
//To sinchronize orientation of the cell and its face
- float aVectorC[3] = { aCenter[0] - aCellCenter[0],
- aCenter[1] - aCellCenter[1],
- aCenter[2] - aCellCenter[2] };
+ vtkFloatingPointType aVectorC[3] = { aCenter[0] - aCellCenter[0],
+ aCenter[1] - aCellCenter[1],
+ aCenter[2] - aCellCenter[2] };
vtkMath::Normalize(aVectorC);
- float aDot = vtkMath::Dot(aNormal,aVectorC);
+ vtkFloatingPointType aDot = vtkMath::Dot(aNormal,aVectorC);
//cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
//cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
//cout<<"\t\taDot = "<<aDot<<"\n";
}
// To calculate the primary direction for point set
- float aVector0[3] = { aCoord[0][0] - aCenter[0],
- aCoord[0][1] - aCenter[1],
- aCoord[0][2] - aCenter[2] };
+ vtkFloatingPointType aVector0[3] = { aCoord[0][0] - aCenter[0],
+ aCoord[0][1] - aCenter[1],
+ aCoord[0][2] - aCenter[2] };
vtkMath::Normalize(aVector0);
//cout<<"\t\taCenter = {"<<aCenter[0]<<", "<<aCenter[1]<<", "<<aCenter[2]<<"}";
// To sort the planar set of the points accrding to the angle
{
- typedef std::map<float,vtkIdType> TSortedPointIds;
+ typedef std::map<vtkFloatingPointType,vtkIdType> 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 = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}";
//cout<<"; aGreaterThanPi = "<<aGreaterThanPi<<"; aCosinus = "<<aCosinus<<"; anAngle = "<<anAngle<<"\n";
if(aGreaterThanPi){
int aNbPolygons = aPolygons.size();
for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
::TPolygon& aPolygon = aPolygons[aPolygonId];
- float* aNormal = aPolygon.myNormal;
- float* anOrigin = aPolygon.myOrigin;
+ vtkFloatingPointType* aNormal = aPolygon.myNormal;
+ vtkFloatingPointType* anOrigin = aPolygon.myOrigin;
//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++){
- float aPntCoord[3];
+ vtkFloatingPointType aPntCoord[3];
vtkIdType anId = GetPointId(aPntId);
aPoints->GetPoint(anId,aPntCoord);
- float aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
+ vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
//cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
if(aDist < -aDistEps)
return false;
return myCell->GetPointId(thePointId);
}
-float
+vtkFloatingPointType
VTKViewer_OrderedTriangulator
::GetCellLength()
{
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++) {
return thePointId;
}
-float
+vtkFloatingPointType
VTKViewer_DelaunayTriangulator
::GetCellLength()
{
GetPointId(vtkIdType thePointId) = 0;
virtual
- float
+ vtkFloatingPointType
GetCellLength() = 0;
virtual
GetPointId(vtkIdType thePointId);
virtual
- float
+ vtkFloatingPointType
GetCellLength();
virtual
GetPointId(vtkIdType thePointId);
virtual
- float
+ vtkFloatingPointType
GetCellLength();
virtual
#include <vtkUnstructuredGrid.h>
#include <vtkObjectFactory.h>
#include <vtkCellArray.h>
-#include <vtkIntArray.h>
+#include <vtkIdTypeArray.h>
#include <vtkIdList.h>
#include <vtkCell.h>
}
}
if((aNbElems = aConnectivity->GetNumberOfCells())){
- vtkIntArray* aCellLocationsArray = vtkIntArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbElems);
aConnectivity->InitTraversal();
}
}
if((aNbElems = aConnectivity->GetNumberOfCells())){
- vtkIntArray* aCellLocationsArray = vtkIntArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbElems);
aConnectivity->InitTraversal();
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());
#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"
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
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;
}
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;
}
}
/*!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]<right) && (aPnt[1]>bottom) && (aPnt[1]<top));
bool IsInRect(vtkCell* theCell,
const int left, const int top,
const int right, const int bottom);
- bool IsInRect(float* thePoint,
+ bool IsInRect(vtkFloatingPointType* thePoint,
const int left, const int top,
const int right, const int bottom);
int State;
- float MotionFactor;
- float RadianToDegree; // constant: for conv from deg to rad
+ vtkFloatingPointType MotionFactor;
+ vtkFloatingPointType RadianToDegree; // constant: for conv from deg to rad
double myScale;
VTKViewer_Actor *myPreViewActor, *myPreSelectionActor, *mySelectedActor;
void VTKViewer_RenderWindow::onChangeBackgroundColor()
{
//float red, green, blue;
- float backint[3];
+ vtkFloatingPointType backint[3];
vtkRendererCollection * theRenderers = myRW->GetRenderers();
theRenderers->InitTraversal();
TUpdateActor theFun)
{
(*theFun)(theMapIndex,theMapActor,theActor);
- float aPos[3];
+ vtkFloatingPointType aPos[3];
theMapActor->GetPosition(aPos);
theActor->SetPosition(aPos);
}
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");
Bounds[1] = Bounds[3] = Bounds[5] = -VTK_LARGE_FLOAT;
}
-float*
+vtkFloatingPointType*
VTKViewer_UnScaledActor
::GetBounds()
{
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);
}
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);
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);
}
myAxis[i]->Delete();
}
-void VTKViewer_Trihedron::SetSize(float theSize)
+void VTKViewer_Trihedron::SetSize(vtkFloatingPointType theSize)
{
mySize = theSize;
for(int i = 0; i < 3; i++)
/*!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);
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};
VTKViewer_Axis* myAxis[3];
/*! Common size for trihedron, for each axis.*/
- float mySize;
+ vtkFloatingPointType mySize;
};
//****************************************************************
/*! Set size of VTKViewer_Axis
*/
- virtual void SetSize(float theSize);
+ virtual void SetSize(vtkFloatingPointType theSize);
/*! Get label actor.
* \retval Return myLabelActor.
/*! \var myRot[3]
* Orientation vector
*/
- float myDir[3], myRot[3];
+ vtkFloatingPointType myDir[3], myRot[3];
/*! VTKViewer_LineActor actor pointer
*/
#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)
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]));
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;
}
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]);
// 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);
}
/*! 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;
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;
}
// 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;
}
/*!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
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))
::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();
}
/*!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));
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])+
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);