Alembic: AbcGeom/XformOp.h Source File

Alembic 1.8.11

Loading...
Searching...
No Matches
XformOp.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_XformOp_h
38#define Alembic_AbcGeom_XformOp_h
39
40#include <Alembic/Util/Export.h>
41#include <Alembic/AbcGeom/Foundation.h>
42
43#include <set>
44
45namespace Alembic {
46namespace AbcGeom {
47namespace ALEMBIC_VERSION_NS {
48
53enum MatrixHint
54{
56 kMatrixHint = 0,
57
59 kMayaShearHint = 1
60};
61
67enum RotateHint
68{
70 kRotateHint = 0,
71
74 kRotateOrientationHint = 1
75};
76
82enum ScaleHint
83{
85 kScaleHint = 0
86};
87
88
94enum TranslateHint
95{
97 kTranslateHint = 0,
98
100 kScalePivotPointHint = 1,
101
104 kScalePivotTranslationHint = 2,
105
107 kRotatePivotPointHint = 3,
108
111 kRotatePivotTranslationHint = 4
112};
113
120 class ALEMBIC_EXPORT XformOp
121{
122public:
123 XformOp();
124
125 XformOp( const XformOperationType iType,
126 const Alembic::Util::uint8_t iHint = 0 );
127
128 XformOp( const Alembic::Util::uint8_t iEncodedOp );
129
131 XformOperationType getType() const;
132
135 void setType( const XformOperationType iType );
136
139 Alembic::Util::uint8_t getHint() const;
140
143 void setHint( const Alembic::Util::uint8_t iHint );
144
147 bool isXAnimated() const;
148
151 bool isYAnimated() const;
152
155 bool isZAnimated() const;
156
161 bool isAngleAnimated() const;
162
168 bool isChannelAnimated( std::size_t iIndex ) const;
169
173 std::size_t getNumChannels() const;
174
179 double getDefaultChannelValue( std::size_t iIndex ) const;
180
181 double getChannelValue( std::size_t iIndex ) const;
182
185 void setChannelValue( std::size_t iIndex, double iVal );
186
187 void setVector( const Abc::V3d &iVec );
188 void setTranslate( const Abc::V3d &iTrans );
189 void setScale( const Abc::V3d &iScale );
190 void setAxis( const Abc::V3d &iAxis );
191 void setAngle( const double iAngle );
192 void setMatrix( const Abc::M44d &iMatrix );
193
194 void setXRotation( const double iAngle );
195 void setYRotation( const double iAngle );
196 void setZRotation( const double iAngle );
197
198 // synthetic getters return by value
199 Abc::V3d getVector() const;
200 Abc::V3d getTranslate() const;
201 Abc::V3d getScale() const;
202 Abc::V3d getAxis() const;
203 double getAngle() const;
204 Abc::M44d getMatrix() const;
205
206 double getXRotation() const;
207 double getYRotation() const;
208 double getZRotation() const;
209
210 bool isTranslateOp() const;
211
212 bool isScaleOp() const;
213
214 bool isRotateOp() const;
215
216 bool isMatrixOp() const;
217
218 bool isRotateXOp() const;
219 bool isRotateYOp() const;
220 bool isRotateZOp() const;
221
226 Alembic::Util::uint8_t getOpEncoding() const;
227
228
229private:
230 XformOperationType m_type;
231 Alembic::Util::uint8_t m_hint;
232
233 std::vector<double> m_channels;
234
235 std::set<Alembic::Util::uint32_t> m_animChannels;
236
237private:
240 friend class IXformSchema;
241
242};
243
244typedef std::vector < XformOp > XformOpVec;
245
246} // End namespace ALEMBIC_VERSION_NS
247
248using namespace ALEMBIC_VERSION_NS;
249
250} // End namespace AbcGeom
251} // End namespace Alembic
252
253#endif
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getNumChannels
std::size_t getNumChannels() const
Definition XformOp.cpp:230
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isXAnimated
bool isXAnimated() const
Definition XformOp.cpp:176
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getDefaultChannelValue
double getDefaultChannelValue(std::size_t iIndex) const
Definition XformOp.cpp:236
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getOpEncoding
Alembic::Util::uint8_t getOpEncoding() const
Definition XformOp.cpp:277
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setHint
void setHint(const Alembic::Util::uint8_t iHint)
Definition XformOp.cpp:147
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isChannelAnimated
bool isChannelAnimated(std::size_t iIndex) const
Definition XformOp.cpp:224
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isZAnimated
bool isZAnimated() const
Definition XformOp.cpp:200
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getHint
Alembic::Util::uint8_t getHint() const
Definition XformOp.cpp:141
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setChannelValue
void setChannelValue(std::size_t iIndex, double iVal)
Definition XformOp.cpp:271
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setType
void setType(const XformOperationType iType)
Definition XformOp.cpp:115
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isYAnimated
bool isYAnimated() const
Definition XformOp.cpp:188
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isAngleAnimated
bool isAngleAnimated() const
Definition XformOp.cpp:212
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::IXformSchema
friend class IXformSchema
Definition XformOp.h:240
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getType
XformOperationType getType() const
Get the type of transform operation. (Translate, Rotate, Scale, Matrix)
Definition XformOp.cpp:109
Alembic
Alembic namespace ...
Definition ArchiveInfo.cpp:39