Alembic 1.8.11

Loading...
Searching...
No Matches
ICamera.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_ICamera_h
38#define Alembic_AbcGeom_ICamera_h
39
40#include <Alembic/Util/Export.h>
41#include <Alembic/AbcGeom/Foundation.h>
42#include <Alembic/AbcGeom/SchemaInfoDeclarations.h>
43#include <Alembic/AbcGeom/CameraSample.h>
44
45 namespace Alembic {
46 namespace AbcGeom {
47 namespace ALEMBIC_VERSION_NS {
48
49//-*****************************************************************************
50 class ALEMBIC_EXPORT ICameraSchema : public Abc::ISchema<CameraSchemaInfo>
51{
52 //-*************************************************************************
53 // CAMERA SCHEMA
54 //-*************************************************************************
55 public:
58 typedef ICameraSchema this_type;
59
60 //-*************************************************************************
61 // CONSTRUCTION, DESTRUCTION, ASSIGNMENT
62 //-*************************************************************************
63
66 ICameraSchema() {}
67
74 ICameraSchema( const ICompoundProperty & iParent,
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
88 ICameraSchema( const ICompoundProperty & iProp,
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
97
99 AbcA::TimeSamplingPtr getTimeSampling() const
100 { return m_coreProperties.getTimeSampling(); }
101
106 size_t getNumSamples() const
107 { return m_coreProperties.getNumSamples(); }
108
111 bool isConstant() const;
112
113 void get( CameraSample &oSample,
114 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const;
115
116 CameraSample getValue(
117 const Abc::ISampleSelector &iSS = Abc::ISampleSelector() ) const
118 {
119 CameraSample smp;
120 get( smp, iSS );
121 return smp;
122 }
123
124 // compound property to use as parent for any arbitrary GeomParams
125 // underneath it
126 ICompoundProperty getArbGeomParams() const { return m_arbGeomParams; }
127 ICompoundProperty getUserProperties() const { return m_userProperties; }
128
129 Abc::IBox3dProperty getChildBoundsProperty() const { return m_childBoundsProperty; }
130
133 void reset()
134 {
135 m_coreProperties.reset();
136 m_childBoundsProperty.reset();
137 m_arbGeomParams.reset();
138 m_userProperties.reset();
139 m_ops.clear();
140 Abc::ISchema<CameraSchemaInfo>::reset();
141 }
142
144 bool valid() const
145 {
146 return ( Abc::ISchema<CameraSchemaInfo>::valid() &&
147 m_coreProperties.valid() );
148 }
149
152 ALEMBIC_OVERRIDE_OPERATOR_BOOL( ICameraSchema::valid() );
153
154 protected:
155 void init( const Abc::Argument &iArg0,
156 const Abc::Argument &iArg1 );
157
158 Abc::IScalarProperty m_coreProperties;
159
160 Abc::IBox3dProperty m_childBoundsProperty;
161
162 Abc::ICompoundProperty m_arbGeomParams;
163 Abc::ICompoundProperty m_userProperties;
164
165 Abc::IScalarProperty m_smallFilmBackChannels;
166 Abc::IDoubleArrayProperty m_largeFilmBackChannels;
167
168 private:
169 std::vector < FilmBackXformOp > m_ops;
170
171};
172
173//-*****************************************************************************
174// SCHEMA OBJECT
175//-*****************************************************************************
176 typedef Abc::ISchemaObject<ICameraSchema> ICamera;
177
178 typedef Util::shared_ptr< ICamera > ICameraPtr;
179
180} // End namespace ALEMBIC_VERSION_NS
181
182 using namespace ALEMBIC_VERSION_NS;
183
184} // End namespace AbcGeom
185} // End namespace Alembic
186
187#endif
Alembic::Abc::ALEMBIC_VERSION_NS::Argument
Definition Argument.h:120
Alembic::Abc::ALEMBIC_VERSION_NS::IBasePropertyT::valid
bool valid() const
Definition IBaseProperty.h:164
Alembic::Abc::ALEMBIC_VERSION_NS::ICompoundProperty
Definition ICompoundProperty.h:53
Alembic::Abc::ALEMBIC_VERSION_NS::ISampleSelector
Definition ISampleSelector.h:49
Alembic::Abc::ALEMBIC_VERSION_NS::IScalarProperty
Definition IScalarProperty.h:54
Alembic::Abc::ALEMBIC_VERSION_NS::ISchema
Definition ISchema.h:58
Alembic::Abc::ALEMBIC_VERSION_NS::ISchema< CameraSchemaInfo >::ISchema
ISchema()
Definition ISchema.h:112
Alembic::Abc::ALEMBIC_VERSION_NS::ISchemaObject
Definition ISchemaObject.h:56
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample
Definition CameraSample.h:50
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::getNumSamples
size_t getNumSamples() const
Definition ICamera.h:106
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::ICameraSchema
ICameraSchema()
Definition ICamera.h:66
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::valid
bool valid() const
Returns whether this function set is valid.
Definition ICamera.h:144
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::ALEMBIC_OVERRIDE_OPERATOR_BOOL
ALEMBIC_OVERRIDE_OPERATOR_BOOL(ICameraSchema::valid())
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::ICameraSchema
ICameraSchema(const ICompoundProperty &iProp, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition ICamera.h:88
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::ICameraSchema
ICameraSchema(const ICompoundProperty &iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument())
Definition ICamera.h:74
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::getTimeSampling
AbcA::TimeSamplingPtr getTimeSampling() const
Default assignment and copy operator used.
Definition ICamera.h:99
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::this_type
ICameraSchema this_type
Definition ICamera.h:58
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ICameraSchema::reset
void reset()
Definition ICamera.h:133
Alembic
Alembic namespace ...
Definition ArchiveInfo.cpp:39