37#ifndef Alembic_AbcGeom_Foundation_h
38#define Alembic_AbcGeom_Foundation_h
42#include <ImathMatrixAlgo.h>
43#include <ImathEuler.h>
50namespace Abc = ::Alembic::Abc::ALEMBIC_VERSION_NS;
95template <
class PROP,
class SAMP>
101 assert( iProp.isArray() );
103 if ( iSamp ) { iProp.set( iSamp ); }
104 else { iProp.setFromPrevious(); }
109inline void SetPropUsePrevIfNull<Abc::OStringProperty, std::string>(
112 if ( ! iProp ) {
return; }
113 if ( iSamp !=
"" ) { iProp.
set( iSamp ); }
118inline void SetPropUsePrevIfNull<Abc::OWstringProperty, Alembic::Util::wstring>(
121 if ( ! iProp ) {
return; }
122 if ( iSamp != L
"" ) { iProp.set( iSamp ); }
123 else { iProp.setFromPrevious(); }
127inline void SetPropUsePrevIfNull<Abc::OBox3dProperty, Abc::Box3d>(
130 if ( ! iProp ) {
return; }
131 if ( iSamp.hasVolume() ) { iProp.
set( iSamp ); }
138template <
class ARRAYSAMP>
142 size_t size = iSamp.size();
143 for (
size_t i = 0 ; i < size ; ++i )
145 ret.extendBy( iSamp[i] );
155 return ( iDegrees * M_PI ) / 180.0;
160 return iRadians * ( 180.0 / M_PI );
#define ALEMBIC_VERSION_NS
void set(const value_type &iVal)
double DegreesToRadians(double iDegrees)
used in xform rotation conversion
XformOperationType
Enum that indicates the type of transformational operation. This enum is used when encoding and decod...
FilmBackXformOperationType
Enum that indicates the type of 2d operation for cameras. This enum is used when encoding and decodin...
@ kScaleFilmBackOperation
@ kTranslateFilmBackOperation
@ kMatrixFilmBackOperation
double RadiansToDegrees(double iRadians)
bool IsGeomParam(const AbcA::PropertyHeader &iHeader)
A couple simple tests for if something is a GeomParam.
static Abc::Box3d ComputeBoundsFromPositions(const ARRAYSAMP &iSamp)
void SetPropUsePrevIfNull(PROP iProp, SAMP iSamp)
OTypedScalarProperty< WstringTPTraits > OWstringProperty