HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_PrimTypeCompat.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GEO_PrimTypeCompat.h (GA Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GEO_PrimTypeCompat_h__
12 #define __GEO_PrimTypeCompat_h__
13 
14 /// @file GEO_PrimTypeCompat.h
15 /// @brief Contains transitional objects to provide some backward compatibility
16 /// for code that references old GEO primitive ids. New code should explicitly
17 /// use either GA_Primitive::getTypeId() or GA_Primitive::getFamilyMask(), as
18 /// appropriate. These transitional objects will be removed in the next major
19 /// release.
20 
21 #include "GEO_API.h"
22 #include <GA/GA_PrimCompat.h>
23 
24 /// The compatibility objects are wrapped in a name space to stress the change
25 /// between the obsolete type bitmasks (e.g. GEOPRIMPOLY) and the new type ids
26 /// (e.g. GEO_PRIMPOLY).
27 namespace GEO_PrimTypeCompat
28 {
30 
31  GEO_API extern const TypeMask GEOPRIMNONE;
32  //
33  // Standard face types
34  GEO_API extern const TypeMask GEOFACE;
35  GEO_API extern const TypeMask GEOPRIMPOLY;
36  GEO_API extern const TypeMask GEOPRIMNURBCURVE;
37  GEO_API extern const TypeMask GEOPRIMBEZCURVE;
38 
39  GEO_API extern const TypeMask GEOCURVE;
40 
41  //
42  // Standard hull types
43  GEO_API extern const TypeMask GEOHULL;
44  GEO_API extern const TypeMask GEOPRIMMESH;
45  GEO_API extern const TypeMask GEOPRIMNURBSURF;
46  GEO_API extern const TypeMask GEOPRIMBEZSURF;
47 
48  GEO_API extern const TypeMask GEOTPSURF;
49  GEO_API extern const TypeMask GEOSPLINE;
50 
51  //
52  // Standard paste types
53  GEO_API extern const TypeMask GEOPRIMPASTESURF;
54 
55  //
56  // Standard quadric types
57  GEO_API extern const TypeMask GEOPRIMQUADRIC;
58  GEO_API extern const TypeMask GEOPRIMCIRCLE;
59  GEO_API extern const TypeMask GEOPRIMSPHERE;
60  GEO_API extern const TypeMask GEOPRIMTUBE;
61 
62  //
63  // Standard particle types
64  GEO_API extern const TypeMask GEOPRIMPART;
65 
66  //
67  // Standard meta primitive types
68  GEO_API extern const TypeMask GEOPRIMMETA;
69  GEO_API extern const TypeMask GEOPRIMMETABALL;
70  GEO_API extern const TypeMask GEOPRIMMETASQUAD;
71  GEO_API extern const TypeMask GEOPRIMMETALINE;
72  GEO_API extern const TypeMask GEOPRIMMETABEZ;
73  GEO_API extern const TypeMask GEOPRIMMETATRI;
74 
75  //
76  // Miscelleneous primitive types.
77  // These guys must be detected via operator==, not operator&.
78  GEO_API extern const TypeMask GEOPRIMOTHER;
79  GEO_API extern const TypeMask GEOPRIMTRIFAN;
80  GEO_API extern const TypeMask GEOPRIMTRISTRIP;
81  GEO_API extern const TypeMask GEOPRIMTRIBEZIER;
82  GEO_API extern const TypeMask GEOPRIMVOLUME;
83  GEO_API extern const TypeMask GEOPRIMTETRAHEDRON;
84  GEO_API extern const TypeMask GEOPRIMPOLYSOUP;
85  GEO_API extern const TypeMask GEOPRIMVDB;
86  GEO_API extern const TypeMask GEOALLFUTURE;
87 
88  GEO_API extern const TypeMask GEOPRIMALL;
89 
90  //
91  // Classifies as U or UV primitives:
92  GEO_API extern const TypeMask GEOPRIMU;
93  GEO_API extern const TypeMask GEOPRIMUV;
94 
95  //
96  // Type strings
97  GEO_API extern const char *GEOPRIMPOLYN;
98  GEO_API extern const char *GEOPRIMNURBCURVEN;
99  GEO_API extern const char *GEOPRIMBEZCURVEN;
100  GEO_API extern const char *GEOPRIMMESHN;
101  GEO_API extern const char *GEOPRIMNURBSURFN;
102  GEO_API extern const char *GEOPRIMBEZSURFN;
103  GEO_API extern const char *GEOPRIMPASTESURFN;
104  GEO_API extern const char *GEOPRIMCIRCLEN;
105  GEO_API extern const char *GEOPRIMSPHEREN;
106  GEO_API extern const char *GEOPRIMTUBEN;
107  GEO_API extern const char *GEOPRIMPARTN;
108  GEO_API extern const char *GEOPRIMMETABALLN;
109  GEO_API extern const char *GEOPRIMMETASQUADN;
110  GEO_API extern const char *GEOPRIMMETALINEN;
111  GEO_API extern const char *GEOPRIMMETABEZN;
112  GEO_API extern const char *GEOPRIMMETATRIN;
113  GEO_API extern const char *GEOPRIMTRIFANN;
114  GEO_API extern const char *GEOPRIMTRISTRIPN;
115  GEO_API extern const char *GEOPRIMTRIBEZIERN;
116  GEO_API extern const char *GEOPRIMVOLUMEN;
117 
118  /// Map from the compatibility type mask to the enum values defined in
119  /// GEO_PrimType.h. If the mask doesn't match one of the enummerated types
120  /// exactly, GEO_PRIMNONE will be returned. In other words @code
121  /// getPrimType(GEO_PrimTypeCompat::GEOPRIMPOLY) == GEO_PRIMPOLY
122  /// getPrimType(GEO_PrimTypeCompat::GEOFACE) == GEO_PRIMNONE
123  /// @endcode
124  GEO_API extern int getPrimType(const TypeMask &mask);
125 
126  //
127  // File type identifiers
128  enum
129  {
130  GEOPRIMPOLY_FILEID = 0x00000001, // Polygon
131  GEOPRIMNURBCURVE_FILEID = 0x00000002, // NURB Curve
132  GEOPRIMBEZCURVE_FILEID = 0x00000004, // Rational Bezier Curve
133  GEOPRIMMESH_FILEID = 0x00000010, // Linear patch
134  GEOPRIMNURBSURF_FILEID = 0x00000020, // NURB Surface
135  GEOPRIMBEZSURF_FILEID = 0x00000040, // Rational Bezier Surface
136  GEOPRIMPASTESURF_FILEID = 0x00000f00, // TPsurf Paste Hierarchy
137  GEOPRIMCIRCLE_FILEID = 0x00001000, // Ellipse/Circle
138  GEOPRIMSPHERE_FILEID = 0x00002000, // Ellipsoid/Sphere
139  GEOPRIMTUBE_FILEID = 0x00004000, // Cylinder
140  GEOPRIMPART_FILEID = 0x00008000, // Particle
141  GEOPRIMMETABALL_FILEID = 0x00100000, // Meta-ball
142  GEOPRIMMETASQUAD_FILEID = 0x00200000, // Super quadric
143  GEOPRIMMETALINE_FILEID = 0x00300000, // Meta-line
144  GEOPRIMMETABEZ_FILEID = 0x00400000, // Meta-bezier
145  GEOPRIMMETATRI_FILEID = 0x00500000, // Meta-triangle
146  GEOPRIMTRIFAN_FILEID = 0x10000000, // Triangle fans
147  GEOPRIMTRISTRIP_FILEID = 0x20000000, // Generalized triangle strips
148  GEOPRIMTRIBEZIER_FILEID = 0x30000000, // Triangular beziers
149  GEOPRIMVOLUME_FILEID = 0x40000000, // Voxel volume
150  };
151 
152  /// Map from an old file bitfield to the compatibility type mask.
153  GEO_API extern TypeMask convertMaskFromFile(unsigned mask);
154 
155  /// Inverse of convertMaskFromFile()
156  GEO_API extern unsigned convertToFileFromMask(TypeMask mask);
157 }
158 
159 #endif
GEO_API const char * GEOPRIMMETALINEN
GEO_API const TypeMask GEOPRIMMESH
GEO_API const TypeMask GEOPRIMPASTESURF
GEO_API const TypeMask GEOPRIMTRISTRIP
GEO_API const char * GEOPRIMSPHEREN
GEO_API const TypeMask GEOTPSURF
GEO_API const char * GEOPRIMMESHN
GEO_API const TypeMask GEOPRIMCIRCLE
GEO_API const TypeMask GEOPRIMNONE
GEO_API const char * GEOPRIMBEZCURVEN
GEO_API const char * GEOPRIMNURBCURVEN
GEO_API const char * GEOPRIMVOLUMEN
GEO_API const TypeMask GEOPRIMVOLUME
GEO_API const char * GEOPRIMMETATRIN
GLint GLuint mask
Definition: glcorearb.h:123
GEO_API const TypeMask GEOPRIMNURBCURVE
GEO_API unsigned convertToFileFromMask(TypeMask mask)
Inverse of convertMaskFromFile()
GEO_API const TypeMask GEOPRIMMETABEZ
GEO_API const TypeMask GEOALLFUTURE
GEO_API const char * GEOPRIMPASTESURFN
GEO_API const char * GEOPRIMPARTN
GEO_API const TypeMask GEOPRIMOTHER
GEO_API const char * GEOPRIMMETABALLN
GEO_API const TypeMask GEOPRIMPOLYSOUP
GEO_API const TypeMask GEOPRIMMETA
GEO_API const TypeMask GEOPRIMNURBSURF
GEO_API const char * GEOPRIMBEZSURFN
GEO_API const char * GEOPRIMTRIFANN
GEO_API const TypeMask GEOPRIMMETASQUAD
GEO_API const TypeMask GEOCURVE
GEO_API const TypeMask GEOPRIMTRIBEZIER
GEO_API const TypeMask GEOPRIMTRIFAN
GEO_API const char * GEOPRIMPOLYN
GEO_API const TypeMask GEOPRIMMETALINE
GEO_API const char * GEOPRIMTUBEN
GEO_API const TypeMask GEOPRIMTETRAHEDRON
#define GEO_API
Definition: GEO_API.h:10
GEO_API const char * GEOPRIMMETASQUADN
GEO_API const TypeMask GEOPRIMTUBE
GEO_API const TypeMask GEOPRIMVDB
GEO_API const char * GEOPRIMCIRCLEN
GEO_API const TypeMask GEOHULL
GEO_API const TypeMask GEOPRIMMETATRI
GEO_API const TypeMask GEOPRIMU
GEO_API const TypeMask GEOPRIMMETABALL
GEO_API const TypeMask GEOPRIMBEZCURVE
GEO_API const TypeMask GEOSPLINE
GEO_API const TypeMask GEOPRIMALL
GEO_API const TypeMask GEOPRIMPART
GEO_API const TypeMask GEOFACE
GEO_API const TypeMask GEOPRIMBEZSURF
GEO_API const char * GEOPRIMTRISTRIPN
GEO_API const TypeMask GEOPRIMUV
GEO_API const char * GEOPRIMNURBSURFN
GEO_API const char * GEOPRIMMETABEZN
GEO_API const TypeMask GEOPRIMQUADRIC
GEO_API const TypeMask GEOPRIMPOLY
GEO_API TypeMask convertMaskFromFile(unsigned mask)
Map from an old file bitfield to the compatibility type mask.
GEO_API int getPrimType(const TypeMask &mask)
GEO_API const TypeMask GEOPRIMSPHERE
GEO_API const char * GEOPRIMTRIBEZIERN