Alembic Version 1.1
ICamera.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_ICamera_h
38#define Alembic_AbcGeom_ICamera_h
39
40#include <Alembic/Util/Export.h>
44
45namespace Alembic {
46namespace AbcGeom {
47namespace ALEMBIC_VERSION_NS {
48
49//-*****************************************************************************
50class ALEMBIC_EXPORT ICameraSchema : public Abc::ISchema<CameraSchemaInfo>
51{
52 //-*************************************************************************
53 // CAMERA SCHEMA
54 //-*************************************************************************
55public:
59
60 //-*************************************************************************
61 // CONSTRUCTION, DESTRUCTION, ASSIGNMENT
62 //-*************************************************************************
63
67
75 const std::string &iName,
76
77 const Abc::Argument &iArg0 = Abc::Argument(),
78 const Abc::Argument &iArg1 = Abc::Argument() )
79 : Abc::ISchema<CameraSchemaInfo>( iParent, iName, iArg0, iArg1 )
80 {
81 init( iArg0, iArg1 );
82 }
83
89 const Abc::Argument &iArg0 = Abc::Argument(),
90 const Abc::Argument &iArg1 = Abc::Argument() )
91 : Abc::ISchema<CameraSchemaInfo>( iProp, iArg0, iArg1 )
92 {
93 init( iArg0, iArg1 );
94 }
95
96
99 : Abc::ISchema<CameraSchemaInfo>()
100 {
101 *this = iCopy;
102 }
103
105
108 { return m_coreProperties.getTimeSampling(); }
109
114 size_t getNumSamples() const
115 { return m_coreProperties.getNumSamples(); }
116
119 bool isConstant() const;
120
121 void get( CameraSample &oSample,
122 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const;
123
125 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const
126 {
127 CameraSample smp;
128 get( smp, iSS );
129 return smp;
130 }
131
132 // compound property to use as parent for any arbitrary GeomParams
133 // underneath it
134 ICompoundProperty getArbGeomParams() const { return m_arbGeomParams; }
135 ICompoundProperty getUserProperties() const { return m_userProperties; }
136
137 Abc::IBox3dProperty getChildBoundsProperty() const { return m_childBoundsProperty; }
138
141 void reset()
142 {
143 m_coreProperties.reset();
144 m_childBoundsProperty.reset();
145 m_arbGeomParams.reset();
146 m_userProperties.reset();
147 m_ops.clear();
149 }
150
152 bool valid() const
153 {
155 m_coreProperties.valid() );
156 }
157
161
162protected:
163 void init( const Abc::Argument &iArg0,
164 const Abc::Argument &iArg1 );
165
167
169
172
175
176private:
177 std::vector < FilmBackXformOp > m_ops;
178
179};
180
181//-*****************************************************************************
182// SCHEMA OBJECT
183//-*****************************************************************************
185
186typedef Util::shared_ptr< ICamera > ICameraPtr;
187
188} // End namespace ALEMBIC_VERSION_NS
189
190using namespace ALEMBIC_VERSION_NS;
191
192} // End namespace AbcGeom
193} // End namespace Alembic
194
195#endif
#define ALEMBIC_EXPORT
Definition: Export.h:51
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:105
bool valid() const
Returns whether this function set is valid.
Definition: ICamera.h:152
CameraSample getValue(const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
Definition: ICamera.h:124
Abc::IDoubleArrayProperty m_largeFilmBackChannels
Definition: ICamera.h:174
ICameraSchema(const ICompoundProperty &iProp, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition: ICamera.h:88
ICameraSchema(const ICompoundProperty &iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition: ICamera.h:74
Abc::IBox3dProperty getChildBoundsProperty() const
Definition: ICamera.h:137
void init(const Abc::Argument &iArg0, const Abc::Argument &iArg1)
AbcA::TimeSamplingPtr getTimeSampling() const
Default assignment operator used.
Definition: ICamera.h:107
ICameraSchema(const ICameraSchema &iCopy)
Copy constructor.
Definition: ICamera.h:98
void get(CameraSample &oSample, const Abc::ISampleSelector &iSS=Abc::ISampleSelector()) const
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Definition: TimeSampling.h:137
Abc::ISchemaObject< ICameraSchema > ICamera
Definition: ICamera.h:184
Util::shared_ptr< ICamera > ICameraPtr
Definition: ICamera.h:186
Alembic namespace ...
Definition: ArchiveInfo.h:46