HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SchemaInfoDeclarations.h
Go to the documentation of this file.
1 //-*****************************************************************************
2 //
3 // Copyright (c) 2009-2012,
4 // Sony Pictures Imageworks, Inc. and
5 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
6 //
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are
11 // met:
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 // * Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following disclaimer
16 // in the documentation and/or other materials provided with the
17 // distribution.
18 // * Neither the name of Sony Pictures Imageworks, nor
19 // Industrial Light & Magic nor the names of their contributors may be used
20 // to endorse or promote products derived from this software without specific
21 // prior written permission.
22 //
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 //
35 //-*****************************************************************************
36 
37 #ifndef _Alembic_AbcGeom_SchemaInfoDeclarations_h_
38 #define _Alembic_AbcGeom_SchemaInfoDeclarations_h_
39 
41 
42 namespace Alembic {
43 namespace AbcGeom {
44 namespace ALEMBIC_VERSION_NS {
45 
46 //-*****************************************************************************
47 //! With properties, specific flavors of properties are expressed via the
48 //! TypedScalarProperty and the TypedArrayProperty. Compound Properties
49 //! are more complex, and the specific flavors require a more complex
50 //! treatment - That's what Schemas are. The CompoundProperty equivalent
51 //! of a TypedArrayProperty or a TypedScalarProperty.
52 //!
53 //! A Schema is a collection of grouped properties which implement some
54 //! complex object, such as a poly mesh. In the simpelest, standard case,
55 //! there will be a compound property at the top with a certain name, and
56 //! inside the compound property will be some number of additional properties
57 //! that implement the object. In the case of a poly mesh, these properties
58 //! would include a list of vertices (a V3fArray), a list of indices
59 //! (an Int32Array), and a list of "per-face counts" (also an Int32Array).
60 
61 
62 //-*****************************************************************************
63 //! Here is a macro for declaring SCHEMA_INFO
64 //! It takes three arguments
65 //! - the SchemaTitle( a string ),
66 //! - the SchemaBaseType( a string ),
67 //! - the DefaultSchemaName( a string )
68 //! - the name of the SchemaInfo Type to be declared.
69 //! - for example:
70 //! ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_PolyMesh_v1",
71 //! "AbcGeom_GeomBase_v1",
72 //! ".geom",
73 //! PolyMeshSchemaInfo );
74 #define ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( STITLE, SBTYP, SDFLT, STDEF ) \
75 struct STDEF \
76 { \
77  static const char * title() { return ( STITLE ) ; } \
78  static const char * defaultName() { return ( SDFLT ); } \
79  static const char * schemaBaseType() { return ( SBTYP ); } \
80 }
81 
82 //-*****************************************************************************
83 //! Now to declare schema traits using the above macro. The SCHEMA_INFO are
84 //! basically a collection of information about the scheme, acting as an
85 //! elaborate typeid
86 
87 //-*****************************************************************************
88 // PolyMesh
89 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_PolyMesh_v1",
90  "AbcGeom_GeomBase_v1",
91  ".geom",
92  PolyMeshSchemaInfo );
93 
94 #define ALEMBIC_ABCGEOM_POLYMESH_SCHEMA (PolyMeshSchemaInfo::title())
95 
96 //-*****************************************************************************
97 // NuPatch
98 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_NuPatch_v2",
99  "AbcGeom_GeomBase_v1",
100  ".geom",
101  NuPatchSchemaInfo );
102 
103 #define ALEMBIC_ABCGEOM_NUPATCH_SCHEMA (NuPatchSchemaInfo::title())
104 
105 //-*****************************************************************************
106 // Subdivision surface
107 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_SubD_v1",
108  "AbcGeom_GeomBase_v1",
109  ".geom",
110  SubDSchemaInfo );
111 
112 #define ALEMBIC_ABCGEOM_SUBD_SCHEMA (SubDSchemaInfo::title())
113 
114 //-*****************************************************************************
115 // SubD and PolyMesh FaceSet
116 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_FaceSet_v1",
117  "AbcGeom_GeomBase_v1",
118  ".faceset",
119  FaceSetSchemaInfo );
120 
121 #define ALEMBIC_ABCGEOM_PARITION_SCHEMA (FaceSetSchemaInfo::title())
122 
123 
124 //-*****************************************************************************
125 // Points
126 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Points_v1",
127  "AbcGeom_GeomBase_v1",
128  ".geom",
129  PointsSchemaInfo );
130 
131 #define ALEMBIC_ABCGEOM_POINTS_SCHEMA (PointsSchemaInfo::title())
132 
133 //-*****************************************************************************
134 // Xform
135 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Xform_v3",
136  "",
137  ".xform",
138  XformSchemaInfo );
139 
140 #define ALEMBIC_ABCGEOM_XFORM_SCHEMA (XformSchemaInfo::title())
141 
142 //-*****************************************************************************
143 // Camera
144 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Camera_v1",
145  "",
146  ".geom",
147  CameraSchemaInfo );
148 
149 #define ALEMBIC_ABCGEOM_CAMERA_SCHEMA (CameraSchemaInfo::title())
150 
151 //-*****************************************************************************
152 // Curves
153 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Curve_v2",
154  "AbcGeom_GeomBase_v1",
155  ".geom",
156  CurvesSchemaInfo );
157 
158 //-*****************************************************************************
159 // GeomBase
160 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_GeomBase_v1",
161  "",
162  ".geom",
163  GeomBaseSchemaInfo );
164 
165 #define ALEMBIC_ABCGEOM_CURVE_SCHEMA (CurvesSchemaInfo::title())
166 
167 //-*****************************************************************************
168 // Light
169 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Light_v1",
170  "",
171  ".geom",
172  LightSchemaInfo );
173 
174 #define ALEMBIC_ABCGEOM_LIGHT_SCHEMA (LightSchemaInfo::title())
175 
176 } // End namespace ALEMBIC_VERSION_NS
177 
178 using namespace ALEMBIC_VERSION_NS;
179 
180 } // End namespace AbcGeom
181 } // End namespace Alembic
182 
183 
184 #endif // header guard
ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO("AbcGeom_PolyMesh_v1","AbcGeom_GeomBase_v1",".geom", PolyMeshSchemaInfo)
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:104