Alembic Version 1.1
PropertyHeader.h
Go to the documentation of this file.
1//-*****************************************************************************
2//
3// Copyright (c) 2009-2011,
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_AbcCoreAbstract_PropertyHeader_h
38#define Alembic_AbcCoreAbstract_PropertyHeader_h
39
44
45namespace Alembic {
46namespace AbcCoreAbstract {
47namespace ALEMBIC_VERSION_NS {
48
49//-*****************************************************************************
57{
58
63
67
72};
73
74//-*****************************************************************************
79{
80public:
85 : m_name(),
86 m_propertyType( kScalarProperty ),
87 m_metaData(),
88 m_dataType(),
89 m_timeSampling() {}
90
93 explicit PropertyHeader( const std::string &iName,
94 const MetaData &iMetaData )
95 : m_name( iName ),
96 m_propertyType( kCompoundProperty ),
97 m_metaData( iMetaData ),
98 m_dataType(),
99 m_timeSampling() {}
100
103 PropertyHeader( const std::string &iName,
104 PropertyType iPropType,
105 const MetaData &iMetaData,
106 const DataType &iDataType,
107 const TimeSamplingPtr & iTsamp )
108 : m_name( iName ),
109 m_propertyType( iPropType ),
110 m_metaData( iMetaData ),
111 m_dataType( iDataType ),
112 m_timeSampling( iTsamp ) {}
113
117 : m_name( iCopy.m_name ),
118 m_propertyType( iCopy.m_propertyType ),
119 m_metaData( iCopy.m_metaData ),
120 m_dataType( iCopy.m_dataType ),
121 m_timeSampling( iCopy.m_timeSampling ) {}
122
126 {
127 m_name = iCopy.m_name;
128 m_propertyType = iCopy.m_propertyType;
129 m_metaData = iCopy.m_metaData;
130 m_dataType = iCopy.m_dataType;
131 m_timeSampling = iCopy.m_timeSampling;
132 return *this;
133 }
134
137 const std::string &getName() const { return m_name; }
138
139 void setName( const std::string &iName ) { m_name = iName; }
140
143 PropertyType getPropertyType() const { return m_propertyType; }
144
145 void setPropertyType( PropertyType iPtyp ) { m_propertyType = iPtyp; }
146
149 bool isScalar() const { return m_propertyType == kScalarProperty; }
150
153 bool isArray() const { return m_propertyType == kArrayProperty; }
154
157 bool isCompound() const { return m_propertyType == kCompoundProperty; }
158
161 bool isSimple() const { return !isCompound(); }
162
165 const MetaData &getMetaData() const { return m_metaData; }
166
167 void setMetaData( const MetaData &iMetaData ) { m_metaData = iMetaData; }
168
173 const DataType &getDataType() const { return m_dataType; }
174
175 void setDataType( const DataType &iDataType ) { m_dataType = iDataType; }
176
182 { return m_timeSampling; }
183
184 void setTimeSampling( const TimeSamplingPtr &iTsamp )
185 { m_timeSampling = iTsamp; }
186
187private:
188 std::string m_name;
189 PropertyType m_propertyType;
190 MetaData m_metaData;
191 DataType m_dataType;
192 TimeSamplingPtr m_timeSampling;
193};
194
195} // End namespace ALEMBIC_VERSION_NS
196
197using namespace ALEMBIC_VERSION_NS;
198
199} // End namespace AbcCoreAbstract
200} // End namespace Alembic
201
202#endif
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:105
PropertyHeader(const std::string &iName, PropertyType iPropType, const MetaData &iMetaData, const DataType &iDataType, const TimeSamplingPtr &iTsamp)
PropertyHeader(const std::string &iName, const MetaData &iMetaData)
PropertyHeader & operator=(const PropertyHeader &iCopy)
Alembic::Util::shared_ptr< TimeSampling > TimeSamplingPtr
Definition: TimeSampling.h:137
Alembic namespace ...
Definition: ArchiveInfo.h:46