Commit 1dc10267 authored by Jerry Clarke's avatar Jerry Clarke

firat addition

parent 2ca14734
# We Need
# HDF5 Include
# HDF5 Libs
# Expat Includes
# Expat Libs
# We'd like
# NDGM
# Python Include
# PythonConfig Include
# Python Libs
# TCL Include
# TCL Libs
SOURCE_FILES( Xdmf_SRCS
vtkXdmfReaderHelper
vtkXdmfReader
vtkXdmfDataArray
vtkXdmfDataSetWriter
vtkXdmfRenderWindowInteractor
vtkXdmfUtil
)
# CYGWIN ?
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(WIN32)
IF(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwin32")
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -mwin32")
ENDIF(UNIX)
ENDIF(WIN32)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ADD_LIBRARY(vtkXdmf Xdmf_SRCS)
SET(ARCH_TO_BUILD Linux CACHE STRING "Host Arcitecture : Linux IRIXN32 IRIX64 AIX CYGWIN")
ADD_DEFINITIONS(-D${ARCH_TO_BUILD})
# If we alread have ICE everything is in
# one place
OPTION(ICE_INSTALLED "ICE Already Installed" ON)
IF(ICE_INSTALLED)
FIND_PATH(ICE_ROOT ice
/unsupported/Ice
/ha/cta/unsupported/Ice
/vis/clarke/Linux
/cygdrive/f/cygwin/home/Administrator/IceDevel02
/usr/local
)
SET(ICE_VERSION 03.03 CACHE STRING "Current Version of Ice")
INCLUDE_DIRECTORIES(${ICE_ROOT}/Release${ICE_VERSION}/${ARCH_TO_BUILD}/include)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Release${ICE_VERSION}/include)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/include)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/include/Vtk)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/include/Vtk/Common)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/include/Vtk/IO)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/include/Vtk/Graphics)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/include/Vtk/Rendering)
INCLUDE_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/include)
LINK_DIRECTORIES(${ICE_ROOT}/Release${ICE_VERSION}/${ARCH_TO_BUILD}/lib)
LINK_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/lib)
LINK_DIRECTORIES(${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/lib/vtk)
ELSE(ICE_INSTALLED)
ENDIF(ICE_INSTALLED)
FIND_PATH(XDMF_INCLUDE_PATH Xdmf/Xdmf.h
/usr/local
)
FIND_LIBRARY(XDMF_LIBRARY Xdmf
/usr/local/lib
)
INCLUDE_DIRECTORIES(${XDMF_INCLUDE_PATH})
LINK_LIBRARIES ( vtkpng vtkzlib vtkjpeg Xdmf hdf5 expat z )
IF(XDMF_HAVE_NDGM)
LINK_DIRECTORIES(${ICE_BINARY_DIR}/Ndgm/libsrc)
LINK_LIBRARIES(ndgm)
ENDIF(XDMF_HAVE_NDGM)
# Allow the user to customize their build with some local options
#
INCLUDE (${VTK_BINARY_DIR}/Xdmf/LocalUserOptions.cmake OPTIONAL)
INCLUDE (${VTK_SOURCE_DIR}/Xdmf/LocalUserOptions.cmake OPTIONAL)
# if we are wrapping into Tcl then add the library and extra
# source files
#
WRAP_EXCLUDE_FILES(vtkXdmfReaderHelper )
IF (VTK_WRAP_TCL)
VTK_WRAP_TCL(vtkXdmfTCL XdmfTCL_SRCS ${Xdmf_SRCS})
ADD_LIBRARY(vtkXdmfTCL ${XdmfTCL_SRCS})
TARGET_LINK_LIBRARIES (vtkXdmfTCL
vtkFilteringTCL
vtkIOTCL
vtkCommonTCL
${TCL_LIBRARY})
INSTALL_TARGETS(/lib/vtk vtkXdmfTCL)
ENDIF (VTK_WRAP_TCL)
# if we are wrapping into Python then add the library and extra
# source files
#
OPTION(XDMF_WRAP_PYTHON "wrap classes into the Python interpreted language")
IF (XDMF_WRAP_PYTHON)
INCLUDE (${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
UTILITY_SOURCE(VTK_WRAP_PYTHON_EXE vtkWrapPython Wrapping vtkWrapPython.c)
MARK_AS_ADVANCED(VTK_WRAP_PYTHON_EXE)
VTK_WRAP_PYTHON(vtkXdmfPython XdmfPython_SRCS ${Xdmf_SRCS})
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
FIND_PATH(PYCONFIG_INCLUDE_PATH pyconfig.h
${PYTHON_INCLUDE_PATH}
${PYTHON_INCLUDE_PATH}/..
${ICE_ROOT}/Support${ICE_VERSION}/${ARCH_TO_BUILD}/include/python2.2
)
INCLUDE_DIRECTORIES(${PYCONFIG_INCLUDE_PATH})
IF (APPLE)
ADD_LIBRARY(vtkXdmfPython MODULE ${XdmfPython_SRCS})
ELSE (APPLE)
ADD_LIBRARY(vtkXdmfPython SHARED ${XdmfPython_SRCS})
TARGET_LINK_LIBRARIES (vtkXdmfPython
vtkRenderingPython
vtkGraphicsPython
vtkFilteringPython
vtkIOPython
vtkCommonPython
)
ENDIF (APPLE)
TARGET_LINK_LIBRARIES (vtkXdmfPython
${PYTHON_LIBRARY})
INSTALL_TARGETS(/lib/vtk vtkXdmfPython)
ENDIF (XDMF_WRAP_PYTHON)
# if we are wrapping into Java then add the library and extra
# source files
#
IF (VTK_WRAP_JAVA)
VTK_WRAP_JAVA(vtkXdmfJava XdmfJava_SRCS ${Xdmf_SRCS})
ADD_LIBRARY(vtkXdmfJava SHARED ${XdmfJava_SRCS})
TARGET_LINK_LIBRARIES (vtkXdmfJava
vtkCommonJava
vtkFilteringJava)
INSTALL_TARGETS(/lib/vtk vtkXdmfJava)
ENDIF (VTK_WRAP_JAVA)
LINK_LIBRARIES (
vtkCommon
vtkFiltering
vtkGraphics
vtkIO
vtkXdmf
)
IF(WIN32)
IF(UNIX)
IF(NOT BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DPNG_STATIC)
ENDIF(NOT BUILD_SHARED_LIBS)
ENDIF(UNIX)
ENDIF(WIN32)
IF(WIN32)
IF(NOT BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DJPEGSTATIC)
ENDIF(NOT BUILD_SHARED_LIBS)
ENDIF(WIN32)
INSTALL_TARGETS(/lib/vtk vtkXdmf)
INSTALL_FILES(/include/vtk .h Xdmf_SRCS)
# IRIX N32
./configure --prefix=/ha/cta/unsupported/ICE/Support --exec-prefix=/ha/cta/unsupported/ICE/Support/IRIXN32 --with-shared --with-tcl --with-tkwidget --with-patented --with-contrib --with-java --with-python --with-parallel --with-local
#
# Makefile for Visualization Toolkit sources.
#
#------------------------------------------------------------------------------
#
SHELL = /bin/sh
.SUFFIXES: .cxx .java .class
#------------------------------------------------------------------------------
CC_FLAGS = ${CPPFLAGS} ${USER_CFLAGS} ${CFLAGS} ${USE_TOOLKIT_FLAGS} \
${GRAPHICS_API_FLAGS} ${CONTROLLER_API_FLAGS} \
${JAVA_INCLUDES} ${PYTHON_INCLUDES}
CXX_FLAGS = ${CPPFLAGS} ${USER_CXXFLAGS} ${CXXFLAGS} -I${srcdir} \
${KIT_FLAGS} -I. ${USE_TOOLKIT_FLAGS} \
${GRAPHICS_API_FLAGS} ${CONTROLLER_API_FLAGS} \
-I${srcdir}/../common -I../common \
${TK_INCLUDE} ${TCL_INCLUDE} \
${JAVA_INCLUDES} ${PYTHON_INCLUDES}
all: ${VTK_LIB_FILE} ${BUILD_TCL} ${BUILD_JAVA} ${BUILD_PYTHON}
.c.o:
${CC} ${CC_FLAGS} -c $< -o $@
.cxx.o:
${CXX} ${CXX_FLAGS} -c $< -o $@
#------------------------------------------------------------------------------
../targets:
cd ..; ${MAKE} targets
depend: ../targets
../targets ${srcdir}/.. extra ${srcdir} ../common ${KIT_EXTRA_DEPENDS} concrete $(CONCRETE) abstract $(ABSTRACT) concrete_h $(CONCRETE_H) abstract_h $(ABSTRACT_H)
targets.make: ../targets Makefile
../targets ${srcdir}/.. extra ${srcdir} ../common ${KIT_EXTRA_DEPENDS} concrete $(CONCRETE) abstract $(ABSTRACT) concrete_h $(CONCRETE_H) abstract_h $(ABSTRACT_H)
#------------------------------------------------------------------------------
# rules for the normal library
#
libVTK${ME}.a: ${SRC_OBJ} ${KIT_OBJ}
${AR} cr libVTK${ME}.a ${KIT_OBJ}
${RANLIB} libVTK$(ME).a
libVTK$(ME)$(SHLIB_SUFFIX): ${KIT_OBJ}
rm -f libVTK$(ME)$(SHLIB_SUFFIX)
$(SHLIB_LD) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} -o \
libVTK$(ME)$(SHLIB_SUFFIX) \
${KIT_OBJ} ${KIT_EXTERNAL_LIBS} ${SHLIB_VTK_LIBS} ${SHLIB_LD_LIBS}
#------------------------------------------------------------------------------
# rules for the tcl library
#
build_tcl: ${TCL_LIB_FILE}
tcl/${ME}Init.cxx: ../wrap/vtkWrapTclInit ${KIT_NEWS} Makefile
../wrap/vtkWrapTclInit VTK${ME}Tcl ${KIT_NEWS} > tcl/${ME}Init.cxx
libVTK${ME}Tcl.a: tcl/${ME}Init.o ${KIT_LIBS} ${KIT_TCL_OBJ}
${AR} cr libVTK${ME}Tcl.a tcl/${ME}Init.o ${KIT_LIBS} ${KIT_TCL_OBJ}
${RANLIB} libVTK$(ME)Tcl.a
libVTK$(ME)Tcl$(SHLIB_SUFFIX): tcl/${ME}Init.o ${KIT_LIBS} ${KIT_TCL_OBJ} \
libVTK$(ME)$(SHLIB_SUFFIX)
rm -f libVTK$(ME)Tcl$(SHLIB_SUFFIX)
$(SHLIB_LD) \
${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} -o \
libVTK$(ME)Tcl$(SHLIB_SUFFIX) \
tcl/${ME}Init.o ${KIT_LIBS} ${KIT_TCL_OBJ} \
-L. -lVTK$(ME) ${SHLIB_VTK_TCL_LIBS} ${SHLIB_VTK_LIBS} \
${SHLIB_LD_LIBS}
#------------------------------------------------------------------------------
# rules for the java library
#
build_java: ${JAVA_CLASSES} ${JAVA_CODE} ${JAVA_CODE_ADD} ${JAVA_O_ADD} ${JAVA_WRAP} libVTK${ME}Java${SHLIB_SUFFIX}
.java.class:
${JAVAC} -d ${JAVA_CLASS_HOME} $<
libVTK$(ME)Java$(SHLIB_SUFFIX): ${JAVA_O_ADD} ${JAVA_WRAP} \
libVTK$(ME)$(SHLIB_SUFFIX)
rm -f libVTK$(ME)Java$(SHLIB_SUFFIX)
$(CXX) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} \
-o libVTK$(ME)Java$(SHLIB_SUFFIX) \
${JAVA_O_ADD} ${JAVA_WRAP} \
${XDMF_EXTRA_LIBS}
#------------------------------------------------------------------------------
# rules for the python library
#
build_python: ${PYTHON_O_ADD} ${PYTHON_WRAP} ${PYTHON_LIB_FILE}
python/${ME}Init.cxx: ../wrap/vtkWrapPythonInit ${PYTHON_WRAP_H} Makefile
../wrap/vtkWrapPythonInit libVTK${ME}Python ${PYTHON_WRAP_H} > python/${ME}Init.cxx
libVTK${ME}Python.a: python/${ME}Init.o ${PYTHON_O_ADD} ${PYTHON_WRAP}
${AR} cr libVTK${ME}Python.a python/${ME}Init.o \
${PYTHON_O_ADD} ${PYTHON_WRAP}
${RANLIB} libVTK$(ME)Python.a
libVTK$(ME)Python$(SHLIB_SUFFIX): libVTK$(ME)$(SHLIB_SUFFIX) \
python/${ME}Init.o ${PYTHON_O_ADD} ${PYTHON_WRAP}
rm -f libVTK$(ME)Python$(SHLIB_SUFFIX)
$(CXX) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} \
-o libVTK$(ME)Python$(SHLIB_SUFFIX) python/${ME}Init.o \
${PYTHON_O_ADD} ${PYTHON_WRAP} -L. ${XLDFLAGS} \
${PYTHON_LIBS} ${XLIBS} -lXext -lXt ${X_PRE_LIBS} -lX11 \
${X_EXTRA_LIBS} ${DL_LIBS} ${THREAD_LIBS}
#------------------------------------------------------------------------------
clean: ${CLEAN_TCL} $(CLEAN_JAVA) $(CLEAN_PYTHON)
-rm -f *.o *.a *.so *.sl *~ Makefile vtkConfigure.h vtkToolkits.h
clean_tcl:
-cd tcl; rm -f *
clean_java:
-cd java; rm -f *
clean_python:
-cd python; rm -f *
#------------------------------------------------------------------------------
install_python: install build_python
@echo "Installing ${PYTHON_LIB_FILE}"
${INSTALL} -m 755 ${PYTHON_LIB_FILE} $(LIB_INSTALL_DIR)/${PYTHON_LIB_FILE}
install_java: install build_java
@echo "Installing libVTK${ME}Java${SHLIB_SUFFIX}"
${INSTALL} -m 755 libVTK${ME}Java${SHLIB_SUFFIX} $(LIB_INSTALL_DIR)/libVTK${ME}Java${SHLIB_SUFFIX}
install_tcl: install ${TCL_LIB_FILE}
@echo "Installing ${TCL_LIB_FILE}"
${INSTALL} -m 755 $(TCL_LIB_FILE) $(LIB_INSTALL_DIR)/$(TCL_LIB_FILE)
install: ${VTK_LIB_FILE}
@echo "Installing ${VTK_LIB_FILE}"
${INSTALL} -m 755 $(VTK_LIB_FILE) $(LIB_INSTALL_DIR)/$(VTK_LIB_FILE)
#
# vtk library makefile
#
# NOTE !!! when adding a class, it must be added in one location.
# Place it in the correct list based on whether it is only a .h file
# and whether it is abstract or concrete.
#
ME = Local
srcdir = @srcdir@
VPATH = @srcdir@
ABSTRACT_H =
CONCRETE_H =
ABSTRACT =
CONCRETE = \
vtkXdmfDataSetWriter \
vtkXdmfRenderWindowInteractor
#------------------------------------------------------------------------------
# Autoconfig defines that can be overridden in user.make
@MAKEINCLUDE@ @MAKEQUOTE@../system.make@MAKEQUOTE@
#------------------------------------------------------------------------------
# Include user-editable defines.
@MAKEINCLUDE@ @MAKEQUOTE@../user.make@MAKEQUOTE@
#------------------------------------------------------------------------------
# Include the generated targets
@MAKEINCLUDE@ @MAKEQUOTE@targets.make@MAKEQUOTE@
ICE_RELEASE = /ha/cta/unsupported/ICE/Release01.08
ICE_SUPPORT = /ha/cta/unsupported/ICE/Support01.08
ICE_MACHINE = IRIXN32
# add in any extra libraies here
KIT_LIBS =
SHLIB_LD_LIBS = \
-L${ICE_SUPPORT}/${ICE_MACHINE}/lib \
-L${ICE_RELEASE}/${ICE_MACHINE}/lib \
-lXdmf -lhdf5 -lndgm -lexpat
# standard stuff here
KIT_OBJ = ${SRC_OBJ}
KIT_TCL_OBJ = ${TCL_OBJ}
KIT_NEWS = ${TCL_NEWS}
KIT_FLAGS = \
-I${ICE_SUPPORT}/include \
-I${ICE_SUPPORT}/${ICE_MACHINE}/include \
-I${ICE_RELEASE}/include \
-I${ICE_RELEASE}/${ICE_MACHINE}/include
PYTHON_LIBS = -lVTK${ME} -L../graphics -lVTKGraphicsPython -L../imaging -lVTKImagingPython -L../common -lVTKCommonPython ${XLIBS} ${GRAPHICS_API_LIBS} ${SHLIB_LD_LIBS}
XDMF_EXTRA_LIBS= -lVTK${ME} -L../graphics -lVTKGraphicsJava -L../imaging -lVTKImagingJava -L../common -lVTKCommonJava ${XLIBS} ${GRAPHICS_API_LIBS} ${SHLIB_LD_LIBS}
VTK_LIB_FILE = libVTK${ME}${VTK_LIB_EXT}
TCL_LIB_FILE = libVTK${ME}Tcl${VTK_LIB_EXT}
PYTHON_LIB_FILE = libVTK${ME}Python${VTK_LIB_EXT}
#------------------------------------------------------------------------------
# Include the generic stuff here
@MAKEINCLUDE@ @MAKEQUOTE@@srcdir@/../Kits.make@MAKEQUOTE@
These files are extensions to vtk
Put them in .....VtkXXX/local then ./configure .... --with-local
All of the wrappers will be made correctly
To add new classes, the Type macro in the .h is critical, so is the New() method
#!/usr/bin/env python
#/*******************************************************************/
#/* XDMF */
#/* eXtensible Data Model and Format */
#/* */
#/* Id : Id */
#/* Date : $Date$ */
#/* Version : $Revision$ */
#/* */
#/* Author: */
#/* Jerry A. Clarke */
#/* clarke@arl.army.mil */
#/* US Army Research Laboratory */
#/* Aberdeen Proving Ground, MD */
#/* */
#/* Copyright @ 2002 US Army Research Laboratory */
#/* All Rights Reserved */
#/* See Copyright.txt or http://www.arl.hpc.mil/ice for details */
#/* */
#/* This software is distributed WITHOUT ANY WARRANTY; without */
#/* even the implied warranty of MERCHANTABILITY or FITNESS */
#/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
#/* for more information. */
#/* */
#/*******************************************************************/
from vtk import *
from libvtkXdmfPython import *
import Xdmf
print 'Create Array'
a = Xdmf.XdmfArray()
a.SetShapeFromString('20 3')
a.Generate( 1, 60 )
print 'Set Array'
v = vtkXdmfDataArray()
v.SetArray( a.GetTagName() )
print 'Get VTK DataArray'
v1 = v.GetVtkArray()
print 'Second Tuple = ' + str(v1.GetTuple3(1))
v1.SetTuple3( 1, 100, 200, 300 )
print 'Convert Back To Array'
v.ToArray()
print 'Values = ' + a.GetValues()
#!/usr/bin/env python
#/*******************************************************************/
#/* XDMF */
#/* eXtensible Data Model and Format */
#/* */
#/* Id : Id */
#/* Date : $Date$ */
#/* Version : $Revision$ */
#/* */
#/* Author: */
#/* Jerry A. Clarke */
#/* clarke@arl.army.mil */
#/* US Army Research Laboratory */
#/* Aberdeen Proving Ground, MD */
#/* */
#/* Copyright @ 2002 US Army Research Laboratory */
#/* All Rights Reserved */
#/* See Copyright.txt or http://www.arl.hpc.mil/ice for details */
#/* */
#/* This software is distributed WITHOUT ANY WARRANTY; without */
#/* even the implied warranty of MERCHANTABILITY or FITNESS */
#/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
#/* for more information. */
#/* */
#/*******************************************************************/
from vtk import *
from libvtkXdmfPython import *
from Xdmf import *
# from libVTKLocalPython import *
# from libVTKGraphicsPython import *
# from libVTKCommonPython import *
con = vtkConeSource()
con.SetRadius(1)
con.SetResolution(5)
con.Update()
t = vtkTriangleFilter()
t.SetInput( con.GetOutput() )
t.Update()
DOM = XdmfDOM()
DOM.SetInputFileName('Wall.xml')
DOM.Parse()
Grid = XdmfGrid()
Grid.SetDOM( DOM )
Grid.SetGridFromElement( DOM.FindElement( "Grid" ))
Data = vtkDataSet( Grid.GetBaseGrid())
x = vtkXdmfDataSetWriter()
x.SetInput( Data )
# x.SetInput( t.GetOutput() )
# x.SetInput( con.GetOutput() )
x.SetHeavyDataSetName("Jerry.h5")
x.SetGridName("My Grid");
x.WriteXdmf()
GridXML = x.GetXML()
XMLFile = open( 'Jerry.xml', 'w' )
XMLFile.write('<?xml version="1.0" ?>\n')
XMLFile.write('<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" [\n')
XMLFile.write('<!ENTITY InitialHeavyData "' + 'Jerry.h5">\n')
XMLFile.write(']>\n')
XMLFile.write('\n\n\n')
XMLFile.write('<Xdmf>\n')
XMLFile.write( GridXML )
XMLFile.write('</Xdmf>')
XMLFile.close()
# this file can be used to override any of the values selected
# by configure in system.make. At a minimum you should set
# the following Tcl/Tk values if you are planning to use Tcl/Tk
TCL_INCLUDE=-I/vis/clarke/Tcl/tcl8.3.3/generic
TCL_LIB=-L/ha/cta/unsupported/ICE/Support/IRIXN32/lib -ltcl8.3
TK_INCLUDE=-I/vis/clarke/Tcl/tk8.3.3/generic
TK_LIB=-L/ha/cta/unsupported/ICE/Support/IRIXN32/lib -ltk8.3
# MESA_INCLUDE=-I/usr/include -I/vis/clarke/Mesa-3.0/include
MESA_INCLUDE=-I/vis/clarke/Mesa-3.0/include
# MESA_INCLUDE=
MESA_LIB=/vis/clarke/Mesa-3.0/lib32/libMesaGL.so
# for python you must set this
PYTHON_INCLUDES=-I/vis/clarke/Python/Python-2.1/Include -I/vis/clarke/Python/Python-2.1
# Add additional CFLAGS and CXXFLAGS for compilation
# uncomment the following two lines to set your own flags
USER_CFLAGS = -O2 -n32 -G 0 -multigot
USER_CXXFLAGS = -O2 -n32 -I/usr/java/include -I/usr/java/include/irix -G 0 -multigot
# VTK_SHLIB_BUILD_FLAGS = -shared -rdata_shared -exports
# USER_CXXFLAGS = -g -64 -G 0 -multigot
JAVAC = javac -sourcepath ../java
JAR = jar
JAVA_CLASS_HOME = ../java
# JAVA_CXX_LIB = -L/usr/java/lib32/sgi -ljawt
INSTALL = $(VTK_OBJ)/install-sh
XLIBS =
X_EXTRA_LIBS = -lXt
# GRAPHICS_API_LIBS = $(MESA_LIB)
GRAPHICS_API_LIBS = -lGL
# GRAPHICS_API_LIBS = $(MESA_LIB)
# GRAPHICS_API_FLAGS = $(MESA_INCLUDE)
XLIBS=
GRAPHICS_API_FLAGS =
/*******************************************************************/
/* XDMF */
/* eXtensible Data Model and Format */
/* */
/* Id : Id */
/* Date : $Date$ */
/* Version : $Revision$ */
/* */
/* Author: */
/* Jerry A. Clarke */
/* clarke@arl.army.mil */
/* US Army Research Laboratory */
/* Aberdeen Proving Ground, MD */
/* */
/* Copyright @ 2002 US Army Research Laboratory */
/* All Rights Reserved */
/* See Copyright.txt or http://www.arl.hpc.mil/ice for details */
/* */
/* This software is distributed WITHOUT ANY WARRANTY; without */
/* even the implied warranty of MERCHANTABILITY or FITNESS */
/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
/* for more information. */
/* */
/*******************************************************************/
#include <vtkXdmfDataArray.h>
#include <vtkObjectFactory.h>
#include <vtkCommand.h>
#include <vtkUnsignedCharArray.h>
#include <vtkIntArray.h>
#include <vtkFloatArray.h>
#include <vtkDoubleArray.h>
#include <Xdmf/XdmfArray.h>
//----------------------------------------------------------------------------
vtkXdmfDataArray* vtkXdmfDataArray::New()
{
// First try to create the object from the vtkObjectFactory
vtkObject* ret = vtkObjectFactory::CreateInstance("vtkXdmfDataArray");
if(ret)
{
return (vtkXdmfDataArray*)ret;
}
// If the factory was unable to create the object, then create it here.
return new vtkXdmfDataArray;
}
vtkXdmfDataArray::vtkXdmfDataArray()
{
this->Array = NULL;
this->vtkArray = NULL;
}
vtkDataArray *vtkXdmfDataArray::FromXdmfArray( char *ArrayName, int CopyShape ){
XdmfArray *Array = this->Array;
if ( ArrayName != NULL ) {
Array = TagNameToArray( ArrayName );
}
if( Array == NULL ){
XdmfErrorMessage("Array is NULL");
return(NULL);
}
switch( Array->GetNumberType() ){
case XDMF_INT8_TYPE :
if( this->vtkArray == NULL ) {
this->vtkArray = vtkUnsignedCharArray::New();
}
break;
case XDMF_INT32_TYPE :
case XDMF_INT64_TYPE :
if( this->vtkArray == NULL ) {
this->vtkArray = vtkIntArray::New();
}
break;
case XDMF_FLOAT32_TYPE :
if( this->vtkArray == NULL ) {
this->vtkArray = vtkFloatArray::New();
}
break;
default :
if( this->vtkArray == NULL ) {
this->vtkArray = vtkDoubleArray::New();
}
break;
}
if ( CopyShape && ( Array->GetRank() == 2 ) ) {
this->vtkArray->SetNumberOfComponents( Array->GetDimension( 1 ) );
this->vtkArray->SetNumberOfTuples( Array->GetDimension( 0 ) );
} else {
this->vtkArray->SetNumberOfComponents( 1 );
this->vtkArray->SetNumberOfTuples( Array->GetNumberOfElements() );
}
switch( Array->GetNumberType() ){
case XDMF_INT8_TYPE :
Array->GetValues( 0,
( unsigned char *)this->vtkArray->GetVoidPointer( 0 ),
Array->GetNumberOfElements() );
break;
case XDMF_INT32_TYPE :
case XDMF_INT64_TYPE :
Array->GetValues( 0,
( int *)this->vtkArray->GetVoidPointer( 0 ),
Array->GetNumberOfElements() );
break;
case XDMF_FLOAT32_TYPE :
Array->GetValues( 0,
( float *)this->vtkArray->GetVoidPointer( 0 ),
Array->GetNumberOfElements() );
break;
default :
Array->GetValues( 0,
( double *)this->vtkArray->GetVoidPointer( 0 ),
Array->GetNumberOfElements() );
break;
}
return( this->vtkArray );
}
char *vtkXdmfDataArray::ToXdmfArray( vtkDataArray *DataArray, int CopyShape ){
XdmfArray *Array;
if ( DataArray == NULL ) {
DataArray = this->vtkArray;
}
if ( DataArray == NULL ) {
vtkDebugMacro(<< "Array is NULL");
return(NULL);
}
if ( this->Array == NULL ){
this->Array = new XdmfArray();
switch( DataArray->GetDataType() ){
case VTK_CHAR :
case VTK_UNSIGNED_CHAR :
this->Array->SetNumberType( XDMF_INT8_TYPE );
break;
case VTK_SHORT :
case VTK_UNSIGNED_SHORT :
case VTK_INT :
case VTK_UNSIGNED_INT :
case VTK_LONG :
case VTK_UNSIGNED_LONG :
this->Array->SetNumberType( XDMF_INT32_TYPE );
break;
case VTK_FLOAT :
this->Array->SetNumberType( XDMF_FLOAT32_TYPE );
break;
case VTK_DOUBLE :
this->Array->SetNumberType( XDMF_FLOAT64_TYPE );
break;
default :
XdmfErrorMessage("Can't handle Data Type");
return( NULL );
}
}
Array = this->Array;
if( CopyShape ) {
XdmfInt64 Shape[3];
Shape[0] = DataArray->GetNumberOfTuples();
Shape[1] = DataArray->GetNumberOfComponents();
if( Shape[1] == 1 ) {
Array->SetShape( 1, Shape );
} else {
Array->SetShape( 2, Shape );
}
}
switch( Array->GetNumberType() ){
case XDMF_INT8_TYPE :
Array->SetValues( 0,
( unsigned char *)DataArray->GetVoidPointer( 0 ),