Alembic 1.8.11
Loading...
Searching...
No Matches
GeometryScope.h
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_GeometryScope_h
38#define Alembic_AbcGeom_GeometryScope_h
39
40#include <Alembic/Util/Export.h>
41#include <Alembic/AbcGeom/Foundation.h>
42
43namespace Alembic {
44namespace AbcGeom {
45namespace ALEMBIC_VERSION_NS {
46
47//-*****************************************************************************
55//-*****************************************************************************
56
57//-*****************************************************************************
94
95//-*****************************************************************************
96enum GeometryScope
97{
98 kConstantScope = 0,
99 kUniformScope = 1,
100 kVaryingScope = 2,
101 kVertexScope = 3,
102 kFacevaryingScope = 4,
103
104 kUnknownScope = 127
105};
106
107//-*****************************************************************************
110//-*****************************************************************************
111
112//-*****************************************************************************
113inline void SetGeometryScope( AbcA::MetaData &ioMetaData, GeometryScope iScope )
114{
115 switch ( iScope )
116 {
117 case kConstantScope: ioMetaData.set( "geoScope", "con" ); return;
118 case kUniformScope: ioMetaData.set( "geoScope", "uni" ); return;
119 case kVaryingScope: ioMetaData.set( "geoScope", "var" ); return;
120 case kVertexScope: ioMetaData.set( "geoScope", "vtx" ); return;
121 case kFacevaryingScope: ioMetaData.set( "geoScope", "fvr" ); return;
122 case kUnknownScope: return;
123 default: return;
124 }
125}
126
127//-*****************************************************************************
128inline GeometryScope GetGeometryScope( const AbcA::MetaData &iMetaData )
129{
130 const std::string val = iMetaData.get( "geoScope" );
131 if ( val == "con" || val == "" ) { return kConstantScope; }
132 else if ( val == "uni" ) { return kUniformScope; }
133 else if ( val == "var" ) { return kVaryingScope; }
134 else if ( val == "vtx" ) { return kVertexScope; }
135 else if ( val == "fvr" ) { return kFacevaryingScope; }
136 else { return kUnknownScope; }
137}
138
139//-*****************************************************************************
142//-*****************************************************************************
143
146ALEMBIC_EXPORT size_t
147GeometryScopeNumValuesQuadrics( GeometryScope iScope );
148
151ALEMBIC_EXPORT size_t
152GeometryScopeNumValuesPolygon( GeometryScope iScope, size_t iNumVerts );
153
156ALEMBIC_EXPORT size_t
157GeometryScopeNumValuesPointsPolygons( GeometryScope iScope,
158 size_t iNumPolys,
159 size_t iNumVerts,
160 size_t iSumOfCounts );
161
164ALEMBIC_EXPORT size_t
165GeometryScopeNumValuesPoints( GeometryScope iScope,
166 size_t iNumPoints );
167
170ALEMBIC_EXPORT size_t
171GeometryScopeNumValuesSubdivisionMesh( GeometryScope iScope,
172 size_t iNumFaces,
173 size_t iNumVerts,
174 size_t iSumOfCounts );
175
178ALEMBIC_EXPORT size_t
179GeometryScopeNumValuesBilinearPatch( GeometryScope iScope );
180
183ALEMBIC_EXPORT size_t
184GeometryScopeNumValuesBicubicPatch( GeometryScope iScope );
185
188ALEMBIC_EXPORT size_t
189GeometryScopeNumValuesBilinearPatchMesh( GeometryScope iScope,
190 size_t iNu, bool iUNoWrap,
191 size_t iNv, bool iVNoWrap );
192
196ALEMBIC_EXPORT size_t
197GeometryScopeNumValuesBicubicPatchMesh( GeometryScope iScope,
198 size_t iNu, bool iUNoWrap,
199 size_t iNv, bool iVNoWrap );
200
203ALEMBIC_EXPORT size_t
204GeometryScopeNumValuesNuPatch( GeometryScope iScope,
205 size_t iNu, size_t iUorder,
206 size_t iNv, size_t iVorder );
207
210ALEMBIC_EXPORT size_t
211GeometryScopeNumValuesLinearCurves( GeometryScope iScope,
212 size_t iNumCurves, bool iNoWrap,
213 size_t iSumOfCounts );
216ALEMBIC_EXPORT size_t
217GeometryScopeNumValuesCubicCurves( GeometryScope iScope,
218 size_t iNumCurves, bool iNoWrap,
219 size_t iSumOfCounts );
220
221//-*****************************************************************************
224//-*****************************************************************************
225
226ALEMBIC_EXPORT void SetIsUV( AbcA::MetaData &ioMetaData, bool isUV );
227
228ALEMBIC_EXPORT bool isUV( const AbcA::PropertyHeader & iHeader );
229
230} // End namespace ALEMBIC_VERSION_NS
231
232using namespace ALEMBIC_VERSION_NS;
233
234} // End namespace AbcGeom
235} // End namespace Alembic
236
237
238
239#endif
Alembic namespace ...
Definition ArchiveInfo.cpp:39