Loading...
Searching...
No Matches
XformSample.h
Go to the documentation of this file.
//-*****************************************************************************
//
// Copyright (c) 2009-2011,
// 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_XformSample_h
#define Alembic_AbcGeom_XformSample_h
#include <Alembic/Util/Export.h>
#include <Alembic/AbcGeom/Foundation.h>
#include <Alembic/AbcGeom/XformOp.h>
namespace Alembic {
namespace AbcGeom {
namespace ALEMBIC_VERSION_NS {
//-*****************************************************************************
class ALEMBIC_EXPORT XformSample
{
public:
XformSample();
// add translate or scale op
// returns the index of the op in its op-stack
std::size_t addOp( XformOp iTransOrScaleOp, const Abc::V3d &iVal );
// add rotate op
// returns the index of the op in its op-stack
std::size_t addOp( XformOp iRotateOp, const Abc::V3d &iAxis,
const double iAngleInDegrees );
// add matrix op
// returns the index of the op in its op-stack
std::size_t addOp( XformOp iMatrixOp, const Abc::M44d &iMatrix );
// add rotateX, rotateY, or rotateZ op
std::size_t addOp( XformOp iSingleRotateOp,
const double iSingleAxisRotationInDegrees );
// add an op with values already set on the op
std::size_t addOp( const XformOp &iOp );
XformOp getOp( const std::size_t iIndex ) const;
XformOp &operator[]( const std::size_t &iIndex );
const XformOp &operator[]( const std::size_t &iIndex ) const;
std::size_t getNumOps() const;
std::size_t getNumOpChannels() const;
void setInheritsXforms( bool iInherits );
bool getInheritsXforms() const;
// non-op-based methods; the getters will compute their return values
// from the ops under the hood, hence return-by-value.
void setTranslation( const Abc::V3d &iTrans );
Abc::V3d getTranslation() const;
void setRotation( const Abc::V3d &iAxis, const double iAngleInDegress );
Abc::V3d getAxis() const;
double getAngle() const;
void setXRotation( const double iAngleInDegrees );
double getXRotation() const;
void setYRotation( const double iAngleInDegrees );
double getYRotation() const;
void setZRotation( const double iAngleInDegrees );
double getZRotation() const;
void setScale( const Abc::V3d &iScale );
Abc::V3d getScale() const;
void setMatrix( const Abc::M44d &iMatrix );
Abc::M44d getMatrix() const;
bool isTopologyEqual( const XformSample & iSample );
bool getIsTopologyFrozen() const { return m_hasBeenRead; }
void reset();
private:
friend class OXformSchema;
friend class IXformSchema;
void freezeTopology();
const std::vector<Alembic::Util::uint8_t> &getOpsArray() const;
void clear();
private:
int32_t m_setWithOpStack;
std::vector<XformOp> m_ops;
bool m_inherits;
bool m_hasBeenRead;
size_t m_opIndex;
};
} // End namespace ALEMBIC_VERSION_NS
using namespace ALEMBIC_VERSION_NS;
} // End namespace AbcGeom
} // End namespace Alembic
#endif
Foundation.h
Export.h
ALEMBIC_EXPORT
#define ALEMBIC_EXPORT
Definition Export.h:51
XformOp.h
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::XformSample::getYRotation
double getYRotation() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setScale
void setScale(const Abc::V3d &iScale)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getXRotation
double getXRotation() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::isTopologyEqual
bool isTopologyEqual(const XformSample &iSample)
Tests whether this sample has the same topology as iSample.
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setRotation
void setRotation(const Abc::V3d &iAxis, const double iAngleInDegress)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::addOp
std::size_t addOp(XformOp iSingleRotateOp, const double iSingleAxisRotationInDegrees)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setXRotation
void setXRotation(const double iAngleInDegrees)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getOp
XformOp getOp(const std::size_t iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getAngle
double getAngle() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setMatrix
void setMatrix(const Abc::M44d &iMatrix)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setInheritsXforms
void setInheritsXforms(bool iInherits)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::operator[]
const XformOp & operator[](const std::size_t &iIndex) const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getAxis
Abc::V3d getAxis() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::operator[]
XformOp & operator[](const std::size_t &iIndex)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getNumOpChannels
std::size_t getNumOpChannels() const
The sum of the number of channels of all the ops in this Sample.
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getScale
Abc::V3d getScale() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getZRotation
double getZRotation() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::addOp
std::size_t addOp(const XformOp &iOp)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getNumOps
std::size_t getNumOps() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getInheritsXforms
bool getInheritsXforms() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setYRotation
void setYRotation(const double iAngleInDegrees)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::addOp
std::size_t addOp(XformOp iTransOrScaleOp, const Abc::V3d &iVal)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getTranslation
Abc::V3d getTranslation() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::reset
void reset()
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::OXformSchema
friend class OXformSchema
Definition XformSample.h:129
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setTranslation
void setTranslation(const Abc::V3d &iTrans)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::XformSample
XformSample()
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getIsTopologyFrozen
bool getIsTopologyFrozen() const
Has this Sample been used in a call to OXformSchema::set()
Definition XformSample.h:124
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::IXformSchema
friend class IXformSchema
Definition XformSample.h:130
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::addOp
std::size_t addOp(XformOp iMatrixOp, const Abc::M44d &iMatrix)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::getMatrix
Abc::M44d getMatrix() const
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::addOp
std::size_t addOp(XformOp iRotateOp, const Abc::V3d &iAxis, const double iAngleInDegrees)
Alembic::AbcGeom::ALEMBIC_VERSION_NS::XformSample::setZRotation
void setZRotation(const double iAngleInDegrees)
Alembic::AbcGeom::ALEMBIC_VERSION_NS
Definition ArchiveBounds.h:45
Alembic::AbcGeom
Definition ArchiveBounds.h:44
Alembic
Alembic namespace ...
Definition ArchiveInfo.h:46