Changeset 5472 for nanovis


Ignore:
Timestamp:
May 7, 2015, 10:11:27 PM (4 years ago)
Author:
ldelgass
Message:

Merge r3870,r4061 from nanovis trunk (new VTK reader/resampler - scalar only).
The new VTK reader is disabled by default.

Location:
nanovis/branches/1.2
Files:
5 edited
4 copied

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.2

  • nanovis/branches/1.2/Command.cpp

    r5304 r5472  
    5757#include "FlowCmd.h"
    5858#include "dxReader.h"
     59#ifdef USE_VTK
     60#include "VtkDataSetReader.h"
     61#endif
    5962#include "VtkReader.h"
    6063#include "BMPWriter.h"
     
    13401343    } else if ((nBytes > 14) && (strncmp(bytes, "# vtk DataFile", 14) == 0)) {
    13411344        TRACE("VTK loading...");
     1345#ifdef USE_VTK
     1346        volume = load_vtk_volume_stream(tag, bytes, nBytes);
     1347#else
    13421348        std::stringstream fdata;
    13431349        fdata.write(bytes, nBytes);
    13441350        volume = load_vtk_volume_stream(tag, fdata);
     1351#endif
    13451352        if (volume == NULL) {
    13461353            Tcl_AppendResult(interp, "Failed to load VTK file", (char*)NULL);
  • nanovis/branches/1.2/Makefile.in

    r5394 r5472  
    33USE_POINTSET_RENDERER   = #yes
    44USE_PARTICLE_SYSTEM     = #yes
     5USE_VTK                 = #yes
    56
    67SHELL = /bin/sh
     
    5354VRMATH_LIB_SPEC = $(VRMATH_LIB)
    5455
     56VTK_VERSION     = @VTK_VERSION@
     57VTK_LIB_DIR     = @VTK_LIB_DIR@
     58VTK_INC_DIR     = @VTK_INC_DIR@
     59ifdef USE_VTK
     60VTK_INC_SPEC    = -I$(VTK_INC_DIR)/vtk-$(VTK_VERSION)
     61VTK_LIB_SPEC    = -L$(VTK_LIB_DIR) \
     62                -lvtkIOCore-$(VTK_VERSION) \
     63                -lvtkIOLegacy-$(VTK_VERSION) \
     64                -lvtkFiltersCore-$(VTK_VERSION) \
     65                -lvtkImagingHybrid-$(VTK_VERSION) \
     66                -lvtkImagingCore-$(VTK_VERSION) \
     67                -lvtkCommonCore-$(VTK_VERSION) \
     68                -lvtkCommonDataModel-$(VTK_VERSION) \
     69                -lvtkCommonExecutionModel-$(VTK_VERSION)  \
     70                -lvtkCommonMisc-$(VTK_VERSION)  \
     71                -lvtkCommonSystem-$(VTK_VERSION) \
     72                -lvtkCommonTransforms-$(VTK_VERSION) \
     73                -lvtkCommonMath-$(VTK_VERSION)
     74else
     75VTK_INC_SPEC    =
     76VTK_LIB_SPEC    =
     77endif
     78
    5579EXTRA_LIBS      = -lm -lpthread
    5680RP_DIR          =  @RP_DIR@
     
    6892LIBS            = \
    6993                $(RP_LIB_SPEC) \
     94                $(VTK_LIB_SPEC) \
    7095                $(TCL_LIB_SPEC) \
    7196                $(CG_LIB_SPEC) \
     
    85110                $(IMG_INC_SPEC) \
    86111                $(VRMATH_INC_SPEC) \
     112                $(VTK_INC_SPEC) \
    87113                $(TCL_INC_SPEC) \
    88114                $(CG_INC_SPEC) \
     
    103129ifdef USE_POINTSET_RENDERER
    104130DEFINES         += -DUSE_POINTSET_RENDERER
     131endif
     132ifdef USE_VTK
     133DEFINES         += -DUSE_VTK
    105134endif
    106135CXX_SWITCHES    = $(CFLAGS) $(EXTRA_CFLAGS) $(DEFINES) $(INCLUDES)
     
    204233endif
    205234
     235ifdef USE_VTK
     236OBJS +=         DataSetResample.o \
     237                VtkDataSetReader.o
     238endif
     239
    206240.PHONY: all install install-resources install-shaders install-nanovis docs clean-docs clean distclean graphics imgloaders newmat11 util vrmath
    207241
     
    287321ContourLineFilter.o: ContourLineFilter.cpp ContourLineFilter.h
    288322ConvexPolygon.o: ConvexPolygon.cpp ConvexPolygon.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h Plane.h
     323DataSetResample.o: DataSetResample.cpp DataSetResample.h
    289324Flow.o: Flow.cpp Flow.h FlowCmd.h FlowTypes.h FlowBox.h FlowParticles.h LIC.h VelocityArrowsSlice.h Switch.h Unirect.h Volume.h TransferFunction.h Trace.h
    290325FlowBox.o: FlowBox.cpp FlowBox.h FlowTypes.h Switch.h Trace.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h
     
    326361VolumeRenderer.o: VolumeRenderer.cpp VolumeRenderer.h ConvexPolygon.h Volume.h nanovis.h Trace.h Plane.h StdVertexShader.h Shader.h
    327362VolumeShader.o: VolumeShader.cpp VolumeShader.h Shader.h
     363VtkDataSetReader.o: VtkDataSetReader.cpp VtkDataSetReader.h DataSetResample.h $(VRMATH_DIR)/include/vrmath/Vector3f.h ReaderCommon.h Trace.h Volume.h nanovis.h config.h
    328364VtkReader.o: VtkReader.h Trace.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h ReaderCommon.h nanovis.h config.h
    329365ZincBlendeReconstructor.o: ZincBlendeReconstructor.cpp ZincBlendeReconstructor.h ZincBlendeVolume.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h
  • nanovis/branches/1.2/VtkDataSetReader.cpp

    r3870 r5472  
    1414#include <vtkCharArray.h>
    1515
    16 #include <RpOutcome.h>
    17 
    1816#include <vrmath/Vector3f.h>
    1917
     
    3028
    3129Volume *
    32 nv::load_vtk_volume_stream(Rappture::Outcome& result, const char *tag, const char *bytes, int nBytes)
     30nv::load_vtk_volume_stream(const char *tag, const char *bytes, int nBytes)
    3331{
    3432    TRACE("Enter tag:%s", tag);
     
    150148    delete [] data;
    151149
     150    //
     151    // Center this new volume on the origin.
     152    //
     153    float dx0 = -0.5;
     154    float dy0 = -0.5*ly/lx;
     155    float dz0 = -0.5*lz/lx;
     156    if (volume) {
     157        volume->setPosition(vrmath::Vector3f(dx0, dy0, dz0));
     158        TRACE("Set volume position to %g %g %g", dx0, dy0, dz0);
     159    }
     160
    152161    TRACE("Leave");
    153162    return volume;
  • nanovis/branches/1.2/VtkDataSetReader.h

    r3870 r5472  
    99#include <iostream>
    1010
    11 namespace Rappture {
    12 class Outcome;
    13 }
    14 
    1511namespace nv {
    1612
     
    1814
    1915extern Volume *
    20 load_vtk_volume_stream(Rappture::Outcome& status, const char *tag, const char *bytes, int nBytes);
     16load_vtk_volume_stream(const char *tag, const char *bytes, int nBytes);
    2117
    2218}
  • nanovis/branches/1.2/configure

    r4937 r5472  
    624624ac_subst_vars='LTLIBOBJS
    625625LIBOBJS
     626VTK_LIB_DIR
     627VTK_INC_DIR
     628VTK_VERSION
    626629TCL_VERSION
    627630TCL_LIB_SPEC
     
    699702with_tcllib
    700703with_rappture
     704with_vtk_includes
     705with_vtk_libs
     706with_vtk
    701707with_ffmpeg
    702708with_avconv
     
    13281334  --with-rappture=DIR     location of rappture files lib/librappture.a and
    13291335                          include/rappture.h [default=/usr]
     1336  --with-vtk-includes=DIR VTK include files are in DIR
     1337  --with-vtk-libs=DIR     VTK libraries are in DIR
     1338  --with-vtk=VERSION      Version of VTK required [default=6.1]
    13301339  --with-ffmpeg=DIR       location of ffmpeg [default=yes]
    13311340  --with-avconv=DIR       location of avconv [default=yes]
     
    22542263
    22552264
     2265# Check whether --with-vtk-includes was given.
     2266if test "${with_vtk_includes+set}" = set; then :
     2267  withval=$with_vtk_includes; with_vtk_includes=$withval
     2268else
     2269  with_vtk_includes=""
     2270fi
     2271
     2272
     2273
     2274# Check whether --with-vtk-libs was given.
     2275if test "${with_vtk_libs+set}" = set; then :
     2276  withval=$with_vtk_libs; with_vtk_libs=$withval
     2277else
     2278  with_vtk_libs=""
     2279fi
     2280
     2281
     2282
     2283# Check whether --with-vtk was given.
     2284if test "${with_vtk+set}" = set; then :
     2285  withval=$with_vtk; with_vtk=$withval
     2286else
     2287  with_vtk=""
     2288fi
     2289
     2290
     2291
    22562292# Check whether --with-ffmpeg was given.
    22572293if test "${with_ffmpeg+set}" = set; then :
     
    46814717fi
    46824718
     4719# There can be multiple versions of VTK installed side-by-side
     4720# By default, we use our version from the install prefix
     4721# lib/include directories
     4722VTK_VERSION=6.1
     4723VTK_LIB_DIR=${libdir}
     4724VTK_INC_DIR=${incdir}
     4725
     4726if test "x$with_vtk_includes" != "x"; then
     4727   VTK_INC_DIR=$with_vtk_includes
     4728fi
     4729
     4730if test "x$with_vtk_libs" != "x"; then
     4731   VTK_LIB_DIR=$with_vtk_libs
     4732fi
     4733
     4734if test "x$with_vtk" != "x" ; then
     4735   VTK_VERSION=$with_vtk
     4736fi
     4737
     4738if ! test -d "$VTK_INC_DIR/vtk-${VTK_VERSION}" ; then
     4739   as_fn_error $? "Couldn't find VTK includes" "$LINENO" 5
     4740else
     4741   VTK_INC_SPEC="-I${VTK_INC_DIR}/vtk-${VTK_VERSION}"
     4742fi
     4743
     4744save_CPPFLAGS=$CPPFLAGS
     4745CPPFLAGS=$VTK_INC_SPEC
     4746for ac_header in vtkSmartPointer.h
     4747do :
     4748  ac_fn_cxx_check_header_mongrel "$LINENO" "vtkSmartPointer.h" "ac_cv_header_vtkSmartPointer_h" "$ac_includes_default"
     4749if test "x$ac_cv_header_vtkSmartPointer_h" = xyes; then :
     4750  cat >>confdefs.h <<_ACEOF
     4751#define HAVE_VTKSMARTPOINTER_H 1
     4752_ACEOF
     4753
     4754else
     4755  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find vtkSmartPointer.h" >&5
     4756$as_echo "$as_me: WARNING: cannot find vtkSmartPointer.h" >&2;}
     4757fi
     4758
     4759done
     4760
     4761CPPFLAGS=$save_CPPFLAGS
     4762
    46834763ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default"
    46844764if test "x$ac_cv_header_GL_glut_h" = xyes; then :
     
    49835063  LD_RPATH="$loader_run_path:${CG_LIB_DIR}"
    49845064fi
     5065
     5066
     5067
    49855068
    49865069
  • nanovis/branches/1.2/configure.in

    r4937 r5472  
    1717    [with_rappture=$withval],
    1818    [with_rappture=yes])
     19
     20AC_ARG_WITH(
     21    [vtk-includes],
     22    [AS_HELP_STRING([--with-vtk-includes=DIR],
     23        [VTK include files are in DIR])],
     24    [with_vtk_includes=$withval],
     25    [with_vtk_includes=""])
     26
     27AC_ARG_WITH(
     28    [vtk-libs],
     29    [AS_HELP_STRING([--with-vtk-libs=DIR],
     30        [VTK libraries are in DIR])],
     31    [with_vtk_libs=$withval],
     32    [with_vtk_libs=""])
     33
     34AC_ARG_WITH(
     35    [vtk],
     36    [AS_HELP_STRING([--with-vtk=VERSION],
     37        [Version of VTK required @<:@default=6.1@:>@])],
     38    [with_vtk=$withval],
     39    [with_vtk=""])
    1940
    2041AC_ARG_WITH(
     
    146167fi
    147168
     169# There can be multiple versions of VTK installed side-by-side
     170# By default, we use our version from the install prefix
     171# lib/include directories
     172VTK_VERSION=6.1
     173VTK_LIB_DIR=${libdir}
     174VTK_INC_DIR=${incdir}
     175
     176if test "x$with_vtk_includes" != "x"; then
     177   VTK_INC_DIR=$with_vtk_includes
     178fi
     179
     180if test "x$with_vtk_libs" != "x"; then
     181   VTK_LIB_DIR=$with_vtk_libs
     182fi
     183
     184if test "x$with_vtk" != "x" ; then
     185   VTK_VERSION=$with_vtk
     186fi
     187
     188if ! test -d "$VTK_INC_DIR/vtk-${VTK_VERSION}" ; then
     189   AC_ERROR([Couldn't find VTK includes])
     190else
     191   VTK_INC_SPEC="-I${VTK_INC_DIR}/vtk-${VTK_VERSION}"
     192fi
     193
     194save_CPPFLAGS=$CPPFLAGS
     195CPPFLAGS=$VTK_INC_SPEC
     196AC_CHECK_HEADERS([vtkSmartPointer.h], [], [AC_MSG_WARN([cannot find vtkSmartPointer.h])])
     197CPPFLAGS=$save_CPPFLAGS
     198
    148199AC_CHECK_HEADER([GL/glut.h])
    149200AC_CHECK_HEADER([GL/glew.h])
     
    239290AC_SUBST(TCL_LIB_SPEC)
    240291AC_SUBST(TCL_VERSION)
     292AC_SUBST(VTK_VERSION)
     293AC_SUBST(VTK_INC_DIR)
     294AC_SUBST(VTK_LIB_DIR)
    241295
    242296AC_OUTPUT([
Note: See TracChangeset for help on using the changeset viewer.