Alembic Version 1.1
Loading...
Searching...
No Matches
XformOp.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_XformOp_h
38#define Alembic_AbcGeom_XformOp_h
39
40#include <Alembic/Util/Export.h>
42
43#include <set>
44
45namespace Alembic {
46namespace AbcGeom {
47namespace ALEMBIC_VERSION_NS {
48
61
76
83{
85 kScaleHint = 0
86};
87
88
113
121{
122public:
124
126 const Alembic::Util::uint8_t iHint = 0 );
127
128 XformOp( const Alembic::Util::uint8_t iEncodedOp );
129
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
#define ALEMBIC_EXPORT
Definition Export.h:51
#define ALEMBIC_VERSION_NS
Definition Foundation.h:105
Xform Operation This class holds the data about a particular transform operation, but does not hold t...
Definition XformOp.h:121
XformOp(const XformOperationType iType, const Alembic::Util::uint8_t iHint=0)
double getDefaultChannelValue(std::size_t iIndex) const
Alembic::Util::uint8_t getOpEncoding() const
void setHint(const Alembic::Util::uint8_t iHint)
bool isChannelAnimated(std::size_t iIndex) const
XformOp(const Alembic::Util::uint8_t iEncodedOp)
void setChannelValue(std::size_t iIndex, double iVal)
Alembic::Util::uint8_t getHint() const
void setType(const XformOperationType iType)
void setMatrix(const Abc::M44d &iMatrix)
void setTranslate(const Abc::V3d &iTrans)
XformOperationType getType() const
Get the type of transform operation. (Translate, Rotate, Scale, Matrix)
double getChannelValue(std::size_t iIndex) const
void setScale(const Abc::V3d &iScale)
XformOperationType
Enum that indicates the type of transformational operation. This enum is used when encoding and decod...
Definition Foundation.h:71
TranslateHint
The Translation identifier hint. Some 3d packages (like Maya) have multiple transformation operations...
Definition XformOp.h:95
@ kTranslateHint
Default, regular translation.
Definition XformOp.h:97
@ kRotatePivotPointHint
Translation used for rotating around the pivot point.
Definition XformOp.h:107
@ kScalePivotPointHint
Translation used for scaling around a pivot point.
Definition XformOp.h:100
RotateHint
The Rotate identifier hint. Some 3d packages (like Maya) have multiple rotation operations that are m...
Definition XformOp.h:68
@ kRotateHint
Default regular rotation.
Definition XformOp.h:70
std::vector< XformOp > XformOpVec
Definition XformOp.h:244
MatrixHint
The Matrix identifier hint. Some 3d packages (like Maya) may have certain transformation operations t...
Definition XformOp.h:54
@ kMayaShearHint
Matrix represents Maya's version of Shear.
Definition XformOp.h:59
ScaleHint
The Scale identifier hint. Some 3d packages (like Maya) have multiple transformation operations that ...
Definition XformOp.h:83
@ kScaleHint
Default, regular scale.
Definition XformOp.h:85
Alembic namespace ...
Definition ArchiveInfo.h:46