Alembic Version 1.1

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>
41#include <Alembic/AbcGeom/Foundation.h>
42
43#include <set>
44
45 namespace Alembic {
46 namespace AbcGeom {
47 namespace ALEMBIC_VERSION_NS {
48
53 enum MatrixHint
54{
56 kMatrixHint = 0,
57
59 kMayaShearHint = 1
60};
61
67 enum RotateHint
68{
70 kRotateHint = 0,
71
74 kRotateOrientationHint = 1
75};
76
82 enum ScaleHint
83{
85 kScaleHint = 0
86};
87
88
94 enum 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{
122 public:
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
229 private:
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
237 private:
240 friend class IXformSchema;
241
242};
243
244 typedef std::vector < XformOp > XformOpVec;
245
246} // End namespace ALEMBIC_VERSION_NS
247
248 using namespace ALEMBIC_VERSION_NS;
249
250} // End namespace AbcGeom
251} // End namespace Alembic
252
253#endif
Foundation.h
Export.h
ALEMBIC_EXPORT
#define ALEMBIC_EXPORT
Definition: Export.h:51
ALEMBIC_VERSION_NS
#define ALEMBIC_VERSION_NS
Definition: Foundation.h:105
Alembic::AbcGeom::ALEMBIC_VERSION_NS::IXformSchema
Definition: IXform.h:52
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp
Xform Operation This class holds the data about a particular transform operation, but does not hold t...
Definition: XformOp.h:121
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getZRotation
double getZRotation() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getNumChannels
std::size_t getNumChannels() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isScaleOp
bool isScaleOp() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setXRotation
void setXRotation(const double iAngle)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setVector
void setVector(const Abc::V3d &iVec)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isXAnimated
bool isXAnimated() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getTranslate
Abc::V3d getTranslate() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::XformOp
XformOp(const XformOperationType iType, const Alembic::Util::uint8_t iHint=0)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getDefaultChannelValue
double getDefaultChannelValue(std::size_t iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getOpEncoding
Alembic::Util::uint8_t getOpEncoding() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setYRotation
void setYRotation(const double iAngle)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isRotateZOp
bool isRotateZOp() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getXRotation
double getXRotation() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isTranslateOp
bool isTranslateOp() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isRotateXOp
bool isRotateXOp() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setHint
void setHint(const Alembic::Util::uint8_t iHint)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isChannelAnimated
bool isChannelAnimated(std::size_t iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getYRotation
double getYRotation() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isZAnimated
bool isZAnimated() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getAngle
double getAngle() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::XformOp
XformOp(const Alembic::Util::uint8_t iEncodedOp)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setChannelValue
void setChannelValue(std::size_t iIndex, double iVal)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getHint
Alembic::Util::uint8_t getHint() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isMatrixOp
bool isMatrixOp() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getScale
Abc::V3d getScale() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setType
void setType(const XformOperationType iType)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isYAnimated
bool isYAnimated() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isRotateOp
bool isRotateOp() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setAngle
void setAngle(const double iAngle)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setMatrix
void setMatrix(const Abc::M44d &iMatrix)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isAngleAnimated
bool isAngleAnimated() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getAxis
Abc::V3d getAxis() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::XformOp
XformOp()
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setZRotation
void setZRotation(const double iAngle)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setAxis
void setAxis(const Abc::V3d &iAxis)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setTranslate
void setTranslate(const Abc::V3d &iTrans)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getType
XformOperationType getType() const
Get the type of transform operation. (Translate, Rotate, Scale, Matrix)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getMatrix
Abc::M44d getMatrix() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getVector
Abc::V3d getVector() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::getChannelValue
double getChannelValue(std::size_t iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::setScale
void setScale(const Abc::V3d &iScale)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOp::isRotateYOp
bool isRotateYOp() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOperationType
XformOperationType
Enum that indicates the type of transformational operation. This enum is used when encoding and decod...
Definition: Foundation.h:71
Alembic::AbcGeom::ALEMBIC_VERSION_NS::TranslateHint
TranslateHint
The Translation identifier hint. Some 3d packages (like Maya) have multiple transformation operations...
Definition: XformOp.h:95
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kRotatePivotTranslationHint
@ kRotatePivotTranslationHint
Definition: XformOp.h:111
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kScalePivotTranslationHint
@ kScalePivotTranslationHint
Definition: XformOp.h:104
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kTranslateHint
@ kTranslateHint
Default, regular translation.
Definition: XformOp.h:97
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kRotatePivotPointHint
@ kRotatePivotPointHint
Translation used for rotating around the pivot point.
Definition: XformOp.h:107
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kScalePivotPointHint
@ kScalePivotPointHint
Translation used for scaling around a pivot point.
Definition: XformOp.h:100
Alembic::AbcGeom::ALEMBIC_VERSION_NS::RotateHint
RotateHint
The Rotate identifier hint. Some 3d packages (like Maya) have multiple rotation operations that are m...
Definition: XformOp.h:68
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kRotateOrientationHint
@ kRotateOrientationHint
Definition: XformOp.h:74
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kRotateHint
@ kRotateHint
Default regular rotation.
Definition: XformOp.h:70
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformOpVec
std::vector< XformOp > XformOpVec
Definition: XformOp.h:244
Alembic::AbcGeom::ALEMBIC_VERSION_NS::MatrixHint
MatrixHint
The Matrix identifier hint. Some 3d packages (like Maya) may have certain transformation operations t...
Definition: XformOp.h:54
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kMayaShearHint
@ kMayaShearHint
Matrix represents Maya's version of Shear.
Definition: XformOp.h:59
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kMatrixHint
@ kMatrixHint
Regular Matrix.
Definition: XformOp.h:56
Alembic::AbcGeom::ALEMBIC_VERSION_NS::ScaleHint
ScaleHint
The Scale identifier hint. Some 3d packages (like Maya) have multiple transformation operations that ...
Definition: XformOp.h:83
Alembic::AbcGeom::ALEMBIC_VERSION_NS::kScaleHint
@ kScaleHint
Default, regular scale.
Definition: XformOp.h:85
Alembic
Alembic namespace ...
Definition: ArchiveInfo.h:46