00001 //-***************************************************************************** 00002 // 00003 // Copyright (c) 2009-2011, 00004 // Sony Pictures Imageworks, Inc. and 00005 // Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. 00006 // 00007 // All rights reserved. 00008 // 00009 // Redistribution and use in source and binary forms, with or without 00010 // modification, are permitted provided that the following conditions are 00011 // met: 00012 // * Redistributions of source code must retain the above copyright 00013 // notice, this list of conditions and the following disclaimer. 00014 // * Redistributions in binary form must reproduce the above 00015 // copyright notice, this list of conditions and the following disclaimer 00016 // in the documentation and/or other materials provided with the 00017 // distribution. 00018 // * Neither the name of Sony Pictures Imageworks, nor 00019 // Industrial Light & Magic nor the names of their contributors may be used 00020 // to endorse or promote products derived from this software without specific 00021 // prior written permission. 00022 // 00023 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00024 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00025 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00026 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00027 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00028 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00029 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00030 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00031 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00032 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 // 00035 //-***************************************************************************** 00036 00037 #ifndef _Alembic_AbcGeom_SchemaInfoDeclarations_h_ 00038 #define _Alembic_AbcGeom_SchemaInfoDeclarations_h_ 00039 00040 namespace Alembic { 00041 namespace AbcGeom { 00042 namespace ALEMBIC_VERSION_NS { 00043 00044 //-***************************************************************************** 00045 //! With properties, specific flavors of properties are expressed via the 00046 //! TypedScalarProperty and the TypedArrayProperty. Compound Properties 00047 //! are more complex, and the specific flavors require a more complex 00048 //! treatment - That's what Schemas are. The CompoundProperty equivalent 00049 //! of a TypedArrayProperty or a TypedScalarProperty. 00050 //! 00051 //! A Schema is a collection of grouped properties which implement some 00052 //! complex object, such as a poly mesh. In the simpelest, standard case, 00053 //! there will be a compound property at the top with a certain name, and 00054 //! inside the compound property will be some number of additional properties 00055 //! that implement the object. In the case of a poly mesh, these properties 00056 //! would include a list of vertices (a V3fArray), a list of indices 00057 //! (an Int32Array), and a list of "per-face counts" (also an Int32Array). 00058 00059 00060 //-***************************************************************************** 00061 //! Here is a macro for declaring SCHEMA_INFO 00062 //! It takes three arguments 00063 //! - the SchemaTitle( a string ), 00064 //! - the SchemaBaseType( a string ), 00065 //! - the DefaultSchemaName( a string ) 00066 //! - the name of the SchemaInfo Type to be declared. 00067 //! - for example: 00068 //! ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_PolyMesh_v1", 00069 //! "AbcGeom_GeomBase_v1", 00070 //! ".geom", 00071 //! PolyMeshSchemaInfo ); 00072 #define ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( STITLE, SBTYP, SDFLT, STDEF ) \ 00073 struct STDEF \ 00074 { \ 00075 static const char * title() { return ( STITLE ) ; } \ 00076 static const char * defaultName() { return ( SDFLT ); } \ 00077 static const char * schemaBaseType() { return ( SBTYP ); } \ 00078 } 00079 00080 //-***************************************************************************** 00081 //! Now to declare schema traits using the above macro. The SCHEMA_INFO are 00082 //! basically a collection of information about the scheme, acting as an 00083 //! elaborate typeid 00084 00085 //-***************************************************************************** 00086 // PolyMesh 00087 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_PolyMesh_v1", 00088 "AbcGeom_GeomBase_v1", 00089 ".geom", 00090 PolyMeshSchemaInfo ); 00091 00092 #define ALEMBIC_ABCGEOM_POLYMESH_SCHEMA (PolyMeshSchemaInfo::title()) 00093 00094 //-***************************************************************************** 00095 // NuPatch 00096 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_NuPatch_v2", 00097 "AbcGeom_GeomBase_v1", 00098 ".geom", 00099 NuPatchSchemaInfo ); 00100 00101 #define ALEMBIC_ABCGEOM_NUPATCH_SCHEMA (NuPatchSchemaInfo::title()) 00102 00103 //-***************************************************************************** 00104 // Subdivision surface 00105 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_SubD_v1", 00106 "AbcGeom_GeomBase_v1", 00107 ".geom", 00108 SubDSchemaInfo ); 00109 00110 #define ALEMBIC_ABCGEOM_SUBD_SCHEMA (SubDSchemaInfo::title()) 00111 00112 //-***************************************************************************** 00113 // SubD and PolyMesh FaceSet 00114 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_FaceSet_v1", 00115 "AbcGeom_GeomBase_v1", 00116 ".faceset", 00117 FaceSetSchemaInfo ); 00118 00119 #define ALEMBIC_ABCGEOM_PARITION_SCHEMA (FaceSetSchemaInfo::title()) 00120 00121 00122 //-***************************************************************************** 00123 // Points 00124 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Points_v1", 00125 "AbcGeom_GeomBase_v1", 00126 ".geom", 00127 PointsSchemaInfo ); 00128 00129 #define ALEMBIC_ABCGEOM_POINTS_SCHEMA (PointsSchemaInfo::title()) 00130 00131 //-***************************************************************************** 00132 // Xform 00133 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Xform_v3", 00134 "", 00135 ".xform", 00136 XformSchemaInfo ); 00137 00138 #define ALEMBIC_ABCGEOM_XFORM_SCHEMA (XformSchemaInfo::title()) 00139 00140 //-***************************************************************************** 00141 // Camera 00142 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Camera_v1", 00143 "", 00144 ".geom", 00145 CameraSchemaInfo ); 00146 00147 #define ALEMBIC_ABCGEOM_CAMERA_SCHEMA (CameraSchemaInfo::title()) 00148 00149 //-***************************************************************************** 00150 // Curves 00151 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_Curve_v2", 00152 "AbcGeom_GeomBase_v1", 00153 ".geom", 00154 CurvesSchemaInfo ); 00155 00156 //-***************************************************************************** 00157 // IGeomBase 00158 ALEMBIC_ABCGEOM_DECLARE_SCHEMA_INFO( "AbcGeom_GeomBase_v1", 00159 "", 00160 ".geom", 00161 GeomBaseSchemaInfo ); 00162 00163 #define ALEMBIC_ABCGEOM_CURVE_SCHEMA (CurvesSchemaInfo::title()) 00164 00165 } // End namespace ALEMBIC_VERSION_NS 00166 00167 using namespace ALEMBIC_VERSION_NS; 00168 00169 } // End namespace AbcGeom 00170 } // End namespace Alembic 00171 00172 00173 #endif // header guard
1.5.9