Added OpenCTM to the external libraries

This commit is contained in:
Paolo Cignoni cignoni 2011-09-09 14:39:03 +00:00
parent d6de8b050a
commit 14c4952d8d
70 changed files with 16906 additions and 0 deletions

100
src/external/OpenCTM-1.0.3/COMPILING.txt vendored Normal file
View File

@ -0,0 +1,100 @@
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

20
src/external/OpenCTM-1.0.3/LICENSE.txt vendored Normal file
View File

@ -0,0 +1,20 @@
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

@ -0,0 +1,65 @@
###############################################################################
# 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

@ -0,0 +1,64 @@
###############################################################################
# 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

@ -0,0 +1,45 @@
###############################################################################
# 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

@ -0,0 +1,45 @@
###############################################################################
# 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 ..

152
src/external/OpenCTM-1.0.3/README.txt vendored Normal file
View File

@ -0,0 +1,152 @@
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

@ -0,0 +1,38 @@
<!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

@ -0,0 +1,51 @@
<!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

@ -0,0 +1,508 @@
<!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

@ -0,0 +1,51 @@
<!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

@ -0,0 +1,476 @@
<!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

@ -0,0 +1,37 @@
<!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

@ -0,0 +1,106 @@
<!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

@ -0,0 +1,37 @@
<!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

@ -0,0 +1,498 @@
/* 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.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,37 @@
<!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

@ -0,0 +1,216 @@
<!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

@ -0,0 +1,216 @@
<!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

@ -0,0 +1,313 @@
<!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

@ -0,0 +1,54 @@
<!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

@ -0,0 +1,48 @@
<!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

@ -0,0 +1,193 @@
<!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

@ -0,0 +1,135 @@
<!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

@ -0,0 +1,63 @@
<!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

@ -0,0 +1,93 @@
<!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

@ -0,0 +1,287 @@
<!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

@ -0,0 +1,46 @@
<!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

@ -0,0 +1,333 @@
<!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.

After

Width:  |  Height:  |  Size: 35 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,105 @@
/* 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;
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,92 @@
.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

@ -0,0 +1,86 @@
.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

@ -0,0 +1,81 @@
###############################################################################
# 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

@ -0,0 +1,86 @@
###############################################################################
# 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

@ -0,0 +1,87 @@
###############################################################################
# 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

@ -0,0 +1,103 @@
###############################################################################
# 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

@ -0,0 +1,324 @@
//-----------------------------------------------------------------------------
// 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

@ -0,0 +1,181 @@
//-----------------------------------------------------------------------------
// 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

@ -0,0 +1,147 @@
//-----------------------------------------------------------------------------
// 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

@ -0,0 +1,127 @@
/* 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

@ -0,0 +1,34 @@
/* 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

@ -0,0 +1,751 @@
/* 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

@ -0,0 +1,107 @@
/* 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

@ -0,0 +1,54 @@
/* 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

@ -0,0 +1,223 @@
/* 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

@ -0,0 +1,72 @@
/* 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

@ -0,0 +1,48 @@
/* 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

@ -0,0 +1,136 @@
/* 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

@ -0,0 +1,84 @@
/* 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

@ -0,0 +1,210 @@
/* 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

@ -0,0 +1,7 @@
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

@ -0,0 +1,32 @@
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

@ -0,0 +1,32 @@
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

@ -0,0 +1,32 @@
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

1423
src/external/OpenCTM-1.0.3/lib/openctm.c vendored Normal file

File diff suppressed because it is too large Load Diff

655
src/external/OpenCTM-1.0.3/lib/openctm.h vendored Normal file
View File

@ -0,0 +1,655 @@
//-----------------------------------------------------------------------------
// 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

@ -0,0 +1,26 @@
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

@ -0,0 +1,377 @@
//-----------------------------------------------------------------------------
// 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

512
src/external/OpenCTM-1.0.3/lib/stream.c vendored Normal file
View File

@ -0,0 +1,512 @@
//-----------------------------------------------------------------------------
// 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;
}

BIN
src/external/lib/macx/libopenctm.a vendored Normal file

Binary file not shown.