opennurbs_3dm.h
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 #if !defined(OPENNURBS_THREEDM_INC_)
18 #define OPENNURBS_THREEDM_INC_
19 
20 /* 3dm defines, structs and typedefs */
21 
22 /* Typecode format 4 bytes long
23 
24  x xxxxxxxxxxxxxxx,x xxx xxxx xxxx x x xx
25  | | | | | | |
26  | | | |
27  | | | | +--- "stuff" bit
28  | | | |
29  | | | +-- specific codes
30  | | |
31  | | +-- RESERVED - DO NOT USE (should be 0) (will be used to control CRC on/off)
32  | |
33  | +-- category:_000 0000 0000 0001 Legacy geometry TCODE_LEGACY_GEOMETRY
34  | _000 0000 0000 0010 openNURBS object TCODE_OPENNURBS_OBJECT
35  | _000 0000 0000 0100 -- RESERVED - DO NOT USE (should be 0 in any typecode) --
36  | _000 0000 0000 1000 -- RESERVED - DO NOT USE (should be 0 in any typecode) --
37  | _000 0000 0001 0000 Geometry TCODE_GEOMETRY
38  | _000 0000 0010 0000 Annotation
39  | _000 0000 0100 0000 Display Attributes TCODE_DISPLAY
40  | _000 0000 1000 0000 Rendering TCODE_RENDER
41  | _000 0001 0000 0000
42  | _000 0010 0000 0000 Interface TCODE_INTERFACE
43  | _000 0100 0000 0000 -- RESERVED - DO NOT USE (should be 0 in any typecode) --
44  | _000 1000 0000 0000 Tolerances TCODE_TOLERANCE
45  | _001 0000 0000 0000 Tables TCODE_TABLE
46  | _010 0000 0000 0000 Table record TCODE_TABLEREC
47  | _100 0000 0000 0000 User information TCODE_USER
48  |
49  +-- format: 0 - data size in header - data block follows TCODE_SHORT
50  1 - data in header - no data block follows
51 
52 */
53 
54 
55 /*
56 // The TCODE_COMMENTBLOCK is the first chunk in the file, starts 32 bytes into
57 // the file, and contains text information terminated with a ^Z. This ^Z and
58 // contents of this chunk were expanded in February 2000. Files written with
59 // code released earlier than this will not have the ^Z.
60 //
61 // The TCODE_ENDOFFILE is the last chunk in the file and the first 4 bytes
62 // of information in this chunk is an integer that contains the file length.
63 // This chunk was added in February 2000 and files written with code released
64 // earlier than this will not have this termination block.
65 */
66 #define TCODE_COMMENTBLOCK 0x00000001
67 #define TCODE_ENDOFFILE 0x00007FFF
68 #define TCODE_ENDOFFILE_GOO 0x00007FFE /*
69  // this typecode is returned when
70  // a rogue eof marker is found
71  // Some v1 3dm file writers put
72  // these markers in a "goo".
73  // Simply skip these chunks and continue.
74  */
75 #define TCODE_LEGACY_GEOMETRY 0x00010000
76 #define TCODE_OPENNURBS_OBJECT 0x00020000
77 #define TCODE_GEOMETRY 0x00100000
78 #define TCODE_ANNOTATION 0x00200000
79 #define TCODE_DISPLAY 0x00400000
80 #define TCODE_RENDER 0x00800000
81 #define TCODE_INTERFACE 0x02000000
82 #define TCODE_TOLERANCE 0x08000000
83 #define TCODE_TABLE 0x10000000
84 #define TCODE_TABLEREC 0x20000000
85 #define TCODE_USER 0x40000000
86 #define TCODE_SHORT 0x80000000
87 
88 #define TCODE_CRC 0x8000
89 
90 #define TCODE_ANONYMOUS_CHUNK (TCODE_USER | TCODE_CRC | 0x0000 )
91 #define TCODE_UTF8_STRING_CHUNK (TCODE_USER | TCODE_CRC | 0x0001 )
92 #define TCODE_MODEL_ATTRIBUTES_CHUNK (TCODE_USER | TCODE_CRC | 0x0002 )
93 
94 #define TCODE_DICTIONARY (TCODE_USER | TCODE_CRC | 0x0010)
95 #define TCODE_DICTIONARY_ID (TCODE_USER | TCODE_CRC | 0x0011)
96 #define TCODE_DICTIONARY_ENTRY (TCODE_USER | TCODE_CRC | 0x0012)
97 #define TCODE_DICTIONARY_END (TCODE_USER | TCODE_SHORT | 0x0013)
98 #define TCODE_XDATA (TCODE_USER | 0x0001)
99 
100 
101 /* The openNURBS toolkit allows users to write all openNURBS classed that are
102 // derived from ON_Object using using TCODE_OPENNURBS_CLASS chunks.
103 // In the .3dm file these TCODE_OPENNURBS_CLASS chunks are always have the
104 // following format.
105 */
106 
107 /* tables added 17 February 2000 */
108 #define TCODE_MATERIAL_TABLE (TCODE_TABLE | 0x0010) /* rendering materials */
109 #define TCODE_LAYER_TABLE (TCODE_TABLE | 0x0011) /* layers */
110 #define TCODE_LIGHT_TABLE (TCODE_TABLE | 0x0012) /* rendering lights */
111 #define TCODE_OBJECT_TABLE (TCODE_TABLE | 0x0013) /* geometry and annotation */
112 #define TCODE_PROPERTIES_TABLE (TCODE_TABLE | 0x0014) /* model properties:
113  // revision history
114  // notes
115  // preview image
116  */
117 #define TCODE_SETTINGS_TABLE (TCODE_TABLE | 0x0015) /* file properties including,
118  // units, tolerancess,
119  // annotation defaults,
120  // render mesh defaults,
121  // current layer,
122  // current material,
123  // current color,
124  // named construction planes,
125  // named viewports,
126  // current viewports,
127  */
128 #define TCODE_BITMAP_TABLE (TCODE_TABLE | 0x0016) /* embedded bitmaps */
129 #define TCODE_USER_TABLE (TCODE_TABLE | 0x0017) /* user table */
130 
131 #define TCODE_GROUP_TABLE (TCODE_TABLE | 0x0018) /* group table */
132 
133 #define TCODE_FONT_TABLE (TCODE_TABLE | 0x0019) /* annotation font table */
134 #define TCODE_DIMSTYLE_TABLE (TCODE_TABLE | 0x0020) /* annotation dimension style table */
135 
136 #define TCODE_INSTANCE_DEFINITION_TABLE (TCODE_TABLE | 0x0021) /* instance definition table */
137 
138 #define TCODE_HATCHPATTERN_TABLE (TCODE_TABLE | 0x0022) /* hatch pattern table */
139 
140 #define TCODE_LINETYPE_TABLE (TCODE_TABLE | 0x0023) /* linetype table */
141 
142 #define TCODE_OBSOLETE_LAYERSET_TABLE (TCODE_TABLE | 0x0024) /* obsolete layer set table */
143 
144 #define TCODE_TEXTURE_MAPPING_TABLE (TCODE_TABLE | 0x0025) /* texture mappings */
145 
146 #define TCODE_HISTORYRECORD_TABLE (TCODE_TABLE | 0x0026) /* history records */
147 
148 #define TCODE_ENDOFTABLE 0xFFFFFFFF
149 
150 /* records in properties table */
151 #define TCODE_PROPERTIES_REVISIONHISTORY (TCODE_TABLEREC | TCODE_CRC | 0x0021)
152 #define TCODE_PROPERTIES_NOTES (TCODE_TABLEREC | TCODE_CRC | 0x0022)
153 #define TCODE_PROPERTIES_PREVIEWIMAGE (TCODE_TABLEREC | TCODE_CRC | 0x0023)
154 #define TCODE_PROPERTIES_APPLICATION (TCODE_TABLEREC | TCODE_CRC | 0x0024)
155 #define TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE (TCODE_TABLEREC | TCODE_CRC | 0x0025)
156 #define TCODE_PROPERTIES_OPENNURBS_VERSION (TCODE_TABLEREC | TCODE_SHORT | 0x0026)
157 #define TCODE_PROPERTIES_AS_FILE_NAME (TCODE_TABLEREC | TCODE_CRC | 0x0027 )
158 
159 /* records in settings table */
160 #define TCODE_SETTINGS_PLUGINLIST (TCODE_TABLEREC | TCODE_CRC | 0x0135)
161 #define TCODE_SETTINGS_UNITSANDTOLS (TCODE_TABLEREC | TCODE_CRC | 0x0031)
162 #define TCODE_SETTINGS_RENDERMESH (TCODE_TABLEREC | TCODE_CRC | 0x0032)
163 #define TCODE_SETTINGS_ANALYSISMESH (TCODE_TABLEREC | TCODE_CRC | 0x0033)
164 #define TCODE_SETTINGS_ANNOTATION (TCODE_TABLEREC | TCODE_CRC | 0x0034)
165 #define TCODE_SETTINGS_NAMED_CPLANE_LIST (TCODE_TABLEREC | TCODE_CRC | 0x0035)
166 #define TCODE_SETTINGS_NAMED_VIEW_LIST (TCODE_TABLEREC | TCODE_CRC | 0x0036)
167 #define TCODE_SETTINGS_VIEW_LIST (TCODE_TABLEREC | TCODE_CRC | 0x0037)
168 #define TCODE_SETTINGS_CURRENT_LAYER_INDEX (TCODE_TABLEREC | TCODE_SHORT | 0x0038)
169 #define TCODE_SETTINGS_CURRENT_MATERIAL_INDEX (TCODE_TABLEREC | TCODE_CRC | 0x0039)
170 #define TCODE_SETTINGS_CURRENT_COLOR (TCODE_TABLEREC | TCODE_CRC | 0x003A)
171 #define TCODE_SETTINGS__NEVER__USE__THIS (TCODE_TABLEREC | TCODE_CRC | 0x003E)
172 #define TCODE_SETTINGS_CURRENT_WIRE_DENSITY (TCODE_TABLEREC | TCODE_SHORT | 0x003C)
173 #define TCODE_SETTINGS_RENDER (TCODE_TABLEREC | TCODE_CRC | 0x003D)
174 #define TCODE_SETTINGS_GRID_DEFAULTS (TCODE_TABLEREC | TCODE_CRC | 0x003F)
175 #define TCODE_SETTINGS_MODEL_URL (TCODE_TABLEREC | TCODE_CRC | 0x0131)
176 #define TCODE_SETTINGS_CURRENT_FONT_INDEX (TCODE_TABLEREC | TCODE_SHORT | 0x0132)
177 #define TCODE_SETTINGS_CURRENT_DIMSTYLE_INDEX (TCODE_TABLEREC | TCODE_SHORT | 0x0133)
178 /* added 29 October 2002 as a chunk to hold new and future ON_3dmSettings information */
179 #define TCODE_SETTINGS_ATTRIBUTES (TCODE_TABLEREC | TCODE_CRC | 0x0134)
180 /* 2016-Nov-28 RH-33298 ON_3dmRenderSettings user data in ON_3dmSettings.m_RenderSettings */
181 #define TCODE_SETTINGS_RENDER_USERDATA (TCODE_TABLEREC | TCODE_CRC | 0x0136)
182 
183 /* views are subrecords in the settings table */
184 #define TCODE_VIEW_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x003B)
185 /* subrecords if view record */
186 #define TCODE_VIEW_CPLANE (TCODE_TABLEREC | TCODE_CRC | 0x013B)
187 #define TCODE_VIEW_VIEWPORT (TCODE_TABLEREC | TCODE_CRC | 0x023B)
188 #define TCODE_VIEW_SHOWCONGRID (TCODE_TABLEREC | TCODE_SHORT | 0x033B)
189 #define TCODE_VIEW_SHOWCONAXES (TCODE_TABLEREC | TCODE_SHORT | 0x043B)
190 #define TCODE_VIEW_SHOWWORLDAXES (TCODE_TABLEREC | TCODE_SHORT | 0x053B)
191 #define TCODE_VIEW_TRACEIMAGE (TCODE_TABLEREC | TCODE_CRC | 0x063B)
192 #define TCODE_VIEW_WALLPAPER (TCODE_TABLEREC | TCODE_CRC | 0x073B)
193 #define TCODE_VIEW_WALLPAPER_V3 (TCODE_TABLEREC | TCODE_CRC | 0x074B)
194 #define TCODE_VIEW_TARGET (TCODE_TABLEREC | TCODE_CRC | 0x083B)
195 #define TCODE_VIEW_V3_DISPLAYMODE (TCODE_TABLEREC | TCODE_SHORT | 0x093B)
196 #define TCODE_VIEW_NAME (TCODE_TABLEREC | TCODE_CRC | 0x0A3B)
197 #define TCODE_VIEW_POSITION (TCODE_TABLEREC | TCODE_CRC | 0x0B3B)
198 
199 /* added 29 October 2002 as a chunk to hold new and future ON_3dmView information */
200 #define TCODE_VIEW_ATTRIBUTES (TCODE_TABLEREC | TCODE_CRC | 0x0C3B)
201 
202 /* added 27 June 2008 as a chunk to hold userdata on ON_Viewports saved in named view list */
203 #define TCODE_VIEW_VIEWPORT_USERDATA (TCODE_TABLEREC | TCODE_CRC | 0x0D3B)
204 
205 /* records in bitmap table */
206 #define TCODE_BITMAP_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0090) /* bitmap table record derived from ON_Bitmap */
207 
208 /* records in material table */
209 #define TCODE_MATERIAL_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0040) /* material table record derived from ON_Material */
210 
211 /* records in layer table */
212 #define TCODE_LAYER_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0050) /* layer table record derived from ON_Layer */
213 
214 /* records in light table */
215 #define TCODE_LIGHT_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0060) /* light table record derived from ON_Light */
216 #define TCODE_LIGHT_RECORD_ATTRIBUTES (TCODE_INTERFACE | TCODE_CRC | 0x0061) /* ON_3dmObjectAttributes chunk */
217 #define TCODE_LIGHT_RECORD_ATTRIBUTES_USERDATA (TCODE_INTERFACE | 0x0062) /* ON_3dmObjectAttributes userdata chunk */
218 
219 #define TCODE_LIGHT_RECORD_END (TCODE_INTERFACE | TCODE_SHORT | 0x006F)
220 
221 /* records in user table
222  Each user table entery has two top level chunks, a TCODE_USER_TABLE_UUID chunk
223  and a TCODE_USER_RECORD chunk.
224 */
225 
226 /* The TCODE_USER_TABLE_UUID chunk
227  contains the plug-in id and, if the archive is V5 or later
228  and was written by an opennurbs with version >= 200910190,
229  a TCODE_USER_TABLE_RECORD_HEADER chunk.
230 */
231 #define TCODE_USER_TABLE_UUID (TCODE_TABLEREC | TCODE_CRC | 0x0080)
232 /* the user record header was added in 200910190 and is inside the TCODE_USER_TABLE_UUID chunk */
233 #define TCODE_USER_TABLE_RECORD_HEADER (TCODE_TABLEREC | TCODE_CRC | 0x0082)
234 /* information saved by the plug-in is in a TCODE_USER_RECORD chunk */
235 #define TCODE_USER_RECORD (TCODE_TABLEREC | 0x0081)
236 
237 
238 /* records in group table */
239 #define TCODE_GROUP_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0073)
240 
241 /* records in font table */
242 #define TCODE_FONT_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0074)
243 
244 /* records in dimension style table */
245 #define TCODE_DIMSTYLE_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0075)
246 
247 /* records in instance definition table */
248 #define TCODE_INSTANCE_DEFINITION_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0076)
249 
250 /* records in hatch pattern table */
251 #define TCODE_HATCHPATTERN_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0077)
252 
253 /* records in linetye pattern table */
254 #define TCODE_LINETYPE_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0078)
255 
256 /* OBSOLETE records in layer set table */
257 #define TCODE_OBSOLETE_LAYERSET_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0079)
258 
259 /* records in linetye pattern table */
260 #define TCODE_TEXTURE_MAPPING_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x007A)
261 
262 /* records in history record pattern table */
263 #define TCODE_HISTORYRECORD_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x007B)
264 
265 /* records in object table */
266 #define TCODE_OBJECT_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0070)
267 #define TCODE_OBJECT_RECORD_TYPE (TCODE_INTERFACE | TCODE_SHORT | 0x0071) /* ON::object_type value */
268 #define TCODE_OBJECT_RECORD_ATTRIBUTES (TCODE_INTERFACE | TCODE_CRC | 0x0072) /* ON_3dmObjectAttributes chunk */
269 #define TCODE_OBJECT_RECORD_ATTRIBUTES_USERDATA (TCODE_INTERFACE | 0x0073) /* ON_3dmObjectAttributes userdata chunk */
270 #define TCODE_OBJECT_RECORD_HISTORY (TCODE_INTERFACE | TCODE_CRC | 0x0074) /* construction history */
271 #define TCODE_OBJECT_RECORD_HISTORY_HEADER (TCODE_INTERFACE | TCODE_CRC | 0x0075) /* construction history header*/
272 #define TCODE_OBJECT_RECORD_HISTORY_DATA (TCODE_INTERFACE | TCODE_CRC | 0x0076) /* construction history data */
273 #define TCODE_OBJECT_RECORD_END (TCODE_INTERFACE | TCODE_SHORT | 0x007F)
274 
275 /*
276 /////////////////////////////////////////////////////////////////////////////////////
277 //
278 // TCODE_OBJECT_RECORD
279 // 4 byte length of entire object record
280 //
281 // TCODE_OBJECT_RECORD_TYPE required - used to quickly filter and skip unwanted objects
282 // 4 byte ON::object_type
283 //
284 // TCODE_OPENNURBS_CLASS
285 // 4 byte length
286 // TCODE_OPENNURBS_CLASS_UUID
287 // 4 byte length = 20
288 // value of ON_ClassId::m_uuid for this class
289 // 4 byte CRC
290 // TCODE_OPENNURBS_CLASS_DATA
291 // 4 byte length
292 // class specific data for geometry or annotation object
293 // 4 byte CRC
294 // TCODE_OPENNURBS_CLASS_USERDATA (1 chunk per piece of user data)
295 // 4 byte length
296 // 2 byte chunk version 2.1
297 // TCODE_OPENNURBS_CLASS_USERDATA_HEADER
298 // 4 byte length
299 // 16 byte value of ON_ClassId::m_uuid for this child class of ON_UserData
300 // 16 byte value of ON_UserData::m_userdata_uuid
301 // 4 byte value of ON_UserData::m_userdata_copycount
302 // 128 byte value of ON_UserData::m_userdata_xform
303 // 16 byte value of ON_UserData::m_application_uuid (in ver 2.1 chunks)
304 // TCODE_ANONYMOUS_CHUNK
305 // 4 byte length
306 // specific user data
307 // TCODE_OPENNURBS_CLASS_END
308 //
309 // TCODE_OBJECT_RECORD_ATTRIBUTES (optional)
310 // 4 byte length
311 // ON_3dmObjectAttributes information
312 // 4 byte crc
313 //
314 // TCODE_OBJECT_RECORD_ATTRIBUTES_USERDATA (optional)
315 // 4 byte length
316 // TCODE_OPENNURBS_CLASS_USERDATA (1 chunk per piece of user data)
317 // 4 byte length
318 // 2 byte chunk version 2.1
319 // TCODE_OPENNURBS_CLASS_USERDATA_HEADER
320 // 4 byte length
321 // 16 byte value of ON_ClassId::m_uuid for this child class of ON_UserData
322 // 16 byte value of ON_UserData::m_userdata_uuid
323 // 4 byte value of ON_UserData::m_userdata_copycount
324 // 128 byte value of ON_UserData::m_userdata_xform
325 // 16 byte value of ON_UserData::m_application_uuid (in ver 2.1 chunks)
326 // TCODE_ANONYMOUS_CHUNK
327 // 4 byte length
328 // specific user data
329 //
330 // TCODE_OBJECT_RECORD_HISTORY (optional) construction history
331 // 4 byte length
332 // 2 byte chunk version
333 // TCODE_OBJECT_RECORD_HISTORY_HEADER
334 // 4 byte length
335 // 2 byte chunk version
336 // ...
337 // 4 byte crc
338 // TCODE_OBJECT_RECORD_HISTORY_DATA
339 // 4 byte length
340 // 2 byte chunk version
341 // ...
342 // 4 byte crc
343 //
344 // TCODE_OBJECT_RECORD_END required - marks end of object record
345 //
346 /////////////////////////////////////////////////////////////////////////////////////
347 */
348 
349 #define TCODE_OPENNURBS_CLASS (TCODE_OPENNURBS_OBJECT | 0x7FFA)
350 #define TCODE_OPENNURBS_CLASS_UUID (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x7FFB)
351 #define TCODE_OPENNURBS_CLASS_DATA (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x7FFC)
352 #define TCODE_OPENNURBS_CLASS_USERDATA (TCODE_OPENNURBS_OBJECT | 0x7FFD)
353 #define TCODE_OPENNURBS_CLASS_USERDATA_HEADER (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x7FF9)
354 #define TCODE_OPENNURBS_CLASS_END (TCODE_OPENNURBS_OBJECT | TCODE_SHORT | 0x7FFF)
355 
356 /*
357 /////////////////////////////////////////////////////////////////////////////////////
358 //
359 // TCODE_OPENNURBS_CLASS
360 // length of entire openNURBS class object chunk
361 //
362 // TCODE_OPENNURBS_CLASS_UUID
363 // length of uuid (16 byte UUID + 4 byte CRC)
364 // 16 byte UUID ( a.k.a. GUID ) openNURBS class ID - determines specific openNURBS class
365 // 4 bytes (32 bit CRC of the UUID)
366 //
367 // TCODE_OPENNURBS_CLASS_DATA
368 // length of object data
369 // ... data that defines object
370 // use ON_classname::Read() to read this data and ON_classname::Write()
371 // to write this data
372 // 4 bytes (32 bit CRC of the object data)
373 //
374 // TCODE_OPENNURBS_CLASS_USERDATA ( 0 or more user data chunks)
375 //
376 // TCODE_OPENNURBS_CLASS_END
377 // 4 bytes = 0
378 //
379 /////////////////////////////////////////////////////////////////////////////////////
380 */
381 
382 /*
383 /////////////////////////////////////////////////////////////////////////////////////
384 //
385 //
386 // The TCODEs below were used in the version 1 file format and are needed so that
387 // the these files can be read and (optionally) written by the current OpenNURBS
388 // toolkit.
389 //
390 //
391 /////////////////////////////////////////////////////////////////////////////////////
392 */
393 
394 
395 #define TCODE_ANNOTATION_SETTINGS (TCODE_ANNOTATION | 0x0001)
396 
397 #define TCODE_TEXT_BLOCK (TCODE_ANNOTATION | 0x0004)
398 #define TCODE_ANNOTATION_LEADER (TCODE_ANNOTATION | 0x0005)
399 #define TCODE_LINEAR_DIMENSION (TCODE_ANNOTATION | 0x0006)
400 #define TCODE_ANGULAR_DIMENSION (TCODE_ANNOTATION | 0x0007)
401 #define TCODE_RADIAL_DIMENSION (TCODE_ANNOTATION | 0x0008)
402 
403 /* old RhinoIO toolkit (pre February 2000) defines */
404 #define TCODE_RHINOIO_OBJECT_NURBS_CURVE (TCODE_OPENNURBS_OBJECT | 0x0008) /* old CRhinoNurbsCurve */
405 #define TCODE_RHINOIO_OBJECT_NURBS_SURFACE (TCODE_OPENNURBS_OBJECT | 0x0009) /* old CRhinoNurbsSurface */
406 #define TCODE_RHINOIO_OBJECT_BREP (TCODE_OPENNURBS_OBJECT | 0x000B) /* old CRhinoBrep */
407 #define TCODE_RHINOIO_OBJECT_DATA (TCODE_OPENNURBS_OBJECT | 0xFFFE) /* obsolete - don't confuse with TCODE_OPENNURBS_OBJECT_DATA */
408 #define TCODE_RHINOIO_OBJECT_END (TCODE_OPENNURBS_OBJECT | 0xFFFF) /* obsolete - don't confuse with TCODE_OPENNURBS_OBJECT_END */
409 
410 /* OpenNURBS classes the require a unique tcode */
411 #define TCODE_OPENNURBS_BUFFER (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x0100) /* chunk stores ON_Buffer classes */
412 
413 /* legacy objects from Rhino 1.x */
414 #define TCODE_LEGACY_ASM (TCODE_LEGACY_GEOMETRY | 0x0001)
415 #define TCODE_LEGACY_PRT (TCODE_LEGACY_GEOMETRY | 0x0002)
416 #define TCODE_LEGACY_SHL (TCODE_LEGACY_GEOMETRY | 0x0003)
417 #define TCODE_LEGACY_FAC (TCODE_LEGACY_GEOMETRY | 0x0004)
418 #define TCODE_LEGACY_BND (TCODE_LEGACY_GEOMETRY | 0x0005)
419 #define TCODE_LEGACY_TRM (TCODE_LEGACY_GEOMETRY | 0x0006)
420 #define TCODE_LEGACY_SRF (TCODE_LEGACY_GEOMETRY | 0x0007)
421 #define TCODE_LEGACY_CRV (TCODE_LEGACY_GEOMETRY | 0x0008)
422 #define TCODE_LEGACY_SPL (TCODE_LEGACY_GEOMETRY | 0x0009)
423 #define TCODE_LEGACY_PNT (TCODE_LEGACY_GEOMETRY | 0x000A)
424 
425 #define TCODE_STUFF 0x0100
426 
427 #define TCODE_LEGACY_ASMSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_ASM)
428 #define TCODE_LEGACY_PRTSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_PRT)
429 #define TCODE_LEGACY_SHLSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_SHL)
430 #define TCODE_LEGACY_FACSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_FAC)
431 #define TCODE_LEGACY_BNDSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_BND)
432 #define TCODE_LEGACY_TRMSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_TRM)
433 #define TCODE_LEGACY_SRFSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_SRF)
434 #define TCODE_LEGACY_CRVSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_CRV)
435 #define TCODE_LEGACY_SPLSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_SPL)
436 #define TCODE_LEGACY_PNTSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_PNT)
437 
438 /* legacy objects from Rhino 1.x */
439 #define TCODE_RH_POINT (TCODE_GEOMETRY | 0x0001)
440 
441 #define TCODE_RH_SPOTLIGHT (TCODE_RENDER | 0x0001)
442 
443 #define TCODE_OLD_RH_TRIMESH (TCODE_GEOMETRY | 0x0011)
444 #define TCODE_OLD_MESH_VERTEX_NORMALS (TCODE_GEOMETRY | 0x0012)
445 #define TCODE_OLD_MESH_UV (TCODE_GEOMETRY | 0x0013)
446 #define TCODE_OLD_FULLMESH (TCODE_GEOMETRY | 0x0014)
447 
448 
449 #define TCODE_MESH_OBJECT (TCODE_GEOMETRY | 0x0015)
450 #define TCODE_COMPRESSED_MESH_GEOMETRY (TCODE_GEOMETRY | 0x0017)
451 #define TCODE_ANALYSIS_MESH (TCODE_GEOMETRY | 0x0018)
452 
453 #define TCODE_NAME (TCODE_INTERFACE | 0x0001)
454 #define TCODE_VIEW (TCODE_INTERFACE | 0x0002)
455 #define TCODE_CPLANE (TCODE_INTERFACE | 0x0003)
456 
457 #define TCODE_NAMED_CPLANE (TCODE_INTERFACE | 0x0004)
458 #define TCODE_NAMED_VIEW (TCODE_INTERFACE | 0x0005)
459 #define TCODE_VIEWPORT (TCODE_INTERFACE | 0x0006)
460 
461 #define TCODE_SHOWGRID (TCODE_SHORT | TCODE_INTERFACE | 0x0007)
462 #define TCODE_SHOWGRIDAXES (TCODE_SHORT | TCODE_INTERFACE | 0x0008)
463 #define TCODE_SHOWWORLDAXES (TCODE_SHORT | TCODE_INTERFACE | 0x0009)
464 
465 #define TCODE_VIEWPORT_POSITION (TCODE_INTERFACE | 0x000A)
466 #define TCODE_VIEWPORT_TRACEINFO (TCODE_INTERFACE | 0x000B)
467 #define TCODE_SNAPSIZE (TCODE_INTERFACE | 0x000C)
468 #define TCODE_NEAR_CLIP_PLANE (TCODE_INTERFACE | 0x000D)
469 #define TCODE_HIDE_TRACE (TCODE_INTERFACE | 0x000E)
470 
471 #define TCODE_NOTES (TCODE_INTERFACE | 0x000F)
472 #define TCODE_UNIT_AND_TOLERANCES (TCODE_INTERFACE | 0x0010)
473 
474 #define TCODE_MAXIMIZED_VIEWPORT (TCODE_SHORT | TCODE_INTERFACE | 0x0011)
475 #define TCODE_VIEWPORT_WALLPAPER (TCODE_INTERFACE | 0x0012)
476 
477 
478 #define TCODE_SUMMARY (TCODE_INTERFACE | 0x0013)
479 #define TCODE_BITMAPPREVIEW (TCODE_INTERFACE | 0x0014)
480 #define TCODE_VIEWPORT_V1_DISPLAYMODE (TCODE_SHORT | TCODE_INTERFACE | 0x0015)
481 
482 
483 #define TCODE_LAYERTABLE (TCODE_SHORT | TCODE_TABLE | 0x0001) /* obsolete - do not use */
484 #define TCODE_LAYERREF (TCODE_SHORT | TCODE_TABLEREC | 0x0001)
485 
486 #define TCODE_RGB (TCODE_SHORT | TCODE_DISPLAY | 0x0001)
487 #define TCODE_TEXTUREMAP (TCODE_DISPLAY | 0x0002)
488 #define TCODE_BUMPMAP (TCODE_DISPLAY | 0x0003)
489 #define TCODE_TRANSPARENCY (TCODE_SHORT | TCODE_DISPLAY | 0x0004)
490 #define TCODE_DISP_AM_RESOLUTION (TCODE_SHORT | TCODE_DISPLAY | 0x0005)
491 #define TCODE_RGBDISPLAY (TCODE_SHORT | TCODE_DISPLAY | 0x0006) /* will be used for color by object */
492 #define TCODE_RENDER_MATERIAL_ID (TCODE_DISPLAY | 0x0007) /* id for render material */
493 
494 #define TCODE_LAYER (TCODE_DISPLAY | 0x0010)
495 
496 /* obsolete layer typecodes from earlier betas - not used anymore */
497 #define TCODE_LAYER_OBSELETE_1 (TCODE_SHORT | TCODE_DISPLAY | 0x0013)
498 #define TCODE_LAYER_OBSELETE_2 (TCODE_SHORT | TCODE_DISPLAY | 0x0014)
499 #define TCODE_LAYER_OBSELETE_3 (TCODE_SHORT | TCODE_DISPLAY | 0x0015)
500 
501 /* these were only ever used by AccuModel and never by Rhino */
502 #define TCODE_LAYERON (TCODE_SHORT | TCODE_DISPLAY | 0x0016)
503 #define TCODE_LAYERTHAWED (TCODE_SHORT | TCODE_DISPLAY | 0x0017)
504 #define TCODE_LAYERLOCKED (TCODE_SHORT | TCODE_DISPLAY | 0x0018)
505 
506 
507 #define TCODE_LAYERVISIBLE (TCODE_SHORT | TCODE_DISPLAY | 0x0012)
508 #define TCODE_LAYERPICKABLE (TCODE_SHORT | TCODE_DISPLAY | 0x0030)
509 #define TCODE_LAYERSNAPABLE (TCODE_SHORT | TCODE_DISPLAY | 0x0031)
510 #define TCODE_LAYERRENDERABLE (TCODE_SHORT | TCODE_DISPLAY | 0x0032)
511 
512 
513 /* use LAYERSTATE ( 0 = LAYER_ON, 1 = LAYER_OFF, 2 = LAYER_LOCKED ) instead of above individual toggles */
514 #define TCODE_LAYERSTATE (TCODE_SHORT | TCODE_DISPLAY | 0x0033)
515 #define TCODE_LAYERINDEX (TCODE_SHORT | TCODE_DISPLAY | 0x0034)
516 #define TCODE_LAYERMATERIALINDEX (TCODE_SHORT | TCODE_DISPLAY | 0x0035)
517 
518 #define TCODE_RENDERMESHPARAMS (TCODE_DISPLAY | 0x0020) /* block of parameters for render meshes */
519 
520 
521 
522 #define TCODE_DISP_CPLINES (TCODE_SHORT | TCODE_DISPLAY | 0x0022)
523 #define TCODE_DISP_MAXLENGTH (TCODE_DISPLAY | 0x0023)
524 
525 #define TCODE_CURRENTLAYER (TCODE_SHORT | TCODE_DISPLAY | 0x0025 )
526 
527 #define TCODE_LAYERNAME (TCODE_DISPLAY | 0x0011)
528 
529 #define TCODE_LEGACY_TOL_FIT (TCODE_TOLERANCE | 0x0001)
530 #define TCODE_LEGACY_TOL_ANGLE (TCODE_TOLERANCE | 0x0002)
531 
532 #endif