Alembic Version 1.1
IXform.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_IXform_h
38#define Alembic_AbcGeom_IXform_h
39
40#include <Alembic/Util/Export.h>
43
45
46namespace Alembic {
47namespace AbcGeom {
48namespace ALEMBIC_VERSION_NS {
49
50//-*****************************************************************************
51class ALEMBIC_EXPORT IXformSchema : public Abc::ISchema<XformSchemaInfo>
52{
53 //-*************************************************************************
54 // XFORM SCHEMA
55 //-*************************************************************************
56public:
57
63
64 //-*************************************************************************
65 // CONSTRUCTION, DESTRUCTION, ASSIGNMENT
66 //-*************************************************************************
67
71 {
72 m_useArrayProp = false;
73 m_isConstant = true;
74 m_isConstantIdentity = true;
75 }
76
84 const std::string &iName,
85 const Abc::Argument &iArg0 = Abc::Argument(),
86 const Abc::Argument &iArg1 = Abc::Argument() )
87 : Abc::ISchema<XformSchemaInfo>( iParent, iName, iArg0, iArg1 )
88 {
89 // Meta data and error handling are eaten up by
90 // the super type, so all that's left is SchemaInterpMatching.
91 init( iArg0, iArg1 );
92 }
93
99 const Abc::Argument &iArg0 = Abc::Argument(),
100 const Abc::Argument &iArg1 = Abc::Argument() )
101 : Abc::ISchema<XformSchemaInfo>( iProp, iArg0, iArg1 )
102 {
103 init( iArg0, iArg1 );
104 }
105
108 : Abc::ISchema<XformSchemaInfo>()
109 {
110 *this = iCopy;
111 }
112
114
115 bool isConstant() const { return m_isConstant; }
116
118 bool isConstantIdentity() const { return m_isConstantIdentity; }
119
120 size_t getNumSamples() const;
121
123 void get( XformSample &oSamp,
124 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const;
125
127 Abc::ISampleSelector() ) const;
128
130 {
131 return m_childBoundsProperty;
132 }
133
134 // lightweight get to avoid constructing a sample
135 // see XformSample.h for explanation of this property
137 Abc::ISampleSelector() ) const;
138
139 size_t getNumOps() const { return m_sample.getNumOps(); }
140
143 void reset()
144 {
145 m_childBoundsProperty.reset();
146 m_sample = XformSample();
147 m_inheritsProperty.reset();
148 m_isConstant = true;
149 m_isConstantIdentity = true;
150
151 m_arbGeomParams.reset();
152 m_userProperties.reset();
153
154 super_type::reset();
155 }
156
158 bool valid() const
159 {
160 return ( super_type::valid() );
161 }
162
163 ICompoundProperty getArbGeomParams() const { return m_arbGeomParams; }
164
165 ICompoundProperty getUserProperties() const { return m_userProperties; }
166
169 ALEMBIC_OVERRIDE_OPERATOR_BOOL( this_type::valid() );
170
171
172protected:
174
176
178
181
183
185
187
188private:
189 void init( const Abc::Argument &iArg0, const Abc::Argument &iArg1 );
190
191 // is m_vals an ArrayProperty, or a ScalarProperty?
192 bool m_useArrayProp;
193
194 // fills m_valVec with data
195 void getChannelValues( const AbcA::index_t iSampleIndex,
196 XformSample & oSamp ) const;
197};
198
199//-*****************************************************************************
200// SCHEMA OBJECT
201//-*****************************************************************************
203
204typedef Util::shared_ptr< IXform > IXformPtr;
205
206} // End namespace ALEMBIC_VERSION_NS
207
208using namespace ALEMBIC_VERSION_NS;
209
210} // End namespace AbcGeom
211} // End namespace Alembic
212
213#endif
#define ALEMBIC_EXPORT
Definition: Export.h:51
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:105
bool isConstantIdentity() const
is this xform both constant and identity?
Definition: IXform.h:118
IXformSchema(const ICompoundProperty &iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition: IXform.h:83
bool valid() const
Valid returns whether this function set is valid.
Definition: IXform.h:158
IXformSchema(const IXformSchema &iCopy)
explicit copy constructor to work around Windows compiler bug
Definition: IXform.h:107
Abc::ISchema< XformSchemaInfo > super_type
Definition: IXform.h:60
IXformSchema(const ICompoundProperty &iProp, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition: IXform.h:98
void get(XformSample &oSamp, const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
fill the supplied sample reference with values
XformSample getValue(const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
bool getInheritsXforms(const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
Abc::IBox3dProperty getChildBoundsProperty() const
Definition: IXform.h:129
ICompoundProperty getArbGeomParams() const
Definition: IXform.h:163
AbcA::BasePropertyReaderPtr m_valsProperty
Definition: IXform.h:175
AbcA::TimeSamplingPtr getTimeSampling() const
ICompoundProperty getUserProperties() const
Definition: IXform.h:165
Alembic::Util::shared_ptr< BasePropertyReader > BasePropertyReaderPtr
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Definition: TimeSampling.h:137
Abc::ISchemaObject< IXformSchema > IXform
Definition: IXform.h:202
Util::shared_ptr< IXform > IXformPtr
Definition: IXform.h:204
Alembic namespace ...
Definition: ArchiveInfo.h:46