HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Foundation.h
Go to the documentation of this file.
1 //-*****************************************************************************
2 //
3 // Copyright (c) 2009-2016,
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_Abc_Foundation_h
38 #define Alembic_Abc_Foundation_h
39 
41 #include <Alembic/Util/All.h>
42 
43 #include <ImathVec.h>
44 #include <ImathBox.h>
45 #include <ImathMatrix.h>
46 #include <ImathQuat.h>
47 #include <ImathColor.h>
48 
49 #include <iostream>
50 #include <string>
51 #include <exception>
52 
53 #include <cstdlib>
54 #include <cstdio>
55 #include <cstring>
56 #include <cassert>
57 
58 namespace Alembic {
59 namespace Abc {
60 namespace ALEMBIC_VERSION_NS {
61 
62 //-*****************************************************************************
63 // Bring 'em ALL in.
65 using namespace AbcA;
66 
67 //-*****************************************************************************
68 //! Flag for specifying whether to match interpretations or schemas
69 //! When we create objects that have certain expected properties, data formats
70 //! or layouts, we use things called "SchemaTitles" and "Interpretations",
71 //! both of which are just strings, for providing a hint as to the meaning
72 //! of CompoundProperties and SimpleProperties, respectively.
73 //! This flag is used by the wrapper classes to indicate how they will
74 //! assert a match of schemaTitle or interpretation.
75 //-*****************************************************************************
77 {
81 };
82 
83 //-*****************************************************************************
84 //! We want to be able to use our wrapper classes to wrap existing writer
85 //! and reader objects from AbcCoreAbstract. However, the constructors
86 //! for these wrapper classes have trouble distinguishing between the
87 //! user request to wrap an existing writer, vs the request to create a new
88 //! writer.
89 //! While for some of the properties herein this is actually not ambiguous,
90 //! we insist on the use of this flag because it makes code and intention
91 //! more readable.
92 //-*****************************************************************************
94 {
96 };
97 
98 //-*****************************************************************************
99 //! This flag exists to indicate that the "top" object or compound property
100 //! is desired - when getting the top object from the Archive or
101 //! getting the top compound property from the Object.
102 //-*****************************************************************************
104 {
106 };
107 
108 //-*****************************************************************************
109 //! Flag used during write which indicates whether we are writing out the
110 //! full schema, or just parts of it.
111 //-*****************************************************************************
113 {
116 };
117 
118 //-*****************************************************************************
119 //-*****************************************************************************
120 //-*****************************************************************************
121 //-*****************************************************************************
122 // IMPORTED IMATH TYPES
123 //-*****************************************************************************
124 //-*****************************************************************************
125 //-*****************************************************************************
126 using Imath::V2s;
127 using Imath::V2i;
128 using Imath::V2f;
129 using Imath::V2d;
130 
131 using Imath::V3s;
132 using Imath::V3i;
133 using Imath::V3f;
134 using Imath::V3d;
135 
136 using Imath::Box2s;
137 using Imath::Box2i;
138 using Imath::Box2f;
139 using Imath::Box2d;
140 
141 using Imath::Box3s;
142 using Imath::Box3i;
143 using Imath::Box3f;
144 using Imath::Box3d;
145 
146 using Imath::M33f;
147 using Imath::M33d;
148 using Imath::M44f;
149 using Imath::M44d;
150 
151 using Imath::Quatf;
152 using Imath::Quatd;
153 
154 using Imath::C3h;
155 using Imath::C3f;
156 using Imath::C3c;
157 
158 using Imath::C4h;
159 using Imath::C4f;
160 using Imath::C4c;
161 
162 typedef V3f N3f;
163 typedef V3d N3d;
164 
165 //-*****************************************************************************
166 //-*****************************************************************************
167 // OBJECT EXTRACTION FUNCTIONS
168 // These are intrusive methods used by the Abc constructors.
169 //-*****************************************************************************
170 //-*****************************************************************************
171 
172 //-*****************************************************************************
175 {
176  return iPtr;
177 }
178 
179 //-*****************************************************************************
182 {
183  return iPtr;
184 }
185 
186 //-*****************************************************************************
187 //-*****************************************************************************
188 // OBJECT EXTRACTION FUNCTIONS
189 // These are intrusive methods used by the templated Abc constructors.
190 //-*****************************************************************************
191 //-*****************************************************************************
192 
193 //-*****************************************************************************
195 {
196  return iPtr;
197 }
198 
199 //-*****************************************************************************
201 {
202  return iPtr;
203 }
204 
205 //-*****************************************************************************
206 //-*****************************************************************************
207 // ARCHIVE EXTRACTION FUNCTIONS
208 // These are intrusive methods used by the templated Abc constructors.
209 //-*****************************************************************************
210 //-*****************************************************************************
211 
212 //-*****************************************************************************
214 {
215  return iPtr;
216 }
217 
218 //-*****************************************************************************
220 {
221  return iPtr;
222 }
223 
224 } // End namespace ALEMBIC_VERSION_NS
225 
226 using namespace ALEMBIC_VERSION_NS;
227 
228 } // End namespace Abc
229 } // End namespace Alembic
230 
231 #endif
Matrix44< float > M44f
4x4 matrix of float
Definition: ImathMatrix.h:1137
Box< V3i > Box3i
3D box of base type int.
Definition: ImathBox.h:158
Alembic::Util::shared_ptr< ObjectWriter > ObjectWriterPtr
Box< V3f > Box3f
3D box of base type float.
Definition: ImathBox.h:164
Vec3< int > V3i
Vec3 of integer.
Definition: ImathVec.h:843
Vec2< int > V2i
Vec2 of integer.
Definition: ImathVec.h:828
Color4< float > C4f
4 float channels
Definition: ImathColor.h:295
Alembic::Util::shared_ptr< ObjectReader > ObjectReaderPtr
Vec2< short > V2s
Vec2 of short.
Definition: ImathVec.h:825
Color4< half > C4h
4 half channels
Definition: ImathColor.h:298
Vec3< short > V3s
Vec3 of short.
Definition: ImathVec.h:840
Matrix33< float > M33f
3x3 matrix of float
Definition: ImathMatrix.h:1131
Matrix44< double > M44d
4x4 matrix of double
Definition: ImathMatrix.h:1140
Box< V2f > Box2f
2D box of base type float.
Definition: ImathBox.h:149
Matrix33< double > M33d
3x3 matrix of double
Definition: ImathMatrix.h:1134
Vec3< double > V3d
Vec3 of double.
Definition: ImathVec.h:852
Box< V2s > Box2s
2D box of base type short.
Definition: ImathBox.h:140
Alembic::Util::shared_ptr< CompoundPropertyReader > CompoundPropertyReaderPtr
Quat< double > Quatd
Quaternion of type double.
Definition: ImathQuat.h:265
Box< V2i > Box2i
2D box of base type int.
Definition: ImathBox.h:143
AbcA::ArchiveReaderPtr GetArchiveReaderPtr(AbcA::ArchiveReaderPtr iPtr)
Definition: Foundation.h:219
Quat< float > Quatf
Quaternion of type float.
Definition: ImathQuat.h:262
Vec2< double > V2d
Vec2 of double.
Definition: ImathVec.h:837
Box< V3s > Box3s
3D box of base type short.
Definition: ImathBox.h:155
AbcA::ObjectWriterPtr GetObjectWriterPtr(AbcA::ObjectWriterPtr iPtr)
Definition: Foundation.h:194
AbcA::ObjectReaderPtr GetObjectReaderPtr(AbcA::ObjectReaderPtr iPtr)
Definition: Foundation.h:200
Color4< unsigned char > C4c
4 8-bit integer channels
Definition: ImathColor.h:301
Box< V2d > Box2d
2D box of base type double.
Definition: ImathBox.h:152
Alembic::Util::shared_ptr< ArchiveReader > ArchiveReaderPtr
Smart Ptrs to Readers.
Vec2< float > V2f
Vec2 of float.
Definition: ImathVec.h:834
Vec3< float > V3f
Vec3 of float.
Definition: ImathVec.h:849
Box< V3d > Box3d
3D box of base type double.
Definition: ImathBox.h:167
Color3< half > C3h
3 half channels
Definition: ImathColor.h:277
AbcA::CompoundPropertyReaderPtr GetCompoundPropertyReaderPtr(AbcA::CompoundPropertyReaderPtr iPtr)
Definition: Foundation.h:181
AbcA::ArchiveWriterPtr GetArchiveWriterPtr(AbcA::ArchiveWriterPtr iPtr)
Definition: Foundation.h:213
AbcA::CompoundPropertyWriterPtr GetCompoundPropertyWriterPtr(AbcA::CompoundPropertyWriterPtr iPtr)
Definition: Foundation.h:174
Color3< float > C3f
3 float channels
Definition: ImathColor.h:280
Alembic::Util::shared_ptr< ArchiveWriter > ArchiveWriterPtr
Smart Ptrs to Writers.
Color3< unsigned char > C3c
3 8-bit integer channels
Definition: ImathColor.h:283
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:88
Alembic::Util::shared_ptr< CompoundPropertyWriter > CompoundPropertyWriterPtr