Merge branch 'devel' into devel-PFasano99

# Conflicts:
#	.github/workflows/Linux.yml
#	.gitignore
#	scripts/Linux/0_setup_env_ubuntu.sh
#	scripts/Windows/0_download_ext.ps1
#	scripts/Windows/0_download_ext.sh
#	src/external/cgal.cmake
#	src/external/xerces.cmake
This commit is contained in:
alemuntoni 2022-11-04 17:25:32 +01:00
commit c62a4e86a3
5956 changed files with 748 additions and 1623584 deletions

View File

@ -48,7 +48,7 @@ jobs:
version: ${{ env.QT_VERSION }}
- name: Install dependencies
run: |
bash scripts/${{ runner.os }}/0_setup_env_ubuntu.sh --dont_install_qt --dowload_cgal_and_boost_src
bash scripts/${{ runner.os }}/0_setup_env_ubuntu.sh --dont_install_qt --dont_install_cgal_and_boost
#needed by qt 5.15 on linux
sudo apt-get install libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-render-util0-dev libxcb-xinerama0-dev
- name: Setup env variables
@ -181,19 +181,11 @@ jobs:
echo "artifact_suffix=" >> $GITHUB_OUTPUT
fi
echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC" >> $GITHUB_ENV
- name: Install wget
run: |
$env:PATH = "${{ env.PATH }};C:\msys64\mingw64\bin;C:\msys64\usr\bin"
pacman.exe -S --noconfirm --noprogressbar wget unzip
- name: Set Certificate
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_CERTIFICATE }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
- name: Download external libraries
shell: C:\shells\msys2bash.cmd {0}
run: |
bash scripts/${{ runner.os }}/0_download_ext.sh
- name: Configure and Build
shell: bash
run: |

View File

@ -25,7 +25,7 @@ jobs:
version: ${{ env.QT_VERSION }}
- name: Install dependencies
run: |
bash scripts/${{ runner.os }}/0_setup_env_ubuntu.sh --dont_install_qt --dowload_cgal_and_boost_src --download_embree_src
bash scripts/${{ runner.os }}/0_setup_env_ubuntu.sh --dont_install_qt --dont_install_cgal_and_boost
#needed by qt 5.15 on linux
sudo apt-get install libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-render-util0-dev libxcb-xinerama0-dev
- name: Setup env variables
@ -37,6 +37,12 @@ jobs:
else
echo "artifact_suffix=" >> $GITHUB_OUTPUT
fi
- name: Cache external libraries sources
id: cache-ext-libs
uses: actions/cache@v3
with:
path: src/external/downloads/*
key: ${{ runner.os }}-external-libraries
- name: Ccache
uses: hendrikmuhs/ccache-action@v1.2
with:

View File

@ -36,6 +36,12 @@ jobs:
else
echo "artifact_suffix=" >> $GITHUB_OUTPUT
fi
- name: Cache external libraries sources
id: cache-ext-libs
uses: actions/cache@v3
with:
path: src/external/downloads/*
key: ${{ runner.os }}-external-libraries
- name: Ccache
uses: hendrikmuhs/ccache-action@v1.2
with:

View File

@ -34,14 +34,18 @@ jobs:
echo "artifact_suffix=" >> $GITHUB_OUTPUT
fi
echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC" >> $GITHUB_ENV
- name: Install wget
- name: Install dependencies
shell: bash
run: |
$env:PATH = "${{ env.PATH }};C:\msys64\mingw64\bin;C:\msys64\usr\bin"
pacman.exe -S --noconfirm --noprogressbar wget unzip
- name: Download external libraries
shell: C:\shells\msys2bash.cmd {0}
run: |
bash scripts/${{ runner.os }}/0_download_ext.sh
choco install ccache
choco install ninja
choco install wget
- name: Cache external libraries sources
id: cache-ext-libs
uses: actions/cache@v3
with:
path: src/external/downloads/*
key: ${{ runner.os }}-external-libraries
- name: Ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
@ -51,9 +55,9 @@ jobs:
run: |
bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }} --nightly --ccache
- name: Deploy
shell: C:\shells\msys2bash.cmd {0}
shell: bash
run: |
bash scripts/${{ runner.os }}/2_deploy.sh -qt=${{ env.Qt5_DIR }}
bash scripts/${{ runner.os }}/2_deploy.sh
- name: NSIS script
shell: bash
run: |

11
.gitignore vendored
View File

@ -17,18 +17,23 @@
*.db-wal
*.AppImage
.DS_Store
# build and install directories
build/*
install/*
src/external/boost_1_75_0
src/external/CGAL-5.2.1
# external libraries automatically downloaded by cmake
src/external/downloads/*
src/external/tmp.zip
src/external/embree-3.13.5.x64.vc14.windows
src/external/embree-3.13.5
src/external/ispc-v1.18.1-linux
src/external/oneapi-tbb-2021.6.0
# files created/modified during deploy stage
install/macos/resources/meshlab_dmg_final.json
install/windows/resources/meshlab_final.nsi
install/windows/resources/MeshLab*.exe
src/common/generated_version_header.h
##Standard cmake gitignore##
CMakeLists.txt.user

3
.gitmodules vendored
View File

@ -2,6 +2,3 @@
path = src/vcglib
url = https://github.com/cnr-isti-vclab/vcglib
branch = devel
[submodule "src/external/nexus"]
path = src/external/nexus
url = https://github.com/cnr-isti-vclab/nexus

View File

@ -5,8 +5,8 @@
# Run this script if you never installed any of the MeshLab dependencies.
DONT_INSTALL_QT=false
DOWNLOAD_CGAL_BOOST_SRC=false
DOWNLOAD_EMBREE_SRC=false
DONT_INSTALL_CGAL_BOOST=false
DONT_INSTALL_EMBREE=false
#checking for parameters
for i in "$@"
@ -16,12 +16,12 @@ case $i in
DONT_INSTALL_QT=true
shift # past argument=value
;;
--dowload_cgal_and_boost_src)
DOWNLOAD_CGAL_BOOST_SRC=true
--dont_install_cgal_and_boost)
DONT_INSTALL_CGAL_BOOST=true
shift # past argument=value
;;
--download_embree_src)
DOWNLOAD_EMBREE_SRC=true
--dont_install_embree)
DONT_INSTALL_EMBREE=true
shift # past argument=value
;;
*)
@ -45,42 +45,29 @@ echo "=== installing cmake, patchelf, gmp, mpfr, tbb, glfw3 and xcerces-c..."
sudo apt-get install -y cmake patchelf libgmp-dev libmpfr-dev libtbb-dev libglfw3-dev libxerces-c-dev
# possibility to use always system libraries starting from ubuntu 20.04, since cgal is header only
if [ "$DOWNLOAD_CGAL_BOOST_SRC" = false ] ; then
if [ "$DONT_INSTALL_CGAL_BOOST" = false ] ; then
echo "=== installing cgal and boost..."
sudo apt-get install -y libcgal-dev libboost-all-dev
else
echo "=== downloading cgal and boost sources..."
#default paths wrt the script folder
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
EXTERNAL_PATH=$SCRIPTS_PATH/../../src/external
cd $EXTERNAL_PATH
wget https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.zip
unzip boost_1_75_0.zip
rm boost_1_75_0.zip
wget https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip
unzip CGAL-5.2.1.zip
rm CGAL-5.2.1.zip
echo "=== jumping installation of cgal and boost packages..."
fi
if [ "$DOWNLOAD_EMBREE_SRC" = false ] ; then
if [ "$DONT_INSTALL_EMBREE" = false ] ; then
echo "=== installing embree..."
sudo apt-get install -y libembree-dev
else
echo "=== downloading ispc and embree sources..."
echo "=== jumping installation of embree package..."
#default paths wrt the script folder
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
EXTERNAL_PATH=$SCRIPTS_PATH/../../src/external
#SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
#EXTERNAL_PATH=$SCRIPTS_PATH/../../src/external
cd $EXTERNAL_PATH
#cd $EXTERNAL_PATH
wget https://github.com/ispc/ispc/releases/download/v1.18.1/ispc-v1.18.1-linux.tar.gz
tar -xf ispc-v1.18.1-linux.tar.gz
rm ispc-v1.18.1-linux.tar.gz
#wget https://github.com/ispc/ispc/releases/download/v1.18.1/ispc-v1.18.1-linux.tar.gz
#tar -xf ispc-v1.18.1-linux.tar.gz
#rm ispc-v1.18.1-linux.tar.gz
wget https://github.com/embree/embree/archive/refs/tags/v3.13.5.zip
unzip v3.13.5.zip
rm v3.13.5.zip
#wget https://github.com/embree/embree/archive/refs/tags/v3.13.5.zip
#unzip v3.13.5.zip
#rm v3.13.5.zip
fi

View File

@ -1,35 +0,0 @@
$DIR = Get-Location
#default paths wrt the script folder
$SCRIPTS_PATH = $PSScriptRoot
$EXTERNAL_PATH = Join-Path $SCRIPTS_PATH ..\..\src\external
cd $EXTERNAL_PATH
# boost
Invoke-WebRequest -Uri "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.zip" -OutFile "boost_1_75_0.zip"
Expand-Archive -Path boost_1_75_0.zip -DestinationPath .\
Remove-Item boost_1_75_0.zip
# cgal
Invoke-WebRequest -Uri "https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip" -OutFile "CGAL-5.2.1.zip"
Expand-Archive -Path CGAL-5.2.1.zip -DestinationPath .\
Remove-Item CGAL-5.2.1.zip
# gmp and mpfr
Invoke-WebRequest -Uri "https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip" -OutFile "CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip"
Expand-Archive -Path CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip -DestinationPath .\CGAL-5.2.1\ -Force
Remove-Item CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip
# tbb
Invoke-WebRequest -Uri "https://github.com/oneapi-src/oneTBB/releases/download/v2021.6.0/oneapi-tbb-2021.6.0-win.zip" -OutFile "oneapi-tbb-2021.6.0-win.zip"
Expand-Archive -Path oneapi-tbb-2021.6.0-win.zip -DestinationPath .\
Remove-Item oneapi-tbb-2021.6.0-win.zip
# embree
Invoke-WebRequest -Uri "https://github.com/embree/embree/releases/download/v3.13.5/embree-3.13.5.x64.vc14.windows.zip" -OutFile "embree-3.13.5.zip"
Expand-Archive -Path embree-3.13.5.zip -DestinationPath .\
Remove-Item embree-3.13.5.zip
#going back to original location
cd $DIR

View File

@ -1,32 +0,0 @@
#!/bin/bash
#default paths wrt the script folder
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
EXTERNAL_PATH=$SCRIPTS_PATH/../../src/external
cd $EXTERNAL_PATH
# boost
wget https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.zip
unzip boost_1_75_0.zip
rm boost_1_75_0.zip
# cgal
wget https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip
unzip CGAL-5.2.1.zip
rm CGAL-5.2.1.zip
# gmp and mpfr
wget https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip
unzip -o CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip -d CGAL-5.2.1/
rm CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip
# tbb
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.6.0/oneapi-tbb-2021.6.0-win.zip
unzip -o oneapi-tbb-2021.6.0-win.zip
rm oneapi-tbb-2021.6.0-win.zip
# embree
wget https://github.com/embree/embree/releases/download/v3.13.5/embree-3.13.5.x64.vc14.windows.zip
unzip -o embree-3.13.5.x64.vc14.windows.zip
rm embree-3.13.5.x64.vc14.windows.zip

View File

@ -30,6 +30,58 @@ function(add_meshlab_plugin target_name)
COMPONENT Plugins)
endfunction()
# function that dowloads and unzips an archive
# params:
# - link: download link
# - dir: directory where the archive will be extracted
# - name: a name used only for log
function(download_and_unzip)
set(download_and_unzip_SUCCESS FALSE PARENT_SCOPE)
set(options)
set(oneValueArgs MD5 NAME DIR)
set(multiValueArgs LINK)
cmake_parse_arguments(DAU
"${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})
list(LENGTH DAU_LINK NUMBER_OF_LINKS)
if(NUMBER_OF_LINKS LESS 1)
message(FATAL_ERROR "Need to specify at least a download link.")
endif()
set(ZIP ${CMAKE_CURRENT_LIST_DIR}/tmp.zip)
foreach(LINK ${DAU_LINK})
message(STATUS "Downloading ${DAU_NAME} from ${LINK}")
file(DOWNLOAD ${LINK} ${ZIP})
file(MD5 ${ZIP} MD5SUM)
# no md5 argument given, no checksum needed...
if (NOT DEFINED DAU_MD5)
set(DAU_MD5 ${MD5SUM})
endif()
# manual md5 check, avoid to fail when a download fails
if(MD5SUM STREQUAL ${DAU_MD5}) # download successful
message(STATUS "${DAU_NAME} downloaded.")
message(STATUS "Extracting ${DAU_NAME} archive...")
file(ARCHIVE_EXTRACT
INPUT ${ZIP}
DESTINATION ${DAU_DIR})
message(STATUS "${DAU_NAME} archive extracted.")
file(REMOVE ${ZIP})
set(download_and_unzip_SUCCESS TRUE PARENT_SCOPE)
break() # done
else()
file(REMOVE ${ZIP})
message(STATUS "${DAU_NAME} download failed...")
# next link in DAU_LINK list...
endif()
endforeach()
endfunction()
# make quiet some portions of cmake
# usage
#

View File

@ -210,7 +210,7 @@ target_link_libraries(
Qt5::Network
vcglib
external-glew
external-exif
external-easyexif
)
set_property(TARGET meshlab-common PROPERTY FOLDER Core)

View File

@ -12,6 +12,9 @@ option(
"Should warnings be disabled on bundled source code?"
ON)
set(MESHLAB_EXTERNAL_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads")
set(MESHLAB_EXTERNAL_DOWNLOAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/downloads")
add_library(external-disable-warnings INTERFACE)
if(BUILD_BUNDLED_SOURCES_WITHOUT_WARNINGS)
if(MSVC)
@ -83,5 +86,4 @@ if ((NOT BUILD_MESHLAB_MINI) AND ALLOW_OPTIONAL_EXTERNAL_MESHLAB_LIBRARIES)
# libe57Format - optional, for io_e57
include(${CMAKE_CURRENT_SOURCE_DIR}/e57.cmake)
endif()

View File

@ -1,100 +0,0 @@
1. PREREQUISITES
================
In order to compile the OpenCTM shared library, all you need is a supported
compiler and it should compile right out of the box.
In order to compile the entire OpenCTM package, including documentation and the
tools, there are some extra dependencies:
- To build all the tools, you need GLUT, and for Un*x/X11 you also need
GTK+ 2.0 (Ubuntu: sudo apt-get install libgtk2.0-dev).
- To build the documentation you need Doxygen (www.doxygen.org), a full
LaTeX installation (see TeX Live - http://www.tug.org/texlive/), and Groff
(Windows: http://gnuwin32.sourceforge.net/packages/groff.htm,
Mac OS X: preinstalled, Ubuntu: sudo apt-get install groff).
2. COMPILING
============
There are a few makefiles for different systems and compilers. Just pick the
one that fits your system, and run "make" on the corresponding file. Here are
a few specific instructions:
2.1 Windows, MinGW32
--------------------
mingw32-make -f Makefile.mingw
2.2 Windows, MS Visual Studio (Express) 2008
--------------------------------------------
nmake /f Makefile.msvc
2.3 Mac OS X
------------
make -f Makefile.macosx
2.4 Linux
---------
make -f Makefile.linux
2.5 OpenSolaris
---------------
gmake -f Makefile.linux
3. BUILD TARGETS
================
By default, the OpenCTM shared library and the OpenCTM tools are compiled when
make is run. To select what is built, use one of the following build targets
(just append it to the end of the make command line):
openctm (the shared library)
toolset (the tools)
documentation (the HTML and PDF documentation)
all (openctm + toolset + documentation)
clean (clean all the built files - start from scratch)
For instance, to just build the OpenCTM shared library under Windows with
MS Visual Studio, type:
nmake /f Makefile.msvc openctm
4. INSTALLATION
===============
For Linux and Mac OS X, it is possible to make a system wide installation by
using the "install" build target. The installation process will install the
following:
- OpenCTM shared library
- OpenCTM C/C++ headers (inlcude files)
- ctmconv and ctmviewer tools
- Man pages
Just make sure that the Makefile contains the correct (and desired)
installation paths. Also, you need to have root privileges to make a system
wide installation.
For instance, to compile and install OpenCTM under Ubuntu, do:
make -f Makefile.linux
sudo make -f Makefile.linux install
...and to compile and install OpenCTM under Mac OS X, do:
make -f Makefile.macosx
sudo make -f Makefile.macosx install

View File

@ -1,20 +0,0 @@
Copyright (c) 2009-2010 Marcus Geelnard
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.

View File

@ -1,65 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.linux
# Description: Top level makefile for Linux systems (should work on most
# Un*x-like systems with gcc, e.g. OpenSolaris).
###############################################################################
# Copyright (c) 2009 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
.phony: default all openctm toolset documentation install clean
default: openctm toolset
all: openctm toolset documentation
clean:
cd lib && $(MAKE) -f Makefile.linux clean && cd ..
cd tools && $(MAKE) -f Makefile.linux clean && cd ..
cd doc && $(MAKE) -f Makefile.linux clean && cd ..
openctm:
cd lib && $(MAKE) -f Makefile.linux -j2 && cd ..
toolset:
cd tools && $(MAKE) -f Makefile.linux -j2 && cd ..
documentation:
cd doc && $(MAKE) -f Makefile.linux -j2 && cd ..
# Installation settings
LIBDIR = /usr/lib/
INCDIR = /usr/local/include/
BINDIR = /usr/local/bin/
MAN1DIR = /usr/local/share/man/man1/
CP = cp
MKDIR = mkdir -p
install:
$(CP) lib/libopenctm.so $(LIBDIR)
$(CP) lib/openctm.h $(INCDIR)
$(CP) lib/openctmpp.h $(INCDIR)
$(CP) tools/ctmconv $(BINDIR)
$(CP) tools/ctmviewer $(BINDIR)
$(MKDIR) $(MAN1DIR)
$(CP) doc/ctmconv.1 $(MAN1DIR)
$(CP) doc/ctmviewer.1 $(MAN1DIR)

View File

@ -1,64 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.macosx
# Description: Top level makefile for Mac OS X.
###############################################################################
# Copyright (c) 2009 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
.phony: default all openctm toolset documentation clean
default: openctm toolset
all: openctm toolset documentation
clean:
cd lib && $(MAKE) -f Makefile.macosx clean && cd ..
cd tools && $(MAKE) -f Makefile.macosx clean && cd ..
cd doc && $(MAKE) -f Makefile.macosx clean && cd ..
openctm:
cd lib && $(MAKE) -f Makefile.macosx -j2 && cd ..
toolset:
cd tools && $(MAKE) -f Makefile.macosx -j2 && cd ..
documentation:
cd doc && $(MAKE) -f Makefile.macosx -j2 && cd ..
# Installation settings
LIBDIR = /usr/local/lib/
INCDIR = /usr/local/include/
BINDIR = /usr/local/bin/
MAN1DIR = /usr/local/share/man/man1/
CP = cp
MKDIR = mkdir -p
install:
$(CP) lib/libopenctm.dylib $(LIBDIR)
$(CP) lib/openctm.h $(INCDIR)
$(CP) lib/openctmpp.h $(INCDIR)
$(CP) tools/ctmconv $(BINDIR)
$(CP) tools/ctmviewer $(BINDIR)
$(MKDIR) $(MAN1DIR)
$(CP) doc/ctmconv.1 $(MAN1DIR)
$(CP) doc/ctmviewer.1 $(MAN1DIR)

View File

@ -1,45 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.mingw
# Description: Top level makefile for Windows / MinGW32.
###############################################################################
# Copyright (c) 2009 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
.phony: default all openctm toolset documentation clean
default: openctm toolset
all: openctm toolset documentation
clean:
cd lib && $(MAKE) -f Makefile.mingw clean && cd ..
cd tools && $(MAKE) -f Makefile.mingw clean && cd ..
cd doc && $(MAKE) -f Makefile.win clean && cd ..
openctm:
cd lib && $(MAKE) -f Makefile.mingw -j2 && cd ..
toolset:
cd tools && $(MAKE) -f Makefile.mingw -j2 && cd ..
documentation:
cd doc && $(MAKE) -f Makefile.win -j2 && cd ..

View File

@ -1,45 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.msvc
# Description: Top level makefile for Windows / MS Visual Studio 2008.
###############################################################################
# Copyright (c) 2009 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
.PHONY: default all openctm toolset documentation clean
default: openctm toolset
all: openctm toolset documentation
clean:
cd lib && $(MAKE) /nologo /f Makefile.msvc clean && cd ..
cd tools && $(MAKE) /nologo /f Makefile.msvc clean && cd ..
cd doc && $(MAKE) /nologo /f Makefile.win clean && cd ..
openctm:
cd lib && $(MAKE) /nologo /f Makefile.msvc && cd ..
toolset:
cd tools && $(MAKE) /nologo /f Makefile.msvc && cd ..
documentation:
cd doc && $(MAKE) /nologo /f Makefile.win && cd ..

View File

@ -1,152 +0,0 @@
1. INTRODUCTION
===============
Welcome to OpenCTM!
OpenCTM is a file format, a software library and a tool set for compression of
3D triangle meshes. The geometry is compressed to a fraction of comparable file
formats (3DS, STL, COLLADA, VRML...), and the format is easily accessible
through a simple, portable API.
The library is written in portable C (C99), and should compile nicely on any
32/64-bit system regardless of endianity (big endian or little endian).
2. LICENSE
==========
The OpenCTM API and the OpenCTM tools are released under the zlib/libpng
license (see LICENSE.txt).
3. CREDITS
==========
Many people have helped out in the development process of OpenCTM, with
valuable feedback, programming efforts, test models and conceptual ideas.
Also, OpenCTM relies heavily on many other open source projects.
Here is an incomplete list of persons that deserve credit:
- Igor Pavlov (LZMA library)
- Jonas Innala (COLLADA importer, Maya exporter plugin)
- Ilian Dinev (help with the OpenCTM file format design and the LWO loader)
- Lee Thomason (TinyXML)
- Diego Nehab (RPly - for loading PLY files)
- Lev Povalahev, Marcelo E. Magallon, Milan Ikits (GLEW)
- Thomas G. Lane, Guido Vollbeding (libjpeg)
- Jean-loup Gailly, Mark Adler (zlib)
- Daniel Karling (pnglite)
During the development of OpenCTM, the following software has been used
extensively:
- Ubuntu (www.ubuntu.com)
- Blender (www.blender.org)
- GCC (gcc.gnu.org)
- SciTE (www.scintilla.org/SciTE.html)
- Notepad++ (notepad-plus.sourceforge.net)
- Smultron (smultron.sourceforge.net)
Legal notices:
- This software is based in part on the work of the Independent JPEG Group.
4. CHANGES
==========
v1.0.3 - 2010.01.15
-------------------
- Added support for PNG format textures (ctmviewer).
- Added support for LightWave LWO files (ctmconv and ctmviewer).
- Added support for Geomview OFF files, e.g. as used by the Princeton Shape
Benchmark (ctmconv and ctmviewer).
- Improved the OBJ file loader (ctmviewer and ctmconv).
- Experimental support for VRML 2.0 files - export only (ctmconv and ctmviewer).
- Made it possible to run ctmviewer without command line arguments.
- Improved the normal calculation algorithm (ctmviewer and ctmconv).
- Normals are no longer exported if no normals were present in the input file
(ctmviewer).
v1.0.2 - 2009.12.13
-------------------
- Added an OpenCTM exporter plugin for Maya [Jonas Innala].
- Added the possiblity to save and load files from ctmviewer, effectively
turning it into a quick and simple converter tool (without all the options
in the ctmconv program, though).
- Added a function to load texture files from ctmviewer.
- Improved the camera control in ctmviewer (panning with the right mouse
button, zooming with the middle mouse button and the mouse wheel, feature
focusing by double clicking, Y/Z up axis selection and "fit to screen"
function).
- Added a GUI dialog for showing errors in ctmviewer (this is especially useful
under Windows, where console output is disabeled).
- Added an option for calculating the normals in ctmconv (if the input file
does not have normals).
- Added options for turning off normals, texture coordinates and/or vertex
colors for the output file in ctmconv.
- Added manuals for ctmviewer and ctmconv (man pages).
- Added a "make install" build target for Mac OS X and Linux for simple system
wide installation (see COMPILING.txt).
- NOTE: The Linux/X11 version of ctmviewer now reqires GTK+ 2.0.
v1.0.1 - 2009.11.15
-------------------
- Notable reduction of the memory footprint by tuning of the LZMA compression
parameters.
- Added a Wavefront OBJ file importer/exporter.
- Some improvements to ctmviewer and ctmconv.
- Some directory structure and build system cleanups.
v1.0 - 2009.11.09
-----------------
- Added a COLLADA converter module to the ctmconv program [Jonas Innala].
- Added Python bindings and a demo Python program.
- Improved the internal mesh integrity checking, to minimize the risk of invalid
data processing.
- Improved the file format specification document.
v0.8 (beta) - 2009.09.14
------------------------
- Introduced a new API function for controlling the compression level
(ctmCompressionLevel), and set the default compression level to 5 (rather
than 9, which would eat a lot of memory, usally without much difference).
- Changed the name "texture map" in the API to "UV map" (and all
corresponding constant and function names). This is more in line with
the nomenclature of most 3D authoring software, and avoids the confusion
with the term texture mapping in 3D hardware (which is not limited to
2D UV mapping coordinates).
- A few updates to the documentation.
v0.7 (beta) - 2009.08.29
------------------------
- This was the first public release of OpenCTM.

View File

@ -1,38 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li class="current"><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table>
<tr><td class="indexkey"><a class="el" href="classctm__error.html">ctm_error</a></td><td class="indexvalue">OpenCTM exception </td></tr>
<tr><td class="indexkey"><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td class="indexvalue">OpenCTM exporter class </td></tr>
<tr><td class="indexkey"><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td class="indexvalue">OpenCTM importer class </td></tr>
</table>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,51 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>CTMexporter Member List</h1>This is the complete list of members for <a class="el" href="classCTMexporter.html">CTMexporter</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#ac6ae926c8a087af172258ee22ef38331">AddAttribMap</a>(const CTMfloat *aAttribValues, const char *aName)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a789c681d97c0bbf584156f529d4216fe">AddUVMap</a>(const CTMfloat *aUVCoords, const char *aName, const char *aFileName)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#aa23b7350d8ce9e0de716528bc550303c">AttribPrecision</a>(CTMenum aAttribMap, CTMfloat aPrecision)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#ab2a81044568d7503e8d0f0272c855113">CompressionLevel</a>(CTMuint aLevel)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a09de9efb7b8b1f043367717c653dc847">CompressionMethod</a>(CTMenum aMethod)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#aad8599a96aa930533f6d2a4b71526165">CTMexporter</a>()</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#ae0b37569a2846b0296cbc923a3477563">CTMexporter</a>(const CTMexporter &amp;v)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#ae93ad35333b949ca371253e43d6936ab">DefineMesh</a>(const CTMfloat *aVertices, CTMuint aVertexCount, const CTMuint *aIndices, CTMuint aTriangleCount, const CTMfloat *aNormals)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#ad9f296aacd93756f482634dba96c9d63">FileComment</a>(const char *aFileComment)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a5e91deaa92b529a2a1c8bc87d46952bb">NormalPrecision</a>(CTMfloat aPrecision)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#ae686aa88aa041e53fdbcbe465b7dbf70">operator=</a>(const CTMexporter &amp;v)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a3fdf6505e0aaa7345218cebf1278addf">Save</a>(const char *aFileName)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a4dd0f34efdfe192b0627b1bb52a36910">SaveCustom</a>(CTMwritefn aWriteFn, void *aUserData)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a1de5b12af537d79ea1d5cf7a0fdd6c9c">UVCoordPrecision</a>(CTMenum aUVMap, CTMfloat aPrecision)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a137df10c84b6feb8b3c54360f077220a">VertexPrecision</a>(CTMfloat aPrecision)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#af4ca0e12d0e6203633abb5ae514cc113">VertexPrecisionRel</a>(CTMfloat aRelPrecision)</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMexporter.html#a2c62a6c252ec24b0bfbdb62e1b7b7ea9">~CTMexporter</a>()</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a></td><td><code> [inline]</code></td></tr>
</table></div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,508 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: CTMexporter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>CTMexporter Class Reference</h1><!-- doxytag: class="CTMexporter" -->
<p>OpenCTM exporter class.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="openctmpp_8h_source.html">openctmpp.h</a>&gt;</code></p>
<p><a href="classCTMexporter-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#aad8599a96aa930533f6d2a4b71526165">CTMexporter</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <a href="#aad8599a96aa930533f6d2a4b71526165"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a2c62a6c252ec24b0bfbdb62e1b7b7ea9">~CTMexporter</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <a href="#a2c62a6c252ec24b0bfbdb62e1b7b7ea9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a09de9efb7b8b1f043367717c653dc847">CompressionMethod</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aMethod)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#af4ac8e534f59be4edacc39753cf54693" title="Set which compression method to use for the given OpenCTM context.">ctmCompressionMethod()</a>. <a href="#a09de9efb7b8b1f043367717c653dc847"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#ab2a81044568d7503e8d0f0272c855113">CompressionLevel</a> (<a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a> aLevel)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#aa2902c49b904a7557fdd012e303c720e" title="Set which LZMA compression level to use for the given OpenCTM context.">ctmCompressionLevel()</a>. <a href="#ab2a81044568d7503e8d0f0272c855113"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a137df10c84b6feb8b3c54360f077220a">VertexPrecision</a> (<a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> aPrecision)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#af4191357f51161a16ff886d18ec848d8" title="Set the vertex coordinate precision (only used by the MG2 compression method).">ctmVertexPrecision()</a>. <a href="#a137df10c84b6feb8b3c54360f077220a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#af4ca0e12d0e6203633abb5ae514cc113">VertexPrecisionRel</a> (<a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> aRelPrecision)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#ade23eb25fa9d5cd1d932bc1203476f27" title="Set the vertex coordinate precision, relative to the mesh dimensions (only used by...">ctmVertexPrecisionRel()</a>. <a href="#af4ca0e12d0e6203633abb5ae514cc113"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a5e91deaa92b529a2a1c8bc87d46952bb">NormalPrecision</a> (<a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> aPrecision)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a07d8b47a0e642d0d8c77cf18e8d354a5" title="Set the normal precision (only used by the MG2 compression method).">ctmNormalPrecision()</a>. <a href="#a5e91deaa92b529a2a1c8bc87d46952bb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a1de5b12af537d79ea1d5cf7a0fdd6c9c">UVCoordPrecision</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aUVMap, <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> aPrecision)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#ac1a75abbf04281acaff4f6f1f9516039" title="Set the coordinate precision for the specified UV map (only used by the MG2 compression...">ctmUVCoordPrecision()</a>. <a href="#a1de5b12af537d79ea1d5cf7a0fdd6c9c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#aa23b7350d8ce9e0de716528bc550303c">AttribPrecision</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aAttribMap, <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> aPrecision)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a8af7af38bd9340838b43805b81698777" title="Set the attribute value precision for the specified attribute map (only used by the...">ctmAttribPrecision()</a>. <a href="#aa23b7350d8ce9e0de716528bc550303c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#ad9f296aacd93756f482634dba96c9d63">FileComment</a> (const char *aFileComment)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a2225924b06488421ee6b9a8505782a25" title="Set the file comment for the given OpenCTM context.">ctmFileComment()</a>. <a href="#ad9f296aacd93756f482634dba96c9d63"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#ae93ad35333b949ca371253e43d6936ab">DefineMesh</a> (const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *aVertices, <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a> aVertexCount, const <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a> *aIndices, <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a> aTriangleCount, const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *aNormals)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a1cb648e89121ae67f5a8b9e5a8f41c4d" title="Define a triangle mesh.">ctmDefineMesh()</a>. <a href="#ae93ad35333b949ca371253e43d6936ab"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a789c681d97c0bbf584156f529d4216fe">AddUVMap</a> (const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *aUVCoords, const char *aName, const char *aFileName)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a44345560299ac49dfd502d0470f05e0f" title="Define a UV map.">ctmAddUVMap()</a>. <a href="#a789c681d97c0bbf584156f529d4216fe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#ac6ae926c8a087af172258ee22ef38331">AddAttribMap</a> (const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *aAttribValues, const char *aName)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a920a8fed6bef834db0b241fc5c9bba03" title="Define a custom vertex attribute map.">ctmAddAttribMap()</a>. <a href="#ac6ae926c8a087af172258ee22ef38331"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a3fdf6505e0aaa7345218cebf1278addf">Save</a> (const char *aFileName)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#acde994008b0b3321bad9f3bbfacb12db" title="Save an OpenCTM format file.">ctmSave()</a>. <a href="#a3fdf6505e0aaa7345218cebf1278addf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#a4dd0f34efdfe192b0627b1bb52a36910">SaveCustom</a> (<a class="el" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b">CTMwritefn</a> aWriteFn, void *aUserData)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a7e62ca5548a34ed0e126fd4f7b77ef3f" title="Save an OpenCTM format file using a custom stream write function.">ctmSaveCustom()</a>. <a href="#a4dd0f34efdfe192b0627b1bb52a36910"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#ae0b37569a2846b0296cbc923a3477563">CTMexporter</a> (const <a class="el" href="classCTMexporter.html">CTMexporter</a> &amp;v)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCTMexporter.html">CTMexporter</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html#ae686aa88aa041e53fdbcbe465b7dbf70">operator=</a> (const <a class="el" href="classCTMexporter.html">CTMexporter</a> &amp;v)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>OpenCTM exporter class. </p>
<p>This is a C++ wrapper class for an OpenCTM export context. Usage example: </p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> MySaveFile(<a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> aVertCount, <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> aTriCount, <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * aVertices,
<a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> * aIndices, <span class="keyword">const</span> <span class="keywordtype">char</span> * aFileName)
{
<span class="comment">// Create a new OpenCTM exporter object</span>
<a class="code" href="classCTMexporter.html" title="OpenCTM exporter class.">CTMexporter</a> ctm;
<span class="comment">// Define our mesh representation to OpenCTM (store references to it in</span>
<span class="comment">// the context)</span>
ctm.<a class="code" href="classCTMexporter.html#ae93ad35333b949ca371253e43d6936ab" title="Wrapper for ctmDefineMesh().">DefineMesh</a>(aVertices, aVertCount, aIndices, aTriCount, NULL);
<span class="comment">// Save the OpenCTM file</span>
ctm.<a class="code" href="classCTMexporter.html#a3fdf6505e0aaa7345218cebf1278addf" title="Wrapper for ctmSave().">Save</a>(aFileName);
}
</pre></div> <hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aad8599a96aa930533f6d2a4b71526165"></a><!-- doxytag: member="CTMexporter::CTMexporter" ref="aad8599a96aa930533f6d2a4b71526165" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CTMexporter::CTMexporter </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructor. </p>
</div>
</div>
<a class="anchor" id="a2c62a6c252ec24b0bfbdb62e1b7b7ea9"></a><!-- doxytag: member="CTMexporter::~CTMexporter" ref="a2c62a6c252ec24b0bfbdb62e1b7b7ea9" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CTMexporter::~CTMexporter </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<a class="anchor" id="ae0b37569a2846b0296cbc923a3477563"></a><!-- doxytag: member="CTMexporter::CTMexporter" ref="ae0b37569a2846b0296cbc923a3477563" args="(const CTMexporter &amp;v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CTMexporter::CTMexporter </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classCTMexporter.html">CTMexporter</a> &amp;&nbsp;</td>
<td class="paramname"> <em>v</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac6ae926c8a087af172258ee22ef38331"></a><!-- doxytag: member="CTMexporter::AddAttribMap" ref="ac6ae926c8a087af172258ee22ef38331" args="(const CTMfloat *aAttribValues, const char *aName)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> CTMexporter::AddAttribMap </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *&nbsp;</td>
<td class="paramname"> <em>aAttribValues</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aName</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a920a8fed6bef834db0b241fc5c9bba03" title="Define a custom vertex attribute map.">ctmAddAttribMap()</a>. </p>
</div>
</div>
<a class="anchor" id="a789c681d97c0bbf584156f529d4216fe"></a><!-- doxytag: member="CTMexporter::AddUVMap" ref="a789c681d97c0bbf584156f529d4216fe" args="(const CTMfloat *aUVCoords, const char *aName, const char *aFileName)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> CTMexporter::AddUVMap </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *&nbsp;</td>
<td class="paramname"> <em>aUVCoords</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aFileName</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a44345560299ac49dfd502d0470f05e0f" title="Define a UV map.">ctmAddUVMap()</a>. </p>
</div>
</div>
<a class="anchor" id="aa23b7350d8ce9e0de716528bc550303c"></a><!-- doxytag: member="CTMexporter::AttribPrecision" ref="aa23b7350d8ce9e0de716528bc550303c" args="(CTMenum aAttribMap, CTMfloat aPrecision)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::AttribPrecision </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aAttribMap</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td>
<td class="paramname"> <em>aPrecision</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a8af7af38bd9340838b43805b81698777" title="Set the attribute value precision for the specified attribute map (only used by the...">ctmAttribPrecision()</a>. </p>
</div>
</div>
<a class="anchor" id="ab2a81044568d7503e8d0f0272c855113"></a><!-- doxytag: member="CTMexporter::CompressionLevel" ref="ab2a81044568d7503e8d0f0272c855113" args="(CTMuint aLevel)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::CompressionLevel </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a>&nbsp;</td>
<td class="paramname"> <em>aLevel</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#aa2902c49b904a7557fdd012e303c720e" title="Set which LZMA compression level to use for the given OpenCTM context.">ctmCompressionLevel()</a>. </p>
</div>
</div>
<a class="anchor" id="a09de9efb7b8b1f043367717c653dc847"></a><!-- doxytag: member="CTMexporter::CompressionMethod" ref="a09de9efb7b8b1f043367717c653dc847" args="(CTMenum aMethod)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::CompressionMethod </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aMethod</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#af4ac8e534f59be4edacc39753cf54693" title="Set which compression method to use for the given OpenCTM context.">ctmCompressionMethod()</a>. </p>
</div>
</div>
<a class="anchor" id="ae93ad35333b949ca371253e43d6936ab"></a><!-- doxytag: member="CTMexporter::DefineMesh" ref="ae93ad35333b949ca371253e43d6936ab" args="(const CTMfloat *aVertices, CTMuint aVertexCount, const CTMuint *aIndices, CTMuint aTriangleCount, const CTMfloat *aNormals)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::DefineMesh </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *&nbsp;</td>
<td class="paramname"> <em>aVertices</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a>&nbsp;</td>
<td class="paramname"> <em>aVertexCount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a> *&nbsp;</td>
<td class="paramname"> <em>aIndices</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a>&nbsp;</td>
<td class="paramname"> <em>aTriangleCount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *&nbsp;</td>
<td class="paramname"> <em>aNormals</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a1cb648e89121ae67f5a8b9e5a8f41c4d" title="Define a triangle mesh.">ctmDefineMesh()</a>. </p>
</div>
</div>
<a class="anchor" id="ad9f296aacd93756f482634dba96c9d63"></a><!-- doxytag: member="CTMexporter::FileComment" ref="ad9f296aacd93756f482634dba96c9d63" args="(const char *aFileComment)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::FileComment </td>
<td>(</td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aFileComment</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a2225924b06488421ee6b9a8505782a25" title="Set the file comment for the given OpenCTM context.">ctmFileComment()</a>. </p>
</div>
</div>
<a class="anchor" id="a5e91deaa92b529a2a1c8bc87d46952bb"></a><!-- doxytag: member="CTMexporter::NormalPrecision" ref="a5e91deaa92b529a2a1c8bc87d46952bb" args="(CTMfloat aPrecision)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::NormalPrecision </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td>
<td class="paramname"> <em>aPrecision</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a07d8b47a0e642d0d8c77cf18e8d354a5" title="Set the normal precision (only used by the MG2 compression method).">ctmNormalPrecision()</a>. </p>
</div>
</div>
<a class="anchor" id="ae686aa88aa041e53fdbcbe465b7dbf70"></a><!-- doxytag: member="CTMexporter::operator=" ref="ae686aa88aa041e53fdbcbe465b7dbf70" args="(const CTMexporter &amp;v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classCTMexporter.html">CTMexporter</a>&amp; CTMexporter::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classCTMexporter.html">CTMexporter</a> &amp;&nbsp;</td>
<td class="paramname"> <em>v</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a3fdf6505e0aaa7345218cebf1278addf"></a><!-- doxytag: member="CTMexporter::Save" ref="a3fdf6505e0aaa7345218cebf1278addf" args="(const char *aFileName)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::Save </td>
<td>(</td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aFileName</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#acde994008b0b3321bad9f3bbfacb12db" title="Save an OpenCTM format file.">ctmSave()</a>. </p>
</div>
</div>
<a class="anchor" id="a4dd0f34efdfe192b0627b1bb52a36910"></a><!-- doxytag: member="CTMexporter::SaveCustom" ref="a4dd0f34efdfe192b0627b1bb52a36910" args="(CTMwritefn aWriteFn, void *aUserData)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::SaveCustom </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b">CTMwritefn</a>&nbsp;</td>
<td class="paramname"> <em>aWriteFn</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>aUserData</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a7e62ca5548a34ed0e126fd4f7b77ef3f" title="Save an OpenCTM format file using a custom stream write function.">ctmSaveCustom()</a>. </p>
</div>
</div>
<a class="anchor" id="a1de5b12af537d79ea1d5cf7a0fdd6c9c"></a><!-- doxytag: member="CTMexporter::UVCoordPrecision" ref="a1de5b12af537d79ea1d5cf7a0fdd6c9c" args="(CTMenum aUVMap, CTMfloat aPrecision)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::UVCoordPrecision </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aUVMap</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td>
<td class="paramname"> <em>aPrecision</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#ac1a75abbf04281acaff4f6f1f9516039" title="Set the coordinate precision for the specified UV map (only used by the MG2 compression...">ctmUVCoordPrecision()</a>. </p>
</div>
</div>
<a class="anchor" id="a137df10c84b6feb8b3c54360f077220a"></a><!-- doxytag: member="CTMexporter::VertexPrecision" ref="a137df10c84b6feb8b3c54360f077220a" args="(CTMfloat aPrecision)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::VertexPrecision </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td>
<td class="paramname"> <em>aPrecision</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#af4191357f51161a16ff886d18ec848d8" title="Set the vertex coordinate precision (only used by the MG2 compression method).">ctmVertexPrecision()</a>. </p>
</div>
</div>
<a class="anchor" id="af4ca0e12d0e6203633abb5ae514cc113"></a><!-- doxytag: member="CTMexporter::VertexPrecisionRel" ref="af4ca0e12d0e6203633abb5ae514cc113" args="(CTMfloat aRelPrecision)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMexporter::VertexPrecisionRel </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td>
<td class="paramname"> <em>aRelPrecision</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#ade23eb25fa9d5cd1d932bc1203476f27" title="Set the vertex coordinate precision, relative to the mesh dimensions (only used by...">ctmVertexPrecisionRel()</a>. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="openctmpp_8h_source.html">openctmpp.h</a></li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,51 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>CTMimporter Member List</h1>This is the complete list of members for <a class="el" href="classCTMimporter.html">CTMimporter</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a4b22cf96b7be2bdff4ed95051dca581d">CTMimporter</a>()</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a7e22bb4bfaae2f373f44a099b9045221">CTMimporter</a>(const CTMimporter &amp;v)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#ae24b12d9c44c75b86ac8a414afe9587d">GetAttribMapFloat</a>(CTMenum aAttribMap, CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a8b9692055a8069faf5e0efda7f1a6e9f">GetAttribMapString</a>(CTMenum aAttribMap, CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#ab2e03da5fbe0c8350e303ee0418bc5db">GetFloat</a>(CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a2fc574cc5d09c7e861867d9193299201">GetFloatArray</a>(CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60">GetInteger</a>(CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a08b5b0d5723066fd56e0fc752321c332">GetIntegerArray</a>(CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a4cbdaa46ec7c4d8e60493a15119d6943">GetNamedAttribMap</a>(const char *aName)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a315d0ac280b74afa832b09c5850d6c59">GetNamedUVMap</a>(const char *aName)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#ae29eed6294afc62ae49eb958813354c8">GetString</a>(CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#ae331cb506a75e1605fa5955dd6f4f1e6">GetUVMapFloat</a>(CTMenum aUVMap, CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a223ee89a56c1151291321b74c0dc69ea">GetUVMapString</a>(CTMenum aUVMap, CTMenum aProperty)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#aafa137d809e6a1947fe438ab6a5f6b32">Load</a>(const char *aFileName)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#af284200fd58bbf545151f5f2c8e71f63">LoadCustom</a>(CTMreadfn aReadFn, void *aUserData)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#adc2b2792aa4f30f26f966342106c1c69">operator=</a>(const CTMimporter &amp;v)</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classCTMimporter.html#a7db4d4c826b8afec5a60679add4097a0">~CTMimporter</a>()</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a></td><td><code> [inline]</code></td></tr>
</table></div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,476 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: CTMimporter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>CTMimporter Class Reference</h1><!-- doxytag: class="CTMimporter" -->
<p>OpenCTM importer class.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="openctmpp_8h_source.html">openctmpp.h</a>&gt;</code></p>
<p><a href="classCTMimporter-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a4b22cf96b7be2bdff4ed95051dca581d">CTMimporter</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <a href="#a4b22cf96b7be2bdff4ed95051dca581d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a7db4d4c826b8afec5a60679add4097a0">~CTMimporter</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <a href="#a7db4d4c826b8afec5a60679add4097a0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60">GetInteger</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e" title="Get information about an OpenCTM context.">ctmGetInteger()</a>. <a href="#aec5a05c77350810f8ebe75334f7c8b60"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#ab2e03da5fbe0c8350e303ee0418bc5db">GetFloat</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#abe7389b3a396a86a3a1c5d5c6f68183d" title="Get information about an OpenCTM context.">ctmGetFloat()</a>. <a href="#ab2e03da5fbe0c8350e303ee0418bc5db"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a08b5b0d5723066fd56e0fc752321c332">GetIntegerArray</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#ae202716acce7a97668654052dc4d0bef" title="Get an integer array from an OpenCTM context.">ctmGetIntegerArray()</a>. <a href="#a08b5b0d5723066fd56e0fc752321c332"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a2fc574cc5d09c7e861867d9193299201">GetFloatArray</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#abdfcfede5d37c75e78cae989dc71e248" title="Get a floating point array from an OpenCTM context.">ctmGetFloatArray()</a>. <a href="#a2fc574cc5d09c7e861867d9193299201"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a315d0ac280b74afa832b09c5850d6c59">GetNamedUVMap</a> (const char *aName)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a43c2d19741ba53f695a4119e594d6069" title="Get a reference to the named UV map.">ctmGetNamedUVMap()</a>. <a href="#a315d0ac280b74afa832b09c5850d6c59"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a223ee89a56c1151291321b74c0dc69ea">GetUVMapString</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aUVMap, <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a2d689ee3371296b68899d564d5a1f998" title="Get information about a UV map.">ctmGetUVMapString()</a>. <a href="#a223ee89a56c1151291321b74c0dc69ea"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#ae331cb506a75e1605fa5955dd6f4f1e6">GetUVMapFloat</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aUVMap, <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#afad1b100b9f2fe4bf0dfc36cb39ec615" title="Get information about a UV map.">ctmGetUVMapFloat()</a>. <a href="#ae331cb506a75e1605fa5955dd6f4f1e6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a4cbdaa46ec7c4d8e60493a15119d6943">GetNamedAttribMap</a> (const char *aName)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a15692de5d6e93adf8bed8d06d88c905c" title="Get a reference to the named vertex attribute map.">ctmGetNamedAttribMap()</a>. <a href="#a4cbdaa46ec7c4d8e60493a15119d6943"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a8b9692055a8069faf5e0efda7f1a6e9f">GetAttribMapString</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aAttribMap, <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a841d7c1e0bafd57ee36ccbbc74470b68" title="Get information about a vertex attribute map.">ctmGetAttribMapString()</a>. <a href="#a8b9692055a8069faf5e0efda7f1a6e9f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#ae24b12d9c44c75b86ac8a414afe9587d">GetAttribMapFloat</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aAttribMap, <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a7c297f9b6d486f47596cff184602a65d" title="Get information about a vertex attribute map.">ctmGetAttribMapFloat()</a>. <a href="#ae24b12d9c44c75b86ac8a414afe9587d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#ae29eed6294afc62ae49eb958813354c8">GetString</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aProperty)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a4e4269df157eb2d117259c69a331e339" title="Get information about an OpenCTM context.">ctmGetString()</a>. <a href="#ae29eed6294afc62ae49eb958813354c8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#aafa137d809e6a1947fe438ab6a5f6b32">Load</a> (const char *aFileName)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a99a57706d438c5654adbc9646058dc01" title="Load an OpenCTM format file into the context.">ctmLoad()</a>. <a href="#aafa137d809e6a1947fe438ab6a5f6b32"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#af284200fd58bbf545151f5f2c8e71f63">LoadCustom</a> (<a class="el" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b">CTMreadfn</a> aReadFn, void *aUserData)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Wrapper for <a class="el" href="openctm_8h.html#a99699bcbd4cbe0942a22498671af107e" title="Load an OpenCTM format file using a custom stream read function.">ctmLoadCustom()</a>. <a href="#af284200fd58bbf545151f5f2c8e71f63"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#a7e22bb4bfaae2f373f44a099b9045221">CTMimporter</a> (const <a class="el" href="classCTMimporter.html">CTMimporter</a> &amp;v)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCTMimporter.html">CTMimporter</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html#adc2b2792aa4f30f26f966342106c1c69">operator=</a> (const <a class="el" href="classCTMimporter.html">CTMimporter</a> &amp;v)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>OpenCTM importer class. </p>
<p>This is a C++ wrapper class for an OpenCTM import context. Usage example:</p>
<div class="fragment"><pre class="fragment"> <span class="comment">// Create a new OpenCTM importer object</span>
<a class="code" href="classCTMimporter.html" title="OpenCTM importer class.">CTMimporter</a> ctm;
<span class="comment">// Load the OpenCTM file</span>
ctm.<a class="code" href="classCTMimporter.html#aafa137d809e6a1947fe438ab6a5f6b32" title="Wrapper for ctmLoad().">Load</a>(<span class="stringliteral">&quot;mymesh.ctm&quot;</span>);
<span class="comment">// Access the mesh data</span>
vertCount = ctm.<a class="code" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60" title="Wrapper for ctmGetInteger().">GetInteger</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7d1a8887b82dc448f9d774e8874d98a" title="Number of vertices in the mesh (integer).">CTM_VERTEX_COUNT</a>);
vertices = ctm.<a class="code" href="classCTMimporter.html#a2fc574cc5d09c7e861867d9193299201" title="Wrapper for ctmGetFloatArray().">GetFloatArray</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7e80243674806368e9e29e9e2bf8d55" title="Vertex point coordinates (float array).">CTM_VERTICES</a>);
triCount = ctm.<a class="code" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60" title="Wrapper for ctmGetInteger().">GetInteger</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a6d97b09d2d5da53c7c3bad5c5f30e51d" title="Number of triangles in the mesh (integer).">CTM_TRIANGLE_COUNT</a>);
indices = ctm.<a class="code" href="classCTMimporter.html#a08b5b0d5723066fd56e0fc752321c332" title="Wrapper for ctmGetIntegerArray().">GetIntegerArray</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa7ec8fe7061e8a336530ee0448073206" title="Triangle indices (integer array).">CTM_INDICES</a>);
<span class="comment">// Deal with the mesh (e.g. transcode it to our internal representation)</span>
<span class="comment">// ...</span>
</pre></div> <hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a4b22cf96b7be2bdff4ed95051dca581d"></a><!-- doxytag: member="CTMimporter::CTMimporter" ref="a4b22cf96b7be2bdff4ed95051dca581d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CTMimporter::CTMimporter </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructor. </p>
</div>
</div>
<a class="anchor" id="a7db4d4c826b8afec5a60679add4097a0"></a><!-- doxytag: member="CTMimporter::~CTMimporter" ref="a7db4d4c826b8afec5a60679add4097a0" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CTMimporter::~CTMimporter </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<a class="anchor" id="a7e22bb4bfaae2f373f44a099b9045221"></a><!-- doxytag: member="CTMimporter::CTMimporter" ref="a7e22bb4bfaae2f373f44a099b9045221" args="(const CTMimporter &amp;v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CTMimporter::CTMimporter </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classCTMimporter.html">CTMimporter</a> &amp;&nbsp;</td>
<td class="paramname"> <em>v</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ae24b12d9c44c75b86ac8a414afe9587d"></a><!-- doxytag: member="CTMimporter::GetAttribMapFloat" ref="ae24b12d9c44c75b86ac8a414afe9587d" args="(CTMenum aAttribMap, CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> CTMimporter::GetAttribMapFloat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aAttribMap</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a7c297f9b6d486f47596cff184602a65d" title="Get information about a vertex attribute map.">ctmGetAttribMapFloat()</a>. </p>
</div>
</div>
<a class="anchor" id="a8b9692055a8069faf5e0efda7f1a6e9f"></a><!-- doxytag: member="CTMimporter::GetAttribMapString" ref="a8b9692055a8069faf5e0efda7f1a6e9f" args="(CTMenum aAttribMap, CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* CTMimporter::GetAttribMapString </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aAttribMap</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a841d7c1e0bafd57ee36ccbbc74470b68" title="Get information about a vertex attribute map.">ctmGetAttribMapString()</a>. </p>
</div>
</div>
<a class="anchor" id="ab2e03da5fbe0c8350e303ee0418bc5db"></a><!-- doxytag: member="CTMimporter::GetFloat" ref="ab2e03da5fbe0c8350e303ee0418bc5db" args="(CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> CTMimporter::GetFloat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#abe7389b3a396a86a3a1c5d5c6f68183d" title="Get information about an OpenCTM context.">ctmGetFloat()</a>. </p>
</div>
</div>
<a class="anchor" id="a2fc574cc5d09c7e861867d9193299201"></a><!-- doxytag: member="CTMimporter::GetFloatArray" ref="a2fc574cc5d09c7e861867d9193299201" args="(CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a>* CTMimporter::GetFloatArray </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#abdfcfede5d37c75e78cae989dc71e248" title="Get a floating point array from an OpenCTM context.">ctmGetFloatArray()</a>. </p>
</div>
</div>
<a class="anchor" id="aec5a05c77350810f8ebe75334f7c8b60"></a><!-- doxytag: member="CTMimporter::GetInteger" ref="aec5a05c77350810f8ebe75334f7c8b60" args="(CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a> CTMimporter::GetInteger </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e" title="Get information about an OpenCTM context.">ctmGetInteger()</a>. </p>
</div>
</div>
<a class="anchor" id="a08b5b0d5723066fd56e0fc752321c332"></a><!-- doxytag: member="CTMimporter::GetIntegerArray" ref="a08b5b0d5723066fd56e0fc752321c332" args="(CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">CTMuint</a>* CTMimporter::GetIntegerArray </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#ae202716acce7a97668654052dc4d0bef" title="Get an integer array from an OpenCTM context.">ctmGetIntegerArray()</a>. </p>
</div>
</div>
<a class="anchor" id="a4cbdaa46ec7c4d8e60493a15119d6943"></a><!-- doxytag: member="CTMimporter::GetNamedAttribMap" ref="a4cbdaa46ec7c4d8e60493a15119d6943" args="(const char *aName)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> CTMimporter::GetNamedAttribMap </td>
<td>(</td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aName</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a15692de5d6e93adf8bed8d06d88c905c" title="Get a reference to the named vertex attribute map.">ctmGetNamedAttribMap()</a>. </p>
</div>
</div>
<a class="anchor" id="a315d0ac280b74afa832b09c5850d6c59"></a><!-- doxytag: member="CTMimporter::GetNamedUVMap" ref="a315d0ac280b74afa832b09c5850d6c59" args="(const char *aName)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> CTMimporter::GetNamedUVMap </td>
<td>(</td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aName</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a43c2d19741ba53f695a4119e594d6069" title="Get a reference to the named UV map.">ctmGetNamedUVMap()</a>. </p>
</div>
</div>
<a class="anchor" id="ae29eed6294afc62ae49eb958813354c8"></a><!-- doxytag: member="CTMimporter::GetString" ref="ae29eed6294afc62ae49eb958813354c8" args="(CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* CTMimporter::GetString </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a4e4269df157eb2d117259c69a331e339" title="Get information about an OpenCTM context.">ctmGetString()</a>. </p>
</div>
</div>
<a class="anchor" id="ae331cb506a75e1605fa5955dd6f4f1e6"></a><!-- doxytag: member="CTMimporter::GetUVMapFloat" ref="ae331cb506a75e1605fa5955dd6f4f1e6" args="(CTMenum aUVMap, CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">CTMfloat</a> CTMimporter::GetUVMapFloat </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aUVMap</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#afad1b100b9f2fe4bf0dfc36cb39ec615" title="Get information about a UV map.">ctmGetUVMapFloat()</a>. </p>
</div>
</div>
<a class="anchor" id="a223ee89a56c1151291321b74c0dc69ea"></a><!-- doxytag: member="CTMimporter::GetUVMapString" ref="a223ee89a56c1151291321b74c0dc69ea" args="(CTMenum aUVMap, CTMenum aProperty)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* CTMimporter::GetUVMapString </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aUVMap</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aProperty</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a2d689ee3371296b68899d564d5a1f998" title="Get information about a UV map.">ctmGetUVMapString()</a>. </p>
</div>
</div>
<a class="anchor" id="aafa137d809e6a1947fe438ab6a5f6b32"></a><!-- doxytag: member="CTMimporter::Load" ref="aafa137d809e6a1947fe438ab6a5f6b32" args="(const char *aFileName)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMimporter::Load </td>
<td>(</td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>aFileName</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a99a57706d438c5654adbc9646058dc01" title="Load an OpenCTM format file into the context.">ctmLoad()</a>. </p>
</div>
</div>
<a class="anchor" id="af284200fd58bbf545151f5f2c8e71f63"></a><!-- doxytag: member="CTMimporter::LoadCustom" ref="af284200fd58bbf545151f5f2c8e71f63" args="(CTMreadfn aReadFn, void *aUserData)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void CTMimporter::LoadCustom </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b">CTMreadfn</a>&nbsp;</td>
<td class="paramname"> <em>aReadFn</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>aUserData</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper for <a class="el" href="openctm_8h.html#a99699bcbd4cbe0942a22498671af107e" title="Load an OpenCTM format file using a custom stream read function.">ctmLoadCustom()</a>. </p>
</div>
</div>
<a class="anchor" id="adc2b2792aa4f30f26f966342106c1c69"></a><!-- doxytag: member="CTMimporter::operator=" ref="adc2b2792aa4f30f26f966342106c1c69" args="(const CTMimporter &amp;v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classCTMimporter.html">CTMimporter</a>&amp; CTMimporter::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classCTMimporter.html">CTMimporter</a> &amp;&nbsp;</td>
<td class="paramname"> <em>v</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="openctmpp_8h_source.html">openctmpp.h</a></li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,37 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>ctm_error Member List</h1>This is the complete list of members for <a class="el" href="classctm__error.html">ctm_error</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classctm__error.html#a2a27a1dfa1c25d52135e3ca74d74ad3b">ctm_error</a>(CTMenum aError)</td><td><a class="el" href="classctm__error.html">ctm_error</a></td><td><code> [inline, explicit]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classctm__error.html#a90be36697549d38e6cd370c97667e23a">error_code</a>() const </td><td><a class="el" href="classctm__error.html">ctm_error</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classctm__error.html#ada16f2648ab34dda2a78a44f89d82468">what</a>() const </td><td><a class="el" href="classctm__error.html">ctm_error</a></td><td><code> [inline, virtual]</code></td></tr>
</table></div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,106 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: ctm_error Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>ctm_error Class Reference</h1><!-- doxytag: class="ctm_error" -->
<p>OpenCTM exception.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="openctmpp_8h_source.html">openctmpp.h</a>&gt;</code></p>
<p><a href="classctm__error-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classctm__error.html#a2a27a1dfa1c25d52135e3ca74d74ad3b">ctm_error</a> (<a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> aError)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classctm__error.html#ada16f2648ab34dda2a78a44f89d82468">what</a> () const throw ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classctm__error.html#a90be36697549d38e6cd370c97667e23a">error_code</a> () const throw ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>OpenCTM exception. </p>
<p>When an error occurs, a <code><a class="el" href="classctm__error.html" title="OpenCTM exception.">ctm_error</a></code> exception is thrown. Its <a class="el" href="classctm__error.html#ada16f2648ab34dda2a78a44f89d82468">what()</a> function returns the name of the OpenCTM error code (for instance "CTM_INVALID_OPERATION"). </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a2a27a1dfa1c25d52135e3ca74d74ad3b"></a><!-- doxytag: member="ctm_error::ctm_error" ref="a2a27a1dfa1c25d52135e3ca74d74ad3b" args="(CTMenum aError)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ctm_error::ctm_error </td>
<td>(</td>
<td class="paramtype"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a>&nbsp;</td>
<td class="paramname"> <em>aError</em></td>
<td>&nbsp;)&nbsp;</td>
<td><code> [inline, explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a90be36697549d38e6cd370c97667e23a"></a><!-- doxytag: member="ctm_error::error_code" ref="a90be36697549d38e6cd370c97667e23a" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">CTMenum</a> ctm_error::error_code </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const throw ()<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ada16f2648ab34dda2a78a44f89d82468"></a><!-- doxytag: member="ctm_error::what" ref="ada16f2648ab34dda2a78a44f89d82468" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual const char* ctm_error::what </td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td> const throw ()<code> [inline, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="openctmpp_8h_source.html">openctmpp.h</a></li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,37 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Alphabetical List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>Class Index</h1><div class="qindex"><a class="qindex" href="#letter_C">C</a></div>
<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td><a name="letter_C"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&nbsp;&nbsp;C&nbsp;&nbsp;</div></td></tr></table>
</td><td><a class="el" href="classctm__error.html">ctm_error</a>&nbsp;&nbsp;&nbsp;</td><td><a class="el" href="classCTMexporter.html">CTMexporter</a>&nbsp;&nbsp;&nbsp;</td><td><a class="el" href="classCTMimporter.html">CTMimporter</a>&nbsp;&nbsp;&nbsp;</td></tr></table><div class="qindex"><a class="qindex" href="#letter_C">C</a></div>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,498 +0,0 @@
/* The standard CSS for doxygen */
body, table, div, p, dl {
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
font-size: 12px;
}
/* @group Heading Levels */
h1 {
text-align: center;
font-size: 150%;
}
h2 {
font-size: 120%;
}
h3 {
font-size: 100%;
}
dt {
font-weight: bold;
}
div.multicol {
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
-moz-column-count: 3;
-webkit-column-count: 3;
}
p.startli, p.startdd {
margin-top: 2px;
}
p.endli {
margin-bottom: 0px;
}
p.enddd {
margin-bottom: 4px;
}
/* @end */
caption {
font-weight: bold;
}
span.legend {
font-size: 70%;
text-align: center;
}
div.qindex, div.navtab{
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
}
div.qindex, div.navpath {
width: 100%;
line-height: 140%;
}
div.navtab {
margin-right: 15px;
}
/* @group Link Styling */
a {
color: #153788;
font-weight: normal;
text-decoration: none;
}
.contents a:visited {
color: #1b77c5;
}
a:hover {
text-decoration: underline;
}
a.qindex {
font-weight: bold;
}
a.qindexHL {
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
.contents a.qindexHL:visited {
color: #ffffff;
}
a.el {
font-weight: bold;
}
a.elRef {
}
a.code {
}
a.codeRef {
}
/* @end */
dl.el {
margin-left: -1cm;
}
.fragment {
font-family: monospace, fixed;
font-size: 105%;
}
pre.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
}
div.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px
}
div.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
div.groupText {
margin-left: 16px;
font-style: italic;
}
body {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}
td.indexkey {
background-color: #e8eef2;
font-weight: bold;
border: 1px solid #CCCCCC;
margin: 2px 0px 2px 0;
padding: 2px 10px;
}
td.indexvalue {
background-color: #e8eef2;
border: 1px solid #CCCCCC;
padding: 2px 10px;
margin: 2px 0px;
}
tr.memlist {
background-color: #f0f0f0;
}
p.formulaDsp {
text-align: center;
}
img.formulaDsp {
}
img.formulaInl {
vertical-align: middle;
}
div.center {
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
padding: 0px;
}
div.center img {
border: 0px;
}
img.footer {
border: 0px;
vertical-align: middle;
}
/* @group Code Colorization */
span.keyword {
color: #008000
}
span.keywordtype {
color: #604020
}
span.keywordflow {
color: #e08000
}
span.comment {
color: #800000
}
span.preprocessor {
color: #806020
}
span.stringliteral {
color: #002080
}
span.charliteral {
color: #008080
}
span.vhdldigit {
color: #ff00ff
}
span.vhdlchar {
color: #000000
}
span.vhdlkeyword {
color: #700070
}
span.vhdllogic {
color: #ff0000
}
/* @end */
.search {
color: #003399;
font-weight: bold;
}
form.search {
margin-bottom: 0px;
margin-top: 0px;
}
input.search {
font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
td.tiny {
font-size: 75%;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #84b0c7;
}
th.dirtab {
background: #e8eef2;
font-weight: bold;
}
hr {
height: 0;
border: none;
border-top: 1px solid #666;
}
/* @group Member Descriptions */
.mdescLeft, .mdescRight,
.memItemLeft, .memItemRight,
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
background-color: #FAFAFA;
border: none;
margin: 4px;
padding: 1px 0 0 8px;
}
.mdescLeft, .mdescRight {
padding: 0px 8px 4px 8px;
color: #555;
}
.memItemLeft, .memItemRight, .memTemplParams {
border-top: 1px solid #ccc;
}
.memItemLeft, .memTemplItemLeft {
white-space: nowrap;
}
.memTemplParams {
color: #606060;
white-space: nowrap;
}
/* @end */
/* @group Member Details */
/* Styles for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #606060;
font-weight: normal;
margin-left: 3px;
}
.memnav {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.memitem {
padding: 0;
margin-bottom: 10px;
}
.memname {
white-space: nowrap;
font-weight: bold;
}
.memproto, .memdoc {
border: 1px solid #84b0c7;
}
.memproto {
padding: 0;
background-color: #d5e1e8;
font-weight: bold;
-webkit-border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-moz-border-radius-topleft: 8px;
-moz-border-radius-topright: 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
}
.memdoc {
padding: 2px 5px;
background-color: #eef3f5;
border-top-width: 0;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-moz-border-radius-bottomleft: 8px;
-moz-border-radius-bottomright: 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
white-space: nowrap;
}
.paramname em {
font-style: normal;
}
/* @end */
/* @group Directory (tree) */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin: 0.5em;
}
/* these are for tree view when used as main index */
.directory {
font-size: 9pt;
font-weight: bold;
}
.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
/*
The following two styles can be used to replace the root node title
with an image of your choice. Simply uncomment the next two styles,
specify the name of your image and be sure to set 'height' to the
proper pixel height of your image.
*/
/*
.directory h3.swap {
height: 61px;
background-repeat: no-repeat;
background-image: url("yourimage.gif");
}
.directory h3.swap span {
display: none;
}
*/
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}
/* these are for tree view when not used as main index */
.directory-alt {
font-size: 100%;
font-weight: bold;
}
.directory-alt h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory-alt > h3 {
margin-top: 0;
}
.directory-alt p {
margin: 0px;
white-space: nowrap;
}
.directory-alt div {
display: none;
margin: 0px;
}
.directory-alt img {
vertical-align: -30%;
}
/* @end */
address {
font-style: normal;
color: #333;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,37 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: File Index</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li class="current"><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>File List</h1>Here is a list of all files with brief descriptions:<table>
<tr><td class="indexkey"><a class="el" href="openctm_8h.html">openctm.h</a> <a href="openctm_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="openctmpp_8h.html">openctmpp.h</a> <a href="openctmpp_8h_source.html">[code]</a></td><td class="indexvalue"></td></tr>
</table>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,216 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li class="current"><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="#index_a"><span>a</span></a></li>
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_e"><span>e</span></a></li>
<li><a href="#index_f"><span>f</span></a></li>
<li><a href="#index_g"><span>g</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_n"><span>n</span></a></li>
<li><a href="#index_o"><span>o</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
<li><a href="#index_w"><span>w</span></a></li>
<li><a href="#index_~"><span>~</span></a></li>
</ul>
</div>
</div>
<div class="contents">
Here is a list of all class members with links to the classes they belong to:
<h3><a class="anchor" id="index_a">- a -</a></h3><ul>
<li>AddAttribMap()
: <a class="el" href="classCTMexporter.html#ac6ae926c8a087af172258ee22ef38331">CTMexporter</a>
</li>
<li>AddUVMap()
: <a class="el" href="classCTMexporter.html#a789c681d97c0bbf584156f529d4216fe">CTMexporter</a>
</li>
<li>AttribPrecision()
: <a class="el" href="classCTMexporter.html#aa23b7350d8ce9e0de716528bc550303c">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_c">- c -</a></h3><ul>
<li>CompressionLevel()
: <a class="el" href="classCTMexporter.html#ab2a81044568d7503e8d0f0272c855113">CTMexporter</a>
</li>
<li>CompressionMethod()
: <a class="el" href="classCTMexporter.html#a09de9efb7b8b1f043367717c653dc847">CTMexporter</a>
</li>
<li>ctm_error()
: <a class="el" href="classctm__error.html#a2a27a1dfa1c25d52135e3ca74d74ad3b">ctm_error</a>
</li>
<li>CTMexporter()
: <a class="el" href="classCTMexporter.html#ae0b37569a2846b0296cbc923a3477563">CTMexporter</a>
</li>
<li>CTMimporter()
: <a class="el" href="classCTMimporter.html#a4b22cf96b7be2bdff4ed95051dca581d">CTMimporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_d">- d -</a></h3><ul>
<li>DefineMesh()
: <a class="el" href="classCTMexporter.html#ae93ad35333b949ca371253e43d6936ab">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_e">- e -</a></h3><ul>
<li>error_code()
: <a class="el" href="classctm__error.html#a90be36697549d38e6cd370c97667e23a">ctm_error</a>
</li>
</ul>
<h3><a class="anchor" id="index_f">- f -</a></h3><ul>
<li>FileComment()
: <a class="el" href="classCTMexporter.html#ad9f296aacd93756f482634dba96c9d63">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_g">- g -</a></h3><ul>
<li>GetAttribMapFloat()
: <a class="el" href="classCTMimporter.html#ae24b12d9c44c75b86ac8a414afe9587d">CTMimporter</a>
</li>
<li>GetAttribMapString()
: <a class="el" href="classCTMimporter.html#a8b9692055a8069faf5e0efda7f1a6e9f">CTMimporter</a>
</li>
<li>GetFloat()
: <a class="el" href="classCTMimporter.html#ab2e03da5fbe0c8350e303ee0418bc5db">CTMimporter</a>
</li>
<li>GetFloatArray()
: <a class="el" href="classCTMimporter.html#a2fc574cc5d09c7e861867d9193299201">CTMimporter</a>
</li>
<li>GetInteger()
: <a class="el" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60">CTMimporter</a>
</li>
<li>GetIntegerArray()
: <a class="el" href="classCTMimporter.html#a08b5b0d5723066fd56e0fc752321c332">CTMimporter</a>
</li>
<li>GetNamedAttribMap()
: <a class="el" href="classCTMimporter.html#a4cbdaa46ec7c4d8e60493a15119d6943">CTMimporter</a>
</li>
<li>GetNamedUVMap()
: <a class="el" href="classCTMimporter.html#a315d0ac280b74afa832b09c5850d6c59">CTMimporter</a>
</li>
<li>GetString()
: <a class="el" href="classCTMimporter.html#ae29eed6294afc62ae49eb958813354c8">CTMimporter</a>
</li>
<li>GetUVMapFloat()
: <a class="el" href="classCTMimporter.html#ae331cb506a75e1605fa5955dd6f4f1e6">CTMimporter</a>
</li>
<li>GetUVMapString()
: <a class="el" href="classCTMimporter.html#a223ee89a56c1151291321b74c0dc69ea">CTMimporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_l">- l -</a></h3><ul>
<li>Load()
: <a class="el" href="classCTMimporter.html#aafa137d809e6a1947fe438ab6a5f6b32">CTMimporter</a>
</li>
<li>LoadCustom()
: <a class="el" href="classCTMimporter.html#af284200fd58bbf545151f5f2c8e71f63">CTMimporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_n">- n -</a></h3><ul>
<li>NormalPrecision()
: <a class="el" href="classCTMexporter.html#a5e91deaa92b529a2a1c8bc87d46952bb">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_o">- o -</a></h3><ul>
<li>operator=()
: <a class="el" href="classCTMimporter.html#adc2b2792aa4f30f26f966342106c1c69">CTMimporter</a>
, <a class="el" href="classCTMexporter.html#ae686aa88aa041e53fdbcbe465b7dbf70">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_s">- s -</a></h3><ul>
<li>Save()
: <a class="el" href="classCTMexporter.html#a3fdf6505e0aaa7345218cebf1278addf">CTMexporter</a>
</li>
<li>SaveCustom()
: <a class="el" href="classCTMexporter.html#a4dd0f34efdfe192b0627b1bb52a36910">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_u">- u -</a></h3><ul>
<li>UVCoordPrecision()
: <a class="el" href="classCTMexporter.html#a1de5b12af537d79ea1d5cf7a0fdd6c9c">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_v">- v -</a></h3><ul>
<li>VertexPrecision()
: <a class="el" href="classCTMexporter.html#a137df10c84b6feb8b3c54360f077220a">CTMexporter</a>
</li>
<li>VertexPrecisionRel()
: <a class="el" href="classCTMexporter.html#af4ca0e12d0e6203633abb5ae514cc113">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_w">- w -</a></h3><ul>
<li>what()
: <a class="el" href="classctm__error.html#ada16f2648ab34dda2a78a44f89d82468">ctm_error</a>
</li>
</ul>
<h3><a class="anchor" id="index_0x7e">- ~ -</a></h3><ul>
<li>~CTMexporter()
: <a class="el" href="classCTMexporter.html#a2c62a6c252ec24b0bfbdb62e1b7b7ea9">CTMexporter</a>
</li>
<li>~CTMimporter()
: <a class="el" href="classCTMimporter.html#a7db4d4c826b8afec5a60679add4097a0">CTMimporter</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,216 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li class="current"><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="functions.html"><span>All</span></a></li>
<li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="#index_a"><span>a</span></a></li>
<li><a href="#index_c"><span>c</span></a></li>
<li><a href="#index_d"><span>d</span></a></li>
<li><a href="#index_e"><span>e</span></a></li>
<li><a href="#index_f"><span>f</span></a></li>
<li><a href="#index_g"><span>g</span></a></li>
<li><a href="#index_l"><span>l</span></a></li>
<li><a href="#index_n"><span>n</span></a></li>
<li><a href="#index_o"><span>o</span></a></li>
<li><a href="#index_s"><span>s</span></a></li>
<li><a href="#index_u"><span>u</span></a></li>
<li><a href="#index_v"><span>v</span></a></li>
<li><a href="#index_w"><span>w</span></a></li>
<li><a href="#index_~"><span>~</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&nbsp;
<h3><a class="anchor" id="index_a">- a -</a></h3><ul>
<li>AddAttribMap()
: <a class="el" href="classCTMexporter.html#ac6ae926c8a087af172258ee22ef38331">CTMexporter</a>
</li>
<li>AddUVMap()
: <a class="el" href="classCTMexporter.html#a789c681d97c0bbf584156f529d4216fe">CTMexporter</a>
</li>
<li>AttribPrecision()
: <a class="el" href="classCTMexporter.html#aa23b7350d8ce9e0de716528bc550303c">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_c">- c -</a></h3><ul>
<li>CompressionLevel()
: <a class="el" href="classCTMexporter.html#ab2a81044568d7503e8d0f0272c855113">CTMexporter</a>
</li>
<li>CompressionMethod()
: <a class="el" href="classCTMexporter.html#a09de9efb7b8b1f043367717c653dc847">CTMexporter</a>
</li>
<li>ctm_error()
: <a class="el" href="classctm__error.html#a2a27a1dfa1c25d52135e3ca74d74ad3b">ctm_error</a>
</li>
<li>CTMexporter()
: <a class="el" href="classCTMexporter.html#ae0b37569a2846b0296cbc923a3477563">CTMexporter</a>
</li>
<li>CTMimporter()
: <a class="el" href="classCTMimporter.html#a4b22cf96b7be2bdff4ed95051dca581d">CTMimporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_d">- d -</a></h3><ul>
<li>DefineMesh()
: <a class="el" href="classCTMexporter.html#ae93ad35333b949ca371253e43d6936ab">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_e">- e -</a></h3><ul>
<li>error_code()
: <a class="el" href="classctm__error.html#a90be36697549d38e6cd370c97667e23a">ctm_error</a>
</li>
</ul>
<h3><a class="anchor" id="index_f">- f -</a></h3><ul>
<li>FileComment()
: <a class="el" href="classCTMexporter.html#ad9f296aacd93756f482634dba96c9d63">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_g">- g -</a></h3><ul>
<li>GetAttribMapFloat()
: <a class="el" href="classCTMimporter.html#ae24b12d9c44c75b86ac8a414afe9587d">CTMimporter</a>
</li>
<li>GetAttribMapString()
: <a class="el" href="classCTMimporter.html#a8b9692055a8069faf5e0efda7f1a6e9f">CTMimporter</a>
</li>
<li>GetFloat()
: <a class="el" href="classCTMimporter.html#ab2e03da5fbe0c8350e303ee0418bc5db">CTMimporter</a>
</li>
<li>GetFloatArray()
: <a class="el" href="classCTMimporter.html#a2fc574cc5d09c7e861867d9193299201">CTMimporter</a>
</li>
<li>GetInteger()
: <a class="el" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60">CTMimporter</a>
</li>
<li>GetIntegerArray()
: <a class="el" href="classCTMimporter.html#a08b5b0d5723066fd56e0fc752321c332">CTMimporter</a>
</li>
<li>GetNamedAttribMap()
: <a class="el" href="classCTMimporter.html#a4cbdaa46ec7c4d8e60493a15119d6943">CTMimporter</a>
</li>
<li>GetNamedUVMap()
: <a class="el" href="classCTMimporter.html#a315d0ac280b74afa832b09c5850d6c59">CTMimporter</a>
</li>
<li>GetString()
: <a class="el" href="classCTMimporter.html#ae29eed6294afc62ae49eb958813354c8">CTMimporter</a>
</li>
<li>GetUVMapFloat()
: <a class="el" href="classCTMimporter.html#ae331cb506a75e1605fa5955dd6f4f1e6">CTMimporter</a>
</li>
<li>GetUVMapString()
: <a class="el" href="classCTMimporter.html#a223ee89a56c1151291321b74c0dc69ea">CTMimporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_l">- l -</a></h3><ul>
<li>Load()
: <a class="el" href="classCTMimporter.html#aafa137d809e6a1947fe438ab6a5f6b32">CTMimporter</a>
</li>
<li>LoadCustom()
: <a class="el" href="classCTMimporter.html#af284200fd58bbf545151f5f2c8e71f63">CTMimporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_n">- n -</a></h3><ul>
<li>NormalPrecision()
: <a class="el" href="classCTMexporter.html#a5e91deaa92b529a2a1c8bc87d46952bb">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_o">- o -</a></h3><ul>
<li>operator=()
: <a class="el" href="classCTMimporter.html#adc2b2792aa4f30f26f966342106c1c69">CTMimporter</a>
, <a class="el" href="classCTMexporter.html#ae686aa88aa041e53fdbcbe465b7dbf70">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_s">- s -</a></h3><ul>
<li>Save()
: <a class="el" href="classCTMexporter.html#a3fdf6505e0aaa7345218cebf1278addf">CTMexporter</a>
</li>
<li>SaveCustom()
: <a class="el" href="classCTMexporter.html#a4dd0f34efdfe192b0627b1bb52a36910">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_u">- u -</a></h3><ul>
<li>UVCoordPrecision()
: <a class="el" href="classCTMexporter.html#a1de5b12af537d79ea1d5cf7a0fdd6c9c">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_v">- v -</a></h3><ul>
<li>VertexPrecision()
: <a class="el" href="classCTMexporter.html#a137df10c84b6feb8b3c54360f077220a">CTMexporter</a>
</li>
<li>VertexPrecisionRel()
: <a class="el" href="classCTMexporter.html#af4ca0e12d0e6203633abb5ae514cc113">CTMexporter</a>
</li>
</ul>
<h3><a class="anchor" id="index_w">- w -</a></h3><ul>
<li>what()
: <a class="el" href="classctm__error.html#ada16f2648ab34dda2a78a44f89d82468">ctm_error</a>
</li>
</ul>
<h3><a class="anchor" id="index_0x7e">- ~ -</a></h3><ul>
<li>~CTMexporter()
: <a class="el" href="classCTMexporter.html#a2c62a6c252ec24b0bfbdb62e1b7b7ea9">CTMexporter</a>
</li>
<li>~CTMimporter()
: <a class="el" href="classCTMimporter.html#a7db4d4c826b8afec5a60679add4097a0">CTMimporter</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,313 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li class="current"><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="#index_c"><span>c</span></a></li>
</ul>
</div>
</div>
<div class="contents">
Here is a list of all file members with links to the files they belong to:
<h3><a class="anchor" id="index_c">- c -</a></h3><ul>
<li>CTM_API_VERSION
: <a class="el" href="openctm_8h.html#a909fd88252d88bd84095aba982900e7f">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_1
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a37c9dffce89ec51e9767e1f9a38e51bd">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_2
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adc4a982b27a02157edff941636063827">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_3
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad991095653802528246723d3ed82b532">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_4
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0f79e8024cea635758c0cf51b24853c6">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_5
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a224d8bba1ab7b7de0ea4ef6ac4b5dc7e">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_6
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2ee3e625af252ef1771136c144cda838">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_7
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a99d3f4511629bb006cfcfa12b4db323a">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_8
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2d749b6c2b0a1384c28ad19f491db31e">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa0b3c108352ad1dbdb60ca6f57e921a4">openctm.h</a>
</li>
<li>CTM_BAD_FORMAT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a607254e23f6dd9ea46f9ed3b01331844">openctm.h</a>
</li>
<li>CTM_COMPRESSION_METHOD
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae25493f9fd4ddc3e06043078a8c23e20">openctm.h</a>
</li>
<li>CTM_EXPORT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4d156b19083ce49d4b8a6da287d6f5d3">openctm.h</a>
</li>
<li>CTM_FALSE
: <a class="el" href="openctm_8h.html#aeab5b58ecb1449e95f577b59e4803314">openctm.h</a>
</li>
<li>CTM_FILE_COMMENT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa4b62d1802dd335fd7bfee2ed25c4c4d">openctm.h</a>
</li>
<li>CTM_FILE_ERROR
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0280fc2383ee4d5c613744c9c68cdafb">openctm.h</a>
</li>
<li>CTM_FILE_NAME
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae9adc5919726099c90ea9ba732e85b6c">openctm.h</a>
</li>
<li>CTM_HAS_NORMALS
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adcbea5e453256bbbb3dc369e9f9fd872">openctm.h</a>
</li>
<li>CTM_IMPORT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a98b76ddee5519228fb8864e7929e5f00">openctm.h</a>
</li>
<li>CTM_INDICES
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa7ec8fe7061e8a336530ee0448073206">openctm.h</a>
</li>
<li>CTM_INTERNAL_ERROR
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a97d27f42581866aa1413999b6f448191">openctm.h</a>
</li>
<li>CTM_INVALID_ARGUMENT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abdfdbc82040b419dbc9906baed538704">openctm.h</a>
</li>
<li>CTM_INVALID_CONTEXT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae8246d2a7b2e7d3cced72f7460e9d5d1">openctm.h</a>
</li>
<li>CTM_INVALID_MESH
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a245e25dc7e5bfd88c03d5c52eebfdf29">openctm.h</a>
</li>
<li>CTM_INVALID_OPERATION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af38eb5e0bd49e7321c4ebd2d1a0a580b">openctm.h</a>
</li>
<li>CTM_LZMA_ERROR
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a5492e61ffa160ff720c89221660dbbf8">openctm.h</a>
</li>
<li>CTM_METHOD_MG1
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeb7ddc6f328ec73944a2fcb20472341b">openctm.h</a>
</li>
<li>CTM_METHOD_MG2
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae52e3f40682c9e56be588a4661f8dc0c">openctm.h</a>
</li>
<li>CTM_METHOD_RAW
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ba5bf3da62c7292644723b227a5cce8">openctm.h</a>
</li>
<li>CTM_NAME
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a3e3d28e72ec322ba63f94d77551c5ede">openctm.h</a>
</li>
<li>CTM_NONE
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abf60b318c307c84b240d374d07ff6bf5">openctm.h</a>
</li>
<li>CTM_NORMAL_PRECISION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae63ebc86a051e3f43492eb051eab9e97">openctm.h</a>
</li>
<li>CTM_NORMALS
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a02185a711fd216acee2171e46653855e">openctm.h</a>
</li>
<li>CTM_OUT_OF_MEMORY
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a43202555b9cfdecf32bdf7b9807056f7">openctm.h</a>
</li>
<li>CTM_PRECISION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ada5784c8eb3143ee996d31214d46b0d4">openctm.h</a>
</li>
<li>CTM_TRIANGLE_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a6d97b09d2d5da53c7c3bad5c5f30e51d">openctm.h</a>
</li>
<li>CTM_TRUE
: <a class="el" href="openctm_8h.html#a2004bfa9db3f5d6e07411d1bea3a573a">openctm.h</a>
</li>
<li>CTM_UNSUPPORTED_FORMAT_VERSION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad3e0a5ee55e26e23f43b28dd61e72f16">openctm.h</a>
</li>
<li>CTM_UV_MAP_1
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a9096ee63af274788fe101c75c08b49f6">openctm.h</a>
</li>
<li>CTM_UV_MAP_2
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a104b93d0bfa7344406c68a45da3f616f">openctm.h</a>
</li>
<li>CTM_UV_MAP_3
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2543bac2bdc3931d37e0465f761060be">openctm.h</a>
</li>
<li>CTM_UV_MAP_4
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acc9b387f30b02c370decac35a253b7a0">openctm.h</a>
</li>
<li>CTM_UV_MAP_5
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad96f31e47775ac51ca393b19525cd8cc">openctm.h</a>
</li>
<li>CTM_UV_MAP_6
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acda599be9fff226924d075c3b09dad7b">openctm.h</a>
</li>
<li>CTM_UV_MAP_7
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ca0e7ec8e66c772f449be1f4749414b">openctm.h</a>
</li>
<li>CTM_UV_MAP_8
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeae61f9c3e9cded4a7f8059d0acc41a3">openctm.h</a>
</li>
<li>CTM_UV_MAP_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a87b3013d9d9c151ca9eae64e74f981bd">openctm.h</a>
</li>
<li>CTM_VERTEX_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7d1a8887b82dc448f9d774e8874d98a">openctm.h</a>
</li>
<li>CTM_VERTEX_PRECISION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a7b32280d8591167a42904920934b8f51">openctm.h</a>
</li>
<li>CTM_VERTICES
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7e80243674806368e9e29e9e2bf8d55">openctm.h</a>
</li>
<li>ctmAddAttribMap()
: <a class="el" href="openctm_8h.html#a920a8fed6bef834db0b241fc5c9bba03">openctm.h</a>
</li>
<li>ctmAddUVMap()
: <a class="el" href="openctm_8h.html#a44345560299ac49dfd502d0470f05e0f">openctm.h</a>
</li>
<li>ctmAttribPrecision()
: <a class="el" href="openctm_8h.html#a8af7af38bd9340838b43805b81698777">openctm.h</a>
</li>
<li>ctmCompressionLevel()
: <a class="el" href="openctm_8h.html#aa2902c49b904a7557fdd012e303c720e">openctm.h</a>
</li>
<li>ctmCompressionMethod()
: <a class="el" href="openctm_8h.html#af4ac8e534f59be4edacc39753cf54693">openctm.h</a>
</li>
<li>CTMcontext
: <a class="el" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888">openctm.h</a>
</li>
<li>ctmDefineMesh()
: <a class="el" href="openctm_8h.html#a1cb648e89121ae67f5a8b9e5a8f41c4d">openctm.h</a>
</li>
<li>CTMenum
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">openctm.h</a>
</li>
<li>ctmErrorString()
: <a class="el" href="openctm_8h.html#a3071b834da6a9cdd684ec733de70cbf2">openctm.h</a>
</li>
<li>ctmFileComment()
: <a class="el" href="openctm_8h.html#a2225924b06488421ee6b9a8505782a25">openctm.h</a>
</li>
<li>CTMfloat
: <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">openctm.h</a>
</li>
<li>ctmFreeContext()
: <a class="el" href="openctm_8h.html#aeb16fd3054a19415be90de4968b21a3a">openctm.h</a>
</li>
<li>ctmGetAttribMapFloat()
: <a class="el" href="openctm_8h.html#a7c297f9b6d486f47596cff184602a65d">openctm.h</a>
</li>
<li>ctmGetAttribMapString()
: <a class="el" href="openctm_8h.html#a841d7c1e0bafd57ee36ccbbc74470b68">openctm.h</a>
</li>
<li>ctmGetError()
: <a class="el" href="openctm_8h.html#a2bbaed33a6809affc4a61469f6676bdf">openctm.h</a>
</li>
<li>ctmGetFloat()
: <a class="el" href="openctm_8h.html#abe7389b3a396a86a3a1c5d5c6f68183d">openctm.h</a>
</li>
<li>ctmGetFloatArray()
: <a class="el" href="openctm_8h.html#abdfcfede5d37c75e78cae989dc71e248">openctm.h</a>
</li>
<li>ctmGetInteger()
: <a class="el" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e">openctm.h</a>
</li>
<li>ctmGetIntegerArray()
: <a class="el" href="openctm_8h.html#ae202716acce7a97668654052dc4d0bef">openctm.h</a>
</li>
<li>ctmGetNamedAttribMap()
: <a class="el" href="openctm_8h.html#a15692de5d6e93adf8bed8d06d88c905c">openctm.h</a>
</li>
<li>ctmGetNamedUVMap()
: <a class="el" href="openctm_8h.html#a43c2d19741ba53f695a4119e594d6069">openctm.h</a>
</li>
<li>ctmGetString()
: <a class="el" href="openctm_8h.html#a4e4269df157eb2d117259c69a331e339">openctm.h</a>
</li>
<li>ctmGetUVMapFloat()
: <a class="el" href="openctm_8h.html#afad1b100b9f2fe4bf0dfc36cb39ec615">openctm.h</a>
</li>
<li>ctmGetUVMapString()
: <a class="el" href="openctm_8h.html#a2d689ee3371296b68899d564d5a1f998">openctm.h</a>
</li>
<li>CTMint
: <a class="el" href="openctm_8h.html#a4c1dde73baa8f68242cc922cf85f2096">openctm.h</a>
</li>
<li>ctmLoad()
: <a class="el" href="openctm_8h.html#a99a57706d438c5654adbc9646058dc01">openctm.h</a>
</li>
<li>ctmLoadCustom()
: <a class="el" href="openctm_8h.html#a99699bcbd4cbe0942a22498671af107e">openctm.h</a>
</li>
<li>ctmNewContext()
: <a class="el" href="openctm_8h.html#a3ca20da713005b0c6afb9b5f21640837">openctm.h</a>
</li>
<li>ctmNormalPrecision()
: <a class="el" href="openctm_8h.html#a07d8b47a0e642d0d8c77cf18e8d354a5">openctm.h</a>
</li>
<li>CTMreadfn
: <a class="el" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b">openctm.h</a>
</li>
<li>ctmSave()
: <a class="el" href="openctm_8h.html#acde994008b0b3321bad9f3bbfacb12db">openctm.h</a>
</li>
<li>ctmSaveCustom()
: <a class="el" href="openctm_8h.html#a7e62ca5548a34ed0e126fd4f7b77ef3f">openctm.h</a>
</li>
<li>CTMuint
: <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">openctm.h</a>
</li>
<li>ctmUVCoordPrecision()
: <a class="el" href="openctm_8h.html#ac1a75abbf04281acaff4f6f1f9516039">openctm.h</a>
</li>
<li>ctmVertexPrecision()
: <a class="el" href="openctm_8h.html#af4191357f51161a16ff886d18ec848d8">openctm.h</a>
</li>
<li>ctmVertexPrecisionRel()
: <a class="el" href="openctm_8h.html#ade23eb25fa9d5cd1d932bc1203476f27">openctm.h</a>
</li>
<li>CTMwritefn
: <a class="el" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b">openctm.h</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,54 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li class="current"><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&nbsp;<ul>
<li>CTM_API_VERSION
: <a class="el" href="openctm_8h.html#a909fd88252d88bd84095aba982900e7f">openctm.h</a>
</li>
<li>CTM_FALSE
: <a class="el" href="openctm_8h.html#aeab5b58ecb1449e95f577b59e4803314">openctm.h</a>
</li>
<li>CTM_TRUE
: <a class="el" href="openctm_8h.html#a2004bfa9db3f5d6e07411d1bea3a573a">openctm.h</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,48 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li class="current"><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&nbsp;<ul>
<li>CTMenum
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">openctm.h</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,193 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li class="current"><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="#index_c"><span>c</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&nbsp;
<h3><a class="anchor" id="index_c">- c -</a></h3><ul>
<li>CTM_ATTRIB_MAP_1
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a37c9dffce89ec51e9767e1f9a38e51bd">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_2
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adc4a982b27a02157edff941636063827">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_3
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad991095653802528246723d3ed82b532">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_4
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0f79e8024cea635758c0cf51b24853c6">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_5
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a224d8bba1ab7b7de0ea4ef6ac4b5dc7e">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_6
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2ee3e625af252ef1771136c144cda838">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_7
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a99d3f4511629bb006cfcfa12b4db323a">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_8
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2d749b6c2b0a1384c28ad19f491db31e">openctm.h</a>
</li>
<li>CTM_ATTRIB_MAP_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa0b3c108352ad1dbdb60ca6f57e921a4">openctm.h</a>
</li>
<li>CTM_BAD_FORMAT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a607254e23f6dd9ea46f9ed3b01331844">openctm.h</a>
</li>
<li>CTM_COMPRESSION_METHOD
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae25493f9fd4ddc3e06043078a8c23e20">openctm.h</a>
</li>
<li>CTM_EXPORT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4d156b19083ce49d4b8a6da287d6f5d3">openctm.h</a>
</li>
<li>CTM_FILE_COMMENT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa4b62d1802dd335fd7bfee2ed25c4c4d">openctm.h</a>
</li>
<li>CTM_FILE_ERROR
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0280fc2383ee4d5c613744c9c68cdafb">openctm.h</a>
</li>
<li>CTM_FILE_NAME
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae9adc5919726099c90ea9ba732e85b6c">openctm.h</a>
</li>
<li>CTM_HAS_NORMALS
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adcbea5e453256bbbb3dc369e9f9fd872">openctm.h</a>
</li>
<li>CTM_IMPORT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a98b76ddee5519228fb8864e7929e5f00">openctm.h</a>
</li>
<li>CTM_INDICES
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa7ec8fe7061e8a336530ee0448073206">openctm.h</a>
</li>
<li>CTM_INTERNAL_ERROR
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a97d27f42581866aa1413999b6f448191">openctm.h</a>
</li>
<li>CTM_INVALID_ARGUMENT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abdfdbc82040b419dbc9906baed538704">openctm.h</a>
</li>
<li>CTM_INVALID_CONTEXT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae8246d2a7b2e7d3cced72f7460e9d5d1">openctm.h</a>
</li>
<li>CTM_INVALID_MESH
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a245e25dc7e5bfd88c03d5c52eebfdf29">openctm.h</a>
</li>
<li>CTM_INVALID_OPERATION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af38eb5e0bd49e7321c4ebd2d1a0a580b">openctm.h</a>
</li>
<li>CTM_LZMA_ERROR
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a5492e61ffa160ff720c89221660dbbf8">openctm.h</a>
</li>
<li>CTM_METHOD_MG1
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeb7ddc6f328ec73944a2fcb20472341b">openctm.h</a>
</li>
<li>CTM_METHOD_MG2
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae52e3f40682c9e56be588a4661f8dc0c">openctm.h</a>
</li>
<li>CTM_METHOD_RAW
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ba5bf3da62c7292644723b227a5cce8">openctm.h</a>
</li>
<li>CTM_NAME
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a3e3d28e72ec322ba63f94d77551c5ede">openctm.h</a>
</li>
<li>CTM_NONE
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abf60b318c307c84b240d374d07ff6bf5">openctm.h</a>
</li>
<li>CTM_NORMAL_PRECISION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae63ebc86a051e3f43492eb051eab9e97">openctm.h</a>
</li>
<li>CTM_NORMALS
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a02185a711fd216acee2171e46653855e">openctm.h</a>
</li>
<li>CTM_OUT_OF_MEMORY
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a43202555b9cfdecf32bdf7b9807056f7">openctm.h</a>
</li>
<li>CTM_PRECISION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ada5784c8eb3143ee996d31214d46b0d4">openctm.h</a>
</li>
<li>CTM_TRIANGLE_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a6d97b09d2d5da53c7c3bad5c5f30e51d">openctm.h</a>
</li>
<li>CTM_UNSUPPORTED_FORMAT_VERSION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad3e0a5ee55e26e23f43b28dd61e72f16">openctm.h</a>
</li>
<li>CTM_UV_MAP_1
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a9096ee63af274788fe101c75c08b49f6">openctm.h</a>
</li>
<li>CTM_UV_MAP_2
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a104b93d0bfa7344406c68a45da3f616f">openctm.h</a>
</li>
<li>CTM_UV_MAP_3
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2543bac2bdc3931d37e0465f761060be">openctm.h</a>
</li>
<li>CTM_UV_MAP_4
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acc9b387f30b02c370decac35a253b7a0">openctm.h</a>
</li>
<li>CTM_UV_MAP_5
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad96f31e47775ac51ca393b19525cd8cc">openctm.h</a>
</li>
<li>CTM_UV_MAP_6
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acda599be9fff226924d075c3b09dad7b">openctm.h</a>
</li>
<li>CTM_UV_MAP_7
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ca0e7ec8e66c772f449be1f4749414b">openctm.h</a>
</li>
<li>CTM_UV_MAP_8
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeae61f9c3e9cded4a7f8059d0acc41a3">openctm.h</a>
</li>
<li>CTM_UV_MAP_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a87b3013d9d9c151ca9eae64e74f981bd">openctm.h</a>
</li>
<li>CTM_VERTEX_COUNT
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7d1a8887b82dc448f9d774e8874d98a">openctm.h</a>
</li>
<li>CTM_VERTEX_PRECISION
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a7b32280d8591167a42904920934b8f51">openctm.h</a>
</li>
<li>CTM_VERTICES
: <a class="el" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7e80243674806368e9e29e9e2bf8d55">openctm.h</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,135 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="globals.html"><span>All</span></a></li>
<li class="current"><a href="globals_func.html"><span>Functions</span></a></li>
<li><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&nbsp;<ul>
<li>ctmAddAttribMap()
: <a class="el" href="openctm_8h.html#a920a8fed6bef834db0b241fc5c9bba03">openctm.h</a>
</li>
<li>ctmAddUVMap()
: <a class="el" href="openctm_8h.html#a44345560299ac49dfd502d0470f05e0f">openctm.h</a>
</li>
<li>ctmAttribPrecision()
: <a class="el" href="openctm_8h.html#a8af7af38bd9340838b43805b81698777">openctm.h</a>
</li>
<li>ctmCompressionLevel()
: <a class="el" href="openctm_8h.html#aa2902c49b904a7557fdd012e303c720e">openctm.h</a>
</li>
<li>ctmCompressionMethod()
: <a class="el" href="openctm_8h.html#af4ac8e534f59be4edacc39753cf54693">openctm.h</a>
</li>
<li>ctmDefineMesh()
: <a class="el" href="openctm_8h.html#a1cb648e89121ae67f5a8b9e5a8f41c4d">openctm.h</a>
</li>
<li>ctmErrorString()
: <a class="el" href="openctm_8h.html#a3071b834da6a9cdd684ec733de70cbf2">openctm.h</a>
</li>
<li>ctmFileComment()
: <a class="el" href="openctm_8h.html#a2225924b06488421ee6b9a8505782a25">openctm.h</a>
</li>
<li>ctmFreeContext()
: <a class="el" href="openctm_8h.html#aeb16fd3054a19415be90de4968b21a3a">openctm.h</a>
</li>
<li>ctmGetAttribMapFloat()
: <a class="el" href="openctm_8h.html#a7c297f9b6d486f47596cff184602a65d">openctm.h</a>
</li>
<li>ctmGetAttribMapString()
: <a class="el" href="openctm_8h.html#a841d7c1e0bafd57ee36ccbbc74470b68">openctm.h</a>
</li>
<li>ctmGetError()
: <a class="el" href="openctm_8h.html#a2bbaed33a6809affc4a61469f6676bdf">openctm.h</a>
</li>
<li>ctmGetFloat()
: <a class="el" href="openctm_8h.html#abe7389b3a396a86a3a1c5d5c6f68183d">openctm.h</a>
</li>
<li>ctmGetFloatArray()
: <a class="el" href="openctm_8h.html#abdfcfede5d37c75e78cae989dc71e248">openctm.h</a>
</li>
<li>ctmGetInteger()
: <a class="el" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e">openctm.h</a>
</li>
<li>ctmGetIntegerArray()
: <a class="el" href="openctm_8h.html#ae202716acce7a97668654052dc4d0bef">openctm.h</a>
</li>
<li>ctmGetNamedAttribMap()
: <a class="el" href="openctm_8h.html#a15692de5d6e93adf8bed8d06d88c905c">openctm.h</a>
</li>
<li>ctmGetNamedUVMap()
: <a class="el" href="openctm_8h.html#a43c2d19741ba53f695a4119e594d6069">openctm.h</a>
</li>
<li>ctmGetString()
: <a class="el" href="openctm_8h.html#a4e4269df157eb2d117259c69a331e339">openctm.h</a>
</li>
<li>ctmGetUVMapFloat()
: <a class="el" href="openctm_8h.html#afad1b100b9f2fe4bf0dfc36cb39ec615">openctm.h</a>
</li>
<li>ctmGetUVMapString()
: <a class="el" href="openctm_8h.html#a2d689ee3371296b68899d564d5a1f998">openctm.h</a>
</li>
<li>ctmLoad()
: <a class="el" href="openctm_8h.html#a99a57706d438c5654adbc9646058dc01">openctm.h</a>
</li>
<li>ctmLoadCustom()
: <a class="el" href="openctm_8h.html#a99699bcbd4cbe0942a22498671af107e">openctm.h</a>
</li>
<li>ctmNewContext()
: <a class="el" href="openctm_8h.html#a3ca20da713005b0c6afb9b5f21640837">openctm.h</a>
</li>
<li>ctmNormalPrecision()
: <a class="el" href="openctm_8h.html#a07d8b47a0e642d0d8c77cf18e8d354a5">openctm.h</a>
</li>
<li>ctmSave()
: <a class="el" href="openctm_8h.html#acde994008b0b3321bad9f3bbfacb12db">openctm.h</a>
</li>
<li>ctmSaveCustom()
: <a class="el" href="openctm_8h.html#a7e62ca5548a34ed0e126fd4f7b77ef3f">openctm.h</a>
</li>
<li>ctmUVCoordPrecision()
: <a class="el" href="openctm_8h.html#ac1a75abbf04281acaff4f6f1f9516039">openctm.h</a>
</li>
<li>ctmVertexPrecision()
: <a class="el" href="openctm_8h.html#af4191357f51161a16ff886d18ec848d8">openctm.h</a>
</li>
<li>ctmVertexPrecisionRel()
: <a class="el" href="openctm_8h.html#ade23eb25fa9d5cd1d932bc1203476f27">openctm.h</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,63 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li class="current"><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="globals.html"><span>All</span></a></li>
<li><a href="globals_func.html"><span>Functions</span></a></li>
<li class="current"><a href="globals_type.html"><span>Typedefs</span></a></li>
<li><a href="globals_enum.html"><span>Enumerations</span></a></li>
<li><a href="globals_eval.html"><span>Enumerator</span></a></li>
<li><a href="globals_defs.html"><span>Defines</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&nbsp;<ul>
<li>CTMcontext
: <a class="el" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888">openctm.h</a>
</li>
<li>CTMfloat
: <a class="el" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">openctm.h</a>
</li>
<li>CTMint
: <a class="el" href="openctm_8h.html#a4c1dde73baa8f68242cc922cf85f2096">openctm.h</a>
</li>
<li>CTMreadfn
: <a class="el" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b">openctm.h</a>
</li>
<li>CTMuint
: <a class="el" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">openctm.h</a>
</li>
<li>CTMwritefn
: <a class="el" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b">openctm.h</a>
</li>
</ul>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,93 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: OpenCTM API Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li class="current"><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>OpenCTM API Reference</h1><h3>1.0.3 </h3><h2><a class="anchor" id="intro_sec">
Introduction</a></h2>
<p>OpenCTM is an open file format for storing compressed triangle meshes. In order to easily read and write OpenCTM files (usually suffixed .ctm) an API (Application Program Interface) is provided that can easily be used from most modern programming languages.</p>
<p>The OpenCTM functionality itself is written in highly portable standard C (C99).</p>
<h2><a class="anchor" id="usage_sec">
Usage</a></h2>
<p>For information about how to use the OpenCTM API, see <a class="el" href="openctm_8h.html">openctm.h</a>.</p>
<p>For information about the C++ wrapper classes, see <a class="el" href="classCTMimporter.html" title="OpenCTM importer class.">CTMimporter</a> and <a class="el" href="classCTMexporter.html" title="OpenCTM exporter class.">CTMexporter</a>.</p>
<h2><a class="anchor" id="example_sec">
Example usage</a></h2>
<h3><a class="anchor" id="example_load_sec">
Loading a CTM file</a></h3>
<p>Here is a simple example of loading a CTM file:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888" title="OpenCTM context handle.">CTMcontext</a> context;
<a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> vertCount, triCount, * indices;
<a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * vertices;
<span class="comment">// Create a new context</span>
context = <a class="code" href="openctm_8h.html#a3ca20da713005b0c6afb9b5f21640837" title="Create a new OpenCTM context.">ctmNewContext</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a98b76ddee5519228fb8864e7929e5f00" title="The OpenCTM context will be used for importing data.">CTM_IMPORT</a>);
<span class="comment">// Load the OpenCTM file</span>
<a class="code" href="openctm_8h.html#a99a57706d438c5654adbc9646058dc01" title="Load an OpenCTM format file into the context.">ctmLoad</a>(context, <span class="stringliteral">&quot;mymesh.ctm&quot;</span>);
<span class="keywordflow">if</span>(<a class="code" href="openctm_8h.html#a2bbaed33a6809affc4a61469f6676bdf" title="Returns the latest error.">ctmGetError</a>(context) == <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abf60b318c307c84b240d374d07ff6bf5" title="No error has occured (everything is OK).">CTM_NONE</a>)
{
<span class="comment">// Access the mesh data</span>
vertCount = <a class="code" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e" title="Get information about an OpenCTM context.">ctmGetInteger</a>(context, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7d1a8887b82dc448f9d774e8874d98a" title="Number of vertices in the mesh (integer).">CTM_VERTEX_COUNT</a>);
vertices = <a class="code" href="openctm_8h.html#abdfcfede5d37c75e78cae989dc71e248" title="Get a floating point array from an OpenCTM context.">ctmGetFloatArray</a>(context, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7e80243674806368e9e29e9e2bf8d55" title="Vertex point coordinates (float array).">CTM_VERTICES</a>);
triCount = <a class="code" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e" title="Get information about an OpenCTM context.">ctmGetInteger</a>(context, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a6d97b09d2d5da53c7c3bad5c5f30e51d" title="Number of triangles in the mesh (integer).">CTM_TRIANGLE_COUNT</a>);
indices = <a class="code" href="openctm_8h.html#ae202716acce7a97668654052dc4d0bef" title="Get an integer array from an OpenCTM context.">ctmGetIntegerArray</a>(context, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa7ec8fe7061e8a336530ee0448073206" title="Triangle indices (integer array).">CTM_INDICES</a>);
<span class="comment">// Deal with the mesh (e.g. transcode it to our internal representation)</span>
<span class="comment">// ...</span>
}
<span class="comment">// Free the context</span>
<a class="code" href="openctm_8h.html#aeb16fd3054a19415be90de4968b21a3a" title="Free an OpenCTM context.">ctmFreeContext</a>(context);
</pre></div><h3><a class="anchor" id="example_create_sec">
Creating a CTM file</a></h3>
<p>Here is a simple example of creating a CTM file:</p>
<div class="fragment"><pre class="fragment"> <a class="code" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888" title="OpenCTM context handle.">CTMcontext</a> context;
<a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> vertCount, triCount, * indices;
<a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * vertices;
<span class="comment">// Create our mesh in memory</span>
vertCount = 100;
triCount = 120;
vertices = (<a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> *) malloc(3 * <span class="keyword">sizeof</span>(<a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a>) * vertCount);
indices = (<a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> *) malloc(3 * <span class="keyword">sizeof</span>(<a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a>) * triCount);
<span class="comment">// ...</span>
<span class="comment">// Create a new context</span>
context = <a class="code" href="openctm_8h.html#a3ca20da713005b0c6afb9b5f21640837" title="Create a new OpenCTM context.">ctmNewContext</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4d156b19083ce49d4b8a6da287d6f5d3" title="The OpenCTM context will be used for exporting data.">CTM_EXPORT</a>);
<span class="comment">// Define our mesh representation to OpenCTM (store references to it in</span>
<span class="comment">// the context)</span>
<a class="code" href="openctm_8h.html#a1cb648e89121ae67f5a8b9e5a8f41c4d" title="Define a triangle mesh.">ctmDefineMesh</a>(context, vertices, vertCount, indices, triCount, NULL);
<span class="comment">// Save the OpenCTM file</span>
<a class="code" href="openctm_8h.html#acde994008b0b3321bad9f3bbfacb12db" title="Save an OpenCTM format file.">ctmSave</a>(context, <span class="stringliteral">&quot;mymesh.ctm&quot;</span>);
<span class="comment">// Free the context</span>
<a class="code" href="openctm_8h.html#aeb16fd3054a19415be90de4968b21a3a" title="Free an OpenCTM context.">ctmFreeContext</a>(context);
<span class="comment">// Free our mesh</span>
free(indices);
free(vertices);
</pre></div> </div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,287 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: openctm.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<h1>openctm.h</h1><a href="openctm_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00002"></a>00002 <span class="comment">// Product: OpenCTM</span>
<a name="l00003"></a>00003 <span class="comment">// File: openctm.h</span>
<a name="l00004"></a>00004 <span class="comment">// Description: OpenCTM API definition.</span>
<a name="l00005"></a>00005 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00006"></a>00006 <span class="comment">// Copyright (c) 2009-2010 Marcus Geelnard</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// This software is provided &apos;as-is&apos;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">// warranty. In no event will the authors be held liable for any damages</span>
<a name="l00010"></a>00010 <span class="comment">// arising from the use of this software.</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012 <span class="comment">// Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00013"></a>00013 <span class="comment">// including commercial applications, and to alter it and redistribute it</span>
<a name="l00014"></a>00014 <span class="comment">// freely, subject to the following restrictions:</span>
<a name="l00015"></a>00015 <span class="comment">//</span>
<a name="l00016"></a>00016 <span class="comment">// 1. The origin of this software must not be misrepresented; you must not</span>
<a name="l00017"></a>00017 <span class="comment">// claim that you wrote the original software. If you use this software</span>
<a name="l00018"></a>00018 <span class="comment">// in a product, an acknowledgment in the product documentation would be</span>
<a name="l00019"></a>00019 <span class="comment">// appreciated but is not required.</span>
<a name="l00020"></a>00020 <span class="comment">//</span>
<a name="l00021"></a>00021 <span class="comment">// 2. Altered source versions must be plainly marked as such, and must not</span>
<a name="l00022"></a>00022 <span class="comment">// be misrepresented as being the original software.</span>
<a name="l00023"></a>00023 <span class="comment">//</span>
<a name="l00024"></a>00024 <span class="comment">// 3. This notice may not be removed or altered from any source</span>
<a name="l00025"></a>00025 <span class="comment">// distribution.</span>
<a name="l00026"></a>00026 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef __OPENCTM_H_</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define __OPENCTM_H_</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00117"></a>00117 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00119"></a>00119 <span class="preprocessor">#endif</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span>
<a name="l00121"></a>00121
<a name="l00122"></a>00122 <span class="comment">// Declare calling conventions etc.</span>
<a name="l00123"></a>00123 <span class="preprocessor">#if defined(WIN32) || defined(_WIN32)</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span> <span class="comment">// Windows</span>
<a name="l00125"></a>00125 <span class="preprocessor"> #if defined(OPENCTM_STATIC)</span>
<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor"> #define CTMEXPORT</span>
<a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor"> #else</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span><span class="preprocessor"> #if defined(OPENCTM_BUILD)</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor"> #define CTMEXPORT __declspec(dllexport)</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor"> #else</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor"> #define CTMEXPORT __declspec(dllimport)</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor"> #endif</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor"> #endif</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="preprocessor"> #if defined(__MINGW32__)</span>
<a name="l00135"></a>00135 <span class="preprocessor"></span><span class="preprocessor"> #define CTMCALL __attribute__ ((__stdcall__))</span>
<a name="l00136"></a>00136 <span class="preprocessor"></span><span class="preprocessor"> #elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) &amp;&amp; !defined(MIDL_PASS)</span>
<a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor"> #define CTMCALL __stdcall</span>
<a name="l00138"></a>00138 <span class="preprocessor"></span><span class="preprocessor"> #else</span>
<a name="l00139"></a>00139 <span class="preprocessor"></span><span class="preprocessor"> #define CTMCALL</span>
<a name="l00140"></a>00140 <span class="preprocessor"></span><span class="preprocessor"> #endif</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00142"></a>00142 <span class="preprocessor"></span> <span class="comment">// Unix</span>
<a name="l00143"></a>00143 <span class="preprocessor"> #if !defined(OPENCTM_STATIC) &amp;&amp; !defined(OPENCTM_BUILD)</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span><span class="preprocessor"> #define CTMEXPORT extern</span>
<a name="l00145"></a>00145 <span class="preprocessor"></span><span class="preprocessor"> #else</span>
<a name="l00146"></a>00146 <span class="preprocessor"></span><span class="preprocessor"> #if defined(OPENCTM_BUILD) &amp;&amp; defined(__GNUC__) &amp;&amp; (__GNUC__ &gt;= 4)</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span><span class="preprocessor"> #define CTMEXPORT __attribute__ ((visibility(&quot;default&quot;)))</span>
<a name="l00148"></a>00148 <span class="preprocessor"></span><span class="preprocessor"> #else</span>
<a name="l00149"></a>00149 <span class="preprocessor"></span><span class="preprocessor"> #define CTMEXPORT</span>
<a name="l00150"></a>00150 <span class="preprocessor"></span><span class="preprocessor"> #endif</span>
<a name="l00151"></a>00151 <span class="preprocessor"></span><span class="preprocessor"> #endif</span>
<a name="l00152"></a>00152 <span class="preprocessor"></span><span class="preprocessor"> #define CTMCALL</span>
<a name="l00153"></a>00153 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00154"></a>00154 <span class="preprocessor"></span>
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <span class="comment">// Get system specific type definitions for sized integers. We use the C99</span>
<a name="l00157"></a>00157 <span class="comment">// standard stdint.h for this.</span>
<a name="l00158"></a>00158 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00159"></a>00159 <span class="preprocessor"></span> <span class="comment">// MS Visual Studio does not support C99</span>
<a name="l00160"></a>00160 <span class="keyword">typedef</span> <span class="keywordtype">int</span> int32_t;
<a name="l00161"></a>00161 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> uint32_t;
<a name="l00162"></a>00162 <span class="preprocessor">#else</span>
<a name="l00163"></a>00163 <span class="preprocessor"></span><span class="preprocessor"> #include &lt;stdint.h&gt;</span>
<a name="l00164"></a>00164 <span class="preprocessor">#endif</span>
<a name="l00165"></a>00165 <span class="preprocessor"></span>
<a name="l00166"></a>00166
<a name="l00168"></a><a class="code" href="openctm_8h.html#a909fd88252d88bd84095aba982900e7f">00168</a> <span class="preprocessor">#define CTM_API_VERSION 0x00000100</span>
<a name="l00169"></a>00169 <span class="preprocessor"></span>
<a name="l00171"></a><a class="code" href="openctm_8h.html#a2004bfa9db3f5d6e07411d1bea3a573a">00171</a> <span class="preprocessor">#define CTM_TRUE 1</span>
<a name="l00172"></a>00172 <span class="preprocessor"></span>
<a name="l00174"></a><a class="code" href="openctm_8h.html#aeab5b58ecb1449e95f577b59e4803314">00174</a> <span class="preprocessor">#define CTM_FALSE 0</span>
<a name="l00175"></a>00175 <span class="preprocessor"></span>
<a name="l00177"></a><a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2">00177</a> <span class="keyword">typedef</span> <span class="keywordtype">float</span> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a>;
<a name="l00178"></a>00178
<a name="l00180"></a><a class="code" href="openctm_8h.html#a4c1dde73baa8f68242cc922cf85f2096">00180</a> <span class="keyword">typedef</span> int32_t <a class="code" href="openctm_8h.html#a4c1dde73baa8f68242cc922cf85f2096" title="Signed integer (32 bits wide).">CTMint</a>;
<a name="l00181"></a>00181
<a name="l00183"></a><a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48">00183</a> <span class="keyword">typedef</span> uint32_t <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a>;
<a name="l00184"></a>00184
<a name="l00186"></a><a class="code" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888">00186</a> <span class="keyword">typedef</span> <span class="keywordtype">void</span> * <a class="code" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888" title="OpenCTM context handle.">CTMcontext</a>;
<a name="l00187"></a>00187
<a name="l00192"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625">00192</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00193"></a>00193 <span class="comment">// Error codes (see ctmGetError())</span>
<a name="l00194"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abf60b318c307c84b240d374d07ff6bf5">00194</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abf60b318c307c84b240d374d07ff6bf5" title="No error has occured (everything is OK).">CTM_NONE</a> = 0x0000,
<a name="l00195"></a>00195
<a name="l00196"></a>00196
<a name="l00197"></a>00197
<a name="l00198"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae8246d2a7b2e7d3cced72f7460e9d5d1">00198</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae8246d2a7b2e7d3cced72f7460e9d5d1" title="The OpenCTM context was invalid (e.g. NULL).">CTM_INVALID_CONTEXT</a> = 0x0001,
<a name="l00199"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abdfdbc82040b419dbc9906baed538704">00199</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abdfdbc82040b419dbc9906baed538704" title="A function argument was invalid.">CTM_INVALID_ARGUMENT</a> = 0x0002,
<a name="l00200"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af38eb5e0bd49e7321c4ebd2d1a0a580b">00200</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af38eb5e0bd49e7321c4ebd2d1a0a580b" title="The operation is not allowed.">CTM_INVALID_OPERATION</a> = 0x0003,
<a name="l00201"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a245e25dc7e5bfd88c03d5c52eebfdf29">00201</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a245e25dc7e5bfd88c03d5c52eebfdf29" title="The mesh was invalid (e.g. no vertices).">CTM_INVALID_MESH</a> = 0x0004,
<a name="l00202"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a43202555b9cfdecf32bdf7b9807056f7">00202</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a43202555b9cfdecf32bdf7b9807056f7" title="Not enough memory to proceed.">CTM_OUT_OF_MEMORY</a> = 0x0005,
<a name="l00203"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0280fc2383ee4d5c613744c9c68cdafb">00203</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0280fc2383ee4d5c613744c9c68cdafb" title="File I/O error.">CTM_FILE_ERROR</a> = 0x0006,
<a name="l00204"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a607254e23f6dd9ea46f9ed3b01331844">00204</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a607254e23f6dd9ea46f9ed3b01331844" title="File format error (e.g. unrecognized format or corrupted file).">CTM_BAD_FORMAT</a> = 0x0007,
<a name="l00205"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a5492e61ffa160ff720c89221660dbbf8">00205</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a5492e61ffa160ff720c89221660dbbf8" title="An error occured within the LZMA library.">CTM_LZMA_ERROR</a> = 0x0008,
<a name="l00206"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a97d27f42581866aa1413999b6f448191">00206</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a97d27f42581866aa1413999b6f448191" title="An internal error occured (indicates a bug).">CTM_INTERNAL_ERROR</a> = 0x0009,
<a name="l00207"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad3e0a5ee55e26e23f43b28dd61e72f16">00207</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad3e0a5ee55e26e23f43b28dd61e72f16" title="Unsupported file format version.">CTM_UNSUPPORTED_FORMAT_VERSION</a> = 0x000A,
<a name="l00208"></a>00208
<a name="l00209"></a>00209 <span class="comment">// OpenCTM context modes</span>
<a name="l00210"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a98b76ddee5519228fb8864e7929e5f00">00210</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a98b76ddee5519228fb8864e7929e5f00" title="The OpenCTM context will be used for importing data.">CTM_IMPORT</a> = 0x0101,
<a name="l00211"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4d156b19083ce49d4b8a6da287d6f5d3">00211</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4d156b19083ce49d4b8a6da287d6f5d3" title="The OpenCTM context will be used for exporting data.">CTM_EXPORT</a> = 0x0102,
<a name="l00212"></a>00212
<a name="l00213"></a>00213 <span class="comment">// Compression methods</span>
<a name="l00214"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ba5bf3da62c7292644723b227a5cce8">00214</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ba5bf3da62c7292644723b227a5cce8" title="Just store the raw data.">CTM_METHOD_RAW</a> = 0x0201,
<a name="l00215"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeb7ddc6f328ec73944a2fcb20472341b">00215</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeb7ddc6f328ec73944a2fcb20472341b" title="Lossless compression (floating point).">CTM_METHOD_MG1</a> = 0x0202,
<a name="l00216"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae52e3f40682c9e56be588a4661f8dc0c">00216</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae52e3f40682c9e56be588a4661f8dc0c" title="Lossless compression (fixed point).">CTM_METHOD_MG2</a> = 0x0203,
<a name="l00217"></a>00217
<a name="l00218"></a>00218 <span class="comment">// Context queries</span>
<a name="l00219"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7d1a8887b82dc448f9d774e8874d98a">00219</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7d1a8887b82dc448f9d774e8874d98a" title="Number of vertices in the mesh (integer).">CTM_VERTEX_COUNT</a> = 0x0301,
<a name="l00220"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a6d97b09d2d5da53c7c3bad5c5f30e51d">00220</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a6d97b09d2d5da53c7c3bad5c5f30e51d" title="Number of triangles in the mesh (integer).">CTM_TRIANGLE_COUNT</a> = 0x0302,
<a name="l00221"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adcbea5e453256bbbb3dc369e9f9fd872">00221</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adcbea5e453256bbbb3dc369e9f9fd872" title="CTM_TRUE if the mesh has normals (integer).">CTM_HAS_NORMALS</a> = 0x0303,
<a name="l00222"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a87b3013d9d9c151ca9eae64e74f981bd">00222</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a87b3013d9d9c151ca9eae64e74f981bd" title="Number of UV coordinate sets (integer).">CTM_UV_MAP_COUNT</a> = 0x0304,
<a name="l00223"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa0b3c108352ad1dbdb60ca6f57e921a4">00223</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa0b3c108352ad1dbdb60ca6f57e921a4" title="Number of custom attribute sets (integer).">CTM_ATTRIB_MAP_COUNT</a> = 0x0305,
<a name="l00224"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a7b32280d8591167a42904920934b8f51">00224</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a7b32280d8591167a42904920934b8f51" title="Vertex precision - for MG2 (float).">CTM_VERTEX_PRECISION</a> = 0x0306,
<a name="l00225"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae63ebc86a051e3f43492eb051eab9e97">00225</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae63ebc86a051e3f43492eb051eab9e97" title="Normal precision - for MG2 (float).">CTM_NORMAL_PRECISION</a> = 0x0307,
<a name="l00226"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae25493f9fd4ddc3e06043078a8c23e20">00226</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae25493f9fd4ddc3e06043078a8c23e20" title="Compression method (integer).">CTM_COMPRESSION_METHOD</a> = 0x0308,
<a name="l00227"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa4b62d1802dd335fd7bfee2ed25c4c4d">00227</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa4b62d1802dd335fd7bfee2ed25c4c4d" title="File comment (string).">CTM_FILE_COMMENT</a> = 0x0309,
<a name="l00228"></a>00228
<a name="l00229"></a>00229 <span class="comment">// UV/attribute map queries</span>
<a name="l00230"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a3e3d28e72ec322ba63f94d77551c5ede">00230</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a3e3d28e72ec322ba63f94d77551c5ede" title="Unique name (UV/attrib map string).">CTM_NAME</a> = 0x0501,
<a name="l00231"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae9adc5919726099c90ea9ba732e85b6c">00231</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ae9adc5919726099c90ea9ba732e85b6c" title="File name reference (UV map string).">CTM_FILE_NAME</a> = 0x0502,
<a name="l00232"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ada5784c8eb3143ee996d31214d46b0d4">00232</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ada5784c8eb3143ee996d31214d46b0d4" title="Value precision (UV/attrib map float).">CTM_PRECISION</a> = 0x0503,
<a name="l00233"></a>00233
<a name="l00234"></a>00234 <span class="comment">// Array queries</span>
<a name="l00235"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa7ec8fe7061e8a336530ee0448073206">00235</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aa7ec8fe7061e8a336530ee0448073206" title="Triangle indices (integer array).">CTM_INDICES</a> = 0x0601,
<a name="l00236"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7e80243674806368e9e29e9e2bf8d55">00236</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625af7e80243674806368e9e29e9e2bf8d55" title="Vertex point coordinates (float array).">CTM_VERTICES</a> = 0x0602,
<a name="l00237"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a02185a711fd216acee2171e46653855e">00237</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a02185a711fd216acee2171e46653855e" title="Per vertex normals (float array).">CTM_NORMALS</a> = 0x0603,
<a name="l00238"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a9096ee63af274788fe101c75c08b49f6">00238</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a9096ee63af274788fe101c75c08b49f6" title="Per vertex UV map 1 (float array).">CTM_UV_MAP_1</a> = 0x0700,
<a name="l00239"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a104b93d0bfa7344406c68a45da3f616f">00239</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a104b93d0bfa7344406c68a45da3f616f" title="Per vertex UV map 2 (float array).">CTM_UV_MAP_2</a> = 0x0701,
<a name="l00240"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2543bac2bdc3931d37e0465f761060be">00240</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2543bac2bdc3931d37e0465f761060be" title="Per vertex UV map 3 (float array).">CTM_UV_MAP_3</a> = 0x0702,
<a name="l00241"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acc9b387f30b02c370decac35a253b7a0">00241</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acc9b387f30b02c370decac35a253b7a0" title="Per vertex UV map 4 (float array).">CTM_UV_MAP_4</a> = 0x0703,
<a name="l00242"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad96f31e47775ac51ca393b19525cd8cc">00242</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad96f31e47775ac51ca393b19525cd8cc" title="Per vertex UV map 5 (float array).">CTM_UV_MAP_5</a> = 0x0704,
<a name="l00243"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acda599be9fff226924d075c3b09dad7b">00243</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625acda599be9fff226924d075c3b09dad7b" title="Per vertex UV map 6 (float array).">CTM_UV_MAP_6</a> = 0x0705,
<a name="l00244"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ca0e7ec8e66c772f449be1f4749414b">00244</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4ca0e7ec8e66c772f449be1f4749414b" title="Per vertex UV map 7 (float array).">CTM_UV_MAP_7</a> = 0x0706,
<a name="l00245"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeae61f9c3e9cded4a7f8059d0acc41a3">00245</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625aeae61f9c3e9cded4a7f8059d0acc41a3" title="Per vertex UV map 8 (float array).">CTM_UV_MAP_8</a> = 0x0707,
<a name="l00246"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a37c9dffce89ec51e9767e1f9a38e51bd">00246</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a37c9dffce89ec51e9767e1f9a38e51bd" title="Per vertex attribute map 1 (float array).">CTM_ATTRIB_MAP_1</a> = 0x0800,
<a name="l00247"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adc4a982b27a02157edff941636063827">00247</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625adc4a982b27a02157edff941636063827" title="Per vertex attribute map 2 (float array).">CTM_ATTRIB_MAP_2</a> = 0x0801,
<a name="l00248"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad991095653802528246723d3ed82b532">00248</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625ad991095653802528246723d3ed82b532" title="Per vertex attribute map 3 (float array).">CTM_ATTRIB_MAP_3</a> = 0x0802,
<a name="l00249"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0f79e8024cea635758c0cf51b24853c6">00249</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a0f79e8024cea635758c0cf51b24853c6" title="Per vertex attribute map 4 (float array).">CTM_ATTRIB_MAP_4</a> = 0x0803,
<a name="l00250"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a224d8bba1ab7b7de0ea4ef6ac4b5dc7e">00250</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a224d8bba1ab7b7de0ea4ef6ac4b5dc7e" title="Per vertex attribute map 5 (float array).">CTM_ATTRIB_MAP_5</a> = 0x0804,
<a name="l00251"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2ee3e625af252ef1771136c144cda838">00251</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2ee3e625af252ef1771136c144cda838" title="Per vertex attribute map 6 (float array).">CTM_ATTRIB_MAP_6</a> = 0x0805,
<a name="l00252"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a99d3f4511629bb006cfcfa12b4db323a">00252</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a99d3f4511629bb006cfcfa12b4db323a" title="Per vertex attribute map 7 (float array).">CTM_ATTRIB_MAP_7</a> = 0x0806,
<a name="l00253"></a><a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2d749b6c2b0a1384c28ad19f491db31e">00253</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a2d749b6c2b0a1384c28ad19f491db31e" title="Per vertex attribute map 8 (float array).">CTM_ATTRIB_MAP_8</a> = 0x0807
<a name="l00254"></a>00254 } <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a>;
<a name="l00255"></a>00255
<a name="l00264"></a><a class="code" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b">00264</a> <span class="keyword">typedef</span> <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> (CTMCALL * <a class="code" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b" title="Stream read() function pointer.">CTMreadfn</a>)(<span class="keywordtype">void</span> * aBuf, CTMuint aCount, <span class="keywordtype">void</span> * aUserData);
<a name="l00265"></a>00265
<a name="l00273"></a><a class="code" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b">00273</a> <span class="keyword">typedef</span> <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> (CTMCALL * <a class="code" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b" title="Stream write() function pointer.">CTMwritefn</a>)(<span class="keyword">const</span> <span class="keywordtype">void</span> * aBuf, CTMuint aCount, <span class="keywordtype">void</span> * aUserData);
<a name="l00274"></a>00274
<a name="l00281"></a>00281 CTMEXPORT CTMcontext CTMCALL <a class="code" href="openctm_8h.html#a3ca20da713005b0c6afb9b5f21640837" title="Create a new OpenCTM context.">ctmNewContext</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aMode);
<a name="l00282"></a>00282
<a name="l00287"></a>00287 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#aeb16fd3054a19415be90de4968b21a3a" title="Free an OpenCTM context.">ctmFreeContext</a>(CTMcontext aContext);
<a name="l00288"></a>00288
<a name="l00297"></a>00297 CTMEXPORT <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> CTMCALL <a class="code" href="openctm_8h.html#a2bbaed33a6809affc4a61469f6676bdf" title="Returns the latest error.">ctmGetError</a>(CTMcontext aContext);
<a name="l00298"></a>00298
<a name="l00305"></a>00305 CTMEXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> * CTMCALL <a class="code" href="openctm_8h.html#a3071b834da6a9cdd684ec733de70cbf2" title="Converts an OpenCTM error code to a zero-terminated string.">ctmErrorString</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aError);
<a name="l00306"></a>00306
<a name="l00314"></a>00314 CTMEXPORT CTMuint CTMCALL <a class="code" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e" title="Get information about an OpenCTM context.">ctmGetInteger</a>(CTMcontext aContext, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00315"></a>00315
<a name="l00323"></a>00323 CTMEXPORT CTMfloat CTMCALL <a class="code" href="openctm_8h.html#abe7389b3a396a86a3a1c5d5c6f68183d" title="Get information about an OpenCTM context.">ctmGetFloat</a>(CTMcontext aContext, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00324"></a>00324
<a name="l00339"></a>00339 CTMEXPORT <span class="keyword">const</span> CTMuint * CTMCALL <a class="code" href="openctm_8h.html#ae202716acce7a97668654052dc4d0bef" title="Get an integer array from an OpenCTM context.">ctmGetIntegerArray</a>(CTMcontext aContext,
<a name="l00340"></a>00340 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00341"></a>00341
<a name="l00356"></a>00356 CTMEXPORT <span class="keyword">const</span> CTMfloat * CTMCALL <a class="code" href="openctm_8h.html#abdfcfede5d37c75e78cae989dc71e248" title="Get a floating point array from an OpenCTM context.">ctmGetFloatArray</a>(CTMcontext aContext,
<a name="l00357"></a>00357 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00358"></a>00358
<a name="l00366"></a>00366 CTMEXPORT <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> CTMCALL <a class="code" href="openctm_8h.html#a43c2d19741ba53f695a4119e594d6069" title="Get a reference to the named UV map.">ctmGetNamedUVMap</a>(CTMcontext aContext,
<a name="l00367"></a>00367 <span class="keyword">const</span> <span class="keywordtype">char</span> * aName);
<a name="l00368"></a>00368
<a name="l00382"></a>00382 CTMEXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> * CTMCALL <a class="code" href="openctm_8h.html#a2d689ee3371296b68899d564d5a1f998" title="Get information about a UV map.">ctmGetUVMapString</a>(CTMcontext aContext,
<a name="l00383"></a>00383 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aUVMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00384"></a>00384
<a name="l00393"></a>00393 CTMEXPORT CTMfloat CTMCALL <a class="code" href="openctm_8h.html#afad1b100b9f2fe4bf0dfc36cb39ec615" title="Get information about a UV map.">ctmGetUVMapFloat</a>(CTMcontext aContext,
<a name="l00394"></a>00394 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aUVMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00395"></a>00395
<a name="l00403"></a>00403 CTMEXPORT <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> CTMCALL <a class="code" href="openctm_8h.html#a15692de5d6e93adf8bed8d06d88c905c" title="Get a reference to the named vertex attribute map.">ctmGetNamedAttribMap</a>(CTMcontext aContext,
<a name="l00404"></a>00404 <span class="keyword">const</span> <span class="keywordtype">char</span> * aName);
<a name="l00405"></a>00405
<a name="l00420"></a>00420 CTMEXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> * CTMCALL <a class="code" href="openctm_8h.html#a841d7c1e0bafd57ee36ccbbc74470b68" title="Get information about a vertex attribute map.">ctmGetAttribMapString</a>(CTMcontext aContext,
<a name="l00421"></a>00421 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aAttribMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00422"></a>00422
<a name="l00432"></a>00432 CTMEXPORT CTMfloat CTMCALL <a class="code" href="openctm_8h.html#a7c297f9b6d486f47596cff184602a65d" title="Get information about a vertex attribute map.">ctmGetAttribMapFloat</a>(CTMcontext aContext,
<a name="l00433"></a>00433 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aAttribMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00434"></a>00434
<a name="l00449"></a>00449 CTMEXPORT <span class="keyword">const</span> <span class="keywordtype">char</span> * CTMCALL <a class="code" href="openctm_8h.html#a4e4269df157eb2d117259c69a331e339" title="Get information about an OpenCTM context.">ctmGetString</a>(CTMcontext aContext,
<a name="l00450"></a>00450 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty);
<a name="l00451"></a>00451
<a name="l00461"></a>00461 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#af4ac8e534f59be4edacc39753cf54693" title="Set which compression method to use for the given OpenCTM context.">ctmCompressionMethod</a>(CTMcontext aContext,
<a name="l00462"></a>00462 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aMethod);
<a name="l00463"></a>00463
<a name="l00471"></a>00471 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#aa2902c49b904a7557fdd012e303c720e" title="Set which LZMA compression level to use for the given OpenCTM context.">ctmCompressionLevel</a>(CTMcontext aContext,
<a name="l00472"></a>00472 CTMuint aLevel);
<a name="l00473"></a>00473
<a name="l00481"></a>00481 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#af4191357f51161a16ff886d18ec848d8" title="Set the vertex coordinate precision (only used by the MG2 compression method).">ctmVertexPrecision</a>(CTMcontext aContext,
<a name="l00482"></a>00482 CTMfloat aPrecision);
<a name="l00483"></a>00483
<a name="l00496"></a>00496 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#ade23eb25fa9d5cd1d932bc1203476f27" title="Set the vertex coordinate precision, relative to the mesh dimensions (only used by...">ctmVertexPrecisionRel</a>(CTMcontext aContext,
<a name="l00497"></a>00497 CTMfloat aRelPrecision);
<a name="l00498"></a>00498
<a name="l00510"></a>00510 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#a07d8b47a0e642d0d8c77cf18e8d354a5" title="Set the normal precision (only used by the MG2 compression method).">ctmNormalPrecision</a>(CTMcontext aContext,
<a name="l00511"></a>00511 CTMfloat aPrecision);
<a name="l00512"></a>00512
<a name="l00523"></a>00523 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#ac1a75abbf04281acaff4f6f1f9516039" title="Set the coordinate precision for the specified UV map (only used by the MG2 compression...">ctmUVCoordPrecision</a>(CTMcontext aContext,
<a name="l00524"></a>00524 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aUVMap, CTMfloat aPrecision);
<a name="l00525"></a>00525
<a name="l00537"></a>00537 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#a8af7af38bd9340838b43805b81698777" title="Set the attribute value precision for the specified attribute map (only used by the...">ctmAttribPrecision</a>(CTMcontext aContext,
<a name="l00538"></a>00538 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aAttribMap, CTMfloat aPrecision);
<a name="l00539"></a>00539
<a name="l00544"></a>00544 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#a2225924b06488421ee6b9a8505782a25" title="Set the file comment for the given OpenCTM context.">ctmFileComment</a>(CTMcontext aContext,
<a name="l00545"></a>00545 <span class="keyword">const</span> <span class="keywordtype">char</span> * aFileComment);
<a name="l00546"></a>00546
<a name="l00562"></a>00562 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#a1cb648e89121ae67f5a8b9e5a8f41c4d" title="Define a triangle mesh.">ctmDefineMesh</a>(CTMcontext aContext,
<a name="l00563"></a>00563 <span class="keyword">const</span> CTMfloat * aVertices, CTMuint aVertexCount, <span class="keyword">const</span> CTMuint * aIndices,
<a name="l00564"></a>00564 CTMuint aTriangleCount, <span class="keyword">const</span> CTMfloat * aNormals);
<a name="l00565"></a>00565
<a name="l00583"></a>00583 CTMEXPORT <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> CTMCALL <a class="code" href="openctm_8h.html#a44345560299ac49dfd502d0470f05e0f" title="Define a UV map.">ctmAddUVMap</a>(CTMcontext aContext,
<a name="l00584"></a>00584 <span class="keyword">const</span> CTMfloat * aUVCoords, <span class="keyword">const</span> <span class="keywordtype">char</span> * aName, <span class="keyword">const</span> <span class="keywordtype">char</span> * aFileName);
<a name="l00585"></a>00585
<a name="l00602"></a>00602 CTMEXPORT <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> CTMCALL <a class="code" href="openctm_8h.html#a920a8fed6bef834db0b241fc5c9bba03" title="Define a custom vertex attribute map.">ctmAddAttribMap</a>(CTMcontext aContext,
<a name="l00603"></a>00603 <span class="keyword">const</span> CTMfloat * aAttribValues, <span class="keyword">const</span> <span class="keywordtype">char</span> * aName);
<a name="l00604"></a>00604
<a name="l00610"></a>00610 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#a99a57706d438c5654adbc9646058dc01" title="Load an OpenCTM format file into the context.">ctmLoad</a>(CTMcontext aContext, <span class="keyword">const</span> <span class="keywordtype">char</span> * aFileName);
<a name="l00611"></a>00611
<a name="l00622"></a>00622 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#a99699bcbd4cbe0942a22498671af107e" title="Load an OpenCTM format file using a custom stream read function.">ctmLoadCustom</a>(CTMcontext aContext, <a class="code" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b" title="Stream read() function pointer.">CTMreadfn</a> aReadFn,
<a name="l00623"></a>00623 <span class="keywordtype">void</span> * aUserData);
<a name="l00624"></a>00624
<a name="l00630"></a>00630 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#acde994008b0b3321bad9f3bbfacb12db" title="Save an OpenCTM format file.">ctmSave</a>(CTMcontext aContext, <span class="keyword">const</span> <span class="keywordtype">char</span> * aFileName);
<a name="l00631"></a>00631
<a name="l00642"></a>00642 CTMEXPORT <span class="keywordtype">void</span> CTMCALL <a class="code" href="openctm_8h.html#a7e62ca5548a34ed0e126fd4f7b77ef3f" title="Save an OpenCTM format file using a custom stream write function.">ctmSaveCustom</a>(CTMcontext aContext, <a class="code" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b" title="Stream write() function pointer.">CTMwritefn</a> aWriteFn,
<a name="l00643"></a>00643 <span class="keywordtype">void</span> * aUserData);
<a name="l00644"></a>00644
<a name="l00645"></a>00645 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00646"></a>00646 <span class="preprocessor"></span>}
<a name="l00647"></a>00647 <span class="preprocessor">#endif</span>
<a name="l00648"></a>00648 <span class="preprocessor"></span>
<a name="l00649"></a>00649
<a name="l00650"></a>00650 <span class="comment">// C++ extensions to the API (to disable C++ extensions, define OPENCTM_NO_CPP)</span>
<a name="l00651"></a>00651 <span class="preprocessor">#if defined(__cplusplus) &amp;&amp; !defined(OPENCTM_NO_CPP)</span>
<a name="l00652"></a>00652 <span class="preprocessor"></span><span class="preprocessor"> #include &quot;<a class="code" href="openctmpp_8h.html">openctmpp.h</a>&quot;</span>
<a name="l00653"></a>00653 <span class="preprocessor">#endif</span>
<a name="l00654"></a>00654 <span class="preprocessor"></span>
<a name="l00655"></a>00655 <span class="preprocessor">#endif // __OPENCTM_H_</span>
</pre></div></div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,46 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: openctmpp.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>openctmpp.h File Reference</h1><code>#include &quot;<a class="el" href="openctm_8h_source.html">openctm.h</a>&quot;</code><br/>
<code>#include &lt;exception&gt;</code><br/>
<p><a href="openctmpp_8h_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classctm__error.html">ctm_error</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">OpenCTM exception. <a href="classctm__error.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMimporter.html">CTMimporter</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">OpenCTM importer class. <a href="classCTMimporter.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCTMexporter.html">CTMexporter</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">OpenCTM exporter class. <a href="classCTMexporter.html#_details">More...</a><br/></td></tr>
</table>
</div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

View File

@ -1,333 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenCTM: openctmpp.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<h1>openctmpp.h</h1><a href="openctmpp_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00002"></a>00002 <span class="comment">// Product: OpenCTM</span>
<a name="l00003"></a>00003 <span class="comment">// File: openctmpp.h</span>
<a name="l00004"></a>00004 <span class="comment">// Description: C++ wrapper for the OpenCTM API.</span>
<a name="l00005"></a>00005 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00006"></a>00006 <span class="comment">// Copyright (c) 2009-2010 Marcus Geelnard</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// This software is provided &apos;as-is&apos;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">// warranty. In no event will the authors be held liable for any damages</span>
<a name="l00010"></a>00010 <span class="comment">// arising from the use of this software.</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012 <span class="comment">// Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00013"></a>00013 <span class="comment">// including commercial applications, and to alter it and redistribute it</span>
<a name="l00014"></a>00014 <span class="comment">// freely, subject to the following restrictions:</span>
<a name="l00015"></a>00015 <span class="comment">//</span>
<a name="l00016"></a>00016 <span class="comment">// 1. The origin of this software must not be misrepresented; you must not</span>
<a name="l00017"></a>00017 <span class="comment">// claim that you wrote the original software. If you use this software</span>
<a name="l00018"></a>00018 <span class="comment">// in a product, an acknowledgment in the product documentation would be</span>
<a name="l00019"></a>00019 <span class="comment">// appreciated but is not required.</span>
<a name="l00020"></a>00020 <span class="comment">//</span>
<a name="l00021"></a>00021 <span class="comment">// 2. Altered source versions must be plainly marked as such, and must not</span>
<a name="l00022"></a>00022 <span class="comment">// be misrepresented as being the original software.</span>
<a name="l00023"></a>00023 <span class="comment">//</span>
<a name="l00024"></a>00024 <span class="comment">// 3. This notice may not be removed or altered from any source</span>
<a name="l00025"></a>00025 <span class="comment">// distribution.</span>
<a name="l00026"></a>00026 <span class="comment">//-----------------------------------------------------------------------------</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="comment">// To disable C++ extensions, define OPENCTM_NO_CPP</span>
<a name="l00029"></a>00029 <span class="preprocessor">#ifndef OPENCTM_NO_CPP</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#ifndef __OPENCTMPP_H_</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define __OPENCTMPP_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="comment">// Just in case (if this file was included from outside openctm.h)...</span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifndef __OPENCTM_H_</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="openctm_8h.html">openctm.h</a>&quot;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;exception&gt;</span>
<a name="l00040"></a>00040
<a name="l00044"></a><a class="code" href="classctm__error.html">00044</a> <span class="keyword">class </span><a class="code" href="classctm__error.html" title="OpenCTM exception.">ctm_error</a>: <span class="keyword">public</span> std::exception
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046 <span class="keyword">private</span>:
<a name="l00047"></a>00047 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> mErrorCode;
<a name="l00048"></a>00048
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a><a class="code" href="classctm__error.html#a2a27a1dfa1c25d52135e3ca74d74ad3b">00050</a> <span class="keyword">explicit</span> <a class="code" href="classctm__error.html#a2a27a1dfa1c25d52135e3ca74d74ad3b">ctm_error</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aError)
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052 mErrorCode = aError;
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054
<a name="l00055"></a><a class="code" href="classctm__error.html#ada16f2648ab34dda2a78a44f89d82468">00055</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classctm__error.html#ada16f2648ab34dda2a78a44f89d82468">what</a>() <span class="keyword">const</span> throw()
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 <span class="keywordflow">return</span> <a class="code" href="openctm_8h.html#a3071b834da6a9cdd684ec733de70cbf2" title="Converts an OpenCTM error code to a zero-terminated string.">ctmErrorString</a>(mErrorCode);
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059
<a name="l00060"></a><a class="code" href="classctm__error.html#a90be36697549d38e6cd370c97667e23a">00060</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> <a class="code" href="classctm__error.html#a90be36697549d38e6cd370c97667e23a">error_code</a>() <span class="keyword">const</span> throw()
<a name="l00061"></a>00061 {
<a name="l00062"></a>00062 <span class="keywordflow">return</span> mErrorCode;
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064 };
<a name="l00065"></a>00065
<a name="l00066"></a>00066
<a name="l00086"></a>00086
<a name="l00087"></a><a class="code" href="classCTMimporter.html">00087</a> <span class="keyword">class </span><a class="code" href="classCTMimporter.html" title="OpenCTM importer class.">CTMimporter</a> {
<a name="l00088"></a>00088 <span class="keyword">private</span>:
<a name="l00090"></a>00090 <a class="code" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888" title="OpenCTM context handle.">CTMcontext</a> mContext;
<a name="l00091"></a>00091
<a name="l00094"></a>00094 <span class="keywordtype">void</span> CheckError()
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> err = <a class="code" href="openctm_8h.html#a2bbaed33a6809affc4a61469f6676bdf" title="Returns the latest error.">ctmGetError</a>(mContext);
<a name="l00097"></a>00097 <span class="keywordflow">if</span>(err != <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abf60b318c307c84b240d374d07ff6bf5" title="No error has occured (everything is OK).">CTM_NONE</a>)
<a name="l00098"></a>00098 <span class="keywordflow">throw</span> <a class="code" href="classctm__error.html" title="OpenCTM exception.">ctm_error</a>(err);
<a name="l00099"></a>00099 }
<a name="l00100"></a>00100
<a name="l00101"></a>00101 <span class="keyword">public</span>:
<a name="l00103"></a><a class="code" href="classCTMimporter.html#a4b22cf96b7be2bdff4ed95051dca581d">00103</a> <a class="code" href="classCTMimporter.html#a4b22cf96b7be2bdff4ed95051dca581d" title="Constructor.">CTMimporter</a>()
<a name="l00104"></a>00104 {
<a name="l00105"></a>00105 mContext = <a class="code" href="openctm_8h.html#a3ca20da713005b0c6afb9b5f21640837" title="Create a new OpenCTM context.">ctmNewContext</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a98b76ddee5519228fb8864e7929e5f00" title="The OpenCTM context will be used for importing data.">CTM_IMPORT</a>);
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107
<a name="l00109"></a><a class="code" href="classCTMimporter.html#a7db4d4c826b8afec5a60679add4097a0">00109</a> <a class="code" href="classCTMimporter.html#a7db4d4c826b8afec5a60679add4097a0" title="Destructor.">~CTMimporter</a>()
<a name="l00110"></a>00110 {
<a name="l00111"></a>00111 <a class="code" href="openctm_8h.html#aeb16fd3054a19415be90de4968b21a3a" title="Free an OpenCTM context.">ctmFreeContext</a>(mContext);
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113
<a name="l00115"></a><a class="code" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60">00115</a> <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> <a class="code" href="classCTMimporter.html#aec5a05c77350810f8ebe75334f7c8b60" title="Wrapper for ctmGetInteger().">GetInteger</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> res = <a class="code" href="openctm_8h.html#a4012ac28aa780819e40ee118d7c6578e" title="Get information about an OpenCTM context.">ctmGetInteger</a>(mContext, aProperty);
<a name="l00118"></a>00118 CheckError();
<a name="l00119"></a>00119 <span class="keywordflow">return</span> res;
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121
<a name="l00123"></a><a class="code" href="classCTMimporter.html#ab2e03da5fbe0c8350e303ee0418bc5db">00123</a> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> <a class="code" href="classCTMimporter.html#ab2e03da5fbe0c8350e303ee0418bc5db" title="Wrapper for ctmGetFloat().">GetFloat</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00124"></a>00124 {
<a name="l00125"></a>00125 <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> res = <a class="code" href="openctm_8h.html#abe7389b3a396a86a3a1c5d5c6f68183d" title="Get information about an OpenCTM context.">ctmGetFloat</a>(mContext, aProperty);
<a name="l00126"></a>00126 CheckError();
<a name="l00127"></a>00127 <span class="keywordflow">return</span> res;
<a name="l00128"></a>00128 }
<a name="l00129"></a>00129
<a name="l00131"></a><a class="code" href="classCTMimporter.html#a08b5b0d5723066fd56e0fc752321c332">00131</a> <span class="keyword">const</span> <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> * <a class="code" href="classCTMimporter.html#a08b5b0d5723066fd56e0fc752321c332" title="Wrapper for ctmGetIntegerArray().">GetIntegerArray</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133 <span class="keyword">const</span> <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> * res = <a class="code" href="openctm_8h.html#ae202716acce7a97668654052dc4d0bef" title="Get an integer array from an OpenCTM context.">ctmGetIntegerArray</a>(mContext, aProperty);
<a name="l00134"></a>00134 CheckError();
<a name="l00135"></a>00135 <span class="keywordflow">return</span> res;
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137
<a name="l00139"></a><a class="code" href="classCTMimporter.html#a2fc574cc5d09c7e861867d9193299201">00139</a> <span class="keyword">const</span> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * <a class="code" href="classCTMimporter.html#a2fc574cc5d09c7e861867d9193299201" title="Wrapper for ctmGetFloatArray().">GetFloatArray</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00140"></a>00140 {
<a name="l00141"></a>00141 <span class="keyword">const</span> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * res = <a class="code" href="openctm_8h.html#abdfcfede5d37c75e78cae989dc71e248" title="Get a floating point array from an OpenCTM context.">ctmGetFloatArray</a>(mContext, aProperty);
<a name="l00142"></a>00142 CheckError();
<a name="l00143"></a>00143 <span class="keywordflow">return</span> res;
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145
<a name="l00147"></a><a class="code" href="classCTMimporter.html#a315d0ac280b74afa832b09c5850d6c59">00147</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> <a class="code" href="classCTMimporter.html#a315d0ac280b74afa832b09c5850d6c59" title="Wrapper for ctmGetNamedUVMap().">GetNamedUVMap</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * aName)
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> res = <a class="code" href="openctm_8h.html#a43c2d19741ba53f695a4119e594d6069" title="Get a reference to the named UV map.">ctmGetNamedUVMap</a>(mContext, aName);
<a name="l00150"></a>00150 CheckError();
<a name="l00151"></a>00151 <span class="keywordflow">return</span> res;
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153
<a name="l00155"></a><a class="code" href="classCTMimporter.html#a223ee89a56c1151291321b74c0dc69ea">00155</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classCTMimporter.html#a223ee89a56c1151291321b74c0dc69ea" title="Wrapper for ctmGetUVMapString().">GetUVMapString</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aUVMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00156"></a>00156 {
<a name="l00157"></a>00157 <span class="keyword">const</span> <span class="keywordtype">char</span> * res = <a class="code" href="openctm_8h.html#a2d689ee3371296b68899d564d5a1f998" title="Get information about a UV map.">ctmGetUVMapString</a>(mContext, aUVMap, aProperty);
<a name="l00158"></a>00158 CheckError();
<a name="l00159"></a>00159 <span class="keywordflow">return</span> res;
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161
<a name="l00163"></a><a class="code" href="classCTMimporter.html#ae331cb506a75e1605fa5955dd6f4f1e6">00163</a> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> <a class="code" href="classCTMimporter.html#ae331cb506a75e1605fa5955dd6f4f1e6" title="Wrapper for ctmGetUVMapFloat().">GetUVMapFloat</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aUVMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00164"></a>00164 {
<a name="l00165"></a>00165 <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> res = <a class="code" href="openctm_8h.html#afad1b100b9f2fe4bf0dfc36cb39ec615" title="Get information about a UV map.">ctmGetUVMapFloat</a>(mContext, aUVMap, aProperty);
<a name="l00166"></a>00166 CheckError();
<a name="l00167"></a>00167 <span class="keywordflow">return</span> res;
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169
<a name="l00171"></a><a class="code" href="classCTMimporter.html#a4cbdaa46ec7c4d8e60493a15119d6943">00171</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> <a class="code" href="classCTMimporter.html#a4cbdaa46ec7c4d8e60493a15119d6943" title="Wrapper for ctmGetNamedAttribMap().">GetNamedAttribMap</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * aName)
<a name="l00172"></a>00172 {
<a name="l00173"></a>00173 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> res = <a class="code" href="openctm_8h.html#a15692de5d6e93adf8bed8d06d88c905c" title="Get a reference to the named vertex attribute map.">ctmGetNamedAttribMap</a>(mContext, aName);
<a name="l00174"></a>00174 CheckError();
<a name="l00175"></a>00175 <span class="keywordflow">return</span> res;
<a name="l00176"></a>00176 }
<a name="l00177"></a>00177
<a name="l00179"></a><a class="code" href="classCTMimporter.html#a8b9692055a8069faf5e0efda7f1a6e9f">00179</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classCTMimporter.html#a8b9692055a8069faf5e0efda7f1a6e9f" title="Wrapper for ctmGetAttribMapString().">GetAttribMapString</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aAttribMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00180"></a>00180 {
<a name="l00181"></a>00181 <span class="keyword">const</span> <span class="keywordtype">char</span> * res = <a class="code" href="openctm_8h.html#a841d7c1e0bafd57ee36ccbbc74470b68" title="Get information about a vertex attribute map.">ctmGetAttribMapString</a>(mContext, aAttribMap, aProperty);
<a name="l00182"></a>00182 CheckError();
<a name="l00183"></a>00183 <span class="keywordflow">return</span> res;
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185
<a name="l00187"></a><a class="code" href="classCTMimporter.html#ae24b12d9c44c75b86ac8a414afe9587d">00187</a> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> <a class="code" href="classCTMimporter.html#ae24b12d9c44c75b86ac8a414afe9587d" title="Wrapper for ctmGetAttribMapFloat().">GetAttribMapFloat</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aAttribMap, <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00188"></a>00188 {
<a name="l00189"></a>00189 <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> res = <a class="code" href="openctm_8h.html#a7c297f9b6d486f47596cff184602a65d" title="Get information about a vertex attribute map.">ctmGetAttribMapFloat</a>(mContext, aAttribMap, aProperty);
<a name="l00190"></a>00190 CheckError();
<a name="l00191"></a>00191 <span class="keywordflow">return</span> res;
<a name="l00192"></a>00192 }
<a name="l00193"></a>00193
<a name="l00195"></a><a class="code" href="classCTMimporter.html#ae29eed6294afc62ae49eb958813354c8">00195</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classCTMimporter.html#ae29eed6294afc62ae49eb958813354c8" title="Wrapper for ctmGetString().">GetString</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aProperty)
<a name="l00196"></a>00196 {
<a name="l00197"></a>00197 <span class="keyword">const</span> <span class="keywordtype">char</span> * res = <a class="code" href="openctm_8h.html#a4e4269df157eb2d117259c69a331e339" title="Get information about an OpenCTM context.">ctmGetString</a>(mContext, aProperty);
<a name="l00198"></a>00198 CheckError();
<a name="l00199"></a>00199 <span class="keywordflow">return</span> res;
<a name="l00200"></a>00200 }
<a name="l00201"></a>00201
<a name="l00203"></a><a class="code" href="classCTMimporter.html#aafa137d809e6a1947fe438ab6a5f6b32">00203</a> <span class="keywordtype">void</span> <a class="code" href="classCTMimporter.html#aafa137d809e6a1947fe438ab6a5f6b32" title="Wrapper for ctmLoad().">Load</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * aFileName)
<a name="l00204"></a>00204 {
<a name="l00205"></a>00205 <a class="code" href="openctm_8h.html#a99a57706d438c5654adbc9646058dc01" title="Load an OpenCTM format file into the context.">ctmLoad</a>(mContext, aFileName);
<a name="l00206"></a>00206 CheckError();
<a name="l00207"></a>00207 }
<a name="l00208"></a>00208
<a name="l00210"></a><a class="code" href="classCTMimporter.html#af284200fd58bbf545151f5f2c8e71f63">00210</a> <span class="keywordtype">void</span> <a class="code" href="classCTMimporter.html#af284200fd58bbf545151f5f2c8e71f63" title="Wrapper for ctmLoadCustom().">LoadCustom</a>(<a class="code" href="openctm_8h.html#ad2fb8fd3b5997a557d8aba2385ed849b" title="Stream read() function pointer.">CTMreadfn</a> aReadFn, <span class="keywordtype">void</span> * aUserData)
<a name="l00211"></a>00211 {
<a name="l00212"></a>00212 <a class="code" href="openctm_8h.html#a99699bcbd4cbe0942a22498671af107e" title="Load an OpenCTM format file using a custom stream read function.">ctmLoadCustom</a>(mContext, aReadFn, aUserData);
<a name="l00213"></a>00213 CheckError();
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215
<a name="l00216"></a>00216 <span class="comment">// You can not copy nor assign from one CTMimporter object to another, since</span>
<a name="l00217"></a>00217 <span class="comment">// the object contains hidden state. By declaring these dummy prototypes</span>
<a name="l00218"></a>00218 <span class="comment">// without an implementation, you will at least get linker errors if you try</span>
<a name="l00219"></a>00219 <span class="comment">// to copy or assign a CTMimporter object.</span>
<a name="l00220"></a>00220 <a class="code" href="classCTMimporter.html#a4b22cf96b7be2bdff4ed95051dca581d" title="Constructor.">CTMimporter</a>(<span class="keyword">const</span> <a class="code" href="classCTMimporter.html" title="OpenCTM importer class.">CTMimporter</a>&amp; v);
<a name="l00221"></a>00221 <a class="code" href="classCTMimporter.html" title="OpenCTM importer class.">CTMimporter</a>&amp; <a class="code" href="classCTMimporter.html#adc2b2792aa4f30f26f966342106c1c69">operator=</a>(<span class="keyword">const</span> <a class="code" href="classCTMimporter.html" title="OpenCTM importer class.">CTMimporter</a>&amp; v);
<a name="l00222"></a>00222 };
<a name="l00223"></a>00223
<a name="l00224"></a>00224
<a name="l00242"></a>00242
<a name="l00243"></a><a class="code" href="classCTMexporter.html">00243</a> <span class="keyword">class </span><a class="code" href="classCTMexporter.html" title="OpenCTM exporter class.">CTMexporter</a> {
<a name="l00244"></a>00244 <span class="keyword">private</span>:
<a name="l00246"></a>00246 <a class="code" href="openctm_8h.html#a7062b4f48dc6d1b736ac93955acf3888" title="OpenCTM context handle.">CTMcontext</a> mContext;
<a name="l00247"></a>00247
<a name="l00250"></a>00250 <span class="keywordtype">void</span> CheckError()
<a name="l00251"></a>00251 {
<a name="l00252"></a>00252 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> err = <a class="code" href="openctm_8h.html#a2bbaed33a6809affc4a61469f6676bdf" title="Returns the latest error.">ctmGetError</a>(mContext);
<a name="l00253"></a>00253 <span class="keywordflow">if</span>(err != <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625abf60b318c307c84b240d374d07ff6bf5" title="No error has occured (everything is OK).">CTM_NONE</a>)
<a name="l00254"></a>00254 <span class="keywordflow">throw</span> <a class="code" href="classctm__error.html" title="OpenCTM exception.">ctm_error</a>(err);
<a name="l00255"></a>00255 }
<a name="l00256"></a>00256
<a name="l00257"></a>00257 <span class="keyword">public</span>:
<a name="l00259"></a><a class="code" href="classCTMexporter.html#aad8599a96aa930533f6d2a4b71526165">00259</a> <a class="code" href="classCTMexporter.html#aad8599a96aa930533f6d2a4b71526165" title="Constructor.">CTMexporter</a>()
<a name="l00260"></a>00260 {
<a name="l00261"></a>00261 mContext = <a class="code" href="openctm_8h.html#a3ca20da713005b0c6afb9b5f21640837" title="Create a new OpenCTM context.">ctmNewContext</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625a4d156b19083ce49d4b8a6da287d6f5d3" title="The OpenCTM context will be used for exporting data.">CTM_EXPORT</a>);
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263
<a name="l00265"></a><a class="code" href="classCTMexporter.html#a2c62a6c252ec24b0bfbdb62e1b7b7ea9">00265</a> <a class="code" href="classCTMexporter.html#a2c62a6c252ec24b0bfbdb62e1b7b7ea9" title="Destructor.">~CTMexporter</a>()
<a name="l00266"></a>00266 {
<a name="l00267"></a>00267 <a class="code" href="openctm_8h.html#aeb16fd3054a19415be90de4968b21a3a" title="Free an OpenCTM context.">ctmFreeContext</a>(mContext);
<a name="l00268"></a>00268 }
<a name="l00269"></a>00269
<a name="l00271"></a><a class="code" href="classCTMexporter.html#a09de9efb7b8b1f043367717c653dc847">00271</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#a09de9efb7b8b1f043367717c653dc847" title="Wrapper for ctmCompressionMethod().">CompressionMethod</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aMethod)
<a name="l00272"></a>00272 {
<a name="l00273"></a>00273 <a class="code" href="openctm_8h.html#af4ac8e534f59be4edacc39753cf54693" title="Set which compression method to use for the given OpenCTM context.">ctmCompressionMethod</a>(mContext, aMethod);
<a name="l00274"></a>00274 CheckError();
<a name="l00275"></a>00275 }
<a name="l00276"></a>00276
<a name="l00278"></a><a class="code" href="classCTMexporter.html#ab2a81044568d7503e8d0f0272c855113">00278</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#ab2a81044568d7503e8d0f0272c855113" title="Wrapper for ctmCompressionLevel().">CompressionLevel</a>(<a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> aLevel)
<a name="l00279"></a>00279 {
<a name="l00280"></a>00280 <a class="code" href="openctm_8h.html#aa2902c49b904a7557fdd012e303c720e" title="Set which LZMA compression level to use for the given OpenCTM context.">ctmCompressionLevel</a>(mContext, aLevel);
<a name="l00281"></a>00281 CheckError();
<a name="l00282"></a>00282 }
<a name="l00283"></a>00283
<a name="l00285"></a><a class="code" href="classCTMexporter.html#a137df10c84b6feb8b3c54360f077220a">00285</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#a137df10c84b6feb8b3c54360f077220a" title="Wrapper for ctmVertexPrecision().">VertexPrecision</a>(<a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> aPrecision)
<a name="l00286"></a>00286 {
<a name="l00287"></a>00287 <a class="code" href="openctm_8h.html#af4191357f51161a16ff886d18ec848d8" title="Set the vertex coordinate precision (only used by the MG2 compression method).">ctmVertexPrecision</a>(mContext, aPrecision);
<a name="l00288"></a>00288 CheckError();
<a name="l00289"></a>00289 }
<a name="l00290"></a>00290
<a name="l00292"></a><a class="code" href="classCTMexporter.html#af4ca0e12d0e6203633abb5ae514cc113">00292</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#af4ca0e12d0e6203633abb5ae514cc113" title="Wrapper for ctmVertexPrecisionRel().">VertexPrecisionRel</a>(<a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> aRelPrecision)
<a name="l00293"></a>00293 {
<a name="l00294"></a>00294 <a class="code" href="openctm_8h.html#ade23eb25fa9d5cd1d932bc1203476f27" title="Set the vertex coordinate precision, relative to the mesh dimensions (only used by...">ctmVertexPrecisionRel</a>(mContext, aRelPrecision);
<a name="l00295"></a>00295 CheckError();
<a name="l00296"></a>00296 }
<a name="l00297"></a>00297
<a name="l00299"></a><a class="code" href="classCTMexporter.html#a5e91deaa92b529a2a1c8bc87d46952bb">00299</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#a5e91deaa92b529a2a1c8bc87d46952bb" title="Wrapper for ctmNormalPrecision().">NormalPrecision</a>(<a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> aPrecision)
<a name="l00300"></a>00300 {
<a name="l00301"></a>00301 <a class="code" href="openctm_8h.html#a07d8b47a0e642d0d8c77cf18e8d354a5" title="Set the normal precision (only used by the MG2 compression method).">ctmNormalPrecision</a>(mContext, aPrecision);
<a name="l00302"></a>00302 CheckError();
<a name="l00303"></a>00303 }
<a name="l00304"></a>00304
<a name="l00306"></a><a class="code" href="classCTMexporter.html#a1de5b12af537d79ea1d5cf7a0fdd6c9c">00306</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#a1de5b12af537d79ea1d5cf7a0fdd6c9c" title="Wrapper for ctmUVCoordPrecision().">UVCoordPrecision</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aUVMap, <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> aPrecision)
<a name="l00307"></a>00307 {
<a name="l00308"></a>00308 <a class="code" href="openctm_8h.html#ac1a75abbf04281acaff4f6f1f9516039" title="Set the coordinate precision for the specified UV map (only used by the MG2 compression...">ctmUVCoordPrecision</a>(mContext, aUVMap, aPrecision);
<a name="l00309"></a>00309 CheckError();
<a name="l00310"></a>00310 }
<a name="l00311"></a>00311
<a name="l00313"></a><a class="code" href="classCTMexporter.html#aa23b7350d8ce9e0de716528bc550303c">00313</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#aa23b7350d8ce9e0de716528bc550303c" title="Wrapper for ctmAttribPrecision().">AttribPrecision</a>(<a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> aAttribMap, <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> aPrecision)
<a name="l00314"></a>00314 {
<a name="l00315"></a>00315 <a class="code" href="openctm_8h.html#a8af7af38bd9340838b43805b81698777" title="Set the attribute value precision for the specified attribute map (only used by the...">ctmAttribPrecision</a>(mContext, aAttribMap, aPrecision);
<a name="l00316"></a>00316 CheckError();
<a name="l00317"></a>00317 }
<a name="l00318"></a>00318
<a name="l00320"></a><a class="code" href="classCTMexporter.html#ad9f296aacd93756f482634dba96c9d63">00320</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#ad9f296aacd93756f482634dba96c9d63" title="Wrapper for ctmFileComment().">FileComment</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * aFileComment)
<a name="l00321"></a>00321 {
<a name="l00322"></a>00322 <a class="code" href="openctm_8h.html#a2225924b06488421ee6b9a8505782a25" title="Set the file comment for the given OpenCTM context.">ctmFileComment</a>(mContext, aFileComment);
<a name="l00323"></a>00323 CheckError();
<a name="l00324"></a>00324 }
<a name="l00325"></a>00325
<a name="l00327"></a><a class="code" href="classCTMexporter.html#ae93ad35333b949ca371253e43d6936ab">00327</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#ae93ad35333b949ca371253e43d6936ab" title="Wrapper for ctmDefineMesh().">DefineMesh</a>(<span class="keyword">const</span> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * aVertices, <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> aVertexCount,
<a name="l00328"></a>00328 <span class="keyword">const</span> <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> * aIndices, <a class="code" href="openctm_8h.html#ac5ea1beb64d415c241f2abf35eeb6c48" title="Unsigned integer (32 bits wide).">CTMuint</a> aTriangleCount,
<a name="l00329"></a>00329 <span class="keyword">const</span> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * aNormals)
<a name="l00330"></a>00330 {
<a name="l00331"></a>00331 <a class="code" href="openctm_8h.html#a1cb648e89121ae67f5a8b9e5a8f41c4d" title="Define a triangle mesh.">ctmDefineMesh</a>(mContext, aVertices, aVertexCount, aIndices, aTriangleCount,
<a name="l00332"></a>00332 aNormals);
<a name="l00333"></a>00333 CheckError();
<a name="l00334"></a>00334 }
<a name="l00335"></a>00335
<a name="l00337"></a><a class="code" href="classCTMexporter.html#a789c681d97c0bbf584156f529d4216fe">00337</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> <a class="code" href="classCTMexporter.html#a789c681d97c0bbf584156f529d4216fe" title="Wrapper for ctmAddUVMap().">AddUVMap</a>(<span class="keyword">const</span> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * aUVCoords, <span class="keyword">const</span> <span class="keywordtype">char</span> * aName,
<a name="l00338"></a>00338 <span class="keyword">const</span> <span class="keywordtype">char</span> * aFileName)
<a name="l00339"></a>00339 {
<a name="l00340"></a>00340 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> res = <a class="code" href="openctm_8h.html#a44345560299ac49dfd502d0470f05e0f" title="Define a UV map.">ctmAddUVMap</a>(mContext, aUVCoords, aName, aFileName);
<a name="l00341"></a>00341 CheckError();
<a name="l00342"></a>00342 <span class="keywordflow">return</span> res;
<a name="l00343"></a>00343 }
<a name="l00344"></a>00344
<a name="l00346"></a><a class="code" href="classCTMexporter.html#ac6ae926c8a087af172258ee22ef38331">00346</a> <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> <a class="code" href="classCTMexporter.html#ac6ae926c8a087af172258ee22ef38331" title="Wrapper for ctmAddAttribMap().">AddAttribMap</a>(<span class="keyword">const</span> <a class="code" href="openctm_8h.html#af8b7eeaefac4d6ad39d11c3f7be8afa2" title="Single precision floating point type (IEEE 754 32 bits wide).">CTMfloat</a> * aAttribValues, <span class="keyword">const</span> <span class="keywordtype">char</span> * aName)
<a name="l00347"></a>00347 {
<a name="l00348"></a>00348 <a class="code" href="openctm_8h.html#a0f5efe622ac5146c4505d49860ce5625" title="OpenCTM specific enumerators.">CTMenum</a> res = <a class="code" href="openctm_8h.html#a920a8fed6bef834db0b241fc5c9bba03" title="Define a custom vertex attribute map.">ctmAddAttribMap</a>(mContext, aAttribValues, aName);
<a name="l00349"></a>00349 CheckError();
<a name="l00350"></a>00350 <span class="keywordflow">return</span> res;
<a name="l00351"></a>00351 }
<a name="l00352"></a>00352
<a name="l00354"></a><a class="code" href="classCTMexporter.html#a3fdf6505e0aaa7345218cebf1278addf">00354</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#a3fdf6505e0aaa7345218cebf1278addf" title="Wrapper for ctmSave().">Save</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * aFileName)
<a name="l00355"></a>00355 {
<a name="l00356"></a>00356 <a class="code" href="openctm_8h.html#acde994008b0b3321bad9f3bbfacb12db" title="Save an OpenCTM format file.">ctmSave</a>(mContext, aFileName);
<a name="l00357"></a>00357 CheckError();
<a name="l00358"></a>00358 }
<a name="l00359"></a>00359
<a name="l00361"></a><a class="code" href="classCTMexporter.html#a4dd0f34efdfe192b0627b1bb52a36910">00361</a> <span class="keywordtype">void</span> <a class="code" href="classCTMexporter.html#a4dd0f34efdfe192b0627b1bb52a36910" title="Wrapper for ctmSaveCustom().">SaveCustom</a>(<a class="code" href="openctm_8h.html#a2428bc1bf2cf2e1af05d132dca892f5b" title="Stream write() function pointer.">CTMwritefn</a> aWriteFn, <span class="keywordtype">void</span> * aUserData)
<a name="l00362"></a>00362 {
<a name="l00363"></a>00363 <a class="code" href="openctm_8h.html#a7e62ca5548a34ed0e126fd4f7b77ef3f" title="Save an OpenCTM format file using a custom stream write function.">ctmSaveCustom</a>(mContext, aWriteFn, aUserData);
<a name="l00364"></a>00364 CheckError();
<a name="l00365"></a>00365 }
<a name="l00366"></a>00366
<a name="l00367"></a>00367 <span class="comment">// You can not copy nor assign from one CTMexporter object to another, since</span>
<a name="l00368"></a>00368 <span class="comment">// the object contains hidden state. By declaring these dummy prototypes</span>
<a name="l00369"></a>00369 <span class="comment">// without an implementation, you will at least get linker errors if you try</span>
<a name="l00370"></a>00370 <span class="comment">// to copy or assign a CTMexporter object.</span>
<a name="l00371"></a>00371 <a class="code" href="classCTMexporter.html#aad8599a96aa930533f6d2a4b71526165" title="Constructor.">CTMexporter</a>(<span class="keyword">const</span> <a class="code" href="classCTMexporter.html" title="OpenCTM exporter class.">CTMexporter</a>&amp; v);
<a name="l00372"></a>00372 <a class="code" href="classCTMexporter.html" title="OpenCTM exporter class.">CTMexporter</a>&amp; <a class="code" href="classCTMexporter.html#ae686aa88aa041e53fdbcbe465b7dbf70">operator=</a>(<span class="keyword">const</span> <a class="code" href="classCTMexporter.html" title="OpenCTM exporter class.">CTMexporter</a>&amp; v);
<a name="l00373"></a>00373 };
<a name="l00374"></a>00374
<a name="l00375"></a>00375 <span class="preprocessor">#endif // __OPENCTMPP_H_</span>
<a name="l00376"></a>00376 <span class="preprocessor"></span>
<a name="l00377"></a>00377 <span class="preprocessor">#endif // OPENCTM_NO_CPP</span>
</pre></div></div>
<div style="padding: 1em 1em 0.5em 1em; margin: 2em 0 0 0; border-top: 1px solid #84b0c7; color: #808080; text-align: center;">
<p>Copyright &copy; 2009-2010 Marcus Geelnard &mdash;
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,105 +0,0 @@
/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
DIV.tabs
{
float : left;
width : 100%;
background : url("tab_b.gif") repeat-x bottom;
margin-bottom : 4px;
}
DIV.tabs UL
{
margin : 0px;
padding-left : 10px;
list-style : none;
}
DIV.tabs LI, DIV.tabs FORM
{
display : inline;
margin : 0px;
padding : 0px;
}
DIV.tabs FORM
{
float : right;
}
DIV.tabs A
{
float : left;
background : url("tab_r.gif") no-repeat right top;
border-bottom : 1px solid #84B0C7;
font-size : 80%;
font-weight : bold;
text-decoration : none;
}
DIV.tabs A:hover
{
background-position: 100% -150px;
}
DIV.tabs A:link, DIV.tabs A:visited,
DIV.tabs A:active, DIV.tabs A:hover
{
color: #1A419D;
}
DIV.tabs SPAN
{
float : left;
display : block;
background : url("tab_l.gif") no-repeat left top;
padding : 5px 9px;
white-space : nowrap;
}
DIV.tabs #MSearchBox
{
float : right;
display : inline;
font-size : 1em;
}
DIV.tabs TD
{
font-size : 80%;
font-weight : bold;
text-decoration : none;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
DIV.tabs SPAN {float : none;}
/* End IE5-Mac hack */
DIV.tabs A:hover SPAN
{
background-position: 0% -150px;
}
DIV.tabs LI.current A
{
background-position: 100% -150px;
border-width : 0px;
}
DIV.tabs LI.current SPAN
{
background-position: 0% -150px;
padding-bottom : 6px;
}
DIV.navpath
{
background : none;
border : none;
border-bottom : 1px solid #84B0C7;
text-align : center;
margin : 2px;
padding : 2px;
}

View File

@ -1,92 +0,0 @@
.TH ctmconv 1
.SH NAME
.B ctmconv
- file format converter for 3D models
.SH SYNOPSIS
.B ctmconv
.I infile outfile [options]
.SH DESCRIPTION
.B ctmconv
is a 3D file converter that can convert 3D model files to and from several
different formats.
.PP
The file
.I infile
is loaded, and then saved as
.I outfile
in the target file format.
.PP
The input and output file formats are determined from the file endings.
.SH OPTIONS
The following options are available:
.TP 16
.B --scale arg
Scale the mesh by a scalar factor.
.TP
.B --upaxis arg
Set up axis (X, Y, Z, -X, -Y, -Z). If != Z, the mesh will be flipped.
.TP
.B --flip
Flip triangle orientation.
.TP
.B --calc-normals
If the source file does not contain any normals, calculate them.
.TP
.B --no-normals
Do not export normals.
.TP
.B --no-texcoords
Do not export texture coordinates.
.TP
.B --no-colors
Do not export vertex colors.
.TP
.B --comment arg
Set the file comment (default is to use the comment from the input file, if
any).
.TP
.B --texfile arg
Set the texture file name reference for the texture (default is to use the
texture file name reference from the input file, if any).
.PP
When exporting an OpenCTM file, the following options are also
available:
.TP 16
.B --method arg
Select compression method (RAW, MG1, MG2).
.TP
.B --level arg
Set the compression level (0 - 9).
.TP
.B --vprec arg
Set vertex precision (only for MG2).
.TP
.B --vprecrel arg
Set vertex precision, relative method (only for MG2).
.TP
.B --nprec arg
Set normal precision (only for MG2).
.TP
.B --tprec arg
Set texture map precision (only for MG2).
.TP
.B --cprec arg
Set color precision (only for MG2).
.SH FILE FORMATS
The following 3D model file formats are supported:
OpenCTM (.ctm),
Stanford triangle format (.ply),
Stereolitography (.stl),
3D Studio (.3ds),
COLLADA 1.4/1.5 (.dae),
Wavefront geometry file (.obj),
LightWave object (.lwo),
Geomview object file format (.off),
VRML 2.0 - export only (.wrl).
.SH AVAILABILITY
.B ctmconv
is designed to be portable, and is available for several different systems,
including (but not limited to): Windows, Mac OS X (10.3+), Linux and
OpenSolaris.
.SH SEE ALSO
ctmviewer(1)

View File

@ -1,86 +0,0 @@
.TH ctmviewer 1
.SH NAME
.B ctmviewer
- 3D viewer for models of various file formats
.SH SYNOPSIS
.B ctmviewer
.I [modelfile [texturefile]]
.SH DESCRIPTION
.B ctmviewer
is a 3D file viewer that can load, show and save 3D model files in several
different formats.
.PP
The program displays an interactive 3D view of the model, which can be operated
with the mouse (e.g. for rotating and zooming).
.PP
If the selected model file contains texture coordinate information, it is
possible to specify which 2D image file to use as a texture with the additional
.I texturefile
argument. If no texture file is given (either by the 3D model file, or by the
.I texturefile
argument), a standard 2D grid is used as a texture.
.SH GUI OPERATIONS
In addition to the command line arguments,
.B ctmviewer
offers several operations that can be performed from the 3D GUI display. For
help, press the F1 key.
.SS Loading and Saving
It is possible to load and save 3D model files from the program by either
using the buttons in the upper left corner of the 3D display, or by using the
keyboard shortcuts CTRL+O (open) and CTRL+S (save).
.PP
It is also possible to load a texture file from the program by using the
Open Texture button.
.SS Rendering
To toggle between a normal filled surface view (default) and a wire frame view,
press the 'w' key.
.SS Camera Control
By holding down the left mouse button and moving the mouse, the camera is
rotated around the 3D model.
.PP
By holding down the right mouse button and moving the mouse, the camera will
pan left/right and up/down.
.PP
By holding down the middle mouse button and moving the mouse, the camera will
zoom in and out. It is also possible to use the mouse wheel (not supported on
all systems) or the +/- keys to zoom in and out.
.PP
Double click the left mouse button on a point on the model to focus the camera
on that point.
.PP
Press the 'f' key to fit the model into the screen view (re-center and re-zoom).
.PP
Press the 'y' key to change the camera up direction to the Y axis (may be
necessary if the model was designed in or for an environment where the Y axis
is considered the up direction).
.PP
Press the 'z' key to change the camera up direction to the Z axis (default).
.SH FILE FORMATS
The following 3D model file formats are supported:
OpenCTM (.ctm),
Stanford triangle format (.ply),
Stereolitography (.stl),
3D Studio (.3ds),
COLLADA 1.4/1.5 (.dae),
Wavefront geometry file (.obj),
LightWave object (.lwo),
Geomview object file format (.off),
VRML 2.0 - export only (.wrl).
.PP
The following 2D image file formats are supported (texture):
JPEG (.jpg), PNG (.png).
.SH AVAILABILITY
.B ctmviewer
is designed to be portable, and is available for several different systems,
including (but not limited to): Windows, Mac OS X (10.3+), Linux and
OpenSolaris.
.PP
.B ctmviewer
uses OpenGL for its accelerated 3D display. When the OpenGL implementation
supports it,
.B ctmviewer
will use per pixel Phong shading for improved visual appearance. Otherwise
.B ctmviewer
will fall back to classic per vertex shading.
.SH SEE ALSO
ctmconv(1)

View File

@ -1,81 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.linux
# Description: Makefile for Linux systems (should work on most Un*x-like
# systems with gcc, e.g. OpenSolaris).
###############################################################################
# Copyright (c) 2009-2010 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
LZMADIR = liblzma
CC = gcc
CFLAGS = -O3 -W -Wall -c -fPIC -DOPENCTM_BUILD -I$(LZMADIR) -DLZMA_PREFIX_CTM -std=c99 -pedantic
CFLAGS_LZMA = -O3 -W -Wall -c -fPIC -DLZMA_PREFIX_CTM -std=c99 -pedantic
RM = rm -f
DEPEND = $(CPP) -MM
DYNAMICLIB = libopenctm.so
OBJS = openctm.o \
stream.o \
compressRAW.o \
compressMG1.o \
compressMG2.o
LZMA_OBJS = Alloc.o \
LzFind.o \
LzmaDec.o \
LzmaEnc.o \
LzmaLib.o
SRCS = openctm.c \
stream.c \
compressRAW.c \
compressMG1.c \
compressMG2.c
LZMA_SRCS = $(LZMADIR)/Alloc.c \
$(LZMADIR)/LzFind.c \
$(LZMADIR)/LzmaDec.c \
$(LZMADIR)/LzmaEnc.c \
$(LZMADIR)/LzmaLib.c
.phony: all clean depend
all: $(DYNAMICLIB)
clean:
$(RM) $(DYNAMICLIB) $(OBJS) $(LZMA_OBJS)
$(DYNAMICLIB): $(OBJS) $(LZMA_OBJS)
gcc -shared -s -Wl,-soname,$@ -o $@ $(OBJS) $(LZMA_OBJS) -lm
%.o: %.c
$(CC) $(CFLAGS) $<
%.o: $(LZMADIR)/%.c
$(CC) $(CFLAGS_LZMA) $<
depend:
$(DEPEND) $(SRCS) $(LZMA_SRCS) > make.depend
-include make.depend

View File

@ -1,86 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.macosx
# Description: Makefile for Mac OS X.
###############################################################################
# Copyright (c) 2009-2010 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
LZMADIR = liblzma
CC = gcc
CFLAGS = -arch i386 -O3 -W -Wall -c -fvisibility=hidden -DOPENCTM_BUILD -I$(LZMADIR) -DLZMA_PREFIX_CTM -std=c99 -pedantic
CFLAGS_LZMA = -arch i386 -O3 -W -Wall -c -fvisibility=hidden -DLZMA_PREFIX_CTM -std=c99 -pedantic
RM = rm -f
DEPEND = $(CPP) -MM
DYNAMICLIB = libopenctm.dylib
STATICLIB = libopenctm.a
OBJS = openctm.o \
stream.o \
compressRAW.o \
compressMG1.o \
compressMG2.o
LZMA_OBJS = Alloc.o \
LzFind.o \
LzmaDec.o \
LzmaEnc.o \
LzmaLib.o
SRCS = openctm.c \
stream.c \
compressRAW.c \
compressMG1.c \
compressMG2.c
LZMA_SRCS = $(LZMADIR)/Alloc.c \
$(LZMADIR)/LzFind.c \
$(LZMADIR)/LzmaDec.c \
$(LZMADIR)/LzmaEnc.c \
$(LZMADIR)/LzmaLib.c
.phony: all clean depend
#all: $(DYNAMICLIB)
all: $(STATICLIB)
clean:
$(RM) $(DYNAMICLIB) $(OBJS) $(LZMA_OBJS)
$(DYNAMICLIB): $(OBJS) $(LZMA_OBJS)
gcc -dynamiclib -o $@ $(OBJS) $(LZMA_OBJS)
$(STATICLIB): $(OBJS) $(LZMA_OBJS)
ar rcs $@ $(OBJS) $(LZMA_OBJS)
%.o: %.c
$(CC) $(CFLAGS) $<
%.o: $(LZMADIR)/%.c
$(CC) $(CFLAGS_LZMA) $<
depend:
$(DEPEND) $(SRCS) $(LZMA_SRCS) > make.depend
-include make.depend

View File

@ -1,87 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.mingw
# Description: Makefile for MinGW32 for Windows.
###############################################################################
# Copyright (c) 2009-2010 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
LZMADIR = liblzma
CC = gcc
CFLAGS = -O3 -W -Wall -c -DOPENCTM_BUILD -I$(LZMADIR) -DLZMA_PREFIX_CTM -std=c99 -pedantic
CFLAGS_LZMA = -O3 -W -Wall -c -DLZMA_PREFIX_CTM -std=c99 -pedantic
RM = del /Q
DEPEND = $(CC) -MM
RC = windres
DYNAMICLIB = openctm.dll
LINKLIB = libopenctm.a
OBJS = openctm.o \
stream.o \
compressRAW.o \
compressMG1.o \
compressMG2.o
LZMA_OBJS = Alloc.o \
LzFind.o \
LzmaDec.o \
LzmaEnc.o \
LzmaLib.o
SRCS = openctm.c \
stream.c \
compressRAW.c \
compressMG1.c \
compressMG2.c
LZMA_SRCS = $(LZMADIR)/Alloc.c \
$(LZMADIR)/LzFind.c \
$(LZMADIR)/LzmaDec.c \
$(LZMADIR)/LzmaEnc.c \
$(LZMADIR)/LzmaLib.c
.phony: all clean depend
all: $(DYNAMICLIB)
clean:
$(RM) $(DYNAMICLIB) $(LINKLIB) $(OBJS) $(LZMA_OBJS) openctm-res.o
$(DYNAMICLIB): $(OBJS) $(LZMA_OBJS) openctm-mingw1.def openctm-mingw2.def openctm-res.o
dllwrap --def openctm-mingw1.def -o $@ $(OBJS) $(LZMA_OBJS) openctm-res.o
strip $@
dlltool --kill-at --output-lib $(LINKLIB) --def openctm-mingw2.def
openctm-res.o: openctm.rc
$(RC) $< $@
%.o: %.c
$(CC) $(CFLAGS) $<
%.o: $(LZMADIR)/%.c
$(CC) $(CFLAGS_LZMA) $<
depend:
$(DEPEND) $(SRCS) $(LZMA_SRCS) > make.depend
-include make.depend

View File

@ -1,103 +0,0 @@
###############################################################################
# Product: OpenCTM
# File: Makefile.msvc
# Description: Makefile for MS Visual Studio 2008 for Windows.
###############################################################################
# Copyright (c) 2009-2010 Marcus Geelnard
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not
# be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source
# distribution.
###############################################################################
LZMADIR = liblzma
CC = cl
CFLAGS = /nologo /Ox /W3 /c /DOPENCTM_BUILD /I$(LZMADIR) /DLZMA_PREFIX_CTM /D_CRT_SECURE_NO_WARNINGS
CFLAGS_LZMA = /nologo /Ox /W3 /c /DLZMA_PREFIX_CTM
RM = del /Q
RC = rc
DYNAMICLIB = openctm.dll
LINKLIB = openctm.lib
OBJS = openctm.obj \
stream.obj \
compressRAW.obj \
compressMG1.obj \
compressMG2.obj
LZMA_OBJS = Alloc.obj \
LzFind.obj \
LzmaDec.obj \
LzmaEnc.obj \
LzmaLib.obj
SRCS = openctm.c \
stream.c \
compressRAW.c \
compressMG1.c \
compressMG2.c
LZMA_SRCS = $(LZMADIR)\Alloc.c \
$(LZMADIR)\LzFind.c \
$(LZMADIR)\LzmaDec.c \
$(LZMADIR)\LzmaEnc.c \
$(LZMADIR)\LzmaLib.c
all: $(DYNAMICLIB)
.PHONY: clean
clean:
$(RM) $(DYNAMICLIB) $(LINKLIB) $(OBJS) $(LZMA_OBJS) openctm.res
$(DYNAMICLIB): $(OBJS) $(LZMA_OBJS) openctm-msvc.def openctm.res
link /nologo /out:$@ /dll /implib:$(LINKLIB) /def:openctm-msvc.def $(OBJS) $(LZMA_OBJS) openctm.res
openctm.res: openctm.rc
$(RC) openctm.rc
openctm.obj: openctm.c openctm.h internal.h
$(CC) $(CFLAGS) openctm.c
stream.obj: stream.c openctm.h internal.h
$(CC) $(CFLAGS) stream.c
compressRAW.obj: compressRAW.c openctm.h internal.h
$(CC) $(CFLAGS) compressRAW.c
compressMG1.obj: compressMG1.c openctm.h internal.h
$(CC) $(CFLAGS) compressMG1.c
compressMG2.obj: compressMG2.c openctm.h internal.h
$(CC) $(CFLAGS) compressMG2.c
Alloc.obj: $(LZMADIR)\Alloc.c $(LZMADIR)\Alloc.h
$(CC) $(CFLAGS_LZMA) $(LZMADIR)\Alloc.c
LzFind.obj: $(LZMADIR)\LzFind.c $(LZMADIR)\LzFind.h $(LZMADIR)\Types.h $(LZMADIR)\LzHash.h $(LZMADIR)\NameMangle.h
$(CC) $(CFLAGS_LZMA) $(LZMADIR)\LzFind.c
LzmaDec.obj: $(LZMADIR)\LzmaDec.c $(LZMADIR)\LzmaDec.h $(LZMADIR)\Types.h $(LZMADIR)\NameMangle.h
$(CC) $(CFLAGS_LZMA) $(LZMADIR)\LzmaDec.c
LzmaEnc.obj: $(LZMADIR)\LzmaEnc.c $(LZMADIR)\LzmaEnc.h $(LZMADIR)\Types.h $(LZMADIR)\LzFind.h $(LZMADIR)\NameMangle.h
$(CC) $(CFLAGS_LZMA) $(LZMADIR)\LzmaEnc.c
LzmaLib.obj: $(LZMADIR)\LzmaLib.c $(LZMADIR)\LzmaEnc.h $(LZMADIR)\Types.h $(LZMADIR)\LzmaDec.h $(LZMADIR)\Alloc.h $(LZMADIR)\LzmaLib.h $(LZMADIR)\NameMangle.h
$(CC) $(CFLAGS_LZMA) $(LZMADIR)\LzmaLib.c

View File

@ -1,324 +0,0 @@
//-----------------------------------------------------------------------------
// Product: OpenCTM
// File: compressMG1.c
// Description: Implementation of the MG1 compression method.
//-----------------------------------------------------------------------------
// Copyright (c) 2009-2010 Marcus Geelnard
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//-----------------------------------------------------------------------------
#include <stdlib.h>
#include <math.h>
#include "openctm.h"
#include "internal.h"
#ifdef __DEBUG_
#include <stdio.h>
#endif
//-----------------------------------------------------------------------------
// _compareTriangle() - Comparator for the triangle sorting.
//-----------------------------------------------------------------------------
static int _compareTriangle(const void * elem1, const void * elem2)
{
CTMuint * tri1 = (CTMuint *) elem1;
CTMuint * tri2 = (CTMuint *) elem2;
if(tri1[0] != tri2[0])
return tri1[0] - tri2[0];
else
return tri1[1] - tri2[1];
}
//-----------------------------------------------------------------------------
// _ctmReArrangeTriangles() - Re-arrange all triangles for optimal
// compression.
//-----------------------------------------------------------------------------
static void _ctmReArrangeTriangles(_CTMcontext * self, CTMuint * aIndices)
{
CTMuint * tri, tmp, i;
// Step 1: Make sure that the first index of each triangle is the smallest
// one (rotate triangle nodes if necessary)
for(i = 0; i < self->mTriangleCount; ++ i)
{
tri = &aIndices[i * 3];
if((tri[1] < tri[0]) && (tri[1] < tri[2]))
{
tmp = tri[0];
tri[0] = tri[1];
tri[1] = tri[2];
tri[2] = tmp;
}
else if((tri[2] < tri[0]) && (tri[2] < tri[1]))
{
tmp = tri[0];
tri[0] = tri[2];
tri[2] = tri[1];
tri[1] = tmp;
}
}
// Step 2: Sort the triangles based on the first triangle index
qsort((void *) aIndices, self->mTriangleCount, sizeof(CTMuint) * 3, _compareTriangle);
}
//-----------------------------------------------------------------------------
// _ctmMakeIndexDeltas() - Calculate various forms of derivatives in order to
// reduce data entropy.
//-----------------------------------------------------------------------------
static void _ctmMakeIndexDeltas(_CTMcontext * self, CTMuint * aIndices)
{
CTMint i;
for(i = self->mTriangleCount - 1; i >= 0; -- i)
{
// Step 1: Calculate delta from second triangle index to the previous
// second triangle index, if the previous triangle shares the same first
// index, otherwise calculate the delta to the first triangle index
if((i >= 1) && (aIndices[i * 3] == aIndices[(i - 1) * 3]))
aIndices[i * 3 + 1] -= aIndices[(i - 1) * 3 + 1];
else
aIndices[i * 3 + 1] -= aIndices[i * 3];
// Step 2: Calculate delta from third triangle index to the first triangle
// index
aIndices[i * 3 + 2] -= aIndices[i * 3];
// Step 3: Calculate derivative of the first triangle index
if(i >= 1)
aIndices[i * 3] -= aIndices[(i - 1) * 3];
}
}
//-----------------------------------------------------------------------------
// _ctmRestoreIndices() - Restore original indices (inverse derivative
// operation).
//-----------------------------------------------------------------------------
static void _ctmRestoreIndices(_CTMcontext * self, CTMuint * aIndices)
{
CTMuint i;
for(i = 0; i < self->mTriangleCount; ++ i)
{
// Step 1: Reverse derivative of the first triangle index
if(i >= 1)
aIndices[i * 3] += aIndices[(i - 1) * 3];
// Step 2: Reverse delta from third triangle index to the first triangle
// index
aIndices[i * 3 + 2] += aIndices[i * 3];
// Step 3: Reverse delta from second triangle index to the previous
// second triangle index, if the previous triangle shares the same first
// index, otherwise reverse the delta to the first triangle index
if((i >= 1) && (aIndices[i * 3] == aIndices[(i - 1) * 3]))
aIndices[i * 3 + 1] += aIndices[(i - 1) * 3 + 1];
else
aIndices[i * 3 + 1] += aIndices[i * 3];
}
}
//-----------------------------------------------------------------------------
// _ctmCompressMesh_MG1() - Compress the mesh that is stored in the CTM
// context, and write it the the output stream in the CTM context.
//-----------------------------------------------------------------------------
int _ctmCompressMesh_MG1(_CTMcontext * self)
{
CTMuint * indices;
_CTMfloatmap * map;
CTMuint i;
#ifdef __DEBUG_
printf("COMPRESSION METHOD: MG1\n");
#endif
// Perpare (sort) indices
indices = (CTMuint *) malloc(sizeof(CTMuint) * self->mTriangleCount * 3);
if(!indices)
{
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
for(i = 0; i < self->mTriangleCount * 3; ++ i)
indices[i] = self->mIndices[i];
_ctmReArrangeTriangles(self, indices);
// Calculate index deltas (entropy-reduction)
_ctmMakeIndexDeltas(self, indices);
// Write triangle indices
#ifdef __DEBUG_
printf("Inidices: ");
#endif
_ctmStreamWrite(self, (void *) "INDX", 4);
if(!_ctmStreamWritePackedInts(self, (CTMint *) indices, self->mTriangleCount, 3, CTM_FALSE))
{
free((void *) indices);
return CTM_FALSE;
}
// Free temporary resources
free((void *) indices);
// Write vertices
#ifdef __DEBUG_
printf("Vertices: ");
#endif
_ctmStreamWrite(self, (void *) "VERT", 4);
if(!_ctmStreamWritePackedFloats(self, self->mVertices, self->mVertexCount * 3, 1))
{
free((void *) indices);
return CTM_FALSE;
}
// Write normals
if(self->mNormals)
{
#ifdef __DEBUG_
printf("Normals: ");
#endif
_ctmStreamWrite(self, (void *) "NORM", 4);
if(!_ctmStreamWritePackedFloats(self, self->mNormals, self->mVertexCount, 3))
return CTM_FALSE;
}
// Write UV maps
map = self->mUVMaps;
while(map)
{
#ifdef __DEBUG_
printf("UV coordinates (%s): ", map->mName ? map->mName : "no name");
#endif
_ctmStreamWrite(self, (void *) "TEXC", 4);
_ctmStreamWriteSTRING(self, map->mName);
_ctmStreamWriteSTRING(self, map->mFileName);
if(!_ctmStreamWritePackedFloats(self, map->mValues, self->mVertexCount, 2))
return CTM_FALSE;
map = map->mNext;
}
// Write attribute maps
map = self->mAttribMaps;
while(map)
{
#ifdef __DEBUG_
printf("Vertex attributes (%s): ", map->mName ? map->mName : "no name");
#endif
_ctmStreamWrite(self, (void *) "ATTR", 4);
_ctmStreamWriteSTRING(self, map->mName);
if(!_ctmStreamWritePackedFloats(self, map->mValues, self->mVertexCount, 4))
return CTM_FALSE;
map = map->mNext;
}
return CTM_TRUE;
}
//-----------------------------------------------------------------------------
// _ctmUncompressMesh_MG1() - Uncmpress the mesh from the input stream in the
// CTM context, and store the resulting mesh in the CTM context.
//-----------------------------------------------------------------------------
int _ctmUncompressMesh_MG1(_CTMcontext * self)
{
CTMuint * indices;
_CTMfloatmap * map;
CTMuint i;
// Allocate memory for the indices
indices = (CTMuint *) malloc(sizeof(CTMuint) * self->mTriangleCount * 3);
if(!indices)
{
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
// Read triangle indices
if(_ctmStreamReadUINT(self) != FOURCC("INDX"))
{
self->mError = CTM_BAD_FORMAT;
free(indices);
return CTM_FALSE;
}
if(!_ctmStreamReadPackedInts(self, (CTMint *) indices, self->mTriangleCount, 3, CTM_FALSE))
return CTM_FALSE;
// Restore indices
_ctmRestoreIndices(self, indices);
for(i = 0; i < self->mTriangleCount * 3; ++ i)
self->mIndices[i] = indices[i];
// Free temporary resources
free(indices);
// Read vertices
if(_ctmStreamReadUINT(self) != FOURCC("VERT"))
{
self->mError = CTM_BAD_FORMAT;
return CTM_FALSE;
}
if(!_ctmStreamReadPackedFloats(self, self->mVertices, self->mVertexCount * 3, 1))
return CTM_FALSE;
// Read normals
if(self->mNormals)
{
if(_ctmStreamReadUINT(self) != FOURCC("NORM"))
{
self->mError = CTM_BAD_FORMAT;
return CTM_FALSE;
}
if(!_ctmStreamReadPackedFloats(self, self->mNormals, self->mVertexCount, 3))
return CTM_FALSE;
}
// Read UV maps
map = self->mUVMaps;
while(map)
{
if(_ctmStreamReadUINT(self) != FOURCC("TEXC"))
{
self->mError = CTM_BAD_FORMAT;
return 0;
}
_ctmStreamReadSTRING(self, &map->mName);
_ctmStreamReadSTRING(self, &map->mFileName);
if(!_ctmStreamReadPackedFloats(self, map->mValues, self->mVertexCount, 2))
return CTM_FALSE;
map = map->mNext;
}
// Read vertex attribute maps
map = self->mAttribMaps;
while(map)
{
if(_ctmStreamReadUINT(self) != FOURCC("ATTR"))
{
self->mError = CTM_BAD_FORMAT;
return 0;
}
_ctmStreamReadSTRING(self, &map->mName);
if(!_ctmStreamReadPackedFloats(self, map->mValues, self->mVertexCount, 4))
return CTM_FALSE;
map = map->mNext;
}
return CTM_TRUE;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,181 +0,0 @@
//-----------------------------------------------------------------------------
// Product: OpenCTM
// File: compressRAW.c
// Description: Implementation of the RAW compression method.
//-----------------------------------------------------------------------------
// Copyright (c) 2009-2010 Marcus Geelnard
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//-----------------------------------------------------------------------------
#include "openctm.h"
#include "internal.h"
#ifdef __DEBUG_
#include <stdio.h>
#endif
//-----------------------------------------------------------------------------
// _ctmCompressMesh_RAW() - Compress the mesh that is stored in the CTM
// context using the RAW method, and write it the the output stream in the CTM
// context.
//-----------------------------------------------------------------------------
int _ctmCompressMesh_RAW(_CTMcontext * self)
{
CTMuint i;
_CTMfloatmap * map;
#ifdef __DEBUG_
printf("COMPRESSION METHOD: RAW\n");
#endif
// Write triangle indices
#ifdef __DEBUG_
printf("Inidices: %d bytes\n", (CTMuint)(self->mTriangleCount * 3 * sizeof(CTMuint)));
#endif
_ctmStreamWrite(self, (void *) "INDX", 4);
for(i = 0; i < self->mTriangleCount * 3; ++ i)
_ctmStreamWriteUINT(self, self->mIndices[i]);
// Write vertices
#ifdef __DEBUG_
printf("Vertices: %d bytes\n", (CTMuint)(self->mVertexCount * 3 * sizeof(CTMfloat)));
#endif
_ctmStreamWrite(self, (void *) "VERT", 4);
for(i = 0; i < self->mVertexCount * 3; ++ i)
_ctmStreamWriteFLOAT(self, self->mVertices[i]);
// Write normals
if(self->mNormals)
{
#ifdef __DEBUG_
printf("Normals: %d bytes\n", (CTMuint)(self->mVertexCount * 3 * sizeof(CTMfloat)));
#endif
_ctmStreamWrite(self, (void *) "NORM", 4);
for(i = 0; i < self->mVertexCount * 3; ++ i)
_ctmStreamWriteFLOAT(self, self->mNormals[i]);
}
// Write UV maps
map = self->mUVMaps;
while(map)
{
#ifdef __DEBUG_
printf("UV coordinates (%s): %d bytes\n", map->mName ? map->mName : "no name", (CTMuint)(self->mVertexCount * 2 * sizeof(CTMfloat)));
#endif
_ctmStreamWrite(self, (void *) "TEXC", 4);
_ctmStreamWriteSTRING(self, map->mName);
_ctmStreamWriteSTRING(self, map->mFileName);
for(i = 0; i < self->mVertexCount * 2; ++ i)
_ctmStreamWriteFLOAT(self, map->mValues[i]);
map = map->mNext;
}
// Write attribute maps
map = self->mAttribMaps;
while(map)
{
#ifdef __DEBUG_
printf("Vertex attributes (%s): %d bytes\n", map->mName ? map->mName : "no name", (CTMuint)(self->mVertexCount * 4 * sizeof(CTMfloat)));
#endif
_ctmStreamWrite(self, (void *) "ATTR", 4);
_ctmStreamWriteSTRING(self, map->mName);
for(i = 0; i < self->mVertexCount * 4; ++ i)
_ctmStreamWriteFLOAT(self, map->mValues[i]);
map = map->mNext;
}
return 1;
}
//-----------------------------------------------------------------------------
// _ctmUncompressMesh_RAW() - Uncmpress the mesh from the input stream in the
// CTM context using the RAW method, and store the resulting mesh in the CTM
// context.
//-----------------------------------------------------------------------------
int _ctmUncompressMesh_RAW(_CTMcontext * self)
{
CTMuint i;
_CTMfloatmap * map;
// Read triangle indices
if(_ctmStreamReadUINT(self) != FOURCC("INDX"))
{
self->mError = CTM_BAD_FORMAT;
return 0;
}
for(i = 0; i < self->mTriangleCount * 3; ++ i)
self->mIndices[i] = _ctmStreamReadUINT(self);
// Read vertices
if(_ctmStreamReadUINT(self) != FOURCC("VERT"))
{
self->mError = CTM_BAD_FORMAT;
return 0;
}
for(i = 0; i < self->mVertexCount * 3; ++ i)
self->mVertices[i] = _ctmStreamReadFLOAT(self);
// Read normals
if(self->mNormals)
{
if(_ctmStreamReadUINT(self) != FOURCC("NORM"))
{
self->mError = CTM_BAD_FORMAT;
return 0;
}
for(i = 0; i < self->mVertexCount * 3; ++ i)
self->mNormals[i] = _ctmStreamReadFLOAT(self);
}
// Read UV maps
map = self->mUVMaps;
while(map)
{
if(_ctmStreamReadUINT(self) != FOURCC("TEXC"))
{
self->mError = CTM_BAD_FORMAT;
return 0;
}
_ctmStreamReadSTRING(self, &map->mName);
_ctmStreamReadSTRING(self, &map->mFileName);
for(i = 0; i < self->mVertexCount * 2; ++ i)
map->mValues[i] = _ctmStreamReadFLOAT(self);
map = map->mNext;
}
// Read attribute maps
map = self->mAttribMaps;
while(map)
{
if(_ctmStreamReadUINT(self) != FOURCC("ATTR"))
{
self->mError = CTM_BAD_FORMAT;
return 0;
}
_ctmStreamReadSTRING(self, &map->mName);
for(i = 0; i < self->mVertexCount * 4; ++ i)
map->mValues[i] = _ctmStreamReadFLOAT(self);
map = map->mNext;
}
return 1;
}

View File

@ -1,147 +0,0 @@
//-----------------------------------------------------------------------------
// Product: OpenCTM
// File: internal.h
// Description: Internal (private) declarations, types and function prototypes.
//-----------------------------------------------------------------------------
// Copyright (c) 2009-2010 Marcus Geelnard
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//-----------------------------------------------------------------------------
#ifndef __OPENCTM_INTERNAL_H_
#define __OPENCTM_INTERNAL_H_
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
// OpenCTM file format version (v5).
#define _CTM_FORMAT_VERSION 0x00000005
// Flags for the Mesh flags field of the file header
#define _CTM_HAS_NORMALS_BIT 0x00000001
//-----------------------------------------------------------------------------
// _CTMfloatmap - Internal representation of a floating point based vertex map
// (used for UV maps and attribute maps).
//-----------------------------------------------------------------------------
typedef struct _CTMfloatmap_struct _CTMfloatmap;
struct _CTMfloatmap_struct {
char * mName; // Unique name
char * mFileName; // File name reference (used only for UV maps)
CTMfloat mPrecision; // Precision for this map
CTMfloat * mValues; // Attribute/UV coordinate values (per vertex)
_CTMfloatmap * mNext; // Pointer to the next map in the list (linked list)
};
//-----------------------------------------------------------------------------
// _CTMcontext - Internal CTM context structure.
//-----------------------------------------------------------------------------
typedef struct {
// Context mode (import or export)
CTMenum mMode;
// Vertices
CTMfloat * mVertices;
CTMuint mVertexCount;
// Indices
CTMuint * mIndices;
CTMuint mTriangleCount;
// Normals (optional)
CTMfloat * mNormals;
// Multiple sets of UV coordinate maps (optional)
CTMuint mUVMapCount;
_CTMfloatmap * mUVMaps;
// Multiple sets of custom vertex attribute maps (optional)
CTMuint mAttribMapCount;
_CTMfloatmap * mAttribMaps;
// Last error code
CTMenum mError;
// The selected compression method
CTMenum mMethod;
// The selected compression level
CTMuint mCompressionLevel;
// Vertex coordinate precision
CTMfloat mVertexPrecision;
// Normal precision (angular + magnitude)
CTMfloat mNormalPrecision;
// File comment
char * mFileComment;
// Read() function pointer
CTMreadfn mReadFn;
// Write() function pointer
CTMwritefn mWriteFn;
// User data (for stream read/write - usually the stream handle)
void * mUserData;
} _CTMcontext;
//-----------------------------------------------------------------------------
// Macros
//-----------------------------------------------------------------------------
#define FOURCC(str) (((CTMuint) str[0]) | (((CTMuint) str[1]) << 8) | \
(((CTMuint) str[2]) << 16) | (((CTMuint) str[3]) << 24))
//-----------------------------------------------------------------------------
// Funcion prototypes for stream.c
//-----------------------------------------------------------------------------
CTMuint _ctmStreamRead(_CTMcontext * self, void * aBuf, CTMuint aCount);
CTMuint _ctmStreamWrite(_CTMcontext * self, void * aBuf, CTMuint aCount);
CTMuint _ctmStreamReadUINT(_CTMcontext * self);
void _ctmStreamWriteUINT(_CTMcontext * self, CTMuint aValue);
CTMfloat _ctmStreamReadFLOAT(_CTMcontext * self);
void _ctmStreamWriteFLOAT(_CTMcontext * self, CTMfloat aValue);
void _ctmStreamReadSTRING(_CTMcontext * self, char ** aValue);
void _ctmStreamWriteSTRING(_CTMcontext * self, const char * aValue);
int _ctmStreamReadPackedInts(_CTMcontext * self, CTMint * aData, CTMuint aCount, CTMuint aSize, CTMint aSignedInts);
int _ctmStreamWritePackedInts(_CTMcontext * self, CTMint * aData, CTMuint aCount, CTMuint aSize, CTMint aSignedInts);
int _ctmStreamReadPackedFloats(_CTMcontext * self, CTMfloat * aData, CTMuint aCount, CTMuint aSize);
int _ctmStreamWritePackedFloats(_CTMcontext * self, CTMfloat * aData, CTMuint aCount, CTMuint aSize);
//-----------------------------------------------------------------------------
// Funcion prototypes for compressRAW.c
//-----------------------------------------------------------------------------
int _ctmCompressMesh_RAW(_CTMcontext * self);
int _ctmUncompressMesh_RAW(_CTMcontext * self);
//-----------------------------------------------------------------------------
// Funcion prototypes for compressMG1.c
//-----------------------------------------------------------------------------
int _ctmCompressMesh_MG1(_CTMcontext * self);
int _ctmUncompressMesh_MG1(_CTMcontext * self);
//-----------------------------------------------------------------------------
// Funcion prototypes for compressMG2.c
//-----------------------------------------------------------------------------
int _ctmCompressMesh_MG2(_CTMcontext * self);
int _ctmUncompressMesh_MG2(_CTMcontext * self);
#endif // __OPENCTM_INTERNAL_H_

View File

@ -1,127 +0,0 @@
/* Alloc.c -- Memory allocation functions
2008-09-24
Igor Pavlov
Public domain */
#ifdef _WIN32
#include <windows.h>
#endif
#include <stdlib.h>
#include "Alloc.h"
/* #define _SZ_ALLOC_DEBUG */
/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
#ifdef _SZ_ALLOC_DEBUG
#include <stdio.h>
int g_allocCount = 0;
int g_allocCountMid = 0;
int g_allocCountBig = 0;
#endif
void *MyAlloc(size_t size)
{
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
{
void *p = malloc(size);
fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
return p;
}
#else
return malloc(size);
#endif
}
void MyFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
#endif
free(address);
}
#ifdef _WIN32
void *MidAlloc(size_t size)
{
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++);
#endif
return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
}
void MidFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid);
#endif
if (address == 0)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#ifndef MEM_LARGE_PAGES
#undef _7ZIP_LARGE_PAGES
#endif
#ifdef _7ZIP_LARGE_PAGES
SIZE_T g_LargePageSize = 0;
typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
#endif
void SetLargePageSize()
{
#ifdef _7ZIP_LARGE_PAGES
SIZE_T size = 0;
GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
if (largePageMinimum == 0)
return;
size = largePageMinimum();
if (size == 0 || (size & (size - 1)) != 0)
return;
g_LargePageSize = size;
#endif
}
void *BigAlloc(size_t size)
{
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++);
#endif
#ifdef _7ZIP_LARGE_PAGES
if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18))
{
void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
if (res != 0)
return res;
}
#endif
return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
}
void BigFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig);
#endif
if (address == 0)
return;
VirtualFree(address, 0, MEM_RELEASE);
}
#endif

View File

@ -1,34 +0,0 @@
/* Alloc.h -- Memory allocation functions
2008-03-13
Igor Pavlov
Public domain */
#ifndef __COMMON_ALLOC_H
#define __COMMON_ALLOC_H
#include <stddef.h>
#include "NameMangle.h"
void *MyAlloc(size_t size);
void MyFree(void *address);
#ifdef _WIN32
void SetLargePageSize();
void *MidAlloc(size_t size);
void MidFree(void *address);
void *BigAlloc(size_t size);
void BigFree(void *address);
#else
#define MidAlloc(size) MyAlloc(size)
#define MidFree(address) MyFree(address)
#define BigAlloc(size) MyAlloc(size)
#define BigFree(address) MyFree(address)
#endif
#endif

View File

@ -1,751 +0,0 @@
/* LzFind.c -- Match finder for LZ algorithms
2008-10-04 : Igor Pavlov : Public domain */
#include <string.h>
#include "LzFind.h"
#include "LzHash.h"
#define kEmptyHashValue 0
#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
#define kNormalizeMask (~(kNormalizeStepMin - 1))
#define kMaxHistorySize ((UInt32)3 << 30)
#define kStartMaxLen 3
static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc)
{
if (!p->directInput)
{
alloc->Free(alloc, p->bufferBase);
p->bufferBase = 0;
}
}
/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc)
{
UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
if (p->directInput)
{
p->blockSize = blockSize;
return 1;
}
if (p->bufferBase == 0 || p->blockSize != blockSize)
{
LzInWindow_Free(p, alloc);
p->blockSize = blockSize;
p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize);
}
return (p->bufferBase != 0);
}
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; }
UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
{
p->posLimit -= subValue;
p->pos -= subValue;
p->streamPos -= subValue;
}
static void MatchFinder_ReadBlock(CMatchFinder *p)
{
if (p->streamEndWasReached || p->result != SZ_OK)
return;
for (;;)
{
Byte *dest = p->buffer + (p->streamPos - p->pos);
size_t size = (p->bufferBase + p->blockSize - dest);
if (size == 0)
return;
p->result = p->stream->Read(p->stream, dest, &size);
if (p->result != SZ_OK)
return;
if (size == 0)
{
p->streamEndWasReached = 1;
return;
}
p->streamPos += (UInt32)size;
if (p->streamPos - p->pos > p->keepSizeAfter)
return;
}
}
void MatchFinder_MoveBlock(CMatchFinder *p)
{
memmove(p->bufferBase,
p->buffer - p->keepSizeBefore,
(size_t)(p->streamPos - p->pos + p->keepSizeBefore));
p->buffer = p->bufferBase + p->keepSizeBefore;
}
int MatchFinder_NeedMove(CMatchFinder *p)
{
/* if (p->streamEndWasReached) return 0; */
return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
}
void MatchFinder_ReadIfRequired(CMatchFinder *p)
{
if (p->streamEndWasReached)
return;
if (p->keepSizeAfter >= p->streamPos - p->pos)
MatchFinder_ReadBlock(p);
}
static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
{
if (MatchFinder_NeedMove(p))
MatchFinder_MoveBlock(p);
MatchFinder_ReadBlock(p);
}
static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
{
p->cutValue = 32;
p->btMode = 1;
p->numHashBytes = 4;
/* p->skipModeBits = 0; */
p->directInput = 0;
p->bigHash = 0;
}
#define kCrcPoly 0xEDB88320
void MatchFinder_Construct(CMatchFinder *p)
{
UInt32 i;
p->bufferBase = 0;
p->directInput = 0;
p->hash = 0;
MatchFinder_SetDefaultSettings(p);
for (i = 0; i < 256; i++)
{
UInt32 r = i;
int j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
p->crc[i] = r;
}
}
static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc)
{
alloc->Free(alloc, p->hash);
p->hash = 0;
}
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc)
{
MatchFinder_FreeThisClassMemory(p, alloc);
LzInWindow_Free(p, alloc);
}
static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc)
{
size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
if (sizeInBytes / sizeof(CLzRef) != num)
return 0;
return (CLzRef *)alloc->Alloc(alloc, sizeInBytes);
}
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAlloc *alloc)
{
UInt32 sizeReserv;
if (historySize > kMaxHistorySize)
{
MatchFinder_Free(p, alloc);
return 0;
}
sizeReserv = historySize >> 1;
if (historySize > ((UInt32)2 << 30))
sizeReserv = historySize >> 2;
sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;
/* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */
if (LzInWindow_Create(p, sizeReserv, alloc))
{
UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1;
UInt32 hs;
p->matchMaxLen = matchMaxLen;
{
p->fixedHashSize = 0;
if (p->numHashBytes == 2)
hs = (1 << 16) - 1;
else
{
hs = historySize - 1;
hs |= (hs >> 1);
hs |= (hs >> 2);
hs |= (hs >> 4);
hs |= (hs >> 8);
hs >>= 1;
/* hs >>= p->skipModeBits; */
hs |= 0xFFFF; /* don't change it! It's required for Deflate */
if (hs > (1 << 24))
{
if (p->numHashBytes == 3)
hs = (1 << 24) - 1;
else
hs >>= 1;
}
}
p->hashMask = hs;
hs++;
if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;
if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;
if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;
hs += p->fixedHashSize;
}
{
UInt32 prevSize = p->hashSizeSum + p->numSons;
UInt32 newSize;
p->historySize = historySize;
p->hashSizeSum = hs;
p->cyclicBufferSize = newCyclicBufferSize;
p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize);
newSize = p->hashSizeSum + p->numSons;
if (p->hash != 0 && prevSize == newSize)
return 1;
MatchFinder_FreeThisClassMemory(p, alloc);
p->hash = AllocRefs(newSize, alloc);
if (p->hash != 0)
{
p->son = p->hash + p->hashSizeSum;
return 1;
}
}
}
MatchFinder_Free(p, alloc);
return 0;
}
static void MatchFinder_SetLimits(CMatchFinder *p)
{
UInt32 limit = kMaxValForNormalize - p->pos;
UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
if (limit2 < limit)
limit = limit2;
limit2 = p->streamPos - p->pos;
if (limit2 <= p->keepSizeAfter)
{
if (limit2 > 0)
limit2 = 1;
}
else
limit2 -= p->keepSizeAfter;
if (limit2 < limit)
limit = limit2;
{
UInt32 lenLimit = p->streamPos - p->pos;
if (lenLimit > p->matchMaxLen)
lenLimit = p->matchMaxLen;
p->lenLimit = lenLimit;
}
p->posLimit = p->pos + limit;
}
void MatchFinder_Init(CMatchFinder *p)
{
UInt32 i;
for (i = 0; i < p->hashSizeSum; i++)
p->hash[i] = kEmptyHashValue;
p->cyclicBufferPos = 0;
p->buffer = p->bufferBase;
p->pos = p->streamPos = p->cyclicBufferSize;
p->result = SZ_OK;
p->streamEndWasReached = 0;
MatchFinder_ReadBlock(p);
MatchFinder_SetLimits(p);
}
static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
{
return (p->pos - p->historySize - 1) & kNormalizeMask;
}
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems)
{
UInt32 i;
for (i = 0; i < numItems; i++)
{
UInt32 value = items[i];
if (value <= subValue)
value = kEmptyHashValue;
else
value -= subValue;
items[i] = value;
}
}
static void MatchFinder_Normalize(CMatchFinder *p)
{
UInt32 subValue = MatchFinder_GetSubValue(p);
MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons);
MatchFinder_ReduceOffsets(p, subValue);
}
static void MatchFinder_CheckLimits(CMatchFinder *p)
{
if (p->pos == kMaxValForNormalize)
MatchFinder_Normalize(p);
if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
MatchFinder_CheckAndMoveAndRead(p);
if (p->cyclicBufferPos == p->cyclicBufferSize)
p->cyclicBufferPos = 0;
MatchFinder_SetLimits(p);
}
static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, UInt32 maxLen)
{
son[_cyclicBufferPos] = curMatch;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
return distances;
{
const Byte *pb = cur - delta;
curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
if (pb[maxLen] == cur[maxLen] && *pb == *cur)
{
UInt32 len = 0;
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
{
*distances++ = maxLen = len;
*distances++ = delta - 1;
if (len == lenLimit)
return distances;
}
}
}
}
}
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
UInt32 *distances, UInt32 maxLen)
{
CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
UInt32 len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
return distances;
}
{
CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
const Byte *pb = cur - delta;
UInt32 len = (len0 < len1 ? len0 : len1);
if (pb[len] == cur[len])
{
if (++len != lenLimit && pb[len] == cur[len])
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
if (maxLen < len)
{
*distances++ = maxLen = len;
*distances++ = delta - 1;
if (len == lenLimit)
{
*ptr1 = pair[0];
*ptr0 = pair[1];
return distances;
}
}
}
if (pb[len] < cur[len])
{
*ptr1 = curMatch;
ptr1 = pair + 1;
curMatch = *ptr1;
len1 = len;
}
else
{
*ptr0 = curMatch;
ptr0 = pair;
curMatch = *ptr0;
len0 = len;
}
}
}
}
static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
{
CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
UInt32 len0 = 0, len1 = 0;
for (;;)
{
UInt32 delta = pos - curMatch;
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
{
*ptr0 = *ptr1 = kEmptyHashValue;
return;
}
{
CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
const Byte *pb = cur - delta;
UInt32 len = (len0 < len1 ? len0 : len1);
if (pb[len] == cur[len])
{
while (++len != lenLimit)
if (pb[len] != cur[len])
break;
{
if (len == lenLimit)
{
*ptr1 = pair[0];
*ptr0 = pair[1];
return;
}
}
}
if (pb[len] < cur[len])
{
*ptr1 = curMatch;
ptr1 = pair + 1;
curMatch = *ptr1;
len1 = len;
}
else
{
*ptr0 = curMatch;
ptr0 = pair;
curMatch = *ptr0;
len0 = len;
}
}
}
}
#define MOVE_POS \
++p->cyclicBufferPos; \
p->buffer++; \
if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
#define MOVE_POS_RET MOVE_POS return offset;
static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
#define GET_MATCHES_HEADER2(minLen, ret_op) \
UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \
lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
cur = p->buffer;
#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)
#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue)
#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
#define GET_MATCHES_FOOTER(offset, maxLen) \
offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \
distances + offset, maxLen) - distances); MOVE_POS_RET;
#define SKIP_FOOTER \
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 offset;
GET_MATCHES_HEADER(2)
HASH2_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
offset = 0;
GET_MATCHES_FOOTER(offset, 1)
}
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 offset;
GET_MATCHES_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
offset = 0;
GET_MATCHES_FOOTER(offset, 2)
}
static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 hash2Value, delta2, maxLen, offset;
GET_MATCHES_HEADER(3)
HASH3_CALC;
delta2 = p->pos - p->hash[hash2Value];
curMatch = p->hash[kFix3HashSize + hashValue];
p->hash[hash2Value] =
p->hash[kFix3HashSize + hashValue] = p->pos;
maxLen = 2;
offset = 0;
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
{
for (; maxLen != lenLimit; maxLen++)
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
break;
distances[0] = maxLen;
distances[1] = delta2 - 1;
offset = 2;
if (maxLen == lenLimit)
{
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
GET_MATCHES_FOOTER(offset, maxLen)
}
static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
GET_MATCHES_HEADER(4)
HASH4_CALC;
delta2 = p->pos - p->hash[ hash2Value];
delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] =
p->hash[kFix4HashSize + hashValue] = p->pos;
maxLen = 1;
offset = 0;
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
{
distances[0] = maxLen = 2;
distances[1] = delta2 - 1;
offset = 2;
}
if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
{
maxLen = 3;
distances[offset + 1] = delta3 - 1;
offset += 2;
delta2 = delta3;
}
if (offset != 0)
{
for (; maxLen != lenLimit; maxLen++)
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
break;
distances[offset - 2] = maxLen;
if (maxLen == lenLimit)
{
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
MOVE_POS_RET;
}
}
if (maxLen < 3)
maxLen = 3;
GET_MATCHES_FOOTER(offset, maxLen)
}
static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
GET_MATCHES_HEADER(4)
HASH4_CALC;
delta2 = p->pos - p->hash[ hash2Value];
delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] =
p->hash[kFix4HashSize + hashValue] = p->pos;
maxLen = 1;
offset = 0;
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
{
distances[0] = maxLen = 2;
distances[1] = delta2 - 1;
offset = 2;
}
if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
{
maxLen = 3;
distances[offset + 1] = delta3 - 1;
offset += 2;
delta2 = delta3;
}
if (offset != 0)
{
for (; maxLen != lenLimit; maxLen++)
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
break;
distances[offset - 2] = maxLen;
if (maxLen == lenLimit)
{
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS_RET;
}
}
if (maxLen < 3)
maxLen = 3;
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances + offset, maxLen) - (distances));
MOVE_POS_RET
}
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
{
UInt32 offset;
GET_MATCHES_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
distances, 2) - (distances));
MOVE_POS_RET
}
static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(2)
HASH2_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 hash2Value;
SKIP_HEADER(3)
HASH3_CALC;
curMatch = p->hash[kFix3HashSize + hashValue];
p->hash[hash2Value] =
p->hash[kFix3HashSize + hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 hash2Value, hash3Value;
SKIP_HEADER(4)
HASH4_CALC;
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] = p->pos;
p->hash[kFix4HashSize + hashValue] = p->pos;
SKIP_FOOTER
}
while (--num != 0);
}
static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
UInt32 hash2Value, hash3Value;
SKIP_HEADER(4)
HASH4_CALC;
curMatch = p->hash[kFix4HashSize + hashValue];
p->hash[ hash2Value] =
p->hash[kFix3HashSize + hash3Value] =
p->hash[kFix4HashSize + hashValue] = p->pos;
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS
}
while (--num != 0);
}
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
{
do
{
SKIP_HEADER(3)
HASH_ZIP_CALC;
curMatch = p->hash[hashValue];
p->hash[hashValue] = p->pos;
p->son[p->cyclicBufferPos] = curMatch;
MOVE_POS
}
while (--num != 0);
}
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
{
vTable->Init = (Mf_Init_Func)MatchFinder_Init;
vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte;
vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
if (!p->btMode)
{
vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
}
else if (p->numHashBytes == 2)
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
}
else if (p->numHashBytes == 3)
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
}
else
{
vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
}
}

View File

@ -1,107 +0,0 @@
/* LzFind.h -- Match finder for LZ algorithms
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZFIND_H
#define __LZFIND_H
#include "Types.h"
typedef UInt32 CLzRef;
typedef struct _CMatchFinder
{
Byte *buffer;
UInt32 pos;
UInt32 posLimit;
UInt32 streamPos;
UInt32 lenLimit;
UInt32 cyclicBufferPos;
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
UInt32 matchMaxLen;
CLzRef *hash;
CLzRef *son;
UInt32 hashMask;
UInt32 cutValue;
Byte *bufferBase;
ISeqInStream *stream;
int streamEndWasReached;
UInt32 blockSize;
UInt32 keepSizeBefore;
UInt32 keepSizeAfter;
UInt32 numHashBytes;
int directInput;
int btMode;
/* int skipModeBits; */
int bigHash;
UInt32 historySize;
UInt32 fixedHashSize;
UInt32 hashSizeSum;
UInt32 numSons;
SRes result;
UInt32 crc[256];
} CMatchFinder;
#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)])
#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
int MatchFinder_NeedMove(CMatchFinder *p);
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
void MatchFinder_MoveBlock(CMatchFinder *p);
void MatchFinder_ReadIfRequired(CMatchFinder *p);
void MatchFinder_Construct(CMatchFinder *p);
/* Conditions:
historySize <= 3 GB
keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
*/
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
ISzAlloc *alloc);
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
UInt32 *distances, UInt32 maxLen);
/*
Conditions:
Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
*/
typedef void (*Mf_Init_Func)(void *object);
typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
typedef void (*Mf_Skip_Func)(void *object, UInt32);
typedef struct _IMatchFinder
{
Mf_Init_Func Init;
Mf_GetIndexByte_Func GetIndexByte;
Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
Mf_GetMatches_Func GetMatches;
Mf_Skip_Func Skip;
} IMatchFinder;
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
void MatchFinder_Init(CMatchFinder *p);
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
#endif

View File

@ -1,54 +0,0 @@
/* LzHash.h -- HASH functions for LZ algorithms
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZHASH_H
#define __LZHASH_H
#define kHash2Size (1 << 10)
#define kHash3Size (1 << 16)
#define kHash4Size (1 << 20)
#define kFix3HashSize (kHash2Size)
#define kFix4HashSize (kHash2Size + kHash3Size)
#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8);
#define HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
#define HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
#define HASH5_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \
hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \
hash4Value &= (kHash4Size - 1); }
/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
#define MT_HASH2_CALC \
hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
#define MT_HASH3_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
#define MT_HASH4_CALC { \
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
hash2Value = temp & (kHash2Size - 1); \
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,223 +0,0 @@
/* LzmaDec.h -- LZMA Decoder
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZMADEC_H
#define __LZMADEC_H
#include "Types.h"
/* #define _LZMA_PROB32 */
/* _LZMA_PROB32 can increase the speed on some CPUs,
but memory usage for CLzmaDec::probs will be doubled in that case */
#ifdef _LZMA_PROB32
#define CLzmaProb UInt32
#else
#define CLzmaProb UInt16
#endif
/* ---------- LZMA Properties ---------- */
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaProps
{
unsigned lc, lp, pb;
UInt32 dicSize;
} CLzmaProps;
/* LzmaProps_Decode - decodes properties
Returns:
SZ_OK
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
/* ---------- LZMA Decoder state ---------- */
/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
#define LZMA_REQUIRED_INPUT_MAX 20
typedef struct
{
CLzmaProps prop;
CLzmaProb *probs;
Byte *dic;
const Byte *buf;
UInt32 range, code;
SizeT dicPos;
SizeT dicBufSize;
UInt32 processedPos;
UInt32 checkDicSize;
unsigned state;
UInt32 reps[4];
unsigned remainLen;
int needFlush;
int needInitState;
UInt32 numProbs;
unsigned tempBufSize;
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
} CLzmaDec;
#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
void LzmaDec_Init(CLzmaDec *p);
/* There are two types of LZMA streams:
0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
typedef enum
{
LZMA_FINISH_ANY, /* finish at any point */
LZMA_FINISH_END /* block must be finished at the end */
} ELzmaFinishMode;
/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
You must use LZMA_FINISH_END, when you know that current output buffer
covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
and output value of destLen will be less than output buffer size limit.
You can check status result also.
You can use multiple checks to test data integrity after full decompression:
1) Check Result and "status" variable.
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
You must use correct finish mode in that case. */
typedef enum
{
LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
} ELzmaStatus;
/* ELzmaStatus is used only as output value for function call */
/* ---------- Interfaces ---------- */
/* There are 3 levels of interfaces:
1) Dictionary Interface
2) Buffer Interface
3) One Call Interface
You can select any of these interfaces, but don't mix functions from different
groups for same object. */
/* There are two variants to allocate state for Dictionary Interface:
1) LzmaDec_Allocate / LzmaDec_Free
2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
You can use variant 2, if you set dictionary buffer manually.
For Buffer Interface you must always use variant 1.
LzmaDec_Allocate* can return:
SZ_OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
/* ---------- Dictionary Interface ---------- */
/* You can use it, if you want to eliminate the overhead for data copying from
dictionary to some other external buffer.
You must work with CLzmaDec variables directly in this interface.
STEPS:
LzmaDec_Constr()
LzmaDec_Allocate()
for (each new stream)
{
LzmaDec_Init()
while (it needs more decompression)
{
LzmaDec_DecodeToDic()
use data from CLzmaDec::dic and update CLzmaDec::dicPos
}
}
LzmaDec_Free()
*/
/* LzmaDec_DecodeToDic
The decoding to internal dictionary buffer (CLzmaDec::dic).
You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
finishMode:
It has meaning only if the decoding reaches output limit (dicLimit).
LZMA_FINISH_ANY - Decode just dicLimit bytes.
LZMA_FINISH_END - Stream must be finished after dicLimit.
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_NEEDS_MORE_INPUT
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
*/
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- Buffer Interface ---------- */
/* It's zlib-like interface.
See LzmaDec_DecodeToDic description for information about STEPS and return results,
but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
to work with CLzmaDec variables manually.
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
*/
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- One Call Interface ---------- */
/* LzmaDecode
finishMode:
It has meaning only if the decoding reaches output limit (*destLen).
LZMA_FINISH_ANY - Decode just destLen bytes.
LZMA_FINISH_END - Stream must be finished after (*destLen).
Returns:
SZ_OK
status:
LZMA_STATUS_FINISHED_WITH_MARK
LZMA_STATUS_NOT_FINISHED
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
*/
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAlloc *alloc);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,72 +0,0 @@
/* LzmaEnc.h -- LZMA Encoder
2008-10-04 : Igor Pavlov : Public domain */
#ifndef __LZMAENC_H
#define __LZMAENC_H
#include "Types.h"
#define LZMA_PROPS_SIZE 5
typedef struct _CLzmaEncProps
{
int level; /* 0 <= level <= 9 */
UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
(1 << 12) <= dictSize <= (1 << 30) for 64-bit version
default = (1 << 24) */
int lc; /* 0 <= lc <= 8, default = 3 */
int lp; /* 0 <= lp <= 4, default = 0 */
int pb; /* 0 <= pb <= 4, default = 2 */
int algo; /* 0 - fast, 1 - normal, default = 1 */
int fb; /* 5 <= fb <= 273, default = 32 */
int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
int numHashBytes; /* 2, 3 or 4, default = 4 */
UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
int numThreads; /* 1 or 2, default = 2 */
} CLzmaEncProps;
void LzmaEncProps_Init(CLzmaEncProps *p);
void LzmaEncProps_Normalize(CLzmaEncProps *p);
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
/* ---------- CLzmaEncHandle Interface ---------- */
/* LzmaEnc_* functions can return the following exit codes:
Returns:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater in props
SZ_ERROR_WRITE - Write callback error.
SZ_ERROR_PROGRESS - some break from progress callback
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
typedef void * CLzmaEncHandle;
CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
/* ---------- One Call Interface ---------- */
/* LzmaEncode
Return code:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
#endif

View File

@ -1,48 +0,0 @@
/* LzmaLib.c -- LZMA library wrapper
2008-08-05
Igor Pavlov
Public domain */
#include "LzmaEnc.h"
#include "LzmaDec.h"
#include "Alloc.h"
#include "LzmaLib.h"
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
static ISzAlloc g_Alloc = { SzAlloc, SzFree };
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize,
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads, /* 1 or 2, default = 2 */
int algo /* 0 = fast, 1 = normal */
)
{
CLzmaEncProps props;
LzmaEncProps_Init(&props);
props.level = level;
props.dictSize = dictSize;
props.lc = lc;
props.lp = lp;
props.pb = pb;
props.fb = fb;
props.numThreads = numThreads;
props.algo = algo;
return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,
NULL, &g_Alloc, &g_Alloc);
}
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen,
const unsigned char *props, size_t propsSize)
{
ELzmaStatus status;
return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);
}

View File

@ -1,136 +0,0 @@
/* LzmaLib.h -- LZMA library interface
2008-08-05
Igor Pavlov
Public domain */
#ifndef __LZMALIB_H
#define __LZMALIB_H
#include "Types.h"
#ifdef __cplusplus
#define MY_EXTERN_C extern "C"
#else
#define MY_EXTERN_C extern
#endif
#define MY_STDAPI MY_EXTERN_C int MY_STD_CALL
#define LZMA_PROPS_SIZE 5
/*
RAM requirements for LZMA:
for compression: (dictSize * 11.5 + 6 MB) + state_size
for decompression: dictSize + state_size
state_size = (4 + (1.5 << (lc + lp))) KB
by default (lc=3, lp=0), state_size = 16 KB.
LZMA properties (5 bytes) format
Offset Size Description
0 1 lc, lp and pb in encoded form.
1 4 dictSize (little endian).
*/
/*
LzmaCompress
------------
outPropsSize -
In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
LZMA Encoder will use defult values for any parameter, if it is
-1 for any from: level, loc, lp, pb, fb, numThreads
0 for dictSize
level - compression level: 0 <= level <= 9;
level dictSize algo fb
0: 16 KB 0 32
1: 64 KB 0 32
2: 256 KB 0 32
3: 1 MB 0 32
4: 4 MB 0 32
5: 16 MB 1 32
6: 32 MB 1 32
7+: 64 MB 1 64
The default value for "level" is 5.
algo = 0 means fast method
algo = 1 means normal method
dictSize - The dictionary size in bytes. The maximum value is
128 MB = (1 << 27) bytes for 32-bit version
1 GB = (1 << 30) bytes for 64-bit version
The default value is 16 MB = (1 << 24) bytes.
It's recommended to use the dictionary that is larger than 4 KB and
that can be calculated as (1 << N) or (3 << N) sizes.
lc - The number of literal context bits (high bits of previous literal).
It can be in the range from 0 to 8. The default value is 3.
Sometimes lc=4 gives the gain for big files.
lp - The number of literal pos bits (low bits of current position for literals).
It can be in the range from 0 to 4. The default value is 0.
The lp switch is intended for periodical data when the period is equal to 2^lp.
For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's
better to set lc=0, if you change lp switch.
pb - The number of pos bits (low bits of current position).
It can be in the range from 0 to 4. The default value is 2.
The pb switch is intended for periodical data when the period is equal 2^pb.
fb - Word size (the number of fast bytes).
It can be in the range from 5 to 273. The default value is 32.
Usually, a big number gives a little bit better compression ratio and
slower compression process.
numThreads - The number of thereads. 1 or 2. The default value is 2.
Fast mode (algo = 0) can use only 1 thread.
Out:
destLen - processed output size
Returns:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* default = (1 << 24) */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads, /* 1 or 2, default = 2 */
int algo /* 0 = fast, 1 = normal, default = 0 for level < 5, 1 for level >= 5 */
);
/*
LzmaUncompress
--------------
In:
dest - output data
destLen - output data size
src - input data
srcLen - input data size
Out:
destLen - processed output size
srcLen - processed input size
Returns:
SZ_OK - OK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation arror
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
*/
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,
const unsigned char *props, size_t propsSize);
#endif

View File

@ -1,84 +0,0 @@
/* NameMangle.h -- Name mangling to avoid linking conflicts
2009-04-15 : Marcus Geelnard : Public domain */
#ifndef __7Z_NAMEMANGLE_H
#define __7Z_NAMEMANGLE_H
#ifdef LZMA_PREFIX_CTM
/* Alloc.c */
#define MyAlloc _ctm_MyAlloc
#define MyFree _ctm_MyFree
#ifdef _WIN32
#define MidAlloc _ctm_MidAlloc
#define MidFree _ctm_MidFree
#define SetLargePageSize _ctm_SetLargePageSize
#define BigAlloc _ctm_BigAlloc
#define BigFree _ctm_BigFree
#endif /* _WIN32 */
/* LzFind.c */
#define MatchFinder_GetPointerToCurrentPos _ctm_MatchFinder_GetPointerToCurrentPos
#define MatchFinder_GetIndexByte _ctm_MatchFinder_GetIndexByte
#define MatchFinder_GetNumAvailableBytes _ctm_MatchFinder_GetNumAvailableBytes
#define MatchFinder_ReduceOffsets _ctm_MatchFinder_ReduceOffsets
#define MatchFinder_MoveBlock _ctm_MatchFinder_MoveBlock
#define MatchFinder_NeedMove _ctm_MatchFinder_NeedMove
#define MatchFinder_ReadIfRequired _ctm_MatchFinder_ReadIfRequired
#define MatchFinder_Construct _ctm_MatchFinder_Construct
#define MatchFinder_Free _ctm_MatchFinder_Free
#define MatchFinder_Create _ctm_MatchFinder_Create
#define MatchFinder_Init _ctm_MatchFinder_Init
#define MatchFinder_Normalize3 _ctm_MatchFinder_Normalize3
#define GetMatchesSpec1 _ctm_GetMatchesSpec1
#define Bt3Zip_MatchFinder_GetMatches _ctm_Bt3Zip_MatchFinder_GetMatches
#define Hc3Zip_MatchFinder_GetMatches _ctm_Hc3Zip_MatchFinder_GetMatches
#define Bt3Zip_MatchFinder_Skip _ctm_Bt3Zip_MatchFinder_Skip
#define Hc3Zip_MatchFinder_Skip _ctm_Hc3Zip_MatchFinder_Skip
#define MatchFinder_CreateVTable _ctm_MatchFinder_CreateVTable
/* LzmaDec.c */
#define LzmaDec_InitDicAndState _ctm_LzmaDec_InitDicAndState
#define LzmaDec_Init _ctm_LzmaDec_Init
#define LzmaDec_DecodeToDic _ctm_LzmaDec_DecodeToDic
#define LzmaDec_DecodeToBuf _ctm_LzmaDec_DecodeToBuf
#define LzmaDec_FreeProbs _ctm_LzmaDec_FreeProbs
#define LzmaDec_Free _ctm_LzmaDec_Free
#define LzmaProps_Decode _ctm_LzmaProps_Decode
#define LzmaDec_AllocateProbs _ctm_LzmaDec_AllocateProbs
#define LzmaDec_Allocate _ctm_LzmaDec_Allocate
#define LzmaDecode _ctm_LzmaDecode
/* LzmaEnc.c */
#define LzmaEncProps_Init _ctm_LzmaEncProps_Init
#define LzmaEncProps_Normalize _ctm_LzmaEncProps_Normalize
#define LzmaEncProps_GetDictSize _ctm_LzmaEncProps_GetDictSize
#define LzmaEnc_FastPosInit _ctm_LzmaEnc_FastPosInit
#define LzmaEnc_SaveState _ctm_LzmaEnc_SaveState
#define LzmaEnc_RestoreState _ctm_LzmaEnc_RestoreState
#define LzmaEnc_SetProps _ctm_LzmaEnc_SetProps
#define LzmaEnc_InitPriceTables _ctm_LzmaEnc_InitPriceTables
#define LzmaEnc_Construct _ctm_LzmaEnc_Construct
#define LzmaEnc_Create _ctm_LzmaEnc_Create
#define LzmaEnc_FreeLits _ctm_LzmaEnc_FreeLits
#define LzmaEnc_Destruct _ctm_LzmaEnc_Destruct
#define LzmaEnc_Destroy _ctm_LzmaEnc_Destroy
#define LzmaEnc_Init _ctm_LzmaEnc_Init
#define LzmaEnc_InitPrices _ctm_LzmaEnc_InitPrices
#define LzmaEnc_PrepareForLzma2 _ctm_LzmaEnc_PrepareForLzma2
#define LzmaEnc_MemPrepare _ctm_LzmaEnc_MemPrepare
#define LzmaEnc_Finish _ctm_LzmaEnc_Finish
#define LzmaEnc_GetNumAvailableBytes _ctm_LzmaEnc_GetNumAvailableBytes
#define LzmaEnc_GetCurBuf _ctm_LzmaEnc_GetCurBuf
#define LzmaEnc_CodeOneMemBlock _ctm_LzmaEnc_CodeOneMemBlock
#define LzmaEnc_Encode _ctm_LzmaEnc_Encode
#define LzmaEnc_WriteProperties _ctm_LzmaEnc_WriteProperties
#define LzmaEnc_MemEncode _ctm_LzmaEnc_MemEncode
/* LzmaLib.c */
#define LzmaCompress _ctm_LzmaCompress
#define LzmaUncompress _ctm_LzmaUncompress
#endif /* LZMA_PREFIX_CTM */
#endif /* __7Z_NAMEMANGLE_H */

View File

@ -1,210 +0,0 @@
/* Types.h -- Basic types
2008-11-23 : Igor Pavlov : Public domain */
#ifndef __7Z_TYPES_H
#define __7Z_TYPES_H
#include <stddef.h>
#ifdef _WIN32
#include <windows.h>
#endif
#include "NameMangle.h"
#define SZ_OK 0
#define SZ_ERROR_DATA 1
#define SZ_ERROR_MEM 2
#define SZ_ERROR_CRC 3
#define SZ_ERROR_UNSUPPORTED 4
#define SZ_ERROR_PARAM 5
#define SZ_ERROR_INPUT_EOF 6
#define SZ_ERROR_OUTPUT_EOF 7
#define SZ_ERROR_READ 8
#define SZ_ERROR_WRITE 9
#define SZ_ERROR_PROGRESS 10
#define SZ_ERROR_FAIL 11
#define SZ_ERROR_THREAD 12
#define SZ_ERROR_ARCHIVE 16
#define SZ_ERROR_NO_ARCHIVE 17
typedef int SRes;
#ifdef _WIN32
typedef DWORD WRes;
#else
typedef int WRes;
#endif
#ifndef RINOK
#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
#endif
typedef unsigned char Byte;
typedef short Int16;
typedef unsigned short UInt16;
#ifdef _LZMA_UINT32_IS_ULONG
typedef long Int32;
typedef unsigned long UInt32;
#else
typedef int Int32;
typedef unsigned int UInt32;
#endif
#ifdef _SZ_NO_INT_64
/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
NOTES: Some code will work incorrectly in that case! */
typedef long Int64;
typedef unsigned long UInt64;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#else
typedef long long int Int64;
typedef unsigned long long int UInt64;
#endif
#endif
#ifdef _LZMA_NO_SYSTEM_SIZE_T
typedef UInt32 SizeT;
#else
typedef size_t SizeT;
#endif
typedef int Bool;
#define True 1
#define False 0
#ifdef _MSC_VER
#if _MSC_VER >= 1300
#define MY_NO_INLINE __declspec(noinline)
#else
#define MY_NO_INLINE
#endif
#define MY_CDECL __cdecl
#define MY_STD_CALL __stdcall
#define MY_FAST_CALL MY_NO_INLINE __fastcall
#else
#define MY_CDECL
#define MY_STD_CALL
#define MY_FAST_CALL
#endif
/* The following interfaces use first parameter as pointer to structure */
typedef struct
{
SRes (*Read)(void *p, void *buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) < input(*size)) is allowed */
} ISeqInStream;
/* it can return SZ_ERROR_INPUT_EOF */
SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);
typedef struct
{
size_t (*Write)(void *p, const void *buf, size_t size);
/* Returns: result - the number of actually written bytes.
(result < size) means error */
} ISeqOutStream;
typedef enum
{
SZ_SEEK_SET = 0,
SZ_SEEK_CUR = 1,
SZ_SEEK_END = 2
} ESzSeek;
typedef struct
{
SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
} ISeekInStream;
typedef struct
{
SRes (*Look)(void *p, void **buf, size_t *size);
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
(output(*size) > input(*size)) is not allowed
(output(*size) < input(*size)) is allowed */
SRes (*Skip)(void *p, size_t offset);
/* offset must be <= output(*size) of Look */
SRes (*Read)(void *p, void *buf, size_t *size);
/* reads directly (without buffer). It's same as ISeqInStream::Read */
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
} ILookInStream;
SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);
SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);
/* reads via ILookInStream::Read */
SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);
SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);
#define LookToRead_BUF_SIZE (1 << 14)
typedef struct
{
ILookInStream s;
ISeekInStream *realStream;
size_t pos;
size_t size;
Byte buf[LookToRead_BUF_SIZE];
} CLookToRead;
void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
void LookToRead_Init(CLookToRead *p);
typedef struct
{
ISeqInStream s;
ILookInStream *realStream;
} CSecToLook;
void SecToLook_CreateVTable(CSecToLook *p);
typedef struct
{
ISeqInStream s;
ILookInStream *realStream;
} CSecToRead;
void SecToRead_CreateVTable(CSecToRead *p);
typedef struct
{
SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);
/* Returns: result. (result != SZ_OK) means break.
Value (UInt64)(Int64)-1 for size means unknown value. */
} ICompressProgress;
typedef struct
{
void *(*Alloc)(void *p, size_t size);
void (*Free)(void *p, void *address); /* address can be 0 */
} ISzAlloc;
#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
#define IAlloc_Free(p, a) (p)->Free((p), a)
#endif

View File

@ -1,7 +0,0 @@
This is the C library implementation of LZMA compression/decompression by Igor Pavlov.
Author: Igor Pavlov
License: Public domain
Version: 4.65 (2009-02-03)
Some administrative adaptations for integration in OpenCTM were made by Marcus Geelnard.

View File

@ -1,32 +0,0 @@
LIBRARY openctm.dll
EXPORTS
ctmAddAttribMap = ctmAddAttribMap@12 @1
ctmAddUVMap = ctmAddUVMap@16 @2
ctmAttribPrecision = ctmAttribPrecision@12 @3
ctmCompressionLevel = ctmCompressionLevel@8 @4
ctmCompressionMethod = ctmCompressionMethod@8 @5
ctmDefineMesh = ctmDefineMesh@24 @6
ctmFileComment = ctmFileComment@8 @7
ctmFreeContext = ctmFreeContext@4 @8
ctmGetAttribMapFloat = ctmGetAttribMapFloat@12 @9
ctmGetAttribMapString = ctmGetAttribMapString@12 @10
ctmGetError = ctmGetError@4 @11
ctmGetFloat = ctmGetFloat@8 @12
ctmGetFloatArray = ctmGetFloatArray@8 @13
ctmGetInteger = ctmGetInteger@8 @14
ctmGetIntegerArray = ctmGetIntegerArray@8 @15
ctmGetNamedAttribMap = ctmGetNamedAttribMap@8 @16
ctmGetNamedUVMap = ctmGetNamedUVMap@8 @17
ctmGetString = ctmGetString@8 @18
ctmGetUVMapFloat = ctmGetUVMapFloat@12 @19
ctmGetUVMapString = ctmGetUVMapString@12 @20
ctmErrorString = ctmErrorString@4 @21
ctmLoad = ctmLoad@8 @22
ctmLoadCustom = ctmLoadCustom@12 @23
ctmNewContext = ctmNewContext@4 @24
ctmNormalPrecision = ctmNormalPrecision@8 @25
ctmSave = ctmSave@8 @26
ctmSaveCustom = ctmSaveCustom@12 @27
ctmUVCoordPrecision = ctmUVCoordPrecision@12 @28
ctmVertexPrecision = ctmVertexPrecision@8 @29
ctmVertexPrecisionRel = ctmVertexPrecisionRel@8 @30

View File

@ -1,32 +0,0 @@
LIBRARY openctm.dll
EXPORTS
ctmAddAttribMap@12 @1
ctmAddUVMap@16 @2
ctmAttribPrecision@12 @3
ctmCompressionLevel@8 @4
ctmCompressionMethod@8 @5
ctmDefineMesh@24 @6
ctmFileComment@8 @7
ctmFreeContext@4 @8
ctmGetAttribMapFloat@12 @9
ctmGetAttribMapString@12 @10
ctmGetError@4 @11
ctmGetFloat@8 @12
ctmGetFloatArray@8 @13
ctmGetInteger@8 @14
ctmGetIntegerArray@8 @15
ctmGetNamedAttribMap@8 @16
ctmGetNamedUVMap@8 @17
ctmGetString@8 @18
ctmGetUVMapFloat@12 @19
ctmGetUVMapString@12 @20
ctmErrorString@4 @21
ctmLoad@8 @22
ctmLoadCustom@12 @23
ctmNewContext@4 @24
ctmNormalPrecision@8 @25
ctmSave@8 @26
ctmSaveCustom@12 @27
ctmUVCoordPrecision@12 @28
ctmVertexPrecision@8 @29
ctmVertexPrecisionRel@8 @30

View File

@ -1,32 +0,0 @@
LIBRARY openctm.dll
EXPORTS
ctmAddAttribMap
ctmAddUVMap
ctmAttribPrecision
ctmCompressionLevel
ctmCompressionMethod
ctmDefineMesh
ctmFileComment
ctmFreeContext
ctmGetAttribMapFloat
ctmGetAttribMapString
ctmGetError
ctmGetFloat
ctmGetFloatArray
ctmGetInteger
ctmGetIntegerArray
ctmGetNamedAttribMap
ctmGetNamedUVMap
ctmGetString
ctmGetUVMapFloat
ctmGetUVMapString
ctmErrorString
ctmLoad
ctmLoadCustom
ctmNewContext
ctmNormalPrecision
ctmSave
ctmSaveCustom
ctmUVCoordPrecision
ctmVertexPrecision
ctmVertexPrecisionRel

File diff suppressed because it is too large Load Diff

View File

@ -1,655 +0,0 @@
//-----------------------------------------------------------------------------
// Product: OpenCTM
// File: openctm.h
// Description: OpenCTM API definition.
//-----------------------------------------------------------------------------
// Copyright (c) 2009-2010 Marcus Geelnard
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//-----------------------------------------------------------------------------
#ifndef __OPENCTM_H_
#define __OPENCTM_H_
/*! @mainpage OpenCTM API Reference
*
* @section intro_sec Introduction
*
* OpenCTM is an open file format for storing compressed triangle meshes.
* In order to easily read and write OpenCTM files (usually suffixed .ctm) an
* API (Application Program Interface) is provided that can easily be used from
* most modern programming languages.
*
* The OpenCTM functionality itself is written in highly portable standard C
* (C99).
*
* @section usage_sec Usage
*
* For information about how to use the OpenCTM API, see openctm.h.
*
* For information about the C++ wrapper classes, see CTMimporter and
* CTMexporter.
*
* @section example_sec Example usage
*
* @subsection example_load_sec Loading a CTM file
*
* Here is a simple example of loading a CTM file:
*
* @code
* CTMcontext context;
* CTMuint vertCount, triCount, * indices;
* CTMfloat * vertices;
*
* // Create a new context
* context = ctmNewContext(CTM_IMPORT);
*
* // Load the OpenCTM file
* ctmLoad(context, "mymesh.ctm");
* if(ctmGetError(context) == CTM_NONE)
* {
* // Access the mesh data
* vertCount = ctmGetInteger(context, CTM_VERTEX_COUNT);
* vertices = ctmGetFloatArray(context, CTM_VERTICES);
* triCount = ctmGetInteger(context, CTM_TRIANGLE_COUNT);
* indices = ctmGetIntegerArray(context, CTM_INDICES);
*
* // Deal with the mesh (e.g. transcode it to our internal representation)
* // ...
* }
*
* // Free the context
* ctmFreeContext(context);
* @endcode
*
* @subsection example_create_sec Creating a CTM file
*
* Here is a simple example of creating a CTM file:
*
* @code
* CTMcontext context;
* CTMuint vertCount, triCount, * indices;
* CTMfloat * vertices;
*
* // Create our mesh in memory
* vertCount = 100;
* triCount = 120;
* vertices = (CTMfloat *) malloc(3 * sizeof(CTMfloat) * vertCount);
* indices = (CTMuint *) malloc(3 * sizeof(CTMuint) * triCount);
* // ...
*
* // Create a new context
* context = ctmNewContext(CTM_EXPORT);
*
* // Define our mesh representation to OpenCTM (store references to it in
* // the context)
* ctmDefineMesh(context, vertices, vertCount, indices, triCount, NULL);
*
* // Save the OpenCTM file
* ctmSave(context, "mymesh.ctm");
*
* // Free the context
* ctmFreeContext(context);
*
* // Free our mesh
* free(indices);
* free(vertices);
* @endcode
*/
#ifdef __cplusplus
extern "C" {
#endif
// Declare calling conventions etc.
#if defined(WIN32) || defined(_WIN32)
// Windows
#if defined(OPENCTM_STATIC)
#define CTMEXPORT
#else
#if defined(OPENCTM_BUILD)
#define CTMEXPORT __declspec(dllexport)
#else
#define CTMEXPORT __declspec(dllimport)
#endif
#endif
#if defined(__MINGW32__)
#define CTMCALL __attribute__ ((__stdcall__))
#elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
#define CTMCALL __stdcall
#else
#define CTMCALL
#endif
#else
// Unix
#if !defined(OPENCTM_STATIC) && !defined(OPENCTM_BUILD)
#define CTMEXPORT extern
#else
#if defined(OPENCTM_BUILD) && defined(__GNUC__) && (__GNUC__ >= 4)
#define CTMEXPORT __attribute__ ((visibility("default")))
#else
#define CTMEXPORT
#endif
#endif
#define CTMCALL
#endif
// Get system specific type definitions for sized integers. We use the C99
// standard stdint.h for this.
#ifdef _MSC_VER
// MS Visual Studio does not support C99
typedef int int32_t;
typedef unsigned int uint32_t;
#else
#include <stdint.h>
#endif
/// OpenCTM API version (1.0).
#define CTM_API_VERSION 0x00000100
/// Boolean TRUE.
#define CTM_TRUE 1
/// Boolean FALSE.
#define CTM_FALSE 0
/// Single precision floating point type (IEEE 754 32 bits wide).
typedef float CTMfloat;
/// Signed integer (32 bits wide).
typedef int32_t CTMint;
/// Unsigned integer (32 bits wide).
typedef uint32_t CTMuint;
/// OpenCTM context handle.
typedef void * CTMcontext;
/// OpenCTM specific enumerators.
/// @note For the information query functions, it is an error to query a value
/// of the wrong type (e.g. to query a string value with the
/// ctmGetInteger() function).
typedef enum {
// Error codes (see ctmGetError())
CTM_NONE = 0x0000, ///< No error has occured (everything is OK).
/// Also used as an error return value for
/// functions that should return a CTMenum
/// value.
CTM_INVALID_CONTEXT = 0x0001, ///< The OpenCTM context was invalid (e.g. NULL).
CTM_INVALID_ARGUMENT = 0x0002, ///< A function argument was invalid.
CTM_INVALID_OPERATION = 0x0003, ///< The operation is not allowed.
CTM_INVALID_MESH = 0x0004, ///< The mesh was invalid (e.g. no vertices).
CTM_OUT_OF_MEMORY = 0x0005, ///< Not enough memory to proceed.
CTM_FILE_ERROR = 0x0006, ///< File I/O error.
CTM_BAD_FORMAT = 0x0007, ///< File format error (e.g. unrecognized format or corrupted file).
CTM_LZMA_ERROR = 0x0008, ///< An error occured within the LZMA library.
CTM_INTERNAL_ERROR = 0x0009, ///< An internal error occured (indicates a bug).
CTM_UNSUPPORTED_FORMAT_VERSION = 0x000A, ///< Unsupported file format version.
// OpenCTM context modes
CTM_IMPORT = 0x0101, ///< The OpenCTM context will be used for importing data.
CTM_EXPORT = 0x0102, ///< The OpenCTM context will be used for exporting data.
// Compression methods
CTM_METHOD_RAW = 0x0201, ///< Just store the raw data.
CTM_METHOD_MG1 = 0x0202, ///< Lossless compression (floating point).
CTM_METHOD_MG2 = 0x0203, ///< Lossless compression (fixed point).
// Context queries
CTM_VERTEX_COUNT = 0x0301, ///< Number of vertices in the mesh (integer).
CTM_TRIANGLE_COUNT = 0x0302, ///< Number of triangles in the mesh (integer).
CTM_HAS_NORMALS = 0x0303, ///< CTM_TRUE if the mesh has normals (integer).
CTM_UV_MAP_COUNT = 0x0304, ///< Number of UV coordinate sets (integer).
CTM_ATTRIB_MAP_COUNT = 0x0305, ///< Number of custom attribute sets (integer).
CTM_VERTEX_PRECISION = 0x0306, ///< Vertex precision - for MG2 (float).
CTM_NORMAL_PRECISION = 0x0307, ///< Normal precision - for MG2 (float).
CTM_COMPRESSION_METHOD = 0x0308, ///< Compression method (integer).
CTM_FILE_COMMENT = 0x0309, ///< File comment (string).
// UV/attribute map queries
CTM_NAME = 0x0501, ///< Unique name (UV/attrib map string).
CTM_FILE_NAME = 0x0502, ///< File name reference (UV map string).
CTM_PRECISION = 0x0503, ///< Value precision (UV/attrib map float).
// Array queries
CTM_INDICES = 0x0601, ///< Triangle indices (integer array).
CTM_VERTICES = 0x0602, ///< Vertex point coordinates (float array).
CTM_NORMALS = 0x0603, ///< Per vertex normals (float array).
CTM_UV_MAP_1 = 0x0700, ///< Per vertex UV map 1 (float array).
CTM_UV_MAP_2 = 0x0701, ///< Per vertex UV map 2 (float array).
CTM_UV_MAP_3 = 0x0702, ///< Per vertex UV map 3 (float array).
CTM_UV_MAP_4 = 0x0703, ///< Per vertex UV map 4 (float array).
CTM_UV_MAP_5 = 0x0704, ///< Per vertex UV map 5 (float array).
CTM_UV_MAP_6 = 0x0705, ///< Per vertex UV map 6 (float array).
CTM_UV_MAP_7 = 0x0706, ///< Per vertex UV map 7 (float array).
CTM_UV_MAP_8 = 0x0707, ///< Per vertex UV map 8 (float array).
CTM_ATTRIB_MAP_1 = 0x0800, ///< Per vertex attribute map 1 (float array).
CTM_ATTRIB_MAP_2 = 0x0801, ///< Per vertex attribute map 2 (float array).
CTM_ATTRIB_MAP_3 = 0x0802, ///< Per vertex attribute map 3 (float array).
CTM_ATTRIB_MAP_4 = 0x0803, ///< Per vertex attribute map 4 (float array).
CTM_ATTRIB_MAP_5 = 0x0804, ///< Per vertex attribute map 5 (float array).
CTM_ATTRIB_MAP_6 = 0x0805, ///< Per vertex attribute map 6 (float array).
CTM_ATTRIB_MAP_7 = 0x0806, ///< Per vertex attribute map 7 (float array).
CTM_ATTRIB_MAP_8 = 0x0807 ///< Per vertex attribute map 8 (float array).
} CTMenum;
/// Stream read() function pointer.
/// @param[in] aBuf Pointer to the memory buffer to which data should be read.
/// @param[in] aCount The number of bytes to read.
/// @param[in] aUserData The custom user data that was passed to the
/// ctmLoadCustom() function.
/// @return The number of bytes actually read (if this is less than aCount, it
/// indicates that an error occured or the end of file was reached
/// before all bytes were read).
typedef CTMuint (CTMCALL * CTMreadfn)(void * aBuf, CTMuint aCount, void * aUserData);
/// Stream write() function pointer.
/// @param[in] aBuf Pointer to the memory buffer from which data should be written.
/// @param[in] aCount The number of bytes to write.
/// @param[in] aUserData The custom user data that was passed to the
/// ctmSaveCustom() function.
/// @return The number of bytes actually written (if this is less than aCount, it
/// indicates that an error occured).
typedef CTMuint (CTMCALL * CTMwritefn)(const void * aBuf, CTMuint aCount, void * aUserData);
/// Create a new OpenCTM context. The context is used for all subsequent
/// OpenCTM function calls. Several contexts can coexist at the same time.
/// @param[in] aMode An OpenCTM context mode. Set this to CTM_IMPORT if the
/// context will be used for importing data, or set it to CTM_EXPORT
/// if it will be used for exporting data.
/// @return An OpenCTM context handle (or NULL if no context could be created).
CTMEXPORT CTMcontext CTMCALL ctmNewContext(CTMenum aMode);
/// Free an OpenCTM context.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @see ctmNewContext()
CTMEXPORT void CTMCALL ctmFreeContext(CTMcontext aContext);
/// Returns the latest error. Calling this function will return the last
/// produced error code, or CTM_NO_ERROR (zero) if no error has occured since
/// the last call to ctmGetError(). When this function is called, the internal
/// error varibale will be reset to CTM_NONE.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @return An OpenCTM error code.
/// @see CTMenum
CTMEXPORT CTMenum CTMCALL ctmGetError(CTMcontext aContext);
/// Converts an OpenCTM error code to a zero-terminated string.
/// @param[in] aError An OpenCTM error code, as returned by ctmGetError().
/// @return A zero terminated string that describes the error. For instance,
/// if \c aError is CTM_INVALID_OPERATION, then the return value will
/// be "CTM_INVALID_OPERATION".
/// @see CTMenum
CTMEXPORT const char * CTMCALL ctmErrorString(CTMenum aError);
/// Get information about an OpenCTM context.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aProperty Which property to return.
/// @return An integer value, representing the OpenCTM context property given
/// by \c aProperty.
/// @see CTMenum
CTMEXPORT CTMuint CTMCALL ctmGetInteger(CTMcontext aContext, CTMenum aProperty);
/// Get information about an OpenCTM context.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aProperty Which property to return.
/// @return A floating point value, representing the OpenCTM context property
/// given by \c aProperty.
/// @see CTMenum
CTMEXPORT CTMfloat CTMCALL ctmGetFloat(CTMcontext aContext, CTMenum aProperty);
/// Get an integer array from an OpenCTM context.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aProperty Which array to return.
/// @return An integer array. If the requested array does not exist, or
/// if \c aProperty does not indicate an integer array, the function
/// returns NULL.
/// @note The array is only valid as long as the OpenCTM context is valid, or
/// until the corresponding array changes within the OpenCTM context.
/// Trying to access an invalid array will result in undefined
/// behaviour. Therefor it is recommended that the array is copied to
/// a new variable if it is to be used other than directly after the call
/// to ctmGetIntegerArray().
/// @see CTMenum
CTMEXPORT const CTMuint * CTMCALL ctmGetIntegerArray(CTMcontext aContext,
CTMenum aProperty);
/// Get a floating point array from an OpenCTM context.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aProperty Which array to return.
/// @return A floating point array. If the requested array does not exist, or
/// if \c aProperty does not indicate a float array, the function
/// returns NULL.
/// @note The array is only valid as long as the OpenCTM context is valid, or
/// until the corresponding array changes within the OpenCTM context.
/// Trying to access an invalid array will result in undefined
/// behaviour. Therefor it is recommended that the array is copied to
/// a new variable if it is to be used other than directly after the call
/// to ctmGetFloatArray().
/// @see CTMenum
CTMEXPORT const CTMfloat * CTMCALL ctmGetFloatArray(CTMcontext aContext,
CTMenum aProperty);
/// Get a reference to the named UV map.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aName The name of the UV map that should be returned.
/// @return A reference to a UV map. If the UV map was found, a value of
/// CTM_UV_MAP_1 or higher is returned, otherwise CTM_NONE is
/// returned.
CTMEXPORT CTMenum CTMCALL ctmGetNamedUVMap(CTMcontext aContext,
const char * aName);
/// Get information about a UV map.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aUVMap Which UV map to query (CTM_UV_MAP_1 or higher).
/// @param[in] aProperty Which UV map property to return.
/// @return A string value, representing the UV map property given
/// by \c aProperty.
/// @note The string is only valid as long as the UV map within the OpenCTM
/// context is valid. Trying to access an invalid string will result in
/// undefined behaviour. Therefor it is recommended that the string is
/// copied to a new variable if it is to be used other than directly after
/// the call to ctmGetUVMapString().
/// @see CTMenum
CTMEXPORT const char * CTMCALL ctmGetUVMapString(CTMcontext aContext,
CTMenum aUVMap, CTMenum aProperty);
/// Get information about a UV map.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aUVMap Which UV map to query (CTM_UV_MAP_1 or higher).
/// @param[in] aProperty Which UV map property to return.
/// @return A floating point value, representing the UV map property given
/// by \c aProperty.
/// @see CTMenum
CTMEXPORT CTMfloat CTMCALL ctmGetUVMapFloat(CTMcontext aContext,
CTMenum aUVMap, CTMenum aProperty);
/// Get a reference to the named vertex attribute map.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aName The name of the attribute map that should be returned.
/// @return A reference to an attribute map. If the attribute map was found,
/// a value of CTM_ATTRIB_MAP_1 or higher is returned, otherwise
/// CTM_NONE is returned.
CTMEXPORT CTMenum CTMCALL ctmGetNamedAttribMap(CTMcontext aContext,
const char * aName);
/// Get information about a vertex attribute map.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aAttribMap Which vertex attribute map to query (CTM_ATTRIB_MAP_1
/// or higher).
/// @param[in] aProperty Which vertex attribute map property to return.
/// @return A string value, representing the vertex attribute map property given
/// by \c aProperty.
/// @note The string is only valid as long as the vertex attribute map within
/// the OpenCTM context is valid. Trying to access an invalid string will
/// result in undefined behaviour. Therefor it is recommended that the
/// string is copied to a new variable if it is to be used other than
/// directly after the call to ctmGetAttribMapString().
/// @see CTMenum
CTMEXPORT const char * CTMCALL ctmGetAttribMapString(CTMcontext aContext,
CTMenum aAttribMap, CTMenum aProperty);
/// Get information about a vertex attribute map.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aAttribMap Which vertex attribute map to query (CTM_ATTRIB_MAP_1
/// or higher).
/// @param[in] aProperty Which vertex attribute map property to return.
/// @return A floating point value, representing the vertex attribute map
/// property given by \c aProperty.
/// @see CTMenum
CTMEXPORT CTMfloat CTMCALL ctmGetAttribMapFloat(CTMcontext aContext,
CTMenum aAttribMap, CTMenum aProperty);
/// Get information about an OpenCTM context.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aProperty Which property to return.
/// @return A string value, representing the OpenCTM context property given
/// by \c aProperty.
/// @note The string is only valid as long as the OpenCTM context is valid, or
/// until the corresponding string changes within the OpenCTM context
/// (e.g. calling ctmFileComment() invalidates the CTM_FILE_COMMENT
/// string). Trying to access an invalid string will result in undefined
/// behaviour. Therefor it is recommended that the string is copied to
/// a new variable if it is to be used other than directly after the call
/// to ctmGetString().
/// @see CTMenum
CTMEXPORT const char * CTMCALL ctmGetString(CTMcontext aContext,
CTMenum aProperty);
/// Set which compression method to use for the given OpenCTM context.
/// The selected compression method will be used when calling the ctmSave()
/// function.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aMethod Which compression method to use: CTM_METHOD_RAW,
/// CTM_METHOD_MG1 or CTM_METHOD_MG2 (the default method is
/// CTM_METHOD_MG1).
/// @see CTM_METHOD_RAW, CTM_METHOD_MG1, CTM_METHOD_MG2
CTMEXPORT void CTMCALL ctmCompressionMethod(CTMcontext aContext,
CTMenum aMethod);
/// Set which LZMA compression level to use for the given OpenCTM context.
/// The compression level can be between 0 (fastest) and 9 (best). The higher
/// the compression level, the more memory is required for compression and
/// decompression. The default compression level is 1.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aLevel Which compression level to use (0 to 9).
CTMEXPORT void CTMCALL ctmCompressionLevel(CTMcontext aContext,
CTMuint aLevel);
/// Set the vertex coordinate precision (only used by the MG2 compression
/// method).
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aPrecision Fixed point precision. For instance, if this value is
/// 0.001, all vertex coordinates will be rounded to three decimals.
/// The default vertex coordinate precision is 2^-10 ~= 0.00098.
CTMEXPORT void CTMCALL ctmVertexPrecision(CTMcontext aContext,
CTMfloat aPrecision);
/// Set the vertex coordinate precision, relative to the mesh dimensions (only
/// used by the MG2 compression method).
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aRelPrecision Relative precision. This factor is multiplied by the
/// average triangle edge length in the mesh in order to obtain the
/// final, fixed point precision. For instance, if aRelPrecision is
/// 0.01, and the average edge length is 3.7, then the fixed point
/// precision is set to 0.037.
/// @note The mesh must have been defined using the ctmDefineMesh() function
/// before calling this function.
/// @see ctmVertexPrecision().
CTMEXPORT void CTMCALL ctmVertexPrecisionRel(CTMcontext aContext,
CTMfloat aRelPrecision);
/// Set the normal precision (only used by the MG2 compression method). The
/// normal is represented in spherical coordinates in the MG2 compression
/// method, and the normal precision controls the angular and radial resolution.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aPrecision Fixed point precision. For the angular information,
/// this value represents the angular precision. For the radial
/// information, this value is the linear resolution. For instance,
/// 0.01 means that the circle is divided into 100 steps, and the
/// normal magnitude is rounded to 2 decimals. The default normal
/// precision is 2^-8 ~= 0.0039.
CTMEXPORT void CTMCALL ctmNormalPrecision(CTMcontext aContext,
CTMfloat aPrecision);
/// Set the coordinate precision for the specified UV map (only used by the
/// MG2 compression method).
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aUVMap A UV map specifier for a defined UV map
/// (CTM_UV_MAP_1, ...).
/// @param[in] aPrecision Fixed point precision. For instance, if this value is
/// 0.001, all UV coordinates will be rounded to three decimals.
/// The default UV coordinate precision is 2^-12 ~= 0.00024.
/// @see ctmAddUVMap().
CTMEXPORT void CTMCALL ctmUVCoordPrecision(CTMcontext aContext,
CTMenum aUVMap, CTMfloat aPrecision);
/// Set the attribute value precision for the specified attribute map (only
/// used by the MG2 compression method).
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aAttribMap An attribute map specifier for a defined attribute map
/// (CTM_ATTRIB_MAP_1, ...).
/// @param[in] aPrecision Fixed point precision. For instance, if this value is
/// 0.001, all attribute values will be rounded to three decimals.
/// If the attributes represent integer values, set the precision
/// to 1.0. The default attribute precision is 2^-8 ~= 0.0039.
/// @see ctmAddAttribMap().
CTMEXPORT void CTMCALL ctmAttribPrecision(CTMcontext aContext,
CTMenum aAttribMap, CTMfloat aPrecision);
/// Set the file comment for the given OpenCTM context.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aFileComment The file comment (zero terminated UTF-8 string).
CTMEXPORT void CTMCALL ctmFileComment(CTMcontext aContext,
const char * aFileComment);
/// Define a triangle mesh.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aVertices An array of vertices (three consecutive floats make
/// one vertex).
/// @param[in] aVertexCount The number of vertices in \c aVertices (and
/// optionally \c aTexCoords).
/// @param[in] aIndices An array of vertex indices (three consecutive integers
/// make one triangle).
/// @param[in] aTriangleCount The number of triangles in \c aIndices (there
/// must be exactly 3 x \c aTriangleCount indices in \c aIndices).
/// @param[in] aNormals An array of per-vertex normals (or NULL if there are
/// no normals). Each normal is made up by three consecutive floats,
/// and there must be \c aVertexCount normals.
/// @see ctmAddUVMap(), ctmAddAttribMap(), ctmSave(), ctmSaveCustom().
CTMEXPORT void CTMCALL ctmDefineMesh(CTMcontext aContext,
const CTMfloat * aVertices, CTMuint aVertexCount, const CTMuint * aIndices,
CTMuint aTriangleCount, const CTMfloat * aNormals);
/// Define a UV map. There can be several UV maps in a mesh. A UV map is
/// typically used for 2D texture mapping.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aUVCoords An array of UV coordinates. Each UV coordinate is made
/// up by two consecutive floats, and there must be as many
/// coordinates as there are vertices in the mesh.
/// @param[in] aName A unique name for this UV map (zero terminated UTF-8
/// string).
/// @param[in] aFileName A reference to a image file (zero terminated
/// UTF-8 string). If no file name reference exists, pass NULL.
/// @return A UV map index (CTM_UV_MAP_1 and higher). If the function
/// failed, it will return the zero valued CTM_NONE (use ctmGetError()
/// to determine the cause of the error).
/// @note A triangle mesh must have been defined before calling this function,
/// since the number of vertices is defined by the triangle mesh.
/// @see ctmDefineMesh().
CTMEXPORT CTMenum CTMCALL ctmAddUVMap(CTMcontext aContext,
const CTMfloat * aUVCoords, const char * aName, const char * aFileName);
/// Define a custom vertex attribute map. Custom vertex attributes can be used
/// for defining special per-vertex attributes, such as color, weight, ambient
/// occlusion factor, etc.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aAttribValues An array of attribute values. Each attribute value
/// is made up by four consecutive floats, and there must be as many
/// values as there are vertices in the mesh.
/// @param[in] aName A unique name for this attribute map (zero terminated UTF-8
/// string).
/// @return A attribute map index (CTM_ATTRIB_MAP_1 and higher). If the function
/// failed, it will return the zero valued CTM_NONE (use ctmGetError()
/// to determine the cause of the error).
/// @note A triangle mesh must have been defined before calling this function,
/// since the number of vertices is defined by the triangle mesh.
/// @see ctmDefineMesh().
CTMEXPORT CTMenum CTMCALL ctmAddAttribMap(CTMcontext aContext,
const CTMfloat * aAttribValues, const char * aName);
/// Load an OpenCTM format file into the context. The mesh data can be retrieved
/// with the various ctmGet functions.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aFileName The name of the file to be loaded.
CTMEXPORT void CTMCALL ctmLoad(CTMcontext aContext, const char * aFileName);
/// Load an OpenCTM format file using a custom stream read function. The mesh
/// data can be retrieved with the various ctmGet functions.
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aReadFn Pointer to a custom stream read function.
/// @param[in] aUserData Custom user data, which can be a C language FILE
/// handle, C++ istream object, or a custom object pointer
/// of any type. The user data pointer will be passed to the
/// custom stream read function.
/// @see CTMreadfn.
CTMEXPORT void CTMCALL ctmLoadCustom(CTMcontext aContext, CTMreadfn aReadFn,
void * aUserData);
/// Save an OpenCTM format file. The mesh must have been defined by
/// ctmDefineMesh().
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aFileName The name of the file to be saved.
CTMEXPORT void CTMCALL ctmSave(CTMcontext aContext, const char * aFileName);
/// Save an OpenCTM format file using a custom stream write function. The mesh
/// must have been defined by ctmDefineMesh().
/// @param[in] aContext An OpenCTM context that has been created by
/// ctmNewContext().
/// @param[in] aWriteFn Pointer to a custom stream write function.
/// @param[in] aUserData Custom user data, which can be a C language FILE
/// handle, C++ ostream object, or a custom object pointer
/// of any type. The user data pointer will be passed to the
/// custom stream write function.
/// @see CTMwritefn.
CTMEXPORT void CTMCALL ctmSaveCustom(CTMcontext aContext, CTMwritefn aWriteFn,
void * aUserData);
#ifdef __cplusplus
}
#endif
// C++ extensions to the API (to disable C++ extensions, define OPENCTM_NO_CPP)
#if defined(__cplusplus) && !defined(OPENCTM_NO_CPP)
#include "openctmpp.h"
#endif
#endif // __OPENCTM_H_

View File

@ -1,26 +0,0 @@
1 VERSIONINFO
FILEVERSION 1,0,3,0
PRODUCTVERSION 1,0,3,0
FILEOS 0x4
FILETYPE 0x2
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "ProductVersion", "1.0.3.0"
VALUE "FileVersion", "1.0.3.0"
VALUE "FileDescription", "OpenCTM API shared library"
VALUE "ProductName", "OpenCTM"
VALUE "OriginalFilename", "openctm.dll"
VALUE "LegalCopyright", "© 2009-2010 Marcus Geelnard"
VALUE "License", "This software is released under the zlib/libpng license."
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END

View File

@ -1,377 +0,0 @@
//-----------------------------------------------------------------------------
// Product: OpenCTM
// File: openctmpp.h
// Description: C++ wrapper for the OpenCTM API.
//-----------------------------------------------------------------------------
// Copyright (c) 2009-2010 Marcus Geelnard
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//-----------------------------------------------------------------------------
// To disable C++ extensions, define OPENCTM_NO_CPP
#ifndef OPENCTM_NO_CPP
#ifndef __OPENCTMPP_H_
#define __OPENCTMPP_H_
// Just in case (if this file was included from outside openctm.h)...
#ifndef __OPENCTM_H_
#include "openctm.h"
#endif
#include <exception>
/// OpenCTM exception. When an error occurs, a \c ctm_error exception is
/// thrown. Its what() function returns the name of the OpenCTM error code
/// (for instance "CTM_INVALID_OPERATION").
class ctm_error: public std::exception
{
private:
CTMenum mErrorCode;
public:
explicit ctm_error(CTMenum aError)
{
mErrorCode = aError;
}
virtual const char* what() const throw()
{
return ctmErrorString(mErrorCode);
}
CTMenum error_code() const throw()
{
return mErrorCode;
}
};
/// OpenCTM importer class. This is a C++ wrapper class for an OpenCTM import
/// context. Usage example:
///
/// @code
/// // Create a new OpenCTM importer object
/// CTMimporter ctm;
///
/// // Load the OpenCTM file
/// ctm.Load("mymesh.ctm");
///
/// // Access the mesh data
/// vertCount = ctm.GetInteger(CTM_VERTEX_COUNT);
/// vertices = ctm.GetFloatArray(CTM_VERTICES);
/// triCount = ctm.GetInteger(CTM_TRIANGLE_COUNT);
/// indices = ctm.GetIntegerArray(CTM_INDICES);
///
/// // Deal with the mesh (e.g. transcode it to our internal representation)
/// // ...
/// @endcode
class CTMimporter {
private:
/// The OpenCTM context handle.
CTMcontext mContext;
/// Check for OpenCTM errors, and throw an exception if an error has
/// occured.
void CheckError()
{
CTMenum err = ctmGetError(mContext);
if(err != CTM_NONE)
throw ctm_error(err);
}
public:
/// Constructor
CTMimporter()
{
mContext = ctmNewContext(CTM_IMPORT);
}
/// Destructor
~CTMimporter()
{
ctmFreeContext(mContext);
}
/// Wrapper for ctmGetInteger()
CTMuint GetInteger(CTMenum aProperty)
{
CTMuint res = ctmGetInteger(mContext, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetFloat()
CTMfloat GetFloat(CTMenum aProperty)
{
CTMfloat res = ctmGetFloat(mContext, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetIntegerArray()
const CTMuint * GetIntegerArray(CTMenum aProperty)
{
const CTMuint * res = ctmGetIntegerArray(mContext, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetFloatArray()
const CTMfloat * GetFloatArray(CTMenum aProperty)
{
const CTMfloat * res = ctmGetFloatArray(mContext, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetNamedUVMap()
CTMenum GetNamedUVMap(const char * aName)
{
CTMenum res = ctmGetNamedUVMap(mContext, aName);
CheckError();
return res;
}
/// Wrapper for ctmGetUVMapString()
const char * GetUVMapString(CTMenum aUVMap, CTMenum aProperty)
{
const char * res = ctmGetUVMapString(mContext, aUVMap, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetUVMapFloat()
CTMfloat GetUVMapFloat(CTMenum aUVMap, CTMenum aProperty)
{
CTMfloat res = ctmGetUVMapFloat(mContext, aUVMap, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetNamedAttribMap()
CTMenum GetNamedAttribMap(const char * aName)
{
CTMenum res = ctmGetNamedAttribMap(mContext, aName);
CheckError();
return res;
}
/// Wrapper for ctmGetAttribMapString()
const char * GetAttribMapString(CTMenum aAttribMap, CTMenum aProperty)
{
const char * res = ctmGetAttribMapString(mContext, aAttribMap, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetAttribMapFloat()
CTMfloat GetAttribMapFloat(CTMenum aAttribMap, CTMenum aProperty)
{
CTMfloat res = ctmGetAttribMapFloat(mContext, aAttribMap, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmGetString()
const char * GetString(CTMenum aProperty)
{
const char * res = ctmGetString(mContext, aProperty);
CheckError();
return res;
}
/// Wrapper for ctmLoad()
void Load(const char * aFileName)
{
ctmLoad(mContext, aFileName);
CheckError();
}
/// Wrapper for ctmLoadCustom()
void LoadCustom(CTMreadfn aReadFn, void * aUserData)
{
ctmLoadCustom(mContext, aReadFn, aUserData);
CheckError();
}
// You can not copy nor assign from one CTMimporter object to another, since
// the object contains hidden state. By declaring these dummy prototypes
// without an implementation, you will at least get linker errors if you try
// to copy or assign a CTMimporter object.
CTMimporter(const CTMimporter& v);
CTMimporter& operator=(const CTMimporter& v);
};
/// OpenCTM exporter class. This is a C++ wrapper class for an OpenCTM export
/// context. Usage example:
/// @code
/// void MySaveFile(CTMuint aVertCount, CTMuint aTriCount, CTMfloat * aVertices,
/// CTMuint * aIndices, const char * aFileName)
/// {
/// // Create a new OpenCTM exporter object
/// CTMexporter ctm;
///
/// // Define our mesh representation to OpenCTM (store references to it in
/// // the context)
/// ctm.DefineMesh(aVertices, aVertCount, aIndices, aTriCount, NULL);
///
/// // Save the OpenCTM file
/// ctm.Save(aFileName);
/// }
/// @endcode
class CTMexporter {
private:
/// The OpenCTM context handle.
CTMcontext mContext;
/// Check for OpenCTM errors, and throw an exception if an error has
/// occured.
void CheckError()
{
CTMenum err = ctmGetError(mContext);
if(err != CTM_NONE)
throw ctm_error(err);
}
public:
/// Constructor
CTMexporter()
{
mContext = ctmNewContext(CTM_EXPORT);
}
/// Destructor
~CTMexporter()
{
ctmFreeContext(mContext);
}
/// Wrapper for ctmCompressionMethod()
void CompressionMethod(CTMenum aMethod)
{
ctmCompressionMethod(mContext, aMethod);
CheckError();
}
/// Wrapper for ctmCompressionLevel()
void CompressionLevel(CTMuint aLevel)
{
ctmCompressionLevel(mContext, aLevel);
CheckError();
}
/// Wrapper for ctmVertexPrecision()
void VertexPrecision(CTMfloat aPrecision)
{
ctmVertexPrecision(mContext, aPrecision);
CheckError();
}
/// Wrapper for ctmVertexPrecisionRel()
void VertexPrecisionRel(CTMfloat aRelPrecision)
{
ctmVertexPrecisionRel(mContext, aRelPrecision);
CheckError();
}
/// Wrapper for ctmNormalPrecision()
void NormalPrecision(CTMfloat aPrecision)
{
ctmNormalPrecision(mContext, aPrecision);
CheckError();
}
/// Wrapper for ctmUVCoordPrecision()
void UVCoordPrecision(CTMenum aUVMap, CTMfloat aPrecision)
{
ctmUVCoordPrecision(mContext, aUVMap, aPrecision);
CheckError();
}
/// Wrapper for ctmAttribPrecision()
void AttribPrecision(CTMenum aAttribMap, CTMfloat aPrecision)
{
ctmAttribPrecision(mContext, aAttribMap, aPrecision);
CheckError();
}
/// Wrapper for ctmFileComment()
void FileComment(const char * aFileComment)
{
ctmFileComment(mContext, aFileComment);
CheckError();
}
/// Wrapper for ctmDefineMesh()
void DefineMesh(const CTMfloat * aVertices, CTMuint aVertexCount,
const CTMuint * aIndices, CTMuint aTriangleCount,
const CTMfloat * aNormals)
{
ctmDefineMesh(mContext, aVertices, aVertexCount, aIndices, aTriangleCount,
aNormals);
CheckError();
}
/// Wrapper for ctmAddUVMap()
CTMenum AddUVMap(const CTMfloat * aUVCoords, const char * aName,
const char * aFileName)
{
CTMenum res = ctmAddUVMap(mContext, aUVCoords, aName, aFileName);
CheckError();
return res;
}
/// Wrapper for ctmAddAttribMap()
CTMenum AddAttribMap(const CTMfloat * aAttribValues, const char * aName)
{
CTMenum res = ctmAddAttribMap(mContext, aAttribValues, aName);
CheckError();
return res;
}
/// Wrapper for ctmSave()
void Save(const char * aFileName)
{
ctmSave(mContext, aFileName);
CheckError();
}
/// Wrapper for ctmSaveCustom()
void SaveCustom(CTMwritefn aWriteFn, void * aUserData)
{
ctmSaveCustom(mContext, aWriteFn, aUserData);
CheckError();
}
// You can not copy nor assign from one CTMexporter object to another, since
// the object contains hidden state. By declaring these dummy prototypes
// without an implementation, you will at least get linker errors if you try
// to copy or assign a CTMexporter object.
CTMexporter(const CTMexporter& v);
CTMexporter& operator=(const CTMexporter& v);
};
#endif // __OPENCTMPP_H_
#endif // OPENCTM_NO_CPP

View File

@ -1,512 +0,0 @@
//-----------------------------------------------------------------------------
// Product: OpenCTM
// File: stream.c
// Description: Stream I/O functions.
//-----------------------------------------------------------------------------
// Copyright (c) 2009-2010 Marcus Geelnard
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//-----------------------------------------------------------------------------
#include <stdlib.h>
#include <string.h>
#include <LzmaLib.h>
#include "openctm.h"
#include "internal.h"
#ifdef __DEBUG_
#include <stdio.h>
#endif
//-----------------------------------------------------------------------------
// _ctmStreamRead() - Read data from a stream.
//-----------------------------------------------------------------------------
CTMuint _ctmStreamRead(_CTMcontext * self, void * aBuf, CTMuint aCount)
{
if(!self->mUserData || !self->mReadFn)
return 0;
return self->mReadFn(aBuf, aCount, self->mUserData);
}
//-----------------------------------------------------------------------------
// _ctmStreamWrite() - Write data to a stream.
//-----------------------------------------------------------------------------
CTMuint _ctmStreamWrite(_CTMcontext * self, void * aBuf, CTMuint aCount)
{
if(!self->mUserData || !self->mWriteFn)
return 0;
return self->mWriteFn(aBuf, aCount, self->mUserData);
}
//-----------------------------------------------------------------------------
// _ctmStreamReadUINT() - Read an unsigned integer from a stream in a machine
// endian independent manner (for portability).
//-----------------------------------------------------------------------------
CTMuint _ctmStreamReadUINT(_CTMcontext * self)
{
unsigned char buf[4];
_ctmStreamRead(self, (void *) buf, 4);
return ((CTMuint) buf[0]) |
(((CTMuint) buf[1]) << 8) |
(((CTMuint) buf[2]) << 16) |
(((CTMuint) buf[3]) << 24);
}
//-----------------------------------------------------------------------------
// _ctmStreamWriteUINT() - Write an unsigned integer to a stream in a machine
// endian independent manner (for portability).
//-----------------------------------------------------------------------------
void _ctmStreamWriteUINT(_CTMcontext * self, CTMuint aValue)
{
unsigned char buf[4];
buf[0] = aValue & 0x000000ff;
buf[1] = (aValue >> 8) & 0x000000ff;
buf[2] = (aValue >> 16) & 0x000000ff;
buf[3] = (aValue >> 24) & 0x000000ff;
_ctmStreamWrite(self, (void *) buf, 4);
}
//-----------------------------------------------------------------------------
// _ctmStreamReadFLOAT() - Read a floating point value from a stream in a
// machine endian independent manner (for portability).
//-----------------------------------------------------------------------------
CTMfloat _ctmStreamReadFLOAT(_CTMcontext * self)
{
union {
CTMfloat f;
CTMuint i;
} u;
u.i = _ctmStreamReadUINT(self);
return u.f;
}
//-----------------------------------------------------------------------------
// _ctmStreamWriteFLOAT() - Write a floating point value to a stream in a
// machine endian independent manner (for portability).
//-----------------------------------------------------------------------------
void _ctmStreamWriteFLOAT(_CTMcontext * self, CTMfloat aValue)
{
union {
CTMfloat f;
CTMuint i;
} u;
u.f = aValue;
_ctmStreamWriteUINT(self, u.i);
}
//-----------------------------------------------------------------------------
// _ctmStreamReadSTRING() - Read a string value from a stream. The format of
// the string in the stream is: an unsigned integer (string length) followed by
// the string (without null termination).
//-----------------------------------------------------------------------------
void _ctmStreamReadSTRING(_CTMcontext * self, char ** aValue)
{
CTMuint len;
// Clear the old string
if(*aValue)
{
free(*aValue);
*aValue = (char *) 0;
}
// Get string length
len = _ctmStreamReadUINT(self);
// Read string
if(len > 0)
{
*aValue = (char *) malloc(len + 1);
if(*aValue)
{
_ctmStreamRead(self, (void *) *aValue, len);
(*aValue)[len] = 0;
}
}
}
//-----------------------------------------------------------------------------
// _ctmStreamWriteSTRING() - Write a string value to a stream. The format of
// the string in the stream is: an unsigned integer (string length) followed by
// the string (without null termination).
//-----------------------------------------------------------------------------
void _ctmStreamWriteSTRING(_CTMcontext * self, const char * aValue)
{
CTMuint len;
// Get string length
if(aValue)
len = strlen(aValue);
else
len = 0;
// Write string length
_ctmStreamWriteUINT(self, len);
// Write string
if(len > 0)
_ctmStreamWrite(self, (void *) aValue, len);
}
//-----------------------------------------------------------------------------
// _ctmStreamReadPackedInts() - Read an compressed binary integer data array
// from a stream, and uncompress it.
//-----------------------------------------------------------------------------
int _ctmStreamReadPackedInts(_CTMcontext * self, CTMint * aData,
CTMuint aCount, CTMuint aSize, CTMint aSignedInts)
{
size_t packedSize, unpackedSize;
CTMuint i, k, x;
CTMint value;
unsigned char * packed, * tmp;
unsigned char props[5];
int lzmaRes;
// Read packed data size from the stream
packedSize = (size_t) _ctmStreamReadUINT(self);
// Read LZMA compression props from the stream
_ctmStreamRead(self, (void *) props, 5);
// Allocate memory and read the packed data from the stream
packed = (unsigned char *) malloc(packedSize);
if(!packed)
{
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
_ctmStreamRead(self, (void *) packed, packedSize);
// Allocate memory for interleaved array
tmp = (unsigned char *) malloc(aCount * aSize * 4);
if(!tmp)
{
free(packed);
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
// Uncompress
unpackedSize = aCount * aSize * 4;
lzmaRes = LzmaUncompress(tmp, &unpackedSize, packed,
&packedSize, props, 5);
// Free the packed array
free(packed);
// Error?
if((lzmaRes != SZ_OK) || (unpackedSize != aCount * aSize * 4))
{
self->mError = CTM_LZMA_ERROR;
free(tmp);
return CTM_FALSE;
}
// Convert interleaved array to integers
for(i = 0; i < aCount; ++ i)
{
for(k = 0; k < aSize; ++ k)
{
value = (CTMint) tmp[i + k * aCount + 3 * aCount * aSize] |
(((CTMint) tmp[i + k * aCount + 2 * aCount * aSize]) << 8) |
(((CTMint) tmp[i + k * aCount + aCount * aSize]) << 16) |
(((CTMint) tmp[i + k * aCount]) << 24);
// Convert signed magnitude to two's complement?
if(aSignedInts)
{
x = (CTMuint) value;
value = (x & 1) ? -(CTMint)((x + 1) >> 1) : (CTMint)(x >> 1);
}
aData[i * aSize + k] = value;
}
}
// Free the interleaved array
free(tmp);
return CTM_TRUE;
}
//-----------------------------------------------------------------------------
// _ctmStreamWritePackedInts() - Compress a binary integer data array, and
// write it to a stream.
//-----------------------------------------------------------------------------
int _ctmStreamWritePackedInts(_CTMcontext * self, CTMint * aData,
CTMuint aCount, CTMuint aSize, CTMint aSignedInts)
{
int lzmaRes, lzmaAlgo;
CTMuint i, k;
CTMint value;
size_t bufSize, outPropsSize;
unsigned char * packed, outProps[5], *tmp;
#ifdef __DEBUG_
CTMuint negCount = 0;
#endif
// Allocate memory for interleaved array
tmp = (unsigned char *) malloc(aCount * aSize * 4);
if(!tmp)
{
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
// Convert integers to an interleaved array
for(i = 0; i < aCount; ++ i)
{
for(k = 0; k < aSize; ++ k)
{
value = aData[i * aSize + k];
// Convert two's complement to signed magnitude?
if(aSignedInts)
value = value < 0 ? -1 - (value << 1) : value << 1;
#ifdef __DEBUG_
else if(value < 0)
++ negCount;
#endif
tmp[i + k * aCount + 3 * aCount * aSize] = value & 0x000000ff;
tmp[i + k * aCount + 2 * aCount * aSize] = (value >> 8) & 0x000000ff;
tmp[i + k * aCount + aCount * aSize] = (value >> 16) & 0x000000ff;
tmp[i + k * aCount] = (value >> 24) & 0x000000ff;
}
}
// Allocate memory for the packed data
bufSize = 1000 + aCount * aSize * 4;
packed = (unsigned char *) malloc(bufSize);
if(!packed)
{
free(tmp);
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
// Call LZMA to compress
outPropsSize = 5;
lzmaAlgo = (self->mCompressionLevel < 1 ? 0 : 1);
lzmaRes = LzmaCompress(packed,
&bufSize,
(const unsigned char *) tmp,
aCount * aSize * 4,
outProps,
&outPropsSize,
self->mCompressionLevel, // Level (0-9)
0, -1, -1, -1, -1, -1, // Default values (set by level)
lzmaAlgo // Algorithm (0 = fast, 1 = normal)
);
// Free temporary array
free(tmp);
// Error?
if(lzmaRes != SZ_OK)
{
self->mError = CTM_LZMA_ERROR;
free(packed);
return CTM_FALSE;
}
#ifdef __DEBUG_
printf("%d->%d bytes (%d negative words)\n", aCount * aSize * 4, (int) bufSize, negCount);
#endif
// Write packed data size to the stream
_ctmStreamWriteUINT(self, (CTMuint) bufSize);
// Write LZMA compression props to the stream
_ctmStreamWrite(self, (void *) outProps, 5);
// Write the packed data to the stream
_ctmStreamWrite(self, (void *) packed, (CTMuint) bufSize);
// Free the packed data
free(packed);
return CTM_TRUE;
}
//-----------------------------------------------------------------------------
// _ctmStreamReadPackedFloats() - Read an compressed binary float data array
// from a stream, and uncompress it.
//-----------------------------------------------------------------------------
int _ctmStreamReadPackedFloats(_CTMcontext * self, CTMfloat * aData,
CTMuint aCount, CTMuint aSize)
{
CTMuint i, k;
size_t packedSize, unpackedSize;
union {
CTMfloat f;
CTMint i;
} value;
unsigned char * packed, * tmp;
unsigned char props[5];
int lzmaRes;
// Read packed data size from the stream
packedSize = (size_t) _ctmStreamReadUINT(self);
// Read LZMA compression props from the stream
_ctmStreamRead(self, (void *) props, 5);
// Allocate memory and read the packed data from the stream
packed = (unsigned char *) malloc(packedSize);
if(!packed)
{
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
_ctmStreamRead(self, (void *) packed, packedSize);
// Allocate memory for interleaved array
tmp = (unsigned char *) malloc(aCount * aSize * 4);
if(!tmp)
{
free(packed);
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
// Uncompress
unpackedSize = aCount * aSize * 4;
lzmaRes = LzmaUncompress(tmp, &unpackedSize, packed,
&packedSize, props, 5);
// Free the packed array
free(packed);
// Error?
if((lzmaRes != SZ_OK) || (unpackedSize != aCount * aSize * 4))
{
self->mError = CTM_LZMA_ERROR;
free(tmp);
return CTM_FALSE;
}
// Convert interleaved array to floats
for(i = 0; i < aCount; ++ i)
{
for(k = 0; k < aSize; ++ k)
{
value.i = (CTMint) tmp[i + k * aCount + 3 * aCount * aSize] |
(((CTMint) tmp[i + k * aCount + 2 * aCount * aSize]) << 8) |
(((CTMint) tmp[i + k * aCount + aCount * aSize]) << 16) |
(((CTMint) tmp[i + k * aCount]) << 24);
aData[i * aSize + k] = value.f;
}
}
// Free the interleaved array
free(tmp);
return CTM_TRUE;
}
//-----------------------------------------------------------------------------
// _ctmStreamWritePackedFloats() - Compress a binary float data array, and
// write it to a stream.
//-----------------------------------------------------------------------------
int _ctmStreamWritePackedFloats(_CTMcontext * self, CTMfloat * aData,
CTMuint aCount, CTMuint aSize)
{
int lzmaRes, lzmaAlgo;
CTMuint i, k;
union {
CTMfloat f;
CTMint i;
} value;
size_t bufSize, outPropsSize;
unsigned char * packed, outProps[5], *tmp;
// Allocate memory for interleaved array
tmp = (unsigned char *) malloc(aCount * aSize * 4);
if(!tmp)
{
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
// Convert floats to an interleaved array
for(i = 0; i < aCount; ++ i)
{
for(k = 0; k < aSize; ++ k)
{
value.f = aData[i * aSize + k];
tmp[i + k * aCount + 3 * aCount * aSize] = value.i & 0x000000ff;
tmp[i + k * aCount + 2 * aCount * aSize] = (value.i >> 8) & 0x000000ff;
tmp[i + k * aCount + aCount * aSize] = (value.i >> 16) & 0x000000ff;
tmp[i + k * aCount] = (value.i >> 24) & 0x000000ff;
}
}
// Allocate memory for the packed data
bufSize = 1000 + aCount * aSize * 4;
packed = (unsigned char *) malloc(bufSize);
if(!packed)
{
free(tmp);
self->mError = CTM_OUT_OF_MEMORY;
return CTM_FALSE;
}
// Call LZMA to compress
outPropsSize = 5;
lzmaAlgo = (self->mCompressionLevel < 1 ? 0 : 1);
lzmaRes = LzmaCompress(packed,
&bufSize,
(const unsigned char *) tmp,
aCount * aSize * 4,
outProps,
&outPropsSize,
self->mCompressionLevel, // Level (0-9)
0, -1, -1, -1, -1, -1, // Default values (set by level)
lzmaAlgo // Algorithm (0 = fast, 1 = normal)
);
// Free temporary array
free(tmp);
// Error?
if(lzmaRes != SZ_OK)
{
self->mError = CTM_LZMA_ERROR;
free(packed);
return CTM_FALSE;
}
#ifdef __DEBUG_
printf("%d->%d bytes\n", aCount * aSize * 4, (int) bufSize);
#endif
// Write packed data size to the stream
_ctmStreamWriteUINT(self, (CTMuint) bufSize);
// Write LZMA compression props to the stream
_ctmStreamWrite(self, (void *) outProps, 5);
// Write the packed data to the stream
_ctmStreamWrite(self, (void *) packed, (CTMuint) bufSize);
// Free the packed data
free(packed);
return CTM_TRUE;
}

View File

@ -2,21 +2,38 @@
# Copyright 2019, 2021, Visual Computing Lab, ISTI - Italian National Research Council
# SPDX-License-Identifier: BSL-1.0
option(ALLOW_BUNDLED_BOOST "Allow use of bundled boost source" ON)
option(ALLOW_SYSTEM_BOOST "Allow use of system-provided boost" ON)
option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_BOOST "Allow download and use of boost source" ON)
option(MESHLAB_ALLOW_SYSTEM_BOOST "Allow use of system-provided boost" ON)
find_package(Boost COMPONENTS thread)
set(BOOST_DIR ${CMAKE_CURRENT_LIST_DIR}/boost_1_75_0)
if(ALLOW_SYSTEM_BOOST AND TARGET Boost::boost)
if(MESHLAB_ALLOW_SYSTEM_BOOST AND TARGET Boost::boost)
message(STATUS "- Boost - using system-provided library")
add_library(external-boost INTERFACE)
target_link_libraries(external-boost INTERFACE Boost::boost)
if (TARGET Boost::thread)
target_link_libraries(external-boost INTERFACE Boost::thread)
endif()
elseif(ALLOW_BUNDLED_BOOST AND EXISTS "${BOOST_DIR}/boost/version.hpp")
message(STATUS "- Boost - using bundled source")
add_library(external-boost INTERFACE)
target_include_directories(external-boost INTERFACE "${BOOST_DIR}")
elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_BOOST)
set(BOOST_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/boost_1_75_0")
set(BOOST_CHECK "${BOOST_DIR}/boost/version.hpp")
if (NOT EXISTS ${BOOST_CHECK})
set(BOOST_LINK https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.zip)
set(BOOST_MD5 d3b276f6d22246171f93282910a1d583)
download_and_unzip(
NAME "Boost"
MD5 ${BOOST_MD5}
LINK ${BOOST_LINK}
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
if (NOT download_and_unzip_SUCCESS)
message(STATUS "- Boost - download failed.")
endif()
endif()
if (EXISTS ${BOOST_CHECK})
message(STATUS "- Boost - using downloaded source")
add_library(external-boost INTERFACE)
target_include_directories(external-boost INTERFACE "${BOOST_DIR}")
endif()
endif()

View File

@ -1,60 +1,98 @@
# Copyright 2019, 2021, Collabora, Ltd.
# Copyright 2019, 2021, Visual Computing Lab, ISTI - Italian National Research Council
# SPDX-License-Identifier: BSL-1.0
option(ALLOW_BUNDLED_CGAL "Allow use of bundled CGAL source" ON)
option(ALLOW_SYSTEM_CGAL "Allow use of system-provided CGAL" ON)
option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL "Allow download and use of CGAL source" ON)
option(MESHLAB_ALLOW_SYSTEM_CGAL "Allow use of system-provided CGAL" ON)
find_package(Threads REQUIRED)
find_package(CGAL)
set(CGAL_DIR "${CMAKE_CURRENT_LIST_DIR}/CGAL-5.2.1")
if(ALLOW_SYSTEM_CGAL AND TARGET CGAL::CGAL)
if(MESHLAB_ALLOW_SYSTEM_CGAL AND TARGET CGAL::CGAL)
message(STATUS "- CGAL - using system-provided library")
add_library(external-cgal INTERFACE)
target_link_libraries(external-cgal INTERFACE CGAL::CGAL Threads::Threads)
elseif(ALLOW_BUNDLED_CGAL AND EXISTS "${CGAL_DIR}/include/CGAL/version.h")
message(STATUS "- CGAL - using bundled source")
add_library(external-cgal INTERFACE)
target_include_directories(external-cgal INTERFACE "${CGAL_DIR}/include/")
if (WIN32)
add_library(mpfr SHARED IMPORTED GLOBAL)
set_property(TARGET mpfr PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib")
set_property(TARGET mpfr PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll")
target_include_directories(mpfr INTERFACE "${CGAL_DIR}/auxiliary/gmp/include")
elseif(MESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL)
set(CGAL_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/CGAL-5.2.1")
set(CGAL_CHECK "${CGAL_DIR}/include/CGAL/version.h")
set(CGAL_WIN_CHECK "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib")
add_library(gmp SHARED IMPORTED GLOBAL)
set_property(TARGET gmp PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib")
set_property(TARGET gmp PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll")
target_link_libraries(external-cgal INTERFACE gmp mpfr Threads::Threads)
else()
find_package(GMP)
find_package(mpfr)
target_include_directories(external-cgal SYSTEM INTERFACE ${GMP_INCLUDE_DIRS})
target_link_libraries(external-cgal INTERFACE ${GMP_LIBRARIES} mpfr Threads::Threads)
endif()
set(CGAL_DOWNLOAD_SUCCESS TRUE)
if (WIN32)
if (DEFINED MESHLAB_LIB_OUTPUT_DIR)
file(
COPY
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll
DESTINATION
${MESHLAB_LIB_OUTPUT_DIR})
if (NOT EXISTS ${CGAL_CHECK})
set(CGAL_LINK
https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1.zip
https://www.meshlab.net/data/libs/CGAL-5.2.1.zip)
set(CGAL_MD5 1a999ab90ea4cf28f6aa17ea2af24876)
download_and_unzip(
NAME "CGAL"
LINK ${CGAL_LINK}
MD5 ${CGAL_MD5}
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
if (NOT download_and_unzip_SUCCESS)
message(STATUS "- CGAL - download failed.")
set(CGAL_DOWNLOAD_SUCCESS FALSE)
endif()
if (DEFINED MESHLAB_LIB_INSTALL_DIR)
install(
FILES
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll
DESTINATION
${MESHLAB_LIB_INSTALL_DIR})
endif()
if (WIN32 AND NOT EXISTS ${CGAL_WIN_CHECK})
set(CGAL_AUX_LINK
https://github.com/CGAL/cgal/releases/download/v5.2.1/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip
https://www.meshlab.net/data/libs/CGAL-5.2.1-win64-auxiliary-libraries-gmp-mpfr.zip)
set(CGAL_AUX_MD5 247f4dca741c6b9a9be76286414070fa)
download_and_unzip(
NAME "CGAL auxiliary libraries"
LINK ${CGAL_AUX_LINK}
MD5 ${CGAL_AUX_MD5}
DIR ${CGAL_DIR})
if (NOT download_and_unzip_SUCCESS)
message(STATUS "- CGAL auxiliary libraries - download failed.")
set(CGAL_DOWNLOAD_SUCCESS FALSE)
endif()
endif()
if (CGAL_DOWNLOAD_SUCCESS)
message(STATUS "- CGAL - using downloaded source")
add_library(external-cgal INTERFACE)
target_include_directories(external-cgal INTERFACE "${CGAL_DIR}/include/")
if (WIN32)
add_library(mpfr SHARED IMPORTED GLOBAL)
set_property(TARGET mpfr PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib")
set_property(TARGET mpfr PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll")
target_include_directories(mpfr INTERFACE "${CGAL_DIR}/auxiliary/gmp/include")
add_library(gmp SHARED IMPORTED GLOBAL)
set_property(TARGET gmp PROPERTY IMPORTED_IMPLIB "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib")
set_property(TARGET gmp PROPERTY IMPORTED_LOCATION "${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll")
target_link_libraries(external-cgal INTERFACE gmp mpfr Threads::Threads)
else()
find_package(GMP)
target_include_directories(external-cgal SYSTEM INTERFACE ${GMP_INCLUDE_DIRS})
target_link_libraries(external-cgal INTERFACE ${GMP_LIBRARIES} mpfr Threads::Threads)
endif()
if (WIN32)
if (DEFINED MESHLAB_LIB_OUTPUT_DIR)
file(
COPY
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll
DESTINATION
${MESHLAB_LIB_OUTPUT_DIR})
endif()
if (DEFINED MESHLAB_LIB_INSTALL_DIR)
install(
FILES
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.lib
${CGAL_DIR}/auxiliary/gmp/lib/libmpfr-4.dll
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.lib
${CGAL_DIR}/auxiliary/gmp/lib/libgmp-10.dll
DESTINATION
${MESHLAB_LIB_INSTALL_DIR})
endif()
endif()
endif()
else()

View File

@ -2,28 +2,40 @@
# Copyright 2019, 2020, 2021 Visual Computing Lab, ISTI - Italian National Research Council
# SPDX-License-Identifier: BSL-1.0
option(ALLOW_BUNDLED_LIBE57_FORMAT "Allow use of bundled libE57Format source" ON)
option(ALLOW_SYSTEM_LIBE57_FORMAT "Allow use of system-provided libE57Format" ON)
option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBE57 "Allow download and use of libE57Format source" ON)
set(E57Format_DIR ${EXTERNAL_DIR}/e57)
if (TARGET XercesC::XercesC)
if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBE57)
set(LIBE57_DIR "${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libE57Format-2.3.0")
set(LIBE57_CHECK "${LIBE57_DIR}/CMakeLists.txt")
if (TARGET external-xerces)
if(ALLOW_SYSTEM_LIBE57_FORMAT AND TARGET E57Format::E57Format)
if (NOT EXISTS ${LIBE57_CHECK})
set(LIBE57_LINK
https://github.com/asmaloney/libE57Format/archive/refs/tags/v2.3.0.zip
https://www.meshlab.net/data/libs/libE57Format-2.3.0.zip)
set(LIBE57_MD5 958ada3883f9b60195f79bbab156f3e3)
download_and_unzip(
NAME "LibE57"
MD5 ${LIBE57_MD5}
LINK ${LIBE57_LINK}
DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR})
if (NOT download_and_unzip_SUCCESS)
message(STATUS "- LibE57 - download failed.")
endif()
endif()
message(STATUS "- libE57Format - using system-provided library")
add_library(external-libE57Format INTERFACE)
target_link_libraries(external-libE57Format INTERFACE E57Format::E57Format)
if (EXISTS ${LIBE57_CHECK})
message(STATUS "- libE57 - using downloaded source")
elseif(ALLOW_BUNDLED_LIBE57_FORMAT)
message(STATUS "- libE57Format - using bundled source")
set(MESSAGE_QUIET ON)
add_subdirectory(e57 EXCLUDE_FROM_ALL)
unset(MESSAGE_QUIET)
add_library(external-libE57Format INTERFACE)
target_link_libraries(external-libE57Format INTERFACE E57Format)
set(MESSAGE_QUIET ON)
add_subdirectory(${LIBE57_DIR} EXCLUDE_FROM_ALL)
unset(MESSAGE_QUIET)
add_library(external-libE57 INTERFACE)
target_link_libraries(external-libE57 INTERFACE E57Format)
install(TARGETS E57Format DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
endif()
endif()
else()
message(STATUS - "Cannot build e57 because Xerces dependence not satisfied.")
endif()

View File

@ -1,68 +0,0 @@
# libE57Format
- v2.2.0 (in development)
- Add and update the E57Simple API from the old reference library ([#41](https://github.com/asmaloney/libE57Format/pull/41)) (Thanks Jiri!)
- Enable building E57Format as a shared library ([#40](https://github.com/asmaloney/libE57Format/pull/40)) (Thanks Amodio!)
- Remove all usage of dynamic_cast<> ([#39](https://github.com/asmaloney/libE57Format/pull/39)) (Thanks Jiri!)
- Added a [clang-format](https://clang.llvm.org/docs/ClangFormat.html) file, a cmake target for it ("format"), and reformatted the code
- Fix building with E57_MAX_VERBOSE defined ([#44](https://github.com/asmaloney/libE57Format/pull/44))
- `E57_V1_0_URI` was changed from a `#define` to a `constexpr`, so if you use it, it will need to be updated with a namespace: `e57::E57_V1_0_URI`
- Split classes out from E57FormatImpl.[h,cpp]
- {win} Fix MSVC warnings ([#34](https://github.com/asmaloney/libE57Format/pull/34))) ([#36](https://github.com/asmaloney/libE57Format/pull/36))
- {cmake} Review and update cmake files
- {doc} Moved some documentation to new repo ([libE57Format-docs](https://github.com/asmaloney/libE57Format-docs)) and generate the [docs](https://asmaloney.github.io/libE57Format-docs/)
- {doc} Add info about using [SPDX License Identifiers](https://spdx.org/ids)
- {ci} Add GitHub Actions to build macOS, Linux, and Windows ([#35](https://github.com/asmaloney/libE57Format/pull/35))
- v2.1.0 (01 Apr 2020)
- handle UTF8 file names on Windows (based on [#26](https://github.com/asmaloney/libE57Format/issues/26))
- now supports _char*_ input ([#22](https://github.com/asmaloney/libE57Format/pull/22))
- internal code cleanups
- {cmake} remove unused ICU requirement for Linux
- {cmake} mark xerces-c as required
- {cmake} added fallback configuration for RelWithDebInfo and MinSizeRel [#29](https://github.com/asmaloney/libE57Format/pull/29)
- {cmake} added proper install configuration [#28](https://github.com/asmaloney/libE57Format/pull/28)
- {cmake} various cleanups
- v2.0.1 (15 Jan 2019)
- writing files was broken and would produce the following error:
Error: bad API function argument provided by user (E57_ERROR_BAD_API_ARGUMENT) (ImageFileImpl.cpp line 109)
- v2.0 (06 Jan 2019)
- forked from E57RefImpl
- removed all but the main sources for reading and writing E57 files
- now requires C++11
- now requires cmake 3.1+
- no longer uses BOOST
- multiple fixes for compilation on macOS
- fix a couple of fallthrough bugs which would result in undefined behaviour
- turn off `E57_MAX_DEBUG` by default
- improve file read times
- add a checksum policy (see _ReadChecksumPolicy_ in *E57Format.h*) so the library user can decide how frequently to check them
- remove "big endian" byte swap code (not sure it was working and no way to test)
- lots and lots of code cleanups
- refactored the code into multiple files
- removed unused macros and code
- remove non-useful comments
- add proper initialization of class and struct members
- modernize using c++11
- [Windows] add cmake option ()`USING_STATIC_XERCES`) to tell the build if you are using a static Xerces lib
# E57RefImpl
- 2013-04-03 roland_schwarz
- e57unpack now also can handle 2d images
- 2013-01-30 roland_schwarz
- added missing library identifier string to cmake build
- 2011-10-04 roland_schwarz
- update to use boost version 1.46.1
- streamlined cmake files for better static linking
- 2011-03-14 roland_schwarz
- E57RefImplConfig.cmake added
- e57validate tool added to cmake
- 2011-03-10: roland_schwarz
- Added E57RefImplConfig.cmake for user project configuration.
- The build instructions can be found inside the CMakeLists.txt file.
- 2010-10-16 roland_schwarz
- e57unpack tool added
- riegl_1 example files added

View File

@ -1,147 +0,0 @@
# This is a rewrite over time of the CMake file from the libe57 reference implementation
# https://en.wikipedia.org/wiki/Ship_of_Theseus
#
# Use git blame to see all the changes and who has contributed.
#
# Original work Copyright 2010-2012 Roland Schwarz, Riegl LMS GmbH
# Modified work Copyright 2018-2020 Andy Maloney <asmaloney@gmail.com>
#
# Permission is hereby granted, free of charge, to any person or organization
# obtaining a copy of the software and accompanying documentation covered by
# this license (the "Software") to use, reproduce, display, distribute,
# execute, and transmit the Software, and to prepare derivative works of the
# Software, and to permit third-parties to whom the Software is furnished to
# do so, all subject to the following:
#
# The copyright notices in the Software and this entire statement, including
# the above license grant, this restriction and the following disclaimer,
# must be included in all copies of the Software, in whole or in part, and
# all derivative works of the Software, unless such copies or derivative
# works are solely in the form of machine-executable object code generated by
# a source language processor.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
cmake_minimum_required( VERSION 3.10.0 )
# Set a private module find path
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" )
project( E57Format
DESCRIPTION
"E57Format is a library to read and write E57 files"
LANGUAGES
CXX
VERSION
2.2.0
)
include( Tags )
# Check if we are building ourself or being included and use this to set some defaults
if ( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
set( E57_BUILDING_SELF ON )
endif()
# propose a default installation directory
if ( E57_BUILDING_SELF )
if( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
string( REGEX REPLACE "/${PROJECT_NAME}" "" CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} )
set( T_ ${PROJECT_NAME} )
set( T_ ${T_}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} )
set( T_ ${T_}-${${PROJECT_NAME}_BUILD_TAG} )
set( CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${T_}
CACHE PATH
"Install path prefix, prepended onto install directories."
FORCE
)
endif()
endif()
find_package( Threads REQUIRED )
#find_package( XercesC REQUIRED )
option( E57_BUILD_SHARED
"Compile E57Format as a shared library"
OFF
)
#if( BUILD_SHARED_LIBS )
# set( E57_BUILD_SHARED ON )
#endif()
set( revision_id "${PROJECT_NAME}-${PROJECT_VERSION}-${${PROJECT_NAME}_BUILD_TAG}" )
message( STATUS "[E57] Revison ID: ${revision_id}" )
# Target
if ( E57_BUILD_SHARED )
message( STATUS "[E57] Building shared library" )
add_library( E57Format SHARED )
else()
message( STATUS "[E57] Building static library" )
add_library( E57Format STATIC )
endif()
include( E57ExportHeader )
# Main sources and includes
add_subdirectory( extern/CRCpp )
add_subdirectory( include )
add_subdirectory( src )
# Target properties
set_target_properties( E57Format
PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
DEBUG_POSTFIX "-d"
POSITION_INDEPENDENT_CODE ON
)
# Target definitions
target_compile_definitions( E57Format
PRIVATE
CRCPP_USE_CPP11
CRCPP_BRANCHLESS
REVISION_ID="${revision_id}"
)
if ( WIN32 )
option( USING_STATIC_XERCES "Turn on if you are linking with Xerces as a static lib" OFF )
if ( USING_STATIC_XERCES )
target_compile_definitions( E57Format
PUBLIC
XERCES_STATIC_LIBRARY
)
endif()
endif()
# Target Libraries
target_link_libraries( E57Format PRIVATE external-xerces )
# Install
if (WIN32)
install(
TARGETS
E57Format
EXPORT
E57Format-export
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
)
else()
install(
TARGETS
E57Format
EXPORT
E57Format-export
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
endif()

View File

@ -1,23 +0,0 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -1,61 +0,0 @@
# libE57Format
[![Build Status](https://travis-ci.org/asmaloney/libE57Format.svg?branch=master)](https://travis-ci.org/asmaloney/libE57Format)
A library to provide read & write support for the E57 file format.
This is a fork of [E57RefImpl](https://sourceforge.net/projects/e57-3d-imgfmt/) v1.1.332. It is primarily for use in the [CloudCompare](https://github.com/CloudCompare/CloudCompare) project, but it should work for anyone else who wants to use it.
The original source is from [E57RefImpl 1.1.332](https://sourceforge.net/projects/e57-3d-imgfmt/files/E57Refimpl-src/) and then everything was stripped out except the main implementation for reading and writing E57.
This version also removes the dependency on [Boost](http://www.boost.org/) and requires C++11.
Many, many other changes were made prior to the first release of this fork. See the [CHANGELOG](CHANGELOG.md) and git history for details.
## Why Fork?
The E57RefImpl code hasn't been touched in years and I wanted to make changes to compile this library with macOS. Forking it gives me a bit more freedom to update the code and make changes as required.
I changed the name of the project so that it is not confused with the **E57RefImpl** project.
I have also changed the main include file's name from `E57Foundation.h` to `E57Format.h` to make sure there is no inclusion confusion.
Versions of **libE57Format** start at 2.0.
## Documentation
The doxygen-generated documentation may be [found here](https://asmaloney.github.io/libE57Format-docs/). These docs are generated and saved in the [libE57Format-docs](https://github.com/asmaloney/libE57Format-docs) repo.
## E57Simple API
Since the original fork, [Jiri Hörner](https://github.com/ptc-jhoerner) has added the E57Simple API from the old reference implementation and updated it.
## Tools
[Ryan Baumann](https://github.com/ryanfb) has updated the `e57unpack` and `e57validate` tools to work with **libE57Format**. You can find them in the [e57tools](https://github.com/ryanfb/e57tools) repo.
## Contributing
I am happy to review any contributions - [pull requests](https://github.com/asmaloney/libE57Format/pulls), [documentation](https://github.com/asmaloney/libE57Format-docs), etc.. Please keep any pull requests as short as possible. Each pull request should be atomic and only address one issue.
This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the code. There is a cmake target (*format*) - which runs *clang-format* on the source files. After changes have been made, and before you submit your pull request, please run the following:
```sh
cmake --build . --target format
```
## License
This project as a whole is licensed under the [**BSL-1.0**](https://opensource.org/licenses/BSL-1.0) license - see the [LICENSE](LICENSE.md) file for details.
Individual source files may contain the following tag instead of the full license text:
SPDX-License-Identifier: BSL-1.0
Some CMake files are licensed under the **MIT** license - see the [LICENSE-MIT](LICENSE-MIT.txt) file for details.
These files contain the following tag instead of the full license text:
SPDX-License-Identifier: MIT
Using SPDX enables machine processing of license information based on the [SPDX License Identifiers](https://spdx.org/ids) and makes it easier for developers to see at a glance which license they are dealing with.

View File

@ -1,38 +0,0 @@
# SPDX-License-Identifier: MIT
# Copyright 2020 Andy Maloney <asmaloney@gmail.com>
# Generate the export header file for E57Format
include( GenerateExportHeader )
set( comment "// NOTE: This is a generated file. Any changes will be overwritten." )
generate_export_header( E57Format
EXPORT_FILE_NAME E57Export.h
EXPORT_MACRO_NAME E57_DLL
CUSTOM_CONTENT_FROM_VARIABLE comment
)
unset( comment )
target_sources( E57Format
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/E57Export.h
)
target_include_directories( ${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
target_compile_definitions( E57Format
PRIVATE
$<$<BOOL:E57_BUILD_SHARED>:E57Format_EXPORTS>
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/E57Export.h
DESTINATION
include/E57Format
)

View File

@ -1,41 +0,0 @@
# This file defines the variables
# ${PROJECT_NAME}_BUILD_TAG
# calculate the tag
set(T_ ${CMAKE_SYSTEM_PROCESSOR})
if (CMAKE_CL_64)
set(T_ ${T_}_64)
endif (CMAKE_CL_64)
string(TOLOWER ${CMAKE_SYSTEM_NAME} T1_)
set(T_ ${T_}-${T1_})
if (MSVC90)
set(T1_ "-vc90")
elseif (MSVC10)
set(T1_ "-vc100")
elseif (MSVC80)
set(T1_ "-vc80")
elseif (MSVC71)
set(T1_ "-vc711")
elseif (MSVC70)
set(T1_ "-vc7")
elseif (MINGW)
set(T1_ "-mgw")
exec_program(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE T2_
)
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" T2_ ${T2_})
set(T1_ ${T1_}${T2_})
elseif (CMAKE_COMPILER_IS_GNUCXX)
set(T1_ "-gcc")
exec_program(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE T2_
)
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" T2_ ${T2_})
set(T1_ ${T1_}${T2_})
else()
set(T1_)
endif()
set(T_ ${T_}${T1_})
set(${PROJECT_NAME}_BUILD_TAG ${T_})

View File

@ -1,9 +0,0 @@
include(CMakeFindDependencyMacro)
find_dependency(XercesC REQUIRED)
include(${CMAKE_CURRENT_LIST_DIR}/E57Format-export.cmake)
set_target_properties(E57Format PROPERTIES
MAP_IMPORTED_CONFIG_MINSIZEREL "MinSizeRel;Release"
MAP_IMPORTED_CONFIG_RELWITHDEBINFO "RelWithDebInfo;Release"
)

View File

@ -1,14 +0,0 @@
# SPDX-License-Identifier: MIT
# Copyright © Andy Maloney <asmaloney@gmail.com>
# CRCpp from here: https://github.com/d-bahr/CRCpp
target_sources( ${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/inc/CRC.h
)
target_include_directories( ${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/inc
)

View File

@ -1,28 +0,0 @@
CRC++
Copyright (c) 2016, Daniel Bahr
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of CRC++ nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,154 +0,0 @@
# CRC++
Easy to use and fast C++ CRC library.
Tired of writing CRC code over and over again? Don't want to include a dozen boost header files just for a little bit of functionality? CRC++ is a portable and extremely lightweight alternative that is incredibly simple, fast, and clean.
### Features
CRC++ supports bit-by-bit and byte-by-byte calculation of full and multipart CRCs. The algorithms used are highly optimized and can even be configured to be branchless (as always, be sure to profile your code to choose the most efficient option). CRC++ is a great option for embedded C++ projects with a need for efficiency.
CRC++ consists of a single header file which can be included in any existing C++ application. No libraries, no boost, no mess, no fuss.
Any CRC width is supported - even CRCs larger than 64 bits, provided there is an integer type large enough to contain it. Trying to compute a 57-bit CRC? Got you covered.
Many common CRCs are provided out-of-the-box, such as CRC-32 (used in PKZip and Ethernet), CRC-XMODEM, and CRC-CCITT.
CRC++ will compile with any reasonably compliant C++03 or C++11 compiler. Compiling with C++11 is recommended, as it allows a number of static computations to be performed at compile-time instead of runtime.
All of the CRC++ code is well-documented. Unit tests are included in the repository (g++ Makefile and Visual Studio 2015 projects included). HTML documentation can also be produced via Doxygen (also included in the repository).
### Comparison
CRC++ boasts one of the fastest and most memory efficient generic CRC implementation available. The below table shows performance comparisons across multiple implementations and platforms.
| Library | Speed, x64 platform (100 million iterations) | Speed, x86 platform (100 million iterations) |
| ------------- | -------------------------------------------- | -------------------------------------------- |
| CRC++ | 2050 milliseconds | 2200 milliseconds |
| boost | 2250 milliseconds | 2000 milliseconds |
| pycrc | 2050 milliseconds | 2240 milliseconds |
| mhash | 2250 milliseconds | 2400 milliseconds |
Additionally, CRC++ has the most features of any library and the smallest code footprint:
| Library | Number of include files | Header-only implemen-tation | Supports byte != 8 bits | Supports arbitrary CRC width | Custom type support | C++11 support | 40+ built-in CRC definitions | Branchless implemen-tation |
| ------------- | ----------------------- | --------------------------- | ----------------------- | ---------------------------- | ------------------- | ------------- | ---------------------------- | -------------------------- |
| CRC++ | 1 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| boost | 17 | Yes | Yes | Yes | Yes | Yes | No | No |
| pycrc | 2 per CRC algorithm | No | No | No | No | No | No | No |
| mhash | 6 | No | Yes | No | No | No | No | No |
### Usage
Computing a CRC is as simple as the following code:
```cpp
#include "CRC.h" // Only need to include this header file!
// No libraries need to be included. No project settings need to be messed with.
#include <iomanip> // Includes ::std::hex
#include <iostream> // Includes ::std::cout
#include <cstdint> // Includes ::std::uint32_t
int main(int argc, char ** argv)
{
const char myString[] = { 'H', 'E', 'L', 'L', 'O', ' ', 'W', 'O', 'R', 'L', 'D' };
std::uint32_t crc = CRC::Calculate(myString, sizeof(myString), CRC::CRC_32());
std::cout << std::hex << crc;
return 0;
}
```
Multi-part CRCs are also supported:
```cpp
int main(int argc, char ** argv)
{
const char myHelloString[] = { 'H', 'E', 'L', 'L', 'O', ' ' };
const char myWorldString[] = { 'W', 'O', 'R', 'L', 'D' };
std::uint32_t crc;
crc = CRC::Calculate(myHelloString, sizeof(myHelloString), CRC::CRC_32());
crc = CRC::Calculate(myWorldString, sizeof(myWorldString), CRC::CRC_32(), crc);
std::cout << std::hex << crc;
return 0;
}
```
This will return the same CRC as the first example.
Both of the above examples compute a CRC bit-by-bit. However, CRC++ also supports lookup tables, as the following example demonstrates:
```cpp
int main(int argc, char ** argv)
{
const char myHelloString[] = { 'H', 'E', 'L', 'L', 'O', ' ' };
const char myWorldString[] = { 'W', 'O', 'R', 'L', 'D' };
CRC::Table<std::uint32_t, 32> table(CRC::CRC_32());
std::uint32_t crc;
crc = CRC::Calculate(myHelloString, sizeof(myHelloString), table);
crc = CRC::Calculate(myWorldString, sizeof(myWorldString), table, crc);
std::cout << std::hex << crc;
return 0;
}
```
Or, if you prefer using the `auto` keyword:
```cpp
int main(int argc, char ** argv)
{
const char myHelloString[] = { 'H', 'E', 'L', 'L', 'O', ' ' };
const char myWorldString[] = { 'W', 'O', 'R', 'L', 'D' };
auto table = CRC::CRC_32().MakeTable();
std::uint32_t crc;
crc = CRC::Calculate(myHelloString, sizeof(myHelloString), table);
crc = CRC::Calculate(myWorldString, sizeof(myWorldString), table, crc);
std::cout << std::hex << crc;
return 0;
}
```
Lookup tables are much faster than computing a CRC bit-by-bit, at the expense of extra memory usage. A lookup table can be reused for as many CRCs as desired until it goes out of scope.
### Configuration
CRC++ can be configured by setting various `#define`s before `#include`-ing the CRC++ header file:
* `#define crcpp_uint8`<br>
Specifies the type used to store CRCs that have a width of 8 bits or less. This type is not used in CRC calculations. Defaults to ::std::uint8_t.
* `#define crcpp_uint16`<br>
Specifies the type used to store CRCs that have a width between 9 and 16 bits (inclusive). This type is not used in CRC calculations. Defaults to ::std::uint16_t.
* `#define crcpp_uint32`<br>
Specifies the type used to store CRCs that have a width between 17 and 32 bits (inclusive). This type is not used in CRC calculations. Defaults to ::std::uint32_t.
* `#define crcpp_uint64`<br>
Specifies the type used to store CRCs that have a width between 33 and 64 bits (inclusive). This type is not used in CRC calculations. Defaults to ::std::uint64_t.
* `#define crcpp_size`<br>
This type is used for loop iteration and function signatures only. Defaults to ::std::size_t.
* `#define CRCPP_USE_NAMESPACE`<br>
Define to place all CRC++ code within the ::CRCPP namespace. Not defined by default.
* `#define CRCPP_BRANCHLESS`<br>
Define to enable a branchless CRC implementation. The branchless implementation uses a single integer multiplication in the bit-by-bit calculation instead of a small conditional. The branchless implementation may be faster on processor architectures which support single-instruction integer multiplication. Not defined by default.
* `#define CRCPP_USE_CPP11`
Define to enables C++11 features (move semantics, constexpr, static_assert, etc.). Not defined by default.
* `#define CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS`
Define to include definitions for little-used CRCs. Not defined by default.
### License
CRC++ is free to use and provided under a BSD license.

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
# SPDX-License-Identifier: MIT
# Copyright 2020 Andy Maloney <asmaloney@gmail.com>
target_sources( ${PROJECT_NAME}
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/E57Exception.h
${CMAKE_CURRENT_LIST_DIR}/E57Format.h
${CMAKE_CURRENT_LIST_DIR}/E57SimpleData.h
${CMAKE_CURRENT_LIST_DIR}/E57SimpleReader.h
${CMAKE_CURRENT_LIST_DIR}/E57SimpleWriter.h
)
install(
FILES
E57Format.h
E57Exception.h
E57SimpleData.h
E57SimpleReader.h
E57SimpleWriter.h
DESTINATION
include/E57Format
)
target_include_directories( ${PROJECT_NAME}
PUBLIC
$<INSTALL_INTERFACE:include/E57Format>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

View File

@ -1,136 +0,0 @@
/*
* Original work Copyright 2009 - 2010 Kevin Ackley (kackley@gwi.net)
* Modified work Copyright 2018 - 2020 Andy Maloney <asmaloney@gmail.com>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <exception>
#include <iostream>
#include <string>
#include "E57Export.h"
namespace e57
{
//! @brief Numeric error identifiers used in E57Exception
enum ErrorCode
{
// N.B. *** When changing error strings here, remember to update the error
// strings in E57Exception.cpp ****
E57_SUCCESS = 0, //!< operation was successful
E57_ERROR_BAD_CV_HEADER = 1, //!< a CompressedVector binary header was bad
E57_ERROR_BAD_CV_PACKET = 2, //!< a CompressedVector binary packet was bad
E57_ERROR_CHILD_INDEX_OUT_OF_BOUNDS = 3, //!< a numerical index identifying a child was out of bounds
E57_ERROR_SET_TWICE = 4, //!< attempted to set an existing child element to a new value
E57_ERROR_HOMOGENEOUS_VIOLATION = 5, //!< attempted to add an E57 Element that would have made the children
//!< of a homogenous Vector have different types
E57_ERROR_VALUE_NOT_REPRESENTABLE = 6, //!< a value could not be represented in the requested type
E57_ERROR_SCALED_VALUE_NOT_REPRESENTABLE = 7, //!< after scaling the result could not be represented in the
//!< requested type
E57_ERROR_REAL64_TOO_LARGE = 8, //!< a 64 bit IEEE float was too large to store in a 32 bit IEEE float
E57_ERROR_EXPECTING_NUMERIC = 9, //!< Expecting numeric representation in user's buffer, found ustring
E57_ERROR_EXPECTING_USTRING = 10, //!< Expecting string representation in user's buffer, found numeric
E57_ERROR_INTERNAL = 11, //!< An unrecoverable inconsistent internal state was detected
E57_ERROR_BAD_XML_FORMAT = 12, //!< E57 primitive not encoded in XML correctly
E57_ERROR_XML_PARSER = 13, //!< XML not well formed
E57_ERROR_BAD_API_ARGUMENT = 14, //!< bad API function argument provided by user
E57_ERROR_FILE_IS_READ_ONLY = 15, //!< can't modify read only file
E57_ERROR_BAD_CHECKSUM = 16, //!< checksum mismatch, file is corrupted
E57_ERROR_OPEN_FAILED = 17, //!< open() failed
E57_ERROR_CLOSE_FAILED = 18, //!< close() failed
E57_ERROR_READ_FAILED = 19, //!< read() failed
E57_ERROR_WRITE_FAILED = 20, //!< write() failed
E57_ERROR_LSEEK_FAILED = 21, //!< lseek() failed
E57_ERROR_PATH_UNDEFINED = 22, //!< E57 element path well formed but not defined
E57_ERROR_BAD_BUFFER = 23, //!< bad SourceDestBuffer
E57_ERROR_NO_BUFFER_FOR_ELEMENT = 24, //!< no buffer specified for an element in CompressedVectorNode during
//!< write
E57_ERROR_BUFFER_SIZE_MISMATCH = 25, //!< SourceDestBuffers not all same size
E57_ERROR_BUFFER_DUPLICATE_PATHNAME = 26, //!< duplicate pathname in CompressedVectorNode read/write
E57_ERROR_BAD_FILE_SIGNATURE = 27, //!< file signature not "ASTM-E57"
E57_ERROR_UNKNOWN_FILE_VERSION = 28, //!< incompatible file version
E57_ERROR_BAD_FILE_LENGTH = 29, //!< size in file header not same as actual
E57_ERROR_XML_PARSER_INIT = 30, //!< XML parser failed to initialize
E57_ERROR_DUPLICATE_NAMESPACE_PREFIX = 31, //!< namespace prefix already defined
E57_ERROR_DUPLICATE_NAMESPACE_URI = 32, //!< namespace URI already defined
E57_ERROR_BAD_PROTOTYPE = 33, //!< bad prototype in CompressedVectorNode
E57_ERROR_BAD_CODECS = 34, //!< bad codecs in CompressedVectorNode
E57_ERROR_VALUE_OUT_OF_BOUNDS = 35, //!< element value out of min/max bounds
E57_ERROR_CONVERSION_REQUIRED = 36, //!< conversion required to assign element value, but not requested
E57_ERROR_BAD_PATH_NAME = 37, //!< E57 path name is not well formed
E57_ERROR_NOT_IMPLEMENTED = 38, //!< functionality not implemented
E57_ERROR_BAD_NODE_DOWNCAST = 39, //!< bad downcast from Node to specific node type
E57_ERROR_WRITER_NOT_OPEN = 40, //!< CompressedVectorWriter is no longer open
E57_ERROR_READER_NOT_OPEN = 41, //!< CompressedVectorReader is no longer open
E57_ERROR_NODE_UNATTACHED = 42, //!< node is not yet attached to tree of ImageFile
E57_ERROR_ALREADY_HAS_PARENT = 43, //!< node already has a parent
E57_ERROR_DIFFERENT_DEST_IMAGEFILE = 44, //!< nodes were constructed with different destImageFiles
E57_ERROR_IMAGEFILE_NOT_OPEN = 45, //!< destImageFile is no longer open
E57_ERROR_BUFFERS_NOT_COMPATIBLE = 46, //!< SourceDestBuffers not compatible with previously given ones
E57_ERROR_TOO_MANY_WRITERS = 47, //!< too many open CompressedVectorWriters of an ImageFile
E57_ERROR_TOO_MANY_READERS = 48, //!< too many open CompressedVectorReaders of an ImageFile
E57_ERROR_BAD_CONFIGURATION = 49, //!< bad configuration string
E57_ERROR_INVARIANCE_VIOLATION = 50 //!< class invariance constraint violation in debug mode
};
class E57_DLL E57Exception : public std::exception
{
public:
void report( const char *reportingFileName = nullptr, int reportingLineNumber = 0,
const char *reportingFunctionName = nullptr, std::ostream &os = std::cout ) const;
ErrorCode errorCode() const;
std::string context() const;
const char *what() const noexcept override;
// For debugging purposes:
const char *sourceFileName() const;
const char *sourceFunctionName() const;
int sourceLineNumber() const;
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
E57Exception() = delete;
E57Exception( ErrorCode ecode, const std::string &context, const std::string &srcFileName = nullptr,
int srcLineNumber = 0, const char *srcFunctionName = nullptr );
~E57Exception() noexcept override = default;
protected:
ErrorCode errorCode_;
std::string context_;
std::string sourceFileName_;
const char *sourceFunctionName_;
int sourceLineNumber_;
//! \endcond
};
namespace Utilities
{
// Get latest version of ASTM standard supported, and library id string
E57_DLL void getVersions( int &astmMajor, int &astmMinor, std::string &libraryId );
E57_DLL std::string errorCodeToString( ErrorCode ecode );
}
}

View File

@ -1,694 +0,0 @@
/*
* E57Format.h - public header of E57 API for reading/writing .e57 files.
*
* Original work Copyright 2009 - 2010 Kevin Ackley (kackley@gwi.net)
* Modified work Copyright 2018 - 2020 Andy Maloney <asmaloney@gmail.com>
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
//! @file E57Format.h header file for the E57 API
#include <cfloat>
#include <memory>
#include <vector>
#include "E57Exception.h"
namespace e57
{
using std::int16_t;
using std::int32_t;
using std::int64_t;
using std::int8_t;
using std::uint16_t;
using std::uint32_t;
using std::uint64_t;
using std::uint8_t;
// Shorthand for unicode string
//! @brief UTF-8 encodeded Unicode string
using ustring = std::string;
//! @brief Identifiers for types of E57 elements
enum NodeType
{
E57_STRUCTURE = 1, //!< StructureNode class
E57_VECTOR = 2, //!< VectorNode class
E57_COMPRESSED_VECTOR = 3, //!< CompressedVectorNode class
E57_INTEGER = 4, //!< IntegerNode class
E57_SCALED_INTEGER = 5, //!< ScaledIntegerNode class
E57_FLOAT = 6, //!< FloatNode class
E57_STRING = 7, //!< StringNode class
E57_BLOB = 8 //!< BlobNode class
};
//! @brief The IEEE floating point number precisions supported
enum FloatPrecision
{
E57_SINGLE = 1, //!< 32 bit IEEE floating point number format
E57_DOUBLE = 2 //!< 64 bit IEEE floating point number format
};
//! @brief Identifies the representations of memory elements API can transfer
//! data to/from
enum MemoryRepresentation
{
E57_INT8 = 1, //!< 8 bit signed integer
E57_UINT8 = 2, //!< 8 bit unsigned integer
E57_INT16 = 3, //!< 16 bit signed integer
E57_UINT16 = 4, //!< 16 bit unsigned integer
E57_INT32 = 5, //!< 32 bit signed integer
E57_UINT32 = 6, //!< 32 bit unsigned integer
E57_INT64 = 7, //!< 64 bit signed integer
E57_BOOL = 8, //!< C++ boolean type
E57_REAL32 = 9, //!< C++ float type
E57_REAL64 = 10, //!< C++ double type
E57_USTRING = 11 //!< Unicode UTF-8 std::string
};
//! @brief Specifies the percentage of checksums which are verified when reading
//! an ImageFile (0-100%).
using ReadChecksumPolicy = int;
constexpr ReadChecksumPolicy CHECKSUM_POLICY_NONE = 0; //! Do not verify the checksums. (fast)
constexpr ReadChecksumPolicy CHECKSUM_POLICY_SPARSE =
25; //! Only verify 25% of the checksums. The last block is always verified.
constexpr ReadChecksumPolicy CHECKSUM_POLICY_HALF =
50; //! Only verify 50% of the checksums. The last block is always verified.
constexpr ReadChecksumPolicy CHECKSUM_POLICY_ALL = 100; //! Verify all checksums. This is the default. (slow)
//! @brief The URI of ASTM E57 v1.0 standard XML namespace
//! Note that even though this URI does not point to a valid document, the standard (section 8.4.2.3)
//! says that this is the required namespace.
constexpr char E57_V1_0_URI[] = "http://www.astm.org/COMMIT/E57/2010-e57-v1.0";
//! @cond documentNonPublic The following aren't documented
// Minimum and maximum values for integers
constexpr int8_t E57_INT8_MIN = -128;
constexpr int8_t E57_INT8_MAX = 127;
constexpr int16_t E57_INT16_MIN = -32768;
constexpr int16_t E57_INT16_MAX = 32767;
constexpr int32_t E57_INT32_MIN = -2147483647 - 1;
constexpr int32_t E57_INT32_MAX = 2147483647;
constexpr int64_t E57_INT64_MIN = -9223372036854775807LL - 1;
constexpr int64_t E57_INT64_MAX = 9223372036854775807LL;
constexpr uint8_t E57_UINT8_MIN = 0U;
constexpr uint8_t E57_UINT8_MAX = 0xffU; /* 255U */
constexpr uint16_t E57_UINT16_MIN = 0U;
constexpr uint16_t E57_UINT16_MAX = 0xffffU; /* 65535U */
constexpr uint32_t E57_UINT32_MIN = 0U;
constexpr uint32_t E57_UINT32_MAX = 0xffffffffU; /* 4294967295U */
constexpr uint64_t E57_UINT64_MIN = 0ULL;
constexpr uint64_t E57_UINT64_MAX = 0xffffffffffffffffULL; /* 18446744073709551615ULL */
constexpr float E57_FLOAT_MIN = -FLT_MAX;
constexpr float E57_FLOAT_MAX = FLT_MAX;
constexpr double E57_DOUBLE_MIN = -DBL_MAX;
constexpr double E57_DOUBLE_MAX = DBL_MAX;
//! @endcond
//! @cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
// Internal implementation files should include E57FormatImpl.h first which
// defines symbol E57_INTERNAL_IMPLEMENTATION_ENABLE. Normal API users should
// not define this symbol. Basically the internal version allows access to the
// pointer to the implementation (impl_)
#ifdef E57_INTERNAL_IMPLEMENTATION_ENABLE
#define E57_OBJECT_IMPLEMENTATION( T ) \
public: \
std::shared_ptr<T##Impl> impl() const \
{ \
return ( impl_ ); \
} \
\
protected: \
std::shared_ptr<T##Impl> impl_;
#else
#define E57_OBJECT_IMPLEMENTATION( T ) \
protected: \
std::shared_ptr<T##Impl> impl_;
#endif
//! @endcond
class BlobNode;
class BlobNodeImpl;
class CompressedVectorNode;
class CompressedVectorNodeImpl;
class CompressedVectorReader;
class CompressedVectorReaderImpl;
class CompressedVectorWriter;
class CompressedVectorWriterImpl;
class FloatNode;
class FloatNodeImpl;
class ImageFile;
class ImageFileImpl;
class IntegerNode;
class IntegerNodeImpl;
class Node;
class NodeImpl;
class ScaledIntegerNode;
class ScaledIntegerNodeImpl;
class SourceDestBuffer;
class SourceDestBufferImpl;
class StringNode;
class StringNodeImpl;
class StructureNode;
class StructureNodeImpl;
class VectorNode;
class VectorNodeImpl;
class E57_DLL Node
{
public:
Node() = delete;
NodeType type() const;
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doDowncast = true );
bool operator==( Node n2 ) const;
bool operator!=( Node n2 ) const;
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
#ifdef E57_INTERNAL_IMPLEMENTATION_ENABLE
explicit Node( std::shared_ptr<NodeImpl> ); // internal use only
#endif
private:
friend class NodeImpl;
E57_OBJECT_IMPLEMENTATION( Node ) // Internal implementation details, not
// part of API, must be last in object
//! \endcond
};
class E57_DLL StructureNode
{
public:
StructureNode() = delete;
StructureNode( ImageFile destImageFile );
int64_t childCount() const;
bool isDefined( const ustring &pathName ) const;
Node get( int64_t index ) const;
Node get( const ustring &pathName ) const;
void set( const ustring &pathName, const Node &n );
// Up/Down cast conversion
operator Node() const;
explicit StructureNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
friend class ImageFile;
StructureNode( std::shared_ptr<StructureNodeImpl> ni ); // internal use only
StructureNode( std::weak_ptr<ImageFileImpl> fileParent ); // internal use only
E57_OBJECT_IMPLEMENTATION( StructureNode ) // Internal implementation details, not part of API, must
// be last in object
//! \endcond
};
class E57_DLL VectorNode
{
public:
VectorNode() = delete;
explicit VectorNode( ImageFile destImageFile, bool allowHeteroChildren = false );
bool allowHeteroChildren() const;
int64_t childCount() const;
bool isDefined( const ustring &pathName ) const;
Node get( int64_t index ) const;
Node get( const ustring &pathName ) const;
void append( const Node &n );
// Up/Down cast conversion
operator Node() const;
explicit VectorNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
friend class CompressedVectorNode;
VectorNode( std::shared_ptr<VectorNodeImpl> ni ); // internal use only
E57_OBJECT_IMPLEMENTATION( VectorNode ) // Internal implementation details, not part of API, must be
// last in object
//! \endcond
};
class E57_DLL SourceDestBuffer
{
public:
SourceDestBuffer() = delete;
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, int8_t *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( int8_t ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, uint8_t *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( uint8_t ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, int16_t *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( int16_t ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, uint16_t *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( uint16_t ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, int32_t *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( int32_t ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, uint32_t *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( uint32_t ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, int64_t *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( int64_t ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, bool *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( bool ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, float *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( float ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, double *b, const size_t capacity,
bool doConversion = false, bool doScaling = false, size_t stride = sizeof( double ) );
SourceDestBuffer( ImageFile destImageFile, const ustring &pathName, std::vector<ustring> *b );
ustring pathName() const;
enum MemoryRepresentation memoryRepresentation() const;
size_t capacity() const;
bool doConversion() const;
bool doScaling() const;
size_t stride() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true ) const;
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
E57_OBJECT_IMPLEMENTATION( SourceDestBuffer ) // Internal implementation details, not part of
// API, must be last in object
//! \endcond
};
class E57_DLL CompressedVectorReader
{
public:
CompressedVectorReader() = delete;
unsigned read();
unsigned read( std::vector<SourceDestBuffer> &dbufs );
void seek( int64_t recordNumber ); // !!! not implemented yet
void close();
bool isOpen();
CompressedVectorNode compressedVectorNode() const;
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
friend class CompressedVectorNode;
CompressedVectorReader( std::shared_ptr<CompressedVectorReaderImpl> ni );
E57_OBJECT_IMPLEMENTATION( CompressedVectorReader ) // Internal implementation details, not
// part of API, must be last in object
//! \endcond
};
class E57_DLL CompressedVectorWriter
{
public:
CompressedVectorWriter() = delete;
void write( const size_t recordCount );
void write( std::vector<SourceDestBuffer> &sbufs, const size_t recordCount );
void close();
bool isOpen();
CompressedVectorNode compressedVectorNode() const;
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
friend class CompressedVectorNode;
CompressedVectorWriter( std::shared_ptr<CompressedVectorWriterImpl> ni );
E57_OBJECT_IMPLEMENTATION( CompressedVectorWriter ) // Internal implementation details, not
// part of API, must be last in object
//! \endcond
};
class E57_DLL CompressedVectorNode
{
public:
CompressedVectorNode() = delete;
explicit CompressedVectorNode( ImageFile destImageFile, const Node &prototype, const VectorNode &codecs );
int64_t childCount() const;
Node prototype() const;
VectorNode codecs() const;
// Iterators
CompressedVectorWriter writer( std::vector<SourceDestBuffer> &sbufs );
CompressedVectorReader reader( const std::vector<SourceDestBuffer> &dbufs );
// Up/Down cast conversion
operator Node() const;
explicit CompressedVectorNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
friend class CompressedVectorReader;
friend class CompressedVectorWriter;
friend class E57XmlParser;
CompressedVectorNode( std::shared_ptr<CompressedVectorNodeImpl> ni ); // internal use only
E57_OBJECT_IMPLEMENTATION( CompressedVectorNode ) // Internal implementation details, not part
// of API, must be last in object
//! \endcond
};
class E57_DLL IntegerNode
{
public:
IntegerNode() = delete;
explicit IntegerNode( ImageFile destImageFile, int64_t value = 0, int64_t minimum = E57_INT64_MIN,
int64_t maximum = E57_INT64_MAX );
int64_t value() const;
int64_t minimum() const;
int64_t maximum() const;
// Up/Down cast conversion
operator Node() const;
explicit IntegerNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
IntegerNode( std::shared_ptr<IntegerNodeImpl> ni ); // internal use only
E57_OBJECT_IMPLEMENTATION( IntegerNode ) // Internal implementation details, not part of API, must be
// last in object
//! \endcond
};
class E57_DLL ScaledIntegerNode
{
public:
ScaledIntegerNode() = delete;
explicit ScaledIntegerNode( ImageFile destImageFile, int64_t rawValue, int64_t minimum, int64_t maximum,
double scale = 1.0, double offset = 0.0 );
explicit ScaledIntegerNode( ImageFile destImageFile, int rawValue, int64_t minimum, int64_t maximum,
double scale = 1.0, double offset = 0.0 );
explicit ScaledIntegerNode( ImageFile destImageFile, int rawValue, int minimum, int maximum, double scale = 1.0,
double offset = 0.0 );
explicit ScaledIntegerNode( ImageFile destImageFile, double scaledValue, double scaledMinimum,
double scaledMaximum, double scale = 1.0, double offset = 0.0 );
int64_t rawValue() const;
double scaledValue() const;
int64_t minimum() const;
double scaledMinimum() const;
int64_t maximum() const;
double scaledMaximum() const;
double scale() const;
double offset() const;
// Up/Down cast conversion
operator Node() const;
explicit ScaledIntegerNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
ScaledIntegerNode( std::shared_ptr<ScaledIntegerNodeImpl> ni ); // internal use only
E57_OBJECT_IMPLEMENTATION( ScaledIntegerNode ) // Internal implementation details, not part of
// API, must be last in object
//! \endcond
};
class E57_DLL FloatNode
{
public:
FloatNode() = delete;
explicit FloatNode( ImageFile destImageFile, double value = 0.0, FloatPrecision precision = E57_DOUBLE,
double minimum = E57_DOUBLE_MIN, double maximum = E57_DOUBLE_MAX );
double value() const;
FloatPrecision precision() const;
double minimum() const;
double maximum() const;
// Up/Down cast conversion
operator Node() const;
explicit FloatNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
FloatNode( std::shared_ptr<FloatNodeImpl> ni ); // internal use only
E57_OBJECT_IMPLEMENTATION( FloatNode ) // Internal implementation details, not part of API, must be
// last in object
//! \endcond
};
class E57_DLL StringNode
{
public:
StringNode() = delete;
explicit StringNode( ImageFile destImageFile, const ustring &value = "" );
ustring value() const;
// Up/Down cast conversion
operator Node() const;
explicit StringNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
friend class StringNodeImpl;
StringNode( std::shared_ptr<StringNodeImpl> ni ); // internal use only
E57_OBJECT_IMPLEMENTATION( StringNode ) // Internal implementation details, not part of API, must be
// last in object
//! \endcond
};
class E57_DLL BlobNode
{
public:
BlobNode() = delete;
explicit BlobNode( ImageFile destImageFile, int64_t byteCount );
int64_t byteCount() const;
void read( uint8_t *buf, int64_t start, size_t count );
void write( uint8_t *buf, int64_t start, size_t count );
// Up/Down cast conversion
operator Node() const;
explicit BlobNode( const Node &n );
// Common generic Node functions
bool isRoot() const;
Node parent() const;
ustring pathName() const;
ustring elementName() const;
ImageFile destImageFile() const;
bool isAttached() const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true, bool doUpcast = true );
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
friend class E57XmlParser;
BlobNode( std::shared_ptr<BlobNodeImpl> ni ); // internal use only
// Internal use only, create blob already in a file
BlobNode( ImageFile destImageFile, int64_t fileOffset, int64_t length );
E57_OBJECT_IMPLEMENTATION( BlobNode ) // Internal implementation details, not
// part of API, must be last in object
//! \endcond
};
class E57_DLL ImageFile
{
public:
ImageFile() = delete;
ImageFile( const ustring &fname, const ustring &mode, ReadChecksumPolicy checksumPolicy = CHECKSUM_POLICY_ALL );
ImageFile( const char *input, const uint64_t size, ReadChecksumPolicy checksumPolicy = CHECKSUM_POLICY_ALL );
StructureNode root() const;
void close();
void cancel();
bool isOpen() const;
bool isWritable() const;
ustring fileName() const;
int writerCount() const;
int readerCount() const;
// Manipulate registered extensions in the file
void extensionsAdd( const ustring &prefix, const ustring &uri );
bool extensionsLookupPrefix( const ustring &prefix, ustring &uri ) const;
bool extensionsLookupUri( const ustring &uri, ustring &prefix ) const;
size_t extensionsCount() const;
ustring extensionsPrefix( const size_t index ) const;
ustring extensionsUri( const size_t index ) const;
// Field name functions:
bool isElementNameExtended( const ustring &elementName ) const;
void elementNameParse( const ustring &elementName, ustring &prefix, ustring &localPart ) const;
// Diagnostic functions:
void dump( int indent = 0, std::ostream &os = std::cout ) const;
void checkInvariant( bool doRecurse = true ) const;
bool operator==( ImageFile imf2 ) const;
bool operator!=( ImageFile imf2 ) const;
//! \cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
private:
ImageFile( double ); // Give a second dummy constructor, better error msg
// for: ImageFile(0)
friend class Node;
friend class StructureNode;
friend class VectorNode;
friend class CompressedVectorNode;
friend class IntegerNode;
friend class ScaledIntegerNode;
friend class FloatNode;
friend class StringNode;
friend class BlobNode;
ImageFile( std::shared_ptr<ImageFileImpl> imfi ); // internal use only
E57_OBJECT_IMPLEMENTATION( ImageFile ) // Internal implementation details, not part of API, must be
// last in object
//! \endcond
};
}

View File

@ -1,654 +0,0 @@
/*
* E57Simple - public header of E57 Simple API for reading/writing .e57 files.
*
* Copyright (c) 2010 Stan Coleby (scoleby@intelisum.com)
* Copyright (c) 2020 PTC Inc.
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
//! @file E57SimpleData.h Data structures for E57 Simple API
#include "E57Format.h"
namespace e57
{
//! Indicates to use FloatNode instead of ScaledIntegerNode in fields that can use both.
constexpr double E57_NOT_SCALED_USE_FLOAT = 0.;
//! Indicates to use ScaledIntegerNode insterad of FloatNode in fields that can use both.
constexpr double E57_NOT_SCALED_USE_INTEGER = -1.;
//! @cond documentNonPublic The following isn't part of the API, and isn't documented.
class ReaderImpl;
class WriterImpl;
//! @endcond
//! @brief Defines a rigid body translation in Cartesian coordinates.
struct E57_DLL Translation
{
double x{ 0. }; //!< The X coordinate of the translation (in meters)
double y{ 0. }; //!< The Y coordinate of the translation (in meters)
double z{ 0. }; //!< The Z coordinate of the translation (in meters)
bool operator==( const Translation &rhs ) const
{
return ( x == rhs.x ) && ( y == rhs.y ) && ( z == rhs.z );
}
bool operator!=( const Translation &rhs ) const
{
return !operator==( rhs );
}
static Translation identity()
{
return {};
}
};
//! @brief Represents a rigid body rotation.
struct E57_DLL Quaternion
{
double w{ 0. }; //!< The real part of the quaternion. Shall be nonnegative
double x{ 0. }; //!< The i coefficient of the quaternion
double y{ 0. }; //!< The j coefficient of the quaternion
double z{ 0. }; //!< The k coefficient of the quaternion
bool operator==( const Quaternion &rhs ) const
{
return ( w == rhs.w ) && ( x == rhs.x ) && ( y == rhs.y ) && ( z == rhs.z );
}
bool operator!=( const Quaternion &rhs ) const
{
return !operator==( rhs );
}
static Quaternion identity()
{
Quaternion identity;
identity.w = 1.;
return identity;
}
};
//! @brief Defines a rigid body transform in cartesian coordinates.
struct E57_DLL RigidBodyTransform
{
Quaternion rotation; //!< A unit quaternion representing the rotation, R, of the transform
Translation translation; //!< The translation point vector, t, of the transform
bool operator==( const RigidBodyTransform &rhs ) const
{
return ( rotation == rhs.rotation ) && ( translation == rhs.translation );
}
bool operator!=( const RigidBodyTransform &rhs ) const
{
return !operator==( rhs );
}
static RigidBodyTransform identity()
{
return { Quaternion::identity(), Translation::identity() };
}
};
//! @brief Specifies an axis-aligned box in local cartesian coordinates.
struct E57_DLL CartesianBounds
{
double xMinimum{ -E57_DOUBLE_MAX }; //!< The minimum extent of the bounding box in the X direction
double xMaximum{ E57_DOUBLE_MAX }; //!< The maximum extent of the bounding box in the X direction
double yMinimum{ -E57_DOUBLE_MAX }; //!< The minimum extent of the bounding box in the Y direction
double yMaximum{ E57_DOUBLE_MAX }; //!< The maximum extent of the bounding box in the Y direction
double zMinimum{ -E57_DOUBLE_MAX }; //!< The minimum extent of the bounding box in the Z direction
double zMaximum{ E57_DOUBLE_MAX }; //!< The maximum extent of the bounding box in the Z direction
bool operator==( const CartesianBounds &rhs ) const
{
return ( xMinimum == rhs.xMinimum ) && ( xMaximum == rhs.xMaximum ) && ( yMinimum == rhs.yMinimum ) &&
( yMaximum == rhs.yMaximum ) && ( zMinimum == rhs.zMinimum ) && ( zMaximum == rhs.zMaximum );
}
bool operator!=( const CartesianBounds &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Stores the bounds of some data in spherical coordinates.
struct E57_DLL SphericalBounds
{
SphericalBounds(); // constructor in the cpp to avoid exposing M_PI
double rangeMinimum; //!< The minimum extent of the bounding region in the r direction
double rangeMaximum; //!< The maximum extent of the bounding region in the r direction
double elevationMinimum; //!< The minimum extent of the bounding region from the horizontal plane
double elevationMaximum; //!< The maximum extent of the bounding region from the horizontal plane
double azimuthStart; //!< The starting azimuth angle defining the extent of the bounding region around the z axis
double azimuthEnd; //!< The ending azimuth angle defining the extent of the bounding region around the z axix
bool operator==( const SphericalBounds &rhs ) const
{
return ( rangeMinimum == rhs.rangeMinimum ) && ( rangeMaximum == rhs.rangeMaximum ) &&
( elevationMinimum == rhs.elevationMinimum ) && ( elevationMaximum == rhs.elevationMaximum ) &&
( azimuthStart == rhs.azimuthStart ) && ( azimuthEnd == rhs.azimuthEnd );
}
bool operator!=( const SphericalBounds &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Stores the minimum and maximum of rowIndex, columnIndex, and returnIndex fields for a set of points.
struct E57_DLL IndexBounds
{
int64_t rowMinimum{ 0 }; //!< The minimum rowIndex value of any point represented by this IndexBounds object.
int64_t rowMaximum{ 0 }; //!< The maximum rowIndex value of any point represented by this IndexBounds object.
int64_t columnMinimum{
0
}; //!< The minimum columnIndex value of any point represented by this IndexBounds object.
int64_t columnMaximum{
0
}; //!< The maximum columnIndex value of any point represented by this IndexBounds object.
int64_t returnMinimum{
0
}; //!< The minimum returnIndex value of any point represented by this IndexBounds object.
int64_t returnMaximum{
0
}; //!< The maximum returnIndex value of any point represented by this IndexBounds object.
bool operator==( const IndexBounds &rhs ) const
{
return ( rowMinimum == rhs.rowMinimum ) && ( rowMaximum == rhs.rowMaximum ) &&
( columnMinimum == rhs.columnMinimum ) && ( columnMaximum == rhs.columnMaximum ) &&
( returnMinimum == rhs.returnMinimum ) && ( returnMaximum == rhs.returnMaximum );
}
bool operator!=( const IndexBounds &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Specifies the limits for the value of signal intensity that a sensor is capable of producing
struct E57_DLL IntensityLimits
{
double intensityMinimum{ 0. }; //!< The minimum producible intensity value. Unit is unspecified.
double intensityMaximum{ 0. }; //!< The maximum producible intensity value. Unit is unspecified.
bool operator==( const IntensityLimits &rhs ) const
{
return ( intensityMinimum == rhs.intensityMinimum ) && ( intensityMaximum == rhs.intensityMaximum );
}
bool operator!=( const IntensityLimits &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Specifies the limits for the value of red, green, and blue color that a sensor is capable of producing.
struct E57_DLL ColorLimits
{
double colorRedMinimum{ 0. }; //!< The minimum producible red color value. Unit is unspecified.
double colorRedMaximum{ 0. }; //!< The maximum producible red color value. Unit is unspecified.
double colorGreenMinimum{ 0. }; //!< The minimum producible green color value. Unit is unspecified.
double colorGreenMaximum{ 0. }; //!< The maximum producible green color value. Unit is unspecified.
double colorBlueMinimum{ 0. }; //!< The minimum producible blue color value. Unit is unspecified.
double colorBlueMaximum{ 0. }; //!< The maximum producible blue color value. Unit is unspecified.
bool operator==( const ColorLimits &rhs ) const
{
return ( colorRedMinimum == rhs.colorRedMinimum ) && ( colorRedMaximum == rhs.colorRedMaximum ) &&
( colorGreenMinimum == rhs.colorGreenMinimum ) && ( colorGreenMaximum == rhs.colorGreenMaximum ) &&
( colorBlueMinimum == rhs.colorBlueMinimum ) && ( colorBlueMaximum == rhs.colorBlueMaximum );
}
bool operator!=( const ColorLimits &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Encodes date and time.
//! @details The date and time is encoded using a single floating point number, stored as an E57 Float element which
//! is based on the Global Positioning
//! System (GPS) time scale.
struct E57_DLL DateTime
{
double dateTimeValue{
0.
}; //!< The time, in seconds, since GPS time was zero. This time specification may include fractions of a second.
int32_t isAtomicClockReferenced{
0
}; //!< This element should be present, and its value set to 1 if, and only if, the time stored in the
//!< dateTimeValue element is obtained from an atomic clock time source. Shall be either 0 or 1.
bool operator==( const DateTime &rhs ) const
{
return ( dateTimeValue == rhs.dateTimeValue ) && ( isAtomicClockReferenced == rhs.isAtomicClockReferenced );
}
bool operator!=( const DateTime &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Stores the top-level information for the XML section of the file.
struct E57_DLL E57Root
{
ustring formatName; //!< Contains the string "ASTM E57 3D Image File"
ustring guid; //!< A globally unique identification string for the current version of the file
uint32_t versionMajor{ 1 }; //!< Major version number, should be 1
uint32_t versionMinor{ 0 }; //!< Minor version number, should be 0
ustring e57LibraryVersion; //!< The version identifier for the E57 file format library that wrote the file.
DateTime creationDateTime; //!< Date/time that the file was created
int64_t data3DSize{ 0 }; //!< Size of the Data3D vector for storing 3D imaging data
int64_t images2DSize{ 0 }; //!< Size of the A heterogeneous Vector of Images2D Structures for storing 2D images
//!< from a camera or similar device.
ustring coordinateMetadata; //!< Information describing the Coordinate Reference System to be used for the file
};
//! @brief Stores information about a single group of points in a row or column
struct E57_DLL LineGroupRecord
{
int64_t idElementValue{
0
}; //!< The value of the identifying element of all members in this group. Shall be in the interval [0, 2^63).
int64_t startPointIndex{
0
}; //!< The record number of the first point in the continuous interval. Shall be in the interval [0, 2^63).
int64_t pointCount{
0
}; //!< The number of PointRecords in the group. Shall be in the interval [1, 2^63). May be zero.
CartesianBounds cartesianBounds; //!< The bounding box (in Cartesian coordinates) of all points in the group
//!< (in the local coordinate system of the points).
SphericalBounds sphericalBounds; //!< The bounding region (in spherical coordinates) of all the points in the
//!< group (in the local coordinate system of the points).
};
//! @brief Stores a set of point groups organized by the rowIndex or columnIndex attribute of the PointRecord
struct E57_DLL GroupingByLine
{
ustring idElementName; //!< The name of the PointRecord element that identifies which group the point is in. The
//!< value of this string must be "rowIndex" or "columnIndex"
int64_t groupsSize{ 0 }; //!< Size of the groups compressedVector of LineGroupRecord structures
int64_t pointCountSize{ 0 }; //!< This is the size value for the LineGroupRecord::pointCount.
};
//! @brief Supports the division of points within an Data3D into logical groupings
struct E57_DLL PointGroupingSchemes
{
GroupingByLine groupingByLine; //!< Grouping information by row or column index
};
//! @brief Used to interrogate if standardized fields are available
struct E57_DLL PointStandardizedFieldsAvailable
{
bool cartesianXField{ false }; //!< Indicates that the PointRecord cartesianX field is active
bool cartesianYField{ false }; //!< Indicates that the PointRecord cartesianY field is active
bool cartesianZField{ false }; //!< Indicates that the PointRecord cartesianZ field is active
bool cartesianInvalidStateField{
false
}; //!< Indicates that the PointRecord cartesianInvalidState field is active
bool sphericalRangeField{ false }; //!< Indicates that the PointRecord sphericalRange field is active
bool sphericalAzimuthField{ false }; //!< Indicates that the PointRecord sphericalAzimuth field is active
bool sphericalElevationField{ false }; //!< Indicates that the PointRecord sphericalElevation field is active
bool sphericalInvalidStateField{
false
}; //!< Indicates that the PointRecord sphericalInvalidState field is active
double pointRangeMinimum{
E57_FLOAT_MIN
}; //!< Indicates that the PointRecord cartesian and range fields should be configured with this minimum value
//!< -E57_FLOAT_MAX or -E57_DOUBLE_MAX. If using a ScaledIntegerNode then this needs to be a minimum range
//!< value.
double pointRangeMaximum{
E57_FLOAT_MAX
}; //!< Indicates that the PointRecord cartesian and range fields should be configured with this maximum value
//!< E57_FLOAT_MAX or E57_DOUBLE_MAX. If using a ScaledIntegerNode then this needs to be a maximum range value.
double pointRangeScaledInteger{
E57_NOT_SCALED_USE_FLOAT
}; //!< Indicates that the PointRecord cartesain and range fields should be configured as a ScaledIntegerNode with
//!< this scale setting. If 0. then use FloatNode.
double angleMinimum{
E57_FLOAT_MIN
}; //!< Indicates that the PointRecord angle fields should be configured with this minimum value -E57_FLOAT_MAX or
//!< -E57_DOUBLE_MAX. If using a ScaledIntegerNode then this needs to be a minimum angle value.
double angleMaximum{
E57_FLOAT_MAX
}; //!< Indicates that the PointRecord angle fields should be configured with this maximum value E57_FLOAT_MAX or
//!< E57_DOUBLE_MAX. If using a ScaledIntegerNode then this needs to be a maximum angle value.
double angleScaledInteger{
E57_NOT_SCALED_USE_FLOAT
}; //!< Indicates that the PointRecord angle fields should be configured as a ScaledIntegerNode with this scale
//!< setting. If 0. then use FloatNode.
bool rowIndexField{ false }; //!< Indicates that the PointRecord rowIndex field is active
uint32_t rowIndexMaximum{ E57_UINT32_MAX }; //!< Indicates that the PointRecord index fields should be configured
//!< with this maximum value where the minimum will be set to 0.
bool columnIndexField{ false }; //!< Indicates that the PointRecord columnIndex field is active
uint32_t columnIndexMaximum{
E57_UINT32_MAX
}; //!< Indicates that the PointRecord index fields should be configured with this maximum value where the minimum
//!< will be set to 0.
bool returnIndexField{ false }; //!< Indicates that the PointRecord returnIndex field is active
bool returnCountField{ false }; //!< Indicates that the PointRecord returnCount field is active
uint8_t returnMaximum{ E57_UINT8_MAX }; //!< Indicates that the PointRecord return fields should be configured
//!< with this maximum value where the minimum will be set to 0.
bool timeStampField{ false }; //!< Indicates that the PointRecord timeStamp field is active
bool isTimeStampInvalidField{ false }; //!< Indicates that the PointRecord isTimeStampInvalid field is active
double timeMaximum{
E57_DOUBLE_MAX
}; //!< Indicates that the PointRecord timeStamp fields should be configured with this maximum value. like
//!< E57_UINT32_MAX, E57_FLOAT_MAX or E57_DOUBLE_MAX
double timeMinimum{ E57_DOUBLE_MIN }; //!< Indicates that the PointRecord timeStamp fields should be configured
//!< with this minimum value -E57_FLOAT_MAX or -E57_DOUBLE_MAX. If using a
//!< ScaledIntegerNode then this needs to be a minimum time value.
double timeScaledInteger{
E57_NOT_SCALED_USE_FLOAT
}; //!< Indicates that the PointRecord timeStamp fields should be configured as a ScaledIntegerNode with this
//!< scale setting. If 0. then use FloatNode, if -1. use IntegerNode.
bool intensityField{ false }; //!< Indicates that the PointRecord intensity field is active
bool isIntensityInvalidField{ false }; //!< Indicates that the PointRecord isIntensityInvalid field is active
double intensityScaledInteger{
E57_NOT_SCALED_USE_INTEGER
}; //!< Indicates that the PointRecord intensity fields should be configured as a ScaledIntegerNode with this
//!< setting. If 0. then use FloatNode, if -1. use IntegerNode
bool colorRedField{ false }; //!< indicates that the PointRecord colorRed field is active
bool colorGreenField{ false }; //!< indicates that the PointRecord colorGreen field is active
bool colorBlueField{ false }; //!< indicates that the PointRecord colorBlue field is active
bool isColorInvalidField{ false }; //!< Indicates that the PointRecord isColorInvalid field is active
bool normalX{ false }; //!< Indicates that the PointRecord nor:normalX field is active
bool normalY{ false }; //!< Indicates that the PointRecord nor:normalY field is active
bool normalZ{ false }; //!< Indicates that the PointRecord nor:normalZ field is active
};
//! @brief Stores the top-level information for a single lidar scan
struct E57_DLL Data3D
{
ustring name; //!< A user-defined name for the Data3D.
ustring guid; //!< A globally unique identification string for the current version of the Data3D object
std::vector<ustring> originalGuids; //!< A vector of globally unique identification Strings from which the points
//!< in this Data3D originated.
ustring description; //!< A user-defined description of the Image
ustring sensorVendor; //!< The name of the manufacturer for the sensor used to collect the points in this Data3D.
ustring sensorModel; //!< The model name or number for the sensor.
ustring sensorSerialNumber; //!< The serial number for the sensor.
ustring sensorHardwareVersion; //!< The version number for the sensor hardware at the time of data collection.
ustring sensorSoftwareVersion; //!< The version number for the software used for the data collection.
ustring sensorFirmwareVersion; //!< The version number for the firmware installed in the sensor at the time of
//!< data collection.
float temperature{ E57_FLOAT_MAX }; //!< The ambient temperature, measured at the sensor, at the time of data
//!< collection (in degrees Celsius).
float relativeHumidity{ E57_FLOAT_MAX }; //!< The percentage relative humidity, measured at the sensor, at the
//!< time of data collection. Shall be in the interval [0, 100].
float atmosphericPressure{ E57_FLOAT_MAX }; //!< The atmospheric pressure, measured at the sensor, at the time of
//!< data collection (in Pascals). Shall be positive.
DateTime acquisitionStart; //!< The start date and time that the data was acquired.
DateTime acquisitionEnd; //!< The end date and time that the data was acquired.
RigidBodyTransform pose; //!< A rigid body transform that describes the coordinate frame of the 3D imaging
//!< system origin in the file-level coordinate system.
IndexBounds indexBounds; //!< The bounds of the row, column, and return number of all the points in this Data3D.
CartesianBounds cartesianBounds; //!< The bounding region (in cartesian coordinates) of all the points in
//!< this Data3D (in the local coordinate system of the points).
SphericalBounds sphericalBounds; //!< The bounding region (in spherical coordinates) of all the points in
//!< this Data3D (in the local coordinate system of the points).
IntensityLimits
intensityLimits; //!< The limits for the value of signal intensity that the sensor is capable of producing.
ColorLimits colorLimits; //!< The limits for the value of red, green, and blue color that the sensor is
//!< capable of producing.
PointGroupingSchemes pointGroupingSchemes; //!< The defined schemes that group points in different ways
PointStandardizedFieldsAvailable
pointFields; //!< This defines the active fields used in the WritePoints function.
int64_t pointsSize{ 0 }; //!< Total size of the compressed vector of PointRecord structures referring to the
//!< binary data that actually stores the point data
};
//! @brief Stores pointers to user-provided buffers
template <typename COORDTYPE=float>
struct Data3DPointsData_t
{
COORDTYPE *cartesianX{
nullptr
}; //!< pointer to a buffer with the X coordinate (in meters) of the point in Cartesian coordinates
COORDTYPE *cartesianY{
nullptr
}; //!< pointer to a buffer with the Y coordinate (in meters) of the point in Cartesian coordinates
COORDTYPE *cartesianZ{
nullptr
}; //!< pointer to a buffer with the Z coordinate (in meters) of the point in Cartesian coordinates
int8_t *cartesianInvalidState{ nullptr }; //!< Value = 0 if the point is considered valid, 1 otherwise
float *intensity{ nullptr }; //!< pointer to a buffer with the Point response intensity. Unit is unspecified
int8_t *isIntensityInvalid{ nullptr }; //!< Value = 0 if the intensity is considered valid, 1 otherwise
uint8_t *colorRed{ nullptr }; //!< pointer to a buffer with the Red color coefficient. Unit is unspecified
uint8_t *colorGreen{ nullptr }; //!< pointer to a buffer with the Green color coefficient. Unit is unspecified
uint8_t *colorBlue{ nullptr }; //!< pointer to a buffer with the Blue color coefficient. Unit is unspecified
int8_t *isColorInvalid{ nullptr }; //!< Value = 0 if the color is considered valid, 1 otherwise
COORDTYPE *sphericalRange{
nullptr
}; //!< pointer to a buffer with the range (in meters) of points in spherical coordinates. Shall be non-negative
COORDTYPE *sphericalAzimuth{
nullptr
}; //!< pointer to a buffer with the Azimuth angle (in radians) of point in spherical coordinates
COORDTYPE *sphericalElevation{
nullptr
}; //!< pointer to a buffer with the Elevation angle (in radians) of point in spherical coordinates
int8_t *sphericalInvalidState{ nullptr }; //!< Value = 0 if the range is considered valid, 1 otherwise
int32_t *rowIndex{ nullptr }; //!< pointer to a buffer with the row number of point (zero based). This is useful
//!< for data that is stored in a regular grid. Shall be in the interval (0, 2^31).
int32_t *columnIndex{
nullptr
}; //!< pointer to a buffer with the column number of point (zero based). This is useful for data that is stored
//!< in a regular grid. Shall be in the interval (0, 2^31).
int8_t *returnIndex{
nullptr
}; //!< pointer to a buffer with the number of this return (zero based). That is, 0 is the first return, 1 is the
//!< second, and so on. Shall be in the interval (0, returnCount). Only for multi-return sensors.
int8_t *returnCount{
nullptr
}; //!< pointer to a buffer with the total number of returns for the pulse that this corresponds to. Shall be in
//!< the interval (0, 2^7). Only for multi-return sensors.
double *timeStamp{
nullptr
}; //!< pointer to a buffer with the time (in seconds) since the start time for the data, which is given by
//!< acquisitionStart in the parent Data3D Structure. Shall be non-negative
int8_t *isTimeStampInvalid{ nullptr }; //!< Value = 0 if the timeStamp is considered valid, 1 otherwise
// E57_EXT_surface_normals
float *normalX{ nullptr }; //!< The X component of a surface normal vector (E57_EXT_surface_normals).
float *normalY{ nullptr }; //!< The Y component of a surface normal vector (E57_EXT_surface_normals).
float *normalZ{ nullptr }; //!< The Z component of a surface normal vector (E57_EXT_surface_normals).
};
typedef Data3DPointsData_t<float> Data3DPointsData;
typedef Data3DPointsData_t<double> Data3DPointsData_d;
//! @brief Stores an image that is to be used only as a visual reference.
struct E57_DLL VisualReferenceRepresentation
{
int64_t jpegImageSize{ 0 }; //!< Size of JPEG format image data in BlobNode.
int64_t pngImageSize{ 0 }; //!< Size of PNG format image data in BlobNode.
int64_t imageMaskSize{ 0 }; //!< Size of PNG format image mask in BlobNode.
int32_t imageWidth{ 0 }; //!< The image width (in pixels). Shall be positive
int32_t imageHeight{ 0 }; //!< The image height (in pixels). Shall be positive
bool operator==( const VisualReferenceRepresentation &rhs ) const
{
return ( jpegImageSize == rhs.jpegImageSize ) && ( pngImageSize == rhs.pngImageSize ) &&
( imageMaskSize == rhs.imageMaskSize ) && ( imageWidth == rhs.imageWidth ) &&
( imageHeight == rhs.imageHeight );
}
bool operator!=( const VisualReferenceRepresentation &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Stores an image that is mapped from 3D using the pinhole camera projection model.
struct E57_DLL PinholeRepresentation
{
int64_t jpegImageSize{ 0 }; //!< Size of JPEG format image data in BlobNode.
int64_t pngImageSize{ 0 }; //!< Size of PNG format image data in BlobNode.
int64_t imageMaskSize{ 0 }; //!< Size of PNG format image mask in BlobNode.
int32_t imageWidth{ 0 }; //!< The image width (in pixels). Shall be positive
int32_t imageHeight{ 0 }; //!< The image height (in pixels). Shall be positive
double focalLength{ 0. }; //!< The camera's focal length (in meters). Shall be positive
double pixelWidth{ 0. }; //!< The width of the pixels in the camera (in meters). Shall be positive
double pixelHeight{ 0. }; //!< The height of the pixels in the camera (in meters). Shall be positive
double principalPointX{
0.
}; //!< The X coordinate in the image of the principal point, (in pixels). The principal point is the intersection
//!< of the z axis of the camera coordinate frame with the image plane.
double principalPointY{ 0. }; //!< The Y coordinate in the image of the principal point (in pixels).
bool operator==( const PinholeRepresentation &rhs ) const
{
return ( jpegImageSize == rhs.jpegImageSize ) && ( pngImageSize == rhs.pngImageSize ) &&
( imageMaskSize == rhs.imageMaskSize ) && ( imageWidth == rhs.imageWidth ) &&
( imageHeight == rhs.imageHeight ) && ( focalLength == rhs.focalLength ) &&
( pixelWidth == rhs.pixelWidth ) && ( pixelHeight == rhs.pixelHeight ) &&
( principalPointX == rhs.principalPointX ) && ( principalPointY == rhs.principalPointY );
}
bool operator!=( const PinholeRepresentation &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Stores an image that is mapped from 3D using a spherical projection model
struct E57_DLL SphericalRepresentation
{
int64_t jpegImageSize{ 0 }; //!< Size of JPEG format image data in BlobNode.
int64_t pngImageSize{ 0 }; //!< Size of PNG format image data in BlobNode.
int64_t imageMaskSize{ 0 }; //!< Size of PNG format image mask in BlobNode.
int32_t imageWidth{ 0 }; //!< The image width (in pixels). Shall be positive
int32_t imageHeight{ 0 }; //!< The image height (in pixels). Shall be positive
double pixelWidth{ 0. }; //!< The width of a pixel in the image (in radians). Shall be positive
double pixelHeight{ 0. }; //!< The height of a pixel in the image (in radians). Shall be positive.
bool operator==( const SphericalRepresentation &rhs ) const
{
return ( jpegImageSize == rhs.jpegImageSize ) && ( pngImageSize == rhs.pngImageSize ) &&
( imageMaskSize == rhs.imageMaskSize ) && ( imageWidth == rhs.imageWidth ) &&
( imageHeight == rhs.imageHeight ) && ( pixelWidth == rhs.pixelWidth ) &&
( pixelHeight == rhs.pixelHeight );
}
bool operator!=( const SphericalRepresentation &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Stores an image that is mapped from 3D using a cylindrical projection model.
struct E57_DLL CylindricalRepresentation
{
int64_t jpegImageSize{ 0 }; //!< Size of JPEG format image data in Blob.
int64_t pngImageSize{ 0 }; //!< Size of PNG format image data in Blob.
int64_t imageMaskSize{ 0 }; //!< Size of PNG format image mask in Blob.
int32_t imageWidth{ 0 }; //!< The image width (in pixels). Shall be positive
int32_t imageHeight{ 0 }; //!< The image height (in pixels). Shall be positive
double pixelWidth{ 0. }; //!< The width of a pixel in the image (in radians). Shall be positive
double pixelHeight{ 0. }; //!< The height of a pixel in the image (in meters). Shall be positive
double radius{ 0. }; //!< The closest distance from the cylindrical image surface to the center of projection
//!< (that is, the radius of the cylinder) (in meters). Shall be non-negative
double principalPointY{ 0. }; //!< The Y coordinate in the image of the principal point (in pixels). This is the
//!< intersection of the z = 0 plane with the image
bool operator==( const CylindricalRepresentation &rhs ) const
{
return ( jpegImageSize == rhs.jpegImageSize ) && ( pngImageSize == rhs.pngImageSize ) &&
( imageMaskSize == rhs.imageMaskSize ) && ( imageWidth == rhs.imageWidth ) &&
( imageHeight == rhs.imageHeight ) && ( pixelWidth == rhs.pixelWidth ) &&
( pixelHeight == rhs.pixelHeight ) && ( radius == rhs.radius ) &&
( principalPointY == rhs.principalPointY );
}
bool operator!=( const CylindricalRepresentation &rhs ) const
{
return !operator==( rhs );
}
};
//! @brief Stores an image from a camera
struct E57_DLL Image2D
{
ustring name; //!< A user-defined name for the Image2D.
ustring guid; //!< A globally unique identification string for the current version of the Image2D object
ustring description; //!< A user-defined description of the Image2D
DateTime acquisitionDateTime; //!< The date and time that the image was taken
ustring associatedData3DGuid; //!< The globally unique identification string (guid element) for the Data3D that
//!< was being acquired when the picture was taken
ustring sensorVendor; //!< The name of the manufacturer for the sensor used to collect the points in this Data3D.
ustring sensorModel; //!< The model name or number for the sensor.
ustring sensorSerialNumber; //!< The serial number for the sensor.
RigidBodyTransform pose; //!< A rigid body transform that describes the coordinate frame of the camera in the
//!< file-level coordinate system
VisualReferenceRepresentation
visualReferenceRepresentation; //!< Representation for an image that does not define any camera projection
//!< model. The image is to be used for visual reference only
PinholeRepresentation
pinholeRepresentation; //!< Representation for an image using the pinhole camera projection model
SphericalRepresentation
sphericalRepresentation; //!< Representation for an image using the spherical camera projection model.
CylindricalRepresentation
cylindricalRepresentation; //!< Representation for an image using the cylindrical camera projection model
};
//! @brief Identifies the format representation for the image data
enum Image2DType
{
E57_NO_IMAGE = 0, //!< No image data
E57_JPEG_IMAGE = 1, //!< JPEG format image data.
E57_PNG_IMAGE = 2, //!< PNG format image data.
E57_PNG_IMAGE_MASK = 3 //!< PNG format image mask.
};
//! @brief Identifies the representation for the image data
enum Image2DProjection
{
E57_NO_PROJECTION = 0, //!< No representation for the image data is present
E57_VISUAL = 1, //!< VisualReferenceRepresentation for the image data
E57_PINHOLE = 2, //!< PinholeRepresentation for the image data
E57_SPHERICAL = 3, //!< SphericalRepresentation for the image data
E57_CYLINDRICAL = 4 //!< CylindricalRepresentation for the image data
};
} // end namespace e57

View File

@ -1,186 +0,0 @@
/*
* E57Simple - public header of E57 Simple API for reading/writing .e57 files.
*
* Copyright (c) 2010 Stan Coleby (scoleby@intelisum.com)
* Copyright (c) 2020 PTC Inc.
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
//! @file E57SimpleReader.h E57 Simple API for reading E57
#include "E57SimpleData.h"
namespace e57
{
//! @brief Used for reading of the E57 file with E57 Simple API
class E57_DLL Reader
{
public:
//! @brief This function is the constructor for the reader class
//! @param [in] filePath file path to E57 file
Reader( const ustring &filePath );
//! @brief This function returns true if the file is open
bool IsOpen() const;
//! @brief This function closes the file
bool Close();
//! @name File information
//!@{
//! @brief This function returns the file header information
//! @param [out] fileHeader is the main header information
//! @return Returns true if sucessful
bool GetE57Root( E57Root &fileHeader ) const;
//!@}
//! @name Image2D
//!@{
//! @brief This function returns the total number of Picture Blocks
//! @return Returns the number of Image2D blocks
int64_t GetImage2DCount() const;
//! @brief This function returns the image2D header and positions the cursor
//! @param [in] imageIndex This in the index into the image2D vector
//! @param [out] image2DHeader pointer to the Image2D structure to receive the picture information
//! @return Returns true if sucessful
bool ReadImage2D( int64_t imageIndex, Image2D &image2DHeader ) const;
//! @brief This function returns the size of the image data
//! @param [in] imageIndex This in the index into the image2D vector
//! @param [out] imageProjection identifies the projection in the image2D.
//! @param [out] imageType identifies the image format of the projection.
//! @param [out] imageWidth The image width (in pixels).
//! @param [out] imageHeight The image height (in pixels).
//! @param [out] imageSize This is the total number of bytes for the image blob.
//! @param [out] imageMaskType This is E57_PNG_IMAGE_MASK if "imageMask" is defined in the projection
//! @param [out] imageVisualType This is image type of the VisualReferenceRepresentation if given.
//! @return Returns true if sucessful
bool GetImage2DSizes( int64_t imageIndex, Image2DProjection &imageProjection, Image2DType &imageType,
int64_t &imageWidth, int64_t &imageHeight, int64_t &imageSize, Image2DType &imageMaskType,
Image2DType &imageVisualType ) const;
//! @brief This function reads an image
//! @param [in] imageIndex index of the image. Must be less than GetImage2DCount()
//! @param [in] imageProjection identifies the projection desired.
//! @param [in] imageType identifies the image format desired.
//! @param [out] buffer pointer the raw image buffer
//! @param [in] start position in the block to start reading
//! @param [in] count size of desired chuck or buffer size
//! @return Returns the number of bytes transferred.
int64_t ReadImage2DData( int64_t imageIndex, Image2DProjection imageProjection, Image2DType imageType,
void *buffer, int64_t start, int64_t count ) const;
//!@}
//! @name Data3D
//!@{
//! @brief This function returns the total number of Data3D Blocks
//! @return Returns number of Data3D blocks.
int64_t GetData3DCount() const;
//! @brief This function returns the Data3D header
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
//! @param [out] data3DHeader Data3D header
//! @return Returns true if sucessful
bool ReadData3D( int64_t dataIndex, Data3D &data3DHeader ) const;
//! @brief This function returns the size of the point data
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
//! @param [out] rowMax This is the maximum row size
//! @param [out] columnMax This is the maximum column size
//! @param [out] pointsSize This is the total number of point records
//! @param [out] groupsSize This is the total number of group reocrds
//! @param [out] countSize This is the maximum point count per group
//! @param [out] columnIndex This indicates that the idElementName is "columnIndex"
//! @return Return true if sucessful, false otherwise
bool GetData3DSizes( int64_t dataIndex, int64_t &rowMax, int64_t &columnMax, int64_t &pointsSize,
int64_t &groupsSize, int64_t &countSize, bool &columnIndex ) const;
//! @brief This funtion reads the group data into the provided buffers.
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
//! @param [in] groupCount size of each of the buffers given
//! @param [out] idElementValue pointer to the buffer holding indices index for this group
//! @param [out] startPointIndex pointer to the buffer holding Starting index in to the "points" data vector for
//! the groups
//! @param [out] pointCount pointer to the buffer holding size of the groups given
//! @return Return true if sucessful, false otherwise
bool ReadData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue,
int64_t *startPointIndex, int64_t *pointCount ) const;
//! @brief Use this function to read the actual 3D data
//! @details All the non-NULL buffers in buffers have number of elements = pointCount.
//! Call the CompressedVectorReader::read() until all data is read.
//! @param [in] dataIndex data block index given by the NewData3D
//! @param [in] pointCount size of each element buffer.
//! @param [in] buffers pointers to user-provided buffers
//! @return vector reader setup to read the selected data into the provided buffers
CompressedVectorReader SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
const Data3DPointsData &buffers ) const;
//! @brief Use this function to read the actual 3D data
//! @details All the non-NULL buffers in buffers have number of elements = pointCount.
//! Call the CompressedVectorReader::read() until all data is read.
//! @param [in] dataIndex data block index given by the NewData3D
//! @param [in] pointCount size of each element buffer.
//! @param [in] buffers pointers to user-provided buffers
//! @return vector reader setup to read the selected data into the provided buffers
CompressedVectorReader SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
const Data3DPointsData_d &buffers ) const;
//!@}
//! @name Foundation API file information
//!@{
//! @brief Returns the file raw E57Root Structure Node
StructureNode GetRawE57Root() const;
//! @brief Returns the raw Data3D Vector Node
VectorNode GetRawData3D() const;
//! @brief Returns the raw Image2D Vector Node
VectorNode GetRawImages2D() const;
//! @brief Returns the ram ImageFile Node which is need to add enhancements
ImageFile GetRawIMF() const;
//!@}
//! @cond documentNonPublic The following isn't part of the API, and isn't
//! documented.
protected:
friend class ReaderImpl;
E57_OBJECT_IMPLEMENTATION( Reader ) // Internal implementation details, not part of API, must be last in object
//! @endcond
}; // end Reader class
} // end namespace e57

Some files were not shown because too many files have changed in this diff Show More