Alembic Version 1.1

OLight.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_OLight_h
38#define Alembic_AbcGeom_OLight_h
39
40
41#include <Alembic/Util/Export.h>
42#include <Alembic/AbcGeom/OCamera.h>
43#include <Alembic/AbcGeom/Foundation.h>
44#include <Alembic/AbcGeom/SchemaInfoDeclarations.h>
45
46 namespace Alembic {
47 namespace AbcGeom {
48 namespace ALEMBIC_VERSION_NS {
49
50//-*****************************************************************************
51 class ALEMBIC_EXPORT OLightSchema : public Abc::OSchema<LightSchemaInfo>
52{
53 //-*************************************************************************
54 // LIGHT SCHEMA (just a container schema which has a camera schema)
55 //-*************************************************************************
56 public:
59 typedef OLightSchema this_type;
60
61 //-*************************************************************************
62 // CONSTRUCTION, DESTRUCTION, ASSIGNMENT
63 //-*************************************************************************
64
67 OLightSchema() {}
68
75 OLightSchema( AbcA::CompoundPropertyWriterPtr iParent,
76 const std::string &iName,
77 const Abc::Argument &iArg0 = Abc::Argument(),
78 const Abc::Argument &iArg1 = Abc::Argument(),
79 const Abc::Argument &iArg2 = Abc::Argument(),
80 const Abc::Argument &iArg3 = Abc::Argument() );
81
88 OLightSchema( Abc::OCompoundProperty iParent,
89 const std::string &iName,
90 const Abc::Argument &iArg0 = Abc::Argument(),
91 const Abc::Argument &iArg1 = Abc::Argument(),
92 const Abc::Argument &iArg2 = Abc::Argument() );
93
95 OLightSchema(const OLightSchema& iCopy)
96 : Abc::OSchema<LightSchemaInfo>()
97 {
98 *this = iCopy;
99 }
100
102
103 //-*************************************************************************
104 // SCHEMA STUFF
105 //-*************************************************************************
106
108 AbcA::TimeSamplingPtr getTimeSampling() const { return m_tsPtr; }
109
110 //-*************************************************************************
111 // SAMPLE STUFF
112 //-*************************************************************************
113
116 size_t getNumSamples();
118 void setCameraSample( const CameraSample &iSamp );
119
121 void setFromPrevious();
122
123 void setTimeSampling( uint32_t iIndex );
124 void setTimeSampling( AbcA::TimeSamplingPtr iTime );
125
126 Abc::OCompoundProperty getUserProperties();
127 Abc::OCompoundProperty getArbGeomParams();
128 Abc::OBox3dProperty getChildBoundsProperty();
129
130 //-*************************************************************************
131 // ABC BASE MECHANISMS
132 // These functions are used by Abc to deal with errors, validity,
133 // and so on.
134 //-*************************************************************************
135
138 void reset()
139 {
140 m_userProperties.reset();
141 m_arbGeomParams.reset();
142 m_cameraSchema.reset();
143 m_childBoundsProperty.reset();
144 Abc::OSchema<LightSchemaInfo>::reset();
145 }
146
148 bool valid() const
149 {
150 return ( Abc::OSchema<LightSchemaInfo>::valid() );
151 }
152
155 ALEMBIC_OVERRIDE_OPERATOR_BOOL( OLightSchema::valid() );
156
157 protected:
158
159 void init( AbcA::CompoundPropertyWriterPtr iParent,
160 const Abc::Argument &iArg0,
161 const Abc::Argument &iArg1,
162 const Abc::Argument &iArg2,
163 const Abc::Argument &iArg3 );
164
165 AbcA::TimeSamplingPtr m_tsPtr;
166
167 Abc::OBox3dProperty m_childBoundsProperty;
168
169 Abc::OCompoundProperty m_userProperties;
170 Abc::OCompoundProperty m_arbGeomParams;
171
172 AbcGeom::OCameraSchema m_cameraSchema;
173};
174
175//-*****************************************************************************
176// SCHEMA OBJECT
177//-*****************************************************************************
178 typedef Abc::OSchemaObject<OLightSchema> OLight;
179
180 typedef Util::shared_ptr< OLight > OLightPtr;
181
182} // End namespace ALEMBIC_VERSION_NS
183
184 using namespace ALEMBIC_VERSION_NS;
185
186} // End namespace AbcGeom
187} // End namespace Alembic
188
189#endif
Foundation.h
SchemaInfoDeclarations.h
Export.h
ALEMBIC_EXPORT
#define ALEMBIC_EXPORT
Definition: Export.h:51
OCamera.h
ALEMBIC_VERSION_NS
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:105
Alembic::AbcGeom::ALEMBIC_VERSION_NS::CameraSample
Definition: CameraSample.h:50
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OCameraSchema
Definition: OCamera.h:51
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema
Definition: OLight.h:52
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::m_cameraSchema
AbcGeom::OCameraSchema m_cameraSchema
Definition: OLight.h:172
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::init
void init(AbcA::CompoundPropertyWriterPtr iParent, const Abc::Argument &iArg0, const Abc::Argument &iArg1, const Abc::Argument &iArg2, const Abc::Argument &iArg3)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::setTimeSampling
void setTimeSampling(AbcA::TimeSamplingPtr iTime)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::setCameraSample
void setCameraSample(const CameraSample &iSamp)
Set a sample.
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::OLightSchema
OLightSchema()
Definition: OLight.h:67
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::setTimeSampling
void setTimeSampling(uint32_t iIndex)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::m_tsPtr
AbcA::TimeSamplingPtr m_tsPtr
Definition: OLight.h:165
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::ALEMBIC_OVERRIDE_OPERATOR_BOOL
ALEMBIC_OVERRIDE_OPERATOR_BOOL(OLightSchema::valid())
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::getNumSamples
size_t getNumSamples()
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::getArbGeomParams
Abc::OCompoundProperty getArbGeomParams()
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::OLightSchema
OLightSchema(const OLightSchema &iCopy)
Copy constructor.
Definition: OLight.h:95
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::getUserProperties
Abc::OCompoundProperty getUserProperties()
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::this_type
OLightSchema this_type
Definition: OLight.h:59
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::OLightSchema
OLightSchema(Abc::OCompoundProperty iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument(), const Abc::Argument &iArg2=Abc::Argument())
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::reset
void reset()
Definition: OLight.h:138
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::setFromPrevious
void setFromPrevious()
Set from previous sample.
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::m_userProperties
Abc::OCompoundProperty m_userProperties
Definition: OLight.h:169
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::valid
bool valid() const
Returns whether this function set is valid.
Definition: OLight.h:148
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::m_childBoundsProperty
Abc::OBox3dProperty m_childBoundsProperty
Definition: OLight.h:167
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::getTimeSampling
AbcA::TimeSamplingPtr getTimeSampling() const
Default assignment operator used.
Definition: OLight.h:108
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::getChildBoundsProperty
Abc::OBox3dProperty getChildBoundsProperty()
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::OLightSchema
OLightSchema(AbcA::CompoundPropertyWriterPtr iParent, const std::string &iName, const Abc::Argument &iArg0=Abc::Argument(), const Abc::Argument &iArg1=Abc::Argument(), const Abc::Argument &iArg2=Abc::Argument(), const Abc::Argument &iArg3=Abc::Argument())
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightSchema::m_arbGeomParams
Abc::OCompoundProperty m_arbGeomParams
Definition: OLight.h:170
Alembic::Abc::ALEMBIC_VERSION_NS::Argument
Definition: Argument.h:120
Alembic::Abc::ALEMBIC_VERSION_NS::OBasePropertyT< AbcA::CompoundPropertyWriterPtr >::reset
void reset()
Definition: OBaseProperty.h:166
Alembic::Abc::ALEMBIC_VERSION_NS::OCompoundProperty
Definition: OCompoundProperty.h:53
Alembic::Abc::ALEMBIC_VERSION_NS::OSchemaObject
Definition: OSchemaObject.h:54
Alembic::Abc::ALEMBIC_VERSION_NS::OSchema
Definition: OSchema.h:119
Alembic::Abc::ALEMBIC_VERSION_NS::OTypedScalarProperty< Box3dTPTraits >
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::CompoundPropertyWriterPtr
Alembic::Util::shared_ptr< CompoundPropertyWriter > CompoundPropertyWriterPtr
Definition: ForwardDeclarations.h:83
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::TimeSamplingPtr
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Definition: TimeSampling.h:137
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLightPtr
Util::shared_ptr< OLight > OLightPtr
Definition: OLight.h:180
Alembic::AbcGeom::ALEMBIC_VERSION_NS::OLight
Abc::OSchemaObject< OLightSchema > OLight
Definition: OLight.h:178
Alembic::Abc::ALEMBIC_VERSION_NS
Definition: ArchiveInfo.h:48
Alembic
Alembic namespace ...
Definition: ArchiveInfo.h:46