Loading...
Searching...
No Matches
XformOp.h
//-*****************************************************************************
//
// Copyright (c) 2009-2012,
// Sony Pictures Imageworks, Inc. and
// Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Sony Pictures Imageworks, nor
// Industrial Light & Magic nor the names of their contributors may be used
// to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//-*****************************************************************************
#ifndef Alembic_AbcGeom_XformOp_h
#define Alembic_AbcGeom_XformOp_h
#include <Alembic/Util/Export.h>
#include <Alembic/AbcGeom/Foundation.h>
#include <set>
namespace Alembic {
namespace AbcGeom {
namespace ALEMBIC_VERSION_NS {
enum MatrixHint
{
kMatrixHint = 0,
kMayaShearHint = 1
};
enum RotateHint
{
kRotateHint = 0,
kRotateOrientationHint = 1
};
enum ScaleHint
{
kScaleHint = 0
};
enum TranslateHint
{
kTranslateHint = 0,
kScalePivotPointHint = 1,
kScalePivotTranslationHint = 2,
kRotatePivotPointHint = 3,
kRotatePivotTranslationHint = 4
};
class ALEMBIC_EXPORT XformOp
{
public:
XformOp();
XformOp( const XformOperationType iType,
const Alembic::Util::uint8_t iHint = 0 );
XformOp( const Alembic::Util::uint8_t iEncodedOp );
XformOperationType getType() const;
void setType( const XformOperationType iType );
Alembic::Util::uint8_t getHint() const;
void setHint( const Alembic::Util::uint8_t iHint );
bool isXAnimated() const;
bool isYAnimated() const;
bool isZAnimated() const;
bool isAngleAnimated() const;
bool isChannelAnimated( std::size_t iIndex ) const;
std::size_t getNumChannels() const;
double getDefaultChannelValue( std::size_t iIndex ) const;
double getChannelValue( std::size_t iIndex ) const;
void setChannelValue( std::size_t iIndex, double iVal );
void setVector( const Abc::V3d &iVec );
void setTranslate( const Abc::V3d &iTrans );
void setScale( const Abc::V3d &iScale );
void setAxis( const Abc::V3d &iAxis );
void setAngle( const double iAngle );
void setMatrix( const Abc::M44d &iMatrix );
void setXRotation( const double iAngle );
void setYRotation( const double iAngle );
void setZRotation( const double iAngle );
// synthetic getters return by value
Abc::V3d getVector() const;
Abc::V3d getTranslate() const;
Abc::V3d getScale() const;
Abc::V3d getAxis() const;
double getAngle() const;
Abc::M44d getMatrix() const;
double getXRotation() const;
double getYRotation() const;
double getZRotation() const;
bool isTranslateOp() const;
bool isScaleOp() const;
bool isRotateOp() const;
bool isMatrixOp() const;
bool isRotateXOp() const;
bool isRotateYOp() const;
bool isRotateZOp() const;
Alembic::Util::uint8_t getOpEncoding() const;
private:
XformOperationType m_type;
Alembic::Util::uint8_t m_hint;
std::vector<double> m_channels;
std::set<Alembic::Util::uint32_t> m_animChannels;
private:
friend class IXformSchema;
};
typedef std::vector < XformOp > XformOpVec;
} // End namespace ALEMBIC_VERSION_NS
using namespace ALEMBIC_VERSION_NS;
} // End namespace AbcGeom
} // End namespace Alembic
#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