1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 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 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 List</span></a></li>
<li><a href="globals.html"><span>File 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 'as-is', 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 "<a class="code" href="openctm_8h.html">openctm.h</a>"</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 <exception></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>& v);
<a name="l00221"></a>00221 <a class="code" href="classCTMimporter.html" title="OpenCTM importer class.">CTMimporter</a>& <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>& 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>& v);
<a name="l00372"></a>00372 <a class="code" href="classCTMexporter.html" title="OpenCTM exporter class.">CTMexporter</a>& <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>& 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 © 2009-2010 Marcus Geelnard —
<a href="http://openctm.sourceforge.net" title="OpenCTM home page">openctm.sourceforge.net</a></p>
</div>
</body>
</html>
|