6 #ifndef OPENVDB_MATH_MAPS_HAS_BEEN_INCLUDED     7 #define OPENVDB_MATH_MAPS_HAS_BEEN_INCLUDED    35 class ScaleTranslateMap;
    36 class UniformScaleMap;
    37 class UniformScaleTranslateMap;
    40 class NonlinearFrustumMap;
    55 template<
typename T> 
struct is_linear                 { 
static const bool value = 
false; };
    59 template<> 
struct is_linear<UnitaryMap>               { 
static const bool value = 
true; };
    75     static const bool value = 
true;
    79 template<
typename T> 
struct is_scale                  { 
static const bool value = 
false; };
   139     using MapFactory = 
Ptr (*)();
   147     virtual Name type() 
const = 0;
   150     template<
typename MapT> 
bool isType()
 const { 
return this->type() == MapT::mapType(); }
   153     virtual bool isEqual(
const MapBase& other) 
const = 0;
   156     virtual bool isLinear() 
const = 0;
   158     virtual bool hasUniformScale() 
const = 0;
   160     virtual Vec3d applyMap(
const Vec3d& in) 
const = 0;
   161     virtual Vec3d applyInverseMap(
const Vec3d& in) 
const = 0;
   167     virtual Vec3d applyIJT(
const Vec3d& in) 
const = 0;
   168     virtual Vec3d applyIJT(
const Vec3d& in, 
const Vec3d& domainPos) 
const = 0;
   171     virtual Mat3d applyIJC(
const Mat3d& m) 
const = 0;
   175     virtual double determinant() 
const = 0;
   176     virtual double determinant(
const Vec3d&) 
const = 0;
   183     virtual Vec3d voxelSize() 
const = 0;
   184     virtual Vec3d voxelSize(
const Vec3d&) 
const = 0;
   187     virtual void read(std::istream&) = 0;
   188     virtual void write(std::ostream&) 
const = 0;
   190     virtual std::string str() 
const = 0;
   213     virtual Vec3d applyJacobian(
const Vec3d& in) 
const = 0;
   214     virtual Vec3d applyJacobian(
const Vec3d& in, 
const Vec3d& domainPos) 
const = 0;
   223     virtual Vec3d applyInverseJacobian(
const Vec3d& in) 
const = 0;
   224     virtual Vec3d applyInverseJacobian(
const Vec3d& in, 
const Vec3d& domainPos) 
const = 0;
   235     virtual Vec3d applyJT(
const Vec3d& in) 
const = 0;
   236     virtual Vec3d applyJT(
const Vec3d& in, 
const Vec3d& domainPos) 
const = 0;
   249     template<
typename MapT>
   252         return other.
isType<MapT>() && (
self == *static_cast<const MapT*>(&other));
   273     static bool isRegistered(
const Name&);
   276     static void registerMap(
const Name&, MapBase::MapFactory);
   279     static void unregisterMap(
const Name&);
   302         mMatrix(
Mat4d::identity()),
   303         mMatrixInv(
Mat4d::identity()),
   304         mJacobianInv(
Mat3d::identity()),
   306         mVoxelSize(
Vec3d(1,1,1)),
   315         Mat4d mat4(Mat4d::identity());
   318         updateAcceleration();
   325                 "Tried to initialize an affine transform from a non-affine 4x4 matrix");
   327         updateAcceleration();
   332         mMatrix(other.mMatrix),
   333         mMatrixInv(other.mMatrixInv),
   334         mJacobianInv(other.mJacobianInv),
   335         mDeterminant(other.mDeterminant),
   336         mVoxelSize(other.mVoxelSize),
   337         mIsDiagonal(other.mIsDiagonal),
   338         mIsIdentity(other.mIsIdentity)
   344         mMatrix(first.mMatrix * second.mMatrix)
   346         updateAcceleration();
   358     static bool isRegistered() { 
return MapRegistry::isRegistered(AffineMap::mapType()); }
   362         MapRegistry::registerMap(
   363             AffineMap::mapType(),
   376         Mat3d mat = mMatrix.getMat3();
   377         const double det = mat.
det();
   381             mat *= (1.0 / pow(std::abs(det), 1.0/3.0));
   386     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
   391         if (!mMatrix.eq(other.mMatrix)) { 
return false; }
   392         if (!mMatrixInv.eq(other.mMatrixInv))  { 
return false; }
   400         mMatrix = other.mMatrix;
   401         mMatrixInv = other.mMatrixInv;
   403         mJacobianInv = other.mJacobianInv;
   404         mDeterminant = other.mDeterminant;
   405         mVoxelSize = other.mVoxelSize;
   406         mIsDiagonal  = other.mIsDiagonal;
   407         mIsIdentity  = other.mIsIdentity;
   423         return applyInverseJacobian(in);
   428         return mMatrixInv.transform3x3(in);
   437         return Vec3d( m[ 0] * in[0] + m[ 1] * in[1] + m[ 2] * in[2],
   438                       m[ 4] * in[0] + m[ 5] * in[1] + m[ 6] * in[2],
   439                       m[ 8] * in[0] + m[ 9] * in[1] + m[10] * in[2] );
   448         return mJacobianInv.
transpose()* m * mJacobianInv;
   481         mMatrix.preRotate(axis, radians);
   482         updateAcceleration();
   487         updateAcceleration();
   491         mMatrix.preTranslate(v);
   492         updateAcceleration();
   496         mMatrix.preShear(axis0, axis1, shear);
   497         updateAcceleration();
   506         mMatrix.postRotate(axis, radians);
   507         updateAcceleration();
   511         mMatrix.postScale(v);
   512         updateAcceleration();
   516         mMatrix.postTranslate(v);
   517         updateAcceleration();
   521         mMatrix.postShear(axis0, axis1, shear);
   522         updateAcceleration();
   528     void read(std::istream& is)
 override { mMatrix.read(is); updateAcceleration(); }
   530     void write(std::ostream& os)
 const override { mMatrix.write(os); }
   532     std::string 
str()
 const override   534         std::ostringstream buffer;
   535         buffer << 
" - mat4:\n" << mMatrix.str() << std::endl;
   536         buffer << 
" - voxel dimensions: " << mVoxelSize << std::endl;
   559         affineMap->accumPreRotation(axis, radians);
   565         affineMap->accumPreTranslation(t);
   566         return StaticPtrCast<MapBase, AffineMap>(affineMap);
   571         affineMap->accumPreScale(s);
   572         return StaticPtrCast<MapBase, AffineMap>(affineMap);
   577         affineMap->accumPreShear(axis0, axis1, shear);
   589         affineMap->accumPostRotation(axis, radians);
   595         affineMap->accumPostTranslation(t);
   596         return StaticPtrCast<MapBase, AffineMap>(affineMap);
   601         affineMap->accumPostScale(s);
   602         return StaticPtrCast<MapBase, AffineMap>(affineMap);
   607         affineMap->accumPostShear(axis0, axis1, shear);
   618     void updateAcceleration() {
   619         Mat3d mat3 = mMatrix.getMat3();
   620         mDeterminant = mat3.
det();
   624                 "Tried to initialize an affine transform from a nearly singular matrix");
   626         mMatrixInv = mMatrix.inverse();
   631         mVoxelSize(0) = (applyMap(
Vec3d(1,0,0)) - pos).length();
   632         mVoxelSize(1) = (applyMap(
Vec3d(0,1,0)) - pos).length();
   633         mVoxelSize(2) = (applyMap(
Vec3d(0,0,1)) - pos).length();
   644     bool   mIsDiagonal, mIsIdentity;
   662                 mScaleValuesInverse(
Vec3d(1,1,1)),
   663                 mInvScaleSqr(1,1,1), mInvTwiceScale(0.5,0.5,0.5){}
   668         mVoxelSize(
Vec3d(
std::abs(scale(0)),
std::abs(scale(1)), 
std::abs(scale(2))))
   670         double determinant = scale[0]* scale[1] * scale[2];
   674         mScaleValuesInverse = 1.0 / mScaleValues;
   675         mInvScaleSqr = mScaleValuesInverse * mScaleValuesInverse;
   676         mInvTwiceScale = mScaleValuesInverse / 2;
   681         mScaleValues(other.mScaleValues),
   682         mVoxelSize(other.mVoxelSize),
   683         mScaleValuesInverse(other.mScaleValuesInverse),
   684         mInvScaleSqr(other.mInvScaleSqr),
   685         mInvTwiceScale(other.mInvTwiceScale)
   700     static bool isRegistered() { 
return MapRegistry::isRegistered(ScaleMap::mapType()); }
   704         MapRegistry::registerMap(
   719             std::abs(mScaleValues.x()), std::abs(mScaleValues.y()), 
double(5e-7));
   721             std::abs(mScaleValues.x()), std::abs(mScaleValues.z()), 
double(5e-7));
   729             in.x() * mScaleValues.x(),
   730             in.y() * mScaleValues.y(),
   731             in.z() * mScaleValues.z());
   737             in.x() * mScaleValuesInverse.x(),
   738             in.y() * mScaleValuesInverse.y(),
   739             in.z() * mScaleValuesInverse.z());
   743         return applyJacobian(in);
   751         return applyInverseJacobian(in);
   756         return applyInverseMap(in);
   776         for (
int i = 0; i < 3; i++) {
   777             tmp.
setRow(i, in.row(i) * mScaleValuesInverse(i));
   779         for (
int i = 0; i < 3; i++) {
   780             tmp.
setCol(i, tmp.
col(i) * mScaleValuesInverse(i));
   791         return mScaleValues.x() * mScaleValues.y() * mScaleValues.z();
   813     void read(std::istream& is)
 override   815         mScaleValues.read(is);
   817         mScaleValuesInverse.read(is);
   818         mInvScaleSqr.read(is);
   819         mInvTwiceScale.read(is);
   822     void write(std::ostream& os)
 const override   824         mScaleValues.write(os);
   825         mVoxelSize.write(os);
   826         mScaleValuesInverse.write(os);
   827         mInvScaleSqr.write(os);
   828         mInvTwiceScale.write(os);
   831     std::string 
str()
 const override   833         std::ostringstream buffer;
   834         buffer << 
" - scale: " << mScaleValues << std::endl;
   835         buffer << 
" - voxel dimensions: " << mVoxelSize << std::endl;
   839     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
   844         if (!mScaleValues.eq(other.mScaleValues)) { 
return false; }
   864         affineMap->accumPreRotation(axis, radians);
   873         affineMap->accumPreShear(axis0, axis1, shear);
   885         affineMap->accumPostRotation(axis, radians);
   893         affineMap->accumPostShear(axis0, axis1, shear);
   899     Vec3d mScaleValues, mVoxelSize, mScaleValuesInverse, mInvScaleSqr, mInvTwiceScale;
   923         const Vec3d& invScale = getInvScale();
   927     static bool isRegistered() { 
return MapRegistry::isRegistered(UniformScaleMap::mapType()); }
   930         MapRegistry::registerMap(
   931             UniformScaleMap::mapType(),
   932             UniformScaleMap::create);
   938     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
   958 ScaleMap::preScale(
const Vec3d& v)
 const   960     const Vec3d new_scale(v * mScaleValues);
   970 ScaleMap::postScale(
const Vec3d& v)
 const   999     static bool isRegistered() { 
return MapRegistry::isRegistered(TranslationMap::mapType()); }
  1003         MapRegistry::registerMap(
  1004             TranslationMap::mapType(),
  1005             TranslationMap::create);
  1029         return applyInverseJacobian(in);
  1051         return applyIJC(mat);
  1068     void read(std::istream& is)
 override { mTranslation.read(is); }
  1070     void write(std::ostream& os)
 const override { mTranslation.write(os); }
  1072     std::string 
str()
 const override  1074         std::ostringstream buffer;
  1075         buffer << 
" - translation: " << mTranslation << std::endl;
  1076         return buffer.str();
  1079     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
  1084         return mTranslation.eq(other.mTranslation);
  1092         Mat4d matrix(Mat4d::identity());
  1105         affineMap->accumPreRotation(axis, radians);
  1119         affineMap->accumPreShear(axis0, axis1, shear);
  1130         affineMap->accumPostRotation(axis, radians);
  1144         affineMap->accumPostShear(axis0, axis1, shear);
  1170         mTranslation(
Vec3d(0,0,0)),
  1171         mScaleValues(
Vec3d(1,1,1)),
  1172         mVoxelSize(
Vec3d(1,1,1)),
  1173         mScaleValuesInverse(
Vec3d(1,1,1)),
  1174         mInvScaleSqr(1,1,1),
  1175         mInvTwiceScale(0.5,0.5,0.5)
  1181         mTranslation(translate),
  1182         mScaleValues(scale),
  1183         mVoxelSize(
std::abs(scale(0)), 
std::abs(scale(1)), 
std::abs(scale(2)))
  1185         const double determinant = scale[0]* scale[1] * scale[2];
  1189         mScaleValuesInverse = 1.0 / mScaleValues;
  1190         mInvScaleSqr = mScaleValuesInverse * mScaleValuesInverse;
  1191         mInvTwiceScale = mScaleValuesInverse / 2;
  1196         mTranslation(translate.getTranslation()),
  1198         mVoxelSize(
std::abs(mScaleValues(0)),
  1199                          std::abs(mScaleValues(1)),
  1200                          std::abs(mScaleValues(2))),
  1201         mScaleValuesInverse(1.0 / scale.
getScale())
  1203         mInvScaleSqr = mScaleValuesInverse * mScaleValuesInverse;
  1204         mInvTwiceScale = mScaleValuesInverse / 2;
  1209         mTranslation(other.mTranslation),
  1210         mScaleValues(other.mScaleValues),
  1211         mVoxelSize(other.mVoxelSize),
  1212         mScaleValuesInverse(other.mScaleValuesInverse),
  1213         mInvScaleSqr(other.mInvScaleSqr),
  1214         mInvTwiceScale(other.mInvTwiceScale)
  1227             mScaleValuesInverse, -mScaleValuesInverse * mTranslation));
  1230     static bool isRegistered() { 
return MapRegistry::isRegistered(ScaleTranslateMap::mapType()); }
  1234         MapRegistry::registerMap(
  1235             ScaleTranslateMap::mapType(),
  1236             ScaleTranslateMap::create);
  1250             std::abs(mScaleValues.x()), std::abs(mScaleValues.y()), 
double(5e-7));
  1252             std::abs(mScaleValues.x()), std::abs(mScaleValues.z()), 
double(5e-7));
  1260             in.x() * mScaleValues.x() + mTranslation.x(),
  1261             in.y() * mScaleValues.y() + mTranslation.y(),
  1262             in.z() * mScaleValues.z() + mTranslation.z());
  1268             (in.x() - mTranslation.x() ) * mScaleValuesInverse.x(),
  1269             (in.y() - mTranslation.y() ) * mScaleValuesInverse.y(),
  1270             (in.z() - mTranslation.z() ) * mScaleValuesInverse.z());
  1275         return applyJacobian(in);
  1283         return applyInverseJacobian(in);
  1288         return in * mScaleValuesInverse;
  1300         return applyIJT(in);
  1306             in.x() * mScaleValuesInverse.x(),
  1307             in.y() * mScaleValuesInverse.y(),
  1308             in.z() * mScaleValuesInverse.z());
  1314         for (
int i=0; i<3; i++){
  1315             tmp.
setRow(i, in.row(i)*mScaleValuesInverse(i));
  1317         for (
int i=0; i<3; i++){
  1318             tmp.
setCol(i, tmp.
col(i)*mScaleValuesInverse(i));
  1323         return applyIJC(in);
  1330         return mScaleValues.x() * mScaleValues.y() * mScaleValues.z();
  1350     void read(std::istream& is)
 override  1352         mTranslation.read(is);
  1353         mScaleValues.read(is);
  1354         mVoxelSize.read(is);
  1355         mScaleValuesInverse.read(is);
  1356         mInvScaleSqr.read(is);
  1357         mInvTwiceScale.read(is);
  1360     void write(std::ostream& os)
 const override  1362         mTranslation.write(os);
  1363         mScaleValues.write(os);
  1364         mVoxelSize.write(os);
  1365         mScaleValuesInverse.write(os);
  1366         mInvScaleSqr.write(os);
  1367         mInvTwiceScale.write(os);
  1370     std::string 
str()
 const override  1372         std::ostringstream buffer;
  1373         buffer << 
" - translation: " << mTranslation << std::endl;
  1374         buffer << 
" - scale: " << mScaleValues << std::endl;
  1375         buffer << 
" - voxel dimensions: " << mVoxelSize << std::endl;
  1376         return buffer.str();
  1379     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
  1384         if (!mScaleValues.eq(other.mScaleValues)) { 
return false; }
  1385         if (!mTranslation.eq(other.mTranslation)) { 
return false; }
  1395         affineMap->accumPostTranslation(mTranslation);
  1405         affineMap->accumPreRotation(axis, radians);
  1410         const Vec3d& s = mScaleValues;
  1411         const Vec3d scaled_trans( t.
x() * s.
x(),
  1422         affineMap->accumPreShear(axis0, axis1, shear);
  1433         affineMap->accumPostRotation(axis, radians);
  1446         affineMap->accumPostShear(axis0, axis1, shear);
  1452     Vec3d mTranslation, mScaleValues, mVoxelSize, mScaleValuesInverse,
  1453         mInvScaleSqr, mInvTwiceScale;
  1458 ScaleMap::postTranslate(
const Vec3d& t)
 const  1465 ScaleMap::preTranslate(
const Vec3d& t)
 const  1468     const Vec3d& s = mScaleValues;
  1469     const Vec3d scaled_trans( t.
x() * s.
x(),
  1500         const Vec3d& scaleInv = getInvScale();
  1501         const Vec3d& trans = getTranslation();
  1507         return MapRegistry::isRegistered(UniformScaleTranslateMap::mapType());
  1512         MapRegistry::registerMap(
  1513             UniformScaleTranslateMap::mapType(), UniformScaleTranslateMap::create);
  1519     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
  1532         const Vec3d  new_trans = this->getTranslation() + scale * t;
  1547 UniformScaleMap::postTranslate(
const Vec3d& t)
 const  1555 UniformScaleMap::preTranslate(
const Vec3d& t)
 const  1563 TranslationMap::preScale(
const Vec3d& v)
 const  1574 TranslationMap::postScale(
const Vec3d& v)
 const  1579         const Vec3d trans(mTranslation.x()*v.
x(),
  1580                           mTranslation.y()*v.
y(),
  1581                           mTranslation.z()*v.
z());
  1588 ScaleTranslateMap::preScale(
const Vec3d& v)
 const  1590     const Vec3d new_scale( v * mScaleValues );
  1600 ScaleTranslateMap::postScale(
const Vec3d& v)
 const  1602     const Vec3d new_scale( v * mScaleValues );
  1603     const Vec3d new_trans( mTranslation.x()*v.
x(),
  1604                            mTranslation.y()*v.
y(),
  1605                            mTranslation.z()*v.
z() );
  1652         Mat4d matrix(Mat4d::identity());
  1661                 "4x4 Matrix initializing unitary map was not unitary: not invertible");
  1666                 "4x4 Matrix initializing unitary map was not unitary: not affine");
  1671                 "4x4 Matrix initializing unitary map was not unitary: had translation");
  1676                 "4x4 Matrix initializing unitary map was not unitary");
  1684         mAffineMap(other.mAffineMap)
  1689         mAffineMap(*(first.getAffineMap()), *(second.getAffineMap()))
  1693     ~UnitaryMap() 
override = 
default;
  1702         return MapBase::Ptr(
new UnitaryMap(mAffineMap.getMat4().inverse()));
  1705     static bool isRegistered() { 
return MapRegistry::isRegistered(UnitaryMap::mapType()); }
  1709         MapRegistry::registerMap(
  1710             UnitaryMap::mapType(),
  1711             UnitaryMap::create);
  1725     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
  1730         if (mAffineMap!=other.mAffineMap)  
return false;
  1734     bool operator!=(
const UnitaryMap& other)
 const { 
return !(*
this == other); }
  1747         return applyInverseJacobian(in);
  1752         return mAffineMap.applyInverseJacobian(in);
  1760         return applyInverseMap(in); 
  1772         return applyIJC(in);
  1778     double determinant()
 const override { 
return mAffineMap.determinant(); }
  1789     void read(std::istream& is)
 override  1791         mAffineMap.read(is);
  1795     void write(std::ostream& os)
 const override  1797         mAffineMap.write(os);
  1800     std::string 
str()
 const override  1802         std::ostringstream buffer;
  1803         buffer << mAffineMap.str();
  1804         return buffer.str();
  1815         UnitaryMap first(axis, radians);
  1817         return StaticPtrCast<MapBase, UnitaryMap>(unitaryMap);
  1824         affineMap->accumPreTranslation(t);
  1832         affineMap->accumPreScale(v);
  1840         affineMap->accumPreShear(axis0, axis1, shear);
  1848         UnitaryMap second(axis, radians);
  1850         return StaticPtrCast<MapBase, UnitaryMap>(unitaryMap);
  1857         affineMap->accumPostTranslation(t);
  1865         affineMap->accumPostScale(v);
  1873         affineMap->accumPostShear(axis0, axis1, shear);
  1910         MapBase(),mBBox(bb), mTaper(taper), mDepth(depth)
  1922         mBBox(bb), mTaper(taper), mDepth(depth)
  1924         if (!secondMap->isLinear() ) {
  1926                 "The second map in the Frustum transfrom must be linear");
  1928         mSecondMap = *( secondMap->getAffineMap() );
  1935         mTaper(other.mTaper),
  1936         mDepth(other.mDepth),
  1937         mSecondMap(other.mSecondMap),
  1938         mHasSimpleAffine(other.mHasSimpleAffine)
  1959                         const Vec3d& direction,
  1962                         double z_near, 
double depth,
  1970                 "The frustum depth must be non-zero and positive");
  1972         if (!(up.
length() > 0)) {
  1974                 "The frustum height must be non-zero and positive");
  1976         if (!(aspect > 0)) {
  1978                 "The frustum aspect ratio  must be non-zero and positive");
  1982                 "The frustum up orientation must be perpendicular to into-frustum direction");
  1985         double near_plane_height = 2 * up.
length();
  1986         double near_plane_width = aspect * near_plane_height;
  1991         mDepth = depth / near_plane_width;  
  1992         double gamma = near_plane_width / z_near;
  1993         mTaper = 1./(mDepth*gamma + 1.);
  1995         Vec3d direction_unit = direction;
  1998         Mat4d r1(Mat4d::identity());
  2000         Mat4d r2(Mat4d::identity());
  2004             Vec3d(near_plane_width, near_plane_width, near_plane_width));
  2008         Mat4d mat = scale * r2 * r1;
  2029             "inverseMap() is not implemented for NonlinearFrustumMap");
  2031     static bool isRegistered() { 
return MapRegistry::isRegistered(NonlinearFrustumMap::mapType()); }
  2035         MapRegistry::registerMap(
  2036             NonlinearFrustumMap::mapType(),
  2037             NonlinearFrustumMap::create);
  2058         const Vec3d e1(1,0,0);
  2059         if (!applyMap(e1).eq(e1)) 
return false;
  2061         const Vec3d e2(0,1,0);
  2062         if (!applyMap(e2).eq(e2)) 
return false;
  2064         const Vec3d e3(0,0,1);
  2065         if (!applyMap(e3).eq(e3)) 
return false;
  2070     bool isEqual(
const MapBase& other)
 const override { 
return isEqualBase(*
this, other); }
  2074         if (mBBox!=other.mBBox) 
return false;
  2081         if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e))) 
return false;
  2084         if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e))) 
return false;
  2087         if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e))) 
return false;
  2090         if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e))) 
return false;
  2099         return mSecondMap.applyMap(applyFrustumMap(in));
  2105         return applyFrustumInverseMap(mSecondMap.applyInverseMap(in));
  2114         Vec3d centered(isloc);
  2115         centered = centered - mBBox.min();
  2116         centered.
x() -= mXo;
  2117         centered.
y() -= mYo;
  2120         const double zprime = centered.
z()*mDepthOnLz;
  2122         const double scale = (mGamma * zprime + 1.) / mLx;
  2123         const double scale2 = mGamma * mDepthOnLz / mLx;
  2125         const Vec3d tmp(scale * in.
x() + scale2 * centered.
x()* in.
z(),
  2126                         scale * in.
y() + scale2 * centered.
y()* in.
z(),
  2127                         mDepthOnLz * in.
z());
  2129         return mSecondMap.applyJacobian(tmp);
  2136         return mSecondMap.applyInverseJacobian(in);
  2143         Vec3d centered(isloc);
  2144         centered = centered - mBBox.min();
  2145         centered.
x() -= mXo;
  2146         centered.
y() -= mYo;
  2149         const double zprime = centered.
z()*mDepthOnLz;
  2151         const double scale = (mGamma * zprime + 1.) / mLx;
  2152         const double scale2 = mGamma * mDepthOnLz / mLx;
  2155         Vec3d out = mSecondMap.applyInverseJacobian(in);
  2157         out.
x() = (out.
x() - scale2 * centered.
x() * out.
z() / mDepthOnLz) / scale;
  2158         out.
y() = (out.
y() - scale2 * centered.
y() * out.
z() / mDepthOnLz) / scale;
  2159         out.
z() = out.
z() / mDepthOnLz;
  2167         const Vec3d tmp = mSecondMap.applyJT(in);
  2170         Vec3d centered(isloc);
  2171         centered = centered - mBBox.min();
  2172         centered.
x() -= mXo;
  2173         centered.
y() -= mYo;
  2176         const double zprime = centered.
z()*mDepthOnLz;
  2178         const double scale = (mGamma * zprime + 1.) / mLx;
  2179         const double scale2 = mGamma * mDepthOnLz / mLx;
  2181         return Vec3d(scale * tmp.
x(),
  2183                      scale2 * centered.
x()* tmp.
x() +
  2184                      scale2 * centered.
y()* tmp.
y() +
  2185                      mDepthOnLz * tmp.
z());
  2189         return mSecondMap.applyJT(in);
  2205         const Vec3d loc = applyFrustumMap(ijk);
  2206         const double s = mGamma * loc.
z() + 1.;
  2211                 " at the singular focal point (e.g. camera)");
  2214         const double sinv = 1.0/s;        
  2215         const double pt0 = mLx * sinv;    
  2216         const double pt1 = mGamma * pt0;  
  2217         const double pt2 = pt1 * sinv;    
  2219         const Mat3d& jacinv = mSecondMap.getConstJacobianInv();
  2222         Mat3d gradE(Mat3d::zero());
  2223         for (
int j = 0; j < 3; ++j ) {
  2224             gradE(0,j) =  pt0 * jacinv(0,j) -  pt2 * loc.
x()*jacinv(2,j);
  2225             gradE(1,j) =  pt0 * jacinv(1,j) -  pt2 * loc.
y()*jacinv(2,j);
  2226             gradE(2,j) = (1./mDepthOnLz) * jacinv(2,j);
  2230         for (
int i = 0; i < 3; ++i) {
  2231             result(i) = d1_is(0) * gradE(0,i) + d1_is(1) * gradE(1,i) + d1_is(2) * gradE(2,i);
  2246         const Vec3d loc = applyFrustumMap(ijk);
  2248         const double s =  mGamma * loc.
z()  + 1.;
  2253                 " at the singular focal point (e.g. camera)");
  2257         const double sinv = 1.0/s;     
  2258         const double pt0 = mLx * sinv;   
  2259         const double pt1 = mGamma * pt0;   
  2260         const double pt2 = pt1 * sinv;   
  2261         const double pt3 = pt2 * sinv;   
  2263         const Mat3d& jacinv = mSecondMap.getConstJacobianInv();
  2267         Mat3d matE0(Mat3d::zero());
  2268         Mat3d matE1(Mat3d::zero()); 
  2269         for(
int j = 0; j < 3; j++) {
  2270             for (
int k = 0; k < 3; k++) {
  2272                 const double pt4 =  2. * jacinv(2,j) * jacinv(2,k) * pt3;
  2274                 matE0(j,k) = -(jacinv(0,j) * jacinv(2,k) + jacinv(2,j) * jacinv(0,k)) * pt2 +
  2277                 matE1(j,k) = -(jacinv(1,j) * jacinv(2,k) + jacinv(2,j) * jacinv(1,k)) * pt2 +
  2283         Mat3d gradE(Mat3d::zero());
  2284         for (
int j = 0; j < 3; ++j ) {
  2285             gradE(0,j) =  pt0 * jacinv(0,j) -  pt2 * loc.
x()*jacinv(2,j);
  2286             gradE(1,j) =  pt0 * jacinv(1,j) -  pt2 * loc.
y()*jacinv(2,j);
  2287             gradE(2,j) = (1./mDepthOnLz) * jacinv(2,j);
  2290         Mat3d result(Mat3d::zero());
  2293         for (
int m = 0; m < 3; ++m ) {
  2294             for ( 
int n = 0; n < 3; ++n) {
  2295                 for (
int i = 0; i < 3; ++i ) {
  2296                     for (
int j = 0; j < 3; ++j) {
  2297                         result(m, n) += gradE(j, m) * gradE(i, n) * d2_is(i, j);
  2303          for (
int m = 0; m < 3; ++m ) {
  2304             for ( 
int n = 0; n < 3; ++n) {
  2306                     matE0(m, n) * d1_is(0) + matE1(m, n) * d1_is(1);
  2314     double determinant()
 const override {
return mSecondMap.determinant();} 
  2320         double s = mGamma * loc.
z() + 1.0;
  2321         double frustum_determinant = s * s * mDepthOnLzLxLx;
  2322         return mSecondMap.determinant() * frustum_determinant;
  2328         const Vec3d loc( 0.5*(mBBox.min().x() + mBBox.max().x()),
  2329                          0.5*(mBBox.min().y() + mBBox.max().y()),
  2332         return voxelSize(loc);
  2342         Vec3d out, pos = applyMap(loc);
  2343         out(0) = (applyMap(loc + 
Vec3d(1,0,0)) - pos).length();
  2344         out(1) = (applyMap(loc + 
Vec3d(0,1,0)) - pos).length();
  2345         out(2) = (applyMap(loc + 
Vec3d(0,0,1)) - pos).length();
  2375     void read(std::istream& is)
 override  2381         is.read(reinterpret_cast<char*>(&mTaper), 
sizeof(
double));
  2382         is.read(reinterpret_cast<char*>(&mDepth), 
sizeof(
double));
  2388         if(!MapRegistry::isRegistered(type)) {
  2393         MapBase::Ptr proxy =  math::MapRegistry::createMap(type);
  2395         mSecondMap = *(proxy->getAffineMap());
  2400     void write(std::ostream& os)
 const override  2403         os.write(reinterpret_cast<const char*>(&mTaper), 
sizeof(
double));
  2404         os.write(reinterpret_cast<const char*>(&mDepth), 
sizeof(
double));
  2407         mSecondMap.write(os);
  2411     std::string 
str()
 const override  2413         std::ostringstream buffer;
  2414         buffer << 
" - taper: " << mTaper << std::endl;
  2415         buffer << 
" - depth: " << mDepth << std::endl;
  2416         buffer << 
" SecondMap: "<< mSecondMap.type() << std::endl;
  2417         buffer << mSecondMap.str() << std::endl;
  2418         return buffer.str();
  2447             mBBox, mTaper, mDepth, mSecondMap.preShear(shear, axis0, axis1)));
  2476             mBBox, mTaper, mDepth, mSecondMap.postShear(shear, axis0, axis1)));
  2483         mLx = mBBox.extents().x();
  2484         mLy = mBBox.extents().y();
  2485         mLz = mBBox.extents().z();
  2489                 " must have at least two index points in each direction.");
  2496         mGamma = (1./mTaper - 1) / mDepth;
  2498         mDepthOnLz = mDepth/mLz;
  2499         mDepthOnLzLxLx = mDepthOnLz/(mLx * mLx);
  2502         mHasSimpleAffine = 
true;
  2503         Vec3d tmp = mSecondMap.voxelSize();
  2506         if (!
isApproxEqual(tmp(0), tmp(1))) { mHasSimpleAffine = 
false; 
return; }
  2507         if (!
isApproxEqual(tmp(0), tmp(2))) { mHasSimpleAffine = 
false; 
return; }
  2509         Vec3d trans = mSecondMap.applyMap(
Vec3d(0,0,0));
  2511         Vec3d tmp1 = mSecondMap.applyMap(
Vec3d(1,0,0)) - trans;
  2512         Vec3d tmp2 = mSecondMap.applyMap(
Vec3d(0,1,0)) - trans;
  2513         Vec3d tmp3 = mSecondMap.applyMap(
Vec3d(0,0,1)) - trans;
  2516         if (!
isApproxEqual(tmp1.
dot(tmp2), 0., 1.e-7)) { mHasSimpleAffine  = 
false; 
return; }
  2517         if (!
isApproxEqual(tmp2.
dot(tmp3), 0., 1.e-7)) { mHasSimpleAffine  = 
false; 
return; }
  2518         if (!
isApproxEqual(tmp3.
dot(tmp1), 0., 1.e-7)) { mHasSimpleAffine  = 
false; 
return; }
  2527         out = out - mBBox.min();
  2532         out.
z() *= mDepthOnLz;
  2534         double scale = (mGamma * out.
z() + 1.)/ mLx;
  2543     Vec3d applyFrustumInverseMap(
const Vec3d& in)
 const  2547         double invScale = mLx / (mGamma * out.
z() + 1.);
  2548         out.
x() *= invScale;
  2549         out.
y() *= invScale;
  2554         out.
z() /= mDepthOnLz;
  2557         out = out +  mBBox.min();
  2572     double mLx, mLy, mLz;
  2573     double mXo, mYo, mGamma, mDepthOnLz, mDepthOnLzLxLx;
  2576     bool mHasSimpleAffine;
  2586 template<
typename FirstMapType, 
typename SecondMapType>
  2598     CompoundMap(
const FirstMapType& f, 
const SecondMapType& s): mFirstMap(f), mSecondMap(s)
  2600         updateAffineMatrix();
  2604         mFirstMap(other.mFirstMap),
  2605         mSecondMap(other.mSecondMap),
  2606         mAffineMap(other.mAffineMap)
  2612         return (FirstMapType::mapType() + 
Name(
":") + SecondMapType::mapType());
  2617         if (mFirstMap != other.mFirstMap)   
return false;
  2618         if (mSecondMap != other.mSecondMap) 
return false;
  2619         if (mAffineMap != other.mAffineMap) 
return false;
  2627         mFirstMap = other.mFirstMap;
  2628         mSecondMap = other.mSecondMap;
  2629         mAffineMap = other.mAffineMap;
  2636             return mAffineMap.isIdentity();
  2638             return mFirstMap.isIdentity()&&mSecondMap.isIdentity();
  2644             return mAffineMap.isDiagonal();
  2646             return mFirstMap.isDiagonal()&&mSecondMap.isDiagonal();
  2657                 "Constant affine matrix representation not possible for this nonlinear map");
  2662     const FirstMapType& 
firstMap()
 const { 
return mFirstMap; }
  2663     const SecondMapType& 
secondMap()
 const {
return mSecondMap; }
  2665     void setFirstMap(
const FirstMapType& first) { mFirstMap = first; updateAffineMatrix(); }
  2666     void setSecondMap(
const SecondMapType& second) { mSecondMap = second; updateAffineMatrix(); }
  2670         mAffineMap.read(is);
  2672         mSecondMap.read(is);
  2676         mAffineMap.write(os);
  2677         mFirstMap.write(os);
  2678         mSecondMap.write(os);
  2682     void updateAffineMatrix()
  2688             mAffineMap = 
AffineMap(*first, *second);
  2692     FirstMapType   mFirstMap;
  2693     SecondMapType  mSecondMap;
  2702 #endif // OPENVDB_MATH_MAPS_HAS_BEEN_INCLUDED Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const  final
Return the Jacobian of the map applied to in. 
Definition: Maps.h:742
 
MapBase::Ptr inverseMap() const  override
Return a new map representing the inverse of this map. 
Definition: Maps.h:696
 
double determinant(const Vec3d &) const  final
Return the product of the scale values, ignores argument. 
Definition: Maps.h:788
 
Mat3< T > getMat3() const 
Definition: Mat4.h:297
 
UnitaryMap(const UnitaryMap &other)
Definition: Maps.h:1682
 
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation to the ...
Definition: Maps.h:870
 
void setSecondMap(const SecondMapType &second)
Definition: Maps.h:2666
 
CompoundMap< CompoundMap< UnitaryMap, ScaleMap >, UnitaryMap > SpectralDecomposedMap
Definition: Maps.h:45
 
static void registerMap()
Definition: Maps.h:1001
 
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given shear. 
Definition: Maps.h:1870
 
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation to the ...
Definition: Maps.h:890
 
ScaleTranslateMap()
Definition: Maps.h:1168
 
ScaleMap(const Vec3d &scale)
Definition: Maps.h:665
 
MapBase::Ptr preRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation...
Definition: Maps.h:1402
 
bool operator==(const NonlinearFrustumMap &other) const 
Definition: Maps.h:2072
 
Vec3d voxelSize() const  override
Returns the lengths of the images of the segments (0,0,0) − (1,0,0), (0,0,0) − (0,1,0) and (0,0,0) − (0,0,1). 
Definition: Maps.h:1784
 
static Name mapType()
Return UnitaryMap. 
Definition: Maps.h:1717
 
Vec3d voxelSize(const Vec3d &loc) const  override
Returns the lengths of the images of the three segments from loc to loc + (1,0,0), from loc to loc + (0,1,0) and from loc to loc + (0,0,1) 
Definition: Maps.h:2340
 
bool operator!=(const MyType &other) const 
Definition: Maps.h:2623
 
Vec3d applyInverseJacobian(const Vec3d &in) const  override
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:1751
 
std::string str() const  override
string serialization, useful for debuging 
Definition: Maps.h:2411
 
const Vec3d & getInvScale() const 
Return 1/(scale) 
Definition: Maps.h:802
 
CompoundMap(const FirstMapType &f, const SecondMapType &s)
Definition: Maps.h:2598
 
void read(std::istream &is) override
read serialization 
Definition: Maps.h:1789
 
MapBase::Ptr postRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropraite operation...
Definition: Maps.h:1430
 
const SecondMapType & secondMap() const 
Definition: Maps.h:2663
 
AffineMap & operator=(const AffineMap &other)
Definition: Maps.h:398
 
AffineMap::Ptr getAffineMap() const  override
Return AffineMap::Ptr to an AffineMap equivalent to *this. 
Definition: Maps.h:1090
 
void accumPostTranslation(const Vec3d &v)
Modify the existing affine map by post-applying the given operation. 
Definition: Maps.h:514
 
static Name mapType()
Definition: Maps.h:710
 
Vec3d applyIJT(const Vec3d &d1_is, const Vec3d &ijk) const  override
Definition: Maps.h:2203
 
bool operator!=(const ScaleTranslateMap &other) const 
Definition: Maps.h:1389
 
Vec3d voxelSize() const  final
Return the absolute values of the scale values. 
Definition: Maps.h:1333
 
static void registerMap()
Definition: Maps.h:1707
 
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:74
 
ScaleTranslateMap(const Vec3d &scale, const Vec3d &translate)
Definition: Maps.h:1179
 
Vec3d applyJT(const Vec3d &in, const Vec3d &) const  final
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:1293
 
double getTaper() const 
Return the taper value. 
Definition: Maps.h:2354
 
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
 
NonlinearFrustumMap(const BBoxd &bb, double taper, double depth)
Constructor that takes an index-space bounding box to be mapped into a frustum with a given depth and...
Definition: Maps.h:1909
 
Name type() const 
Definition: Maps.h:2609
 
AffineMap::Ptr getAffineMap() const  override
Definition: Maps.h:2349
 
static bool isEqualBase(const MapT &self, const MapBase &other)
Definition: Maps.h:250
 
AffineMap(const Mat3d &m)
Definition: Maps.h:313
 
Vec3d applyIJT(const Vec3d &in) const  override
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:1768
 
const Vec3d & getScale() const 
Return the scale values that define the map. 
Definition: Maps.h:795
 
static Name mapType()
Definition: Maps.h:2610
 
Vec3d applyJacobian(const Vec3d &in) const  final
Return the Jacobian of the map applied to in. 
Definition: Maps.h:1278
 
std::string Name
Definition: Name.h:19
 
NonlinearFrustumMap(const Vec3d &position, const Vec3d &direction, const Vec3d &up, double aspect, double z_near, double depth, Coord::ValueType x_count, Coord::ValueType z_count)
Constructor from a camera frustum. 
Definition: Maps.h:1958
 
MapBase::Ptr copy() const  override
Return a MapBase::Ptr to a deep copy of this map. 
Definition: Maps.h:1222
 
Name readString(std::istream &is)
Definition: Name.h:22
 
AffineMap::Ptr getAffineMap() const 
Definition: Maps.h:2650
 
Name type() const  override
Return the name of this map's concrete type (e.g., "AffineMap"). 
Definition: Maps.h:1239
 
Mat3d applyIJC(const Mat3d &in) const  final
Return the Jacobian Curvature: zero for a linear map. 
Definition: Maps.h:773
 
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given shear to the linear par...
Definition: Maps.h:2444
 
bool isEqual(const MapBase &other) const  override
Return true if this map is equal to the given map. 
Definition: Maps.h:1725
 
MatType shear(Axis axis0, Axis axis1, typename MatType::value_type shear)
Set the matrix to a shear along axis0 by a fraction of axis1. 
Definition: Mat.h:688
 
Mat3d applyIJC(const Mat3d &d2_is, const Vec3d &d1_is, const Vec3d &ijk) const  override
Definition: Maps.h:2244
 
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const  final
Definition: Maps.h:1322
 
bool hasUniformScale() const  final
Return true if the scale values have the same magnitude (eg. -1, 1, -1 would be a rotation)...
Definition: Maps.h:1247
 
Mat3d applyIJC(const Mat3d &in) const  override
Return the Jacobian Curvature: zero for a linear map. 
Definition: Maps.h:1770
 
void setToRotation(const Quat< T > &q)
Set this matrix to the rotation matrix specified by the quaternion. 
Definition: Mat3.h:253
 
static bool isRegistered()
Definition: Maps.h:358
 
OPENVDB_API SharedPtr< FullyDecomposedMap > createFullyDecomposedMap(const Mat4d &m)
General decomposition of a Matrix into a Unitary (e.g. rotation) following a Symmetric (e...
 
T & y()
Definition: Vec3.h:87
 
UnitaryMap(Axis axis, double radians)
Definition: Maps.h:1638
 
AffineMap::Ptr getAffineMap() const  override
Return AffineMap::Ptr to a deep copy of the current AffineMap. 
Definition: Maps.h:547
 
void write(std::ostream &os) const 
Definition: Maps.h:2674
 
Vec3d applyJacobian(const Vec3d &in) const  final
Return the Jacobian of the map applied to in. 
Definition: Maps.h:746
 
double determinant() const  override
Return 1. 
Definition: Maps.h:1057
 
MapBase::Ptr copy() const  override
Returns a MapBase::Ptr to a deep copy of *this. 
Definition: Maps.h:1698
 
bool operator!=(const NonlinearFrustumMap &other) const 
Definition: Maps.h:2094
 
Mat3d applyIJC(const Mat3d &mat, const Vec3d &, const Vec3d &) const  override
Definition: Maps.h:1050
 
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows. 
Definition: Mat.h:633
 
bool isIdentity() const 
Definition: Maps.h:2633
 
void setRow(int i, const Vec3< T > &v)
Set ith row to vector v. 
Definition: Mat3.h:141
 
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons. 
Definition: Vec3.h:474
 
A specialized linear transform that performs a translation. 
Definition: Maps.h:977
 
MyType & operator=(const MyType &other)
Definition: Maps.h:2625
 
bool operator==(const ScaleMap &other) const 
Definition: Maps.h:841
 
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1162
 
SharedPtr< AffineMap > Ptr
Definition: Maps.h:298
 
Vec3d applyJacobian(const Vec3d &in) const  override
Return the Jacobian of the map applied to in. 
Definition: Maps.h:1742
 
MapBase::Ptr preRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation to the ...
Definition: Maps.h:861
 
const Vec3d & getInvScale() const 
Return 1/(scale) 
Definition: Maps.h:1347
 
Vec3d applyJT(const Vec3d &in, const Vec3d &) const  override
Definition: Maps.h:433
 
AffineMap::Ptr getAffineMap() const  override
Return AffineMap::Ptr to an AffineMap equivalent to *this. 
Definition: Maps.h:1807
 
SharedPtr< FullyDecomposedMap > createDecomposedMap()
on-demand decomposition of the affine map 
Definition: Maps.h:541
 
Vec3d voxelSize(const Vec3d &) const  final
Return the lengths of the images of the segments (0,0,0) − 1,0,0), (0,0,0) − (0,1,0) and (0,0,0) − (0,0,1). 
Definition: Maps.h:809
 
Vec3d applyIJT(const Vec3d &in, const Vec3d &) const  final
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:767
 
void accumPreRotation(Axis axis, double radians)
Modify the existing affine map by pre-applying the given operation. 
Definition: Maps.h:479
 
static MapBase::Ptr create()
Return a MapBase::Ptr to a new UnitaryMap. 
Definition: Maps.h:1696
 
void read(std::istream &is) override
read serialization 
Definition: Maps.h:528
 
MapBase::Ptr postRotate(double radians, Axis axis=X_AXIS) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given rotation to the linear p...
Definition: Maps.h:2452
 
OPENVDB_API void checkFormatVersion(std::ios_base &)
Throws an IoError if the file format version number is not supported. 
 
AffineMap(const AffineMap &first, const AffineMap &second)
constructor that merges the matrixes for two affine maps 
Definition: Maps.h:343
 
Vec3d applyInverseJacobian(const Vec3d &in) const  override
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:1033
 
double getDepth() const 
Return the unscaled frustm depth. 
Definition: Maps.h:2358
 
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection...
Definition: Maps.h:1620
 
Vec3d applyJT(const Vec3d &in) const  override
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:435
 
Definition: Exceptions.h:56
 
Vec3d voxelSize() const  final
Return the lengths of the images of the segments (0,0,0) − 1,0,0), (0,0,0) − (0,1,0) and (0,0,0) − (0,0,1). 
Definition: Maps.h:808
 
TranslationMap(const TranslationMap &other)
Definition: Maps.h:986
 
double determinant() const  final
Return the product of the scale values. 
Definition: Maps.h:1329
 
Vec3d voxelSize(const Vec3d &) const  override
Returns the lengths of the images of the segments (0,0,0) − (1,0,0), (0,0,0) − (0,1,0) and (0,0,0) − (0,0,1). 
Definition: Maps.h:1785
 
static Name mapType()
Return NonlinearFrustumMap. 
Definition: Maps.h:2042
 
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation...
Definition: Maps.h:1419
 
Mat3d applyIJC(const Mat3d &in) const  final
Return the Jacobian Curvature: zero for a linear map. 
Definition: Maps.h:1311
 
Tolerance for floating-point comparison. 
Definition: Math.h:159
 
double determinant() const  final
Return the product of the scale values. 
Definition: Maps.h:790
 
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const  final
Definition: Maps.h:784
 
Vec3d applyIJT(const Vec3d &in) const  override
Return the transpose of the inverse Jacobian (Identity for TranslationMap) of the map applied to in...
Definition: Maps.h:1047
 
bool isEqual(const MapBase &other) const  override
Return true if this map is equal to the given map. 
Definition: Maps.h:386
 
void setMat3(const Mat3< T > &m)
Set upper left to a Mat3. 
Definition: Mat4.h:290
 
SharedPtr< MyType > Ptr
Definition: Maps.h:2592
 
TranslationMap(const Vec3d &t)
Definition: Maps.h:985
 
SharedPtr< UnitaryMap > Ptr
Definition: Maps.h:1623
 
bool operator==(const AffineMap &other) const 
Definition: Maps.h:388
 
NonlinearFrustumMap()
Definition: Maps.h:1897
 
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given shear to the linear part...
Definition: Maps.h:2473
 
bool isType() const 
Return true if this map is of concrete type MapT (e.g., AffineMap). 
Definition: Maps.h:150
 
MatType scale(const Vec3< typename MatType::value_type > &s)
Return a matrix that scales by s. 
Definition: Mat.h:615
 
Vec3d applyIJT(const Vec3d &in) const  override
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:445
 
Vec3d applyIJT(const Vec3d &in) const  final
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:771
 
bool isEqual(const MapBase &other) const  override
Return true if this map is equal to the given map. 
Definition: Maps.h:2070
 
NonlinearFrustumMap(const NonlinearFrustumMap &other)
Definition: Maps.h:1932
 
std::map< Name, MapBase::MapFactory > MapDictionary
Definition: Maps.h:265
 
SharedPtr< MapBase > Ptr
Definition: Maps.h:137
 
const Vec3d & getInvTwiceScale() const 
Return 1/(2 scale). Used to optimize some finite difference calculations. 
Definition: Maps.h:800
 
double determinant() const  override
Return the determinant of the Jacobian. 
Definition: Maps.h:456
 
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given shear. 
Definition: Maps.h:1837
 
MapBase::Ptr postRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given rotation. 
Definition: Maps.h:1846
 
This map is composed of three steps. First it will take a box of size (Lx X Ly X Lz) defined by a mem...
Definition: Maps.h:1891
 
AffineMap()
Definition: Maps.h:301
 
static Name mapType()
Definition: Maps.h:1240
 
MapBase::Ptr postScale(const Vec3d &s) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given scale to the linear part...
Definition: Maps.h:2466
 
bool operator!=(const AffineMap &other) const 
Definition: Maps.h:396
 
CompoundMap()
Definition: Maps.h:2596
 
MapBase::Ptr copy() const  override
Return a MapBase::Ptr to a deep copy of this map. 
Definition: Maps.h:2021
 
Vec3d applyInverseJacobian(const Vec3d &in) const  final
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:1287
 
static bool isRegistered()
Definition: Maps.h:700
 
MapBase::Ptr copy() const  override
Return a MapBase::Ptr to a deep copy of this map. 
Definition: Maps.h:694
 
Vec3d applyJT(const Vec3d &in) const  override
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:1040
 
Vec3d applyIJT(const Vec3d &in) const  final
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:1303
 
MapBase::Ptr preRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropriate operation...
Definition: Maps.h:1102
 
MapBase::Ptr postTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given translation to the linea...
Definition: Maps.h:2459
 
ScaleMap()
Definition: Maps.h:661
 
double determinant(const Vec3d &) const  override
Return 1. 
Definition: Maps.h:1055
 
Threadsafe singleton object for accessing the map type-name dictionary. Associates a map type-name wi...
Definition: Maps.h:262
 
math::BBox< Vec3d > BBoxd
Definition: Types.h:65
 
Int32 ValueType
Definition: Coord.h:33
 
ScaleMap(const ScaleMap &other)
Definition: Maps.h:679
 
Map traits. 
Definition: Maps.h:55
 
Mat3 transpose() const 
returns transpose of this 
Definition: Mat3.h:454
 
void accumPostRotation(Axis axis, double radians)
Modify the existing affine map by post-applying the given operation. 
Definition: Maps.h:504
 
Vec3d applyInverseMap(const Vec3d &in) const  override
Return the pre-image of in under the map. 
Definition: Maps.h:1020
 
MapBase::Ptr postTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropraite operation...
Definition: Maps.h:1436
 
std::string str() const  override
string serialization, useful for debuging 
Definition: Maps.h:1370
 
Vec3d applyJacobian(const Vec3d &in) const  override
Return the Jacobian of the map applied to in. 
Definition: Maps.h:418
 
static bool isRegistered()
Definition: Maps.h:2031
 
void setCol(int j, const Vec3< T > &v)
Set jth column to vector v. 
Definition: Mat3.h:159
 
void read(std::istream &is) override
read serialization 
Definition: Maps.h:1068
 
static MapBase::Ptr create()
Return a MapBase::Ptr to a new ScaleTranslateMap. 
Definition: Maps.h:1220
 
bool isLinear() const  override
Return true (an AffineMap is always linear). 
Definition: Maps.h:371
 
MapBase::Ptr preTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation...
Definition: Maps.h:1408
 
void accumPreScale(const Vec3d &v)
Modify the existing affine map by pre-applying the given operation. 
Definition: Maps.h:484
 
T dot(const Vec3< T > &v) const 
Dot product. 
Definition: Vec3.h:192
 
AffineMap(const Mat4d &m)
Definition: Maps.h:321
 
static bool isRegistered()
Definition: Maps.h:1230
 
Vec3d applyJT(const Vec3d &in, const Vec3d &isloc) const  override
Return the Jacobian Transpose of the map applied to vector in at indexloc. 
Definition: Maps.h:2166
 
void write(std::ostream &os) const  override
write serialization 
Definition: Maps.h:2400
 
Vec3d applyInverseMap(const Vec3d &in) const  final
Return the pre-image of under the map. 
Definition: Maps.h:1265
 
MapBase::Ptr preTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given translation to the line...
Definition: Maps.h:2430
 
void setDepth(double d)
set the frustum depth: distance between near and far plane = frustm depth * frustm x-width ...
Definition: Maps.h:2356
 
AffineMap::Ptr getAffineMap() const  override
Return AffineMap::Ptr to an AffineMap equivalent to *this. 
Definition: Maps.h:1392
 
Vec3d applyInverseMap(const Vec3d &in) const  final
Return the pre-image of in under the map. 
Definition: Maps.h:734
 
Vec3d voxelSize() const  override
Return (1,1,1). 
Definition: Maps.h:1060
 
Vec3d applyInverseMap(const Vec3d &in) const  override
Return the pre-image of in under the map. 
Definition: Maps.h:1738
 
static void registerMap()
Definition: Maps.h:2033
 
Mat3d applyIJC(const Mat3d &in) const  override
Return the Jacobian Curvature for the linear second map. 
Definition: Maps.h:2239
 
std::string str() const  override
string serialization, useful for debuging 
Definition: Maps.h:1800
 
OPENVDB_API SharedPtr< SymmetricMap > createSymmetricMap(const Mat3d &m)
Utility methods. 
 
const Mat4d & getConstMat4() const 
Definition: Maps.h:614
 
static void registerMap()
Definition: Maps.h:1232
 
static void registerMap()
Definition: Maps.h:702
 
Vec3d applyInverseJacobian(const Vec3d &in) const  override
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:427
 
Vec3d applyInverseMap(const Vec3d &in) const  override
Return the pre-image of in under the map. 
Definition: Maps.h:413
 
const FirstMapType & firstMap() const 
Definition: Maps.h:2662
 
double determinant(const Vec3d &) const  override
Return the determinant of the Jacobian, ignores argument. 
Definition: Maps.h:1776
 
bool isValid() const 
Definition: Maps.h:2369
 
Vec3< T > col(int j) const 
Get jth column, e.g. Vec3d v = m.col(0);. 
Definition: Mat3.h:168
 
void read(std::istream &is) override
read serialization 
Definition: Maps.h:2375
 
bool operator==(const UnitaryMap &other) const 
Definition: Maps.h:1727
 
bool operator==(const ScaleTranslateMap &other) const 
Definition: Maps.h:1381
 
static Name mapType()
Definition: Maps.h:368
 
Vec3d applyInverseJacobian(const Vec3d &in, const Vec3d &) const  final
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:1282
 
MapBase::Ptr preTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropriate operation...
Definition: Maps.h:1109
 
A general linear transform using homogeneous coordinates to perform rotation, scaling, shear and translation. 
Definition: Maps.h:295
 
Mat4d getMat4() const 
Return the matrix representation of this AffineMap. 
Definition: Maps.h:613
 
SharedPtr< const MapBase > ConstPtr
Definition: Maps.h:138
 
std::string str() const  override
string serialization, useful for debugging 
Definition: Maps.h:532
 
Vec3d applyMap(const Vec3d &in) const  override
Return the image of in under the map. 
Definition: Maps.h:1736
 
MapBase::Ptr postRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropriate operation...
Definition: Maps.h:1127
 
const Vec3d & getScale() const 
Returns the scale values. 
Definition: Maps.h:1338
 
Vec3d applyIJT(const Vec3d &in) const  override
Return the transpose of the inverse Jacobian of the linear second map applied to in. 
Definition: Maps.h:2193
 
float Round(float x)
Return x rounded to the nearest integer. 
Definition: Math.h:890
 
Vec3d voxelSize(const Vec3d &) const  final
Return the absolute values of the scale values, ignores argument. 
Definition: Maps.h:1335
 
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropriate operation...
Definition: Maps.h:1141
 
UnitaryMap(const UnitaryMap &first, const UnitaryMap &second)
Definition: Maps.h:1688
 
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropraite operation...
Definition: Maps.h:604
 
MapBase::Ptr copy() const  override
Return a MapBase::Ptr to a deep copy of this map. 
Definition: Maps.h:993
 
bool isDiagonal() const 
Return true if the underylying matrix is diagonal. 
Definition: Maps.h:468
 
T det() const 
Determinant of matrix. 
Definition: Mat3.h:479
 
void setTaper(double t)
set the taper value, the ratio of nearplane width / far plane width 
Definition: Maps.h:2352
 
UnitaryMap(const Mat4d &m)
Definition: Maps.h:1657
 
OPENVDB_API SharedPtr< PolarDecomposedMap > createPolarDecomposedMap(const Mat3d &m)
Decomposes a general linear into translation following polar decomposition. 
 
Vec4< T0 > transform(const Vec4< T0 > &v) const 
Transform a Vec4 by post-multiplication. 
Definition: Mat4.h:999
 
bool hasTranslation(const Mat4< T > &m)
Definition: Mat4.h:1310
 
Definition: Exceptions.h:13
 
NonlinearFrustumMap(const BBoxd &bb, double taper, double depth, const MapBase::Ptr &secondMap)
Constructor that takes an index-space bounding box to be mapped into a frustum with a given depth and...
Definition: Maps.h:1920
 
Vec3d applyJT(const Vec3d &in) const  final
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:763
 
Vec3d applyIJT(const Vec3d &in, const Vec3d &) const  override
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:443
 
const Vec3d & getTranslation() const 
Return the translation vector. 
Definition: Maps.h:1065
 
UnitaryMap()
default constructor makes an Idenity. 
Definition: Maps.h:1627
 
static Name mapType()
Definition: Maps.h:1009
 
double determinant(const Vec3d &) const  override
Return the determinant of the Jacobian, ignores argument. 
Definition: Maps.h:454
 
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:655
 
Vec3d applyJT(const Vec3d &in) const  override
Return the Jacobian Transpose of the second map applied to in. 
Definition: Maps.h:2188
 
AffineMap(const AffineMap &other)
Definition: Maps.h:330
 
static MapBase::Ptr create()
Return a MapBase::Ptr to a new TranslationMap. 
Definition: Maps.h:991
 
Vec3d applyJacobian(const Vec3d &in, const Vec3d &isloc) const  override
Return the Jacobian defined at isloc applied to in. 
Definition: Maps.h:2110
 
void write(std::ostream &os) const  override
write serialization 
Definition: Maps.h:1070
 
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropraite operation...
Definition: Maps.h:1443
 
void read(std::istream &is)
Definition: Maps.h:2668
 
bool isLinear() const  override
Return true (a TranslationMap is always linear). 
Definition: Maps.h:1012
 
bool isLinear() const  final
Return true (a ScaleMap is always linear). 
Definition: Maps.h:713
 
Vec3d applyJT(const Vec3d &in, const Vec3d &) const  override
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:1038
 
double determinant(const Vec3d &) const  final
Return the product of the scale values, ignores argument. 
Definition: Maps.h:1327
 
MapBase::Ptr inverseMap() const  override
Return a new map representing the inverse of this map. 
Definition: Maps.h:1224
 
T & z()
Definition: Vec3.h:88
 
static void registerMap()
Definition: Maps.h:360
 
MapBase::Ptr postTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given translation. 
Definition: Maps.h:1854
 
bool hasUniformScale() const  override
Return false (by convention false) 
Definition: Maps.h:2048
 
bool operator==(const MyType &other) const 
Definition: Maps.h:2615
 
const Vec3d & getInvTwiceScale() const 
Return 1/(2 scale). Used to optimize some finite difference calculations. 
Definition: Maps.h:1345
 
Vec3d applyInverseJacobian(const Vec3d &in) const  override
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:2135
 
T length() const 
Length of the vector. 
Definition: Vec3.h:201
 
Name type() const  override
Return NonlinearFrustumMap. 
Definition: Maps.h:2040
 
Vec3d applyInverseJacobian(const Vec3d &in) const  final
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:755
 
Creates the composition of two maps, each of which could be a composition. In the case that each comp...
Definition: Maps.h:42
 
UnitaryMap(const Mat3d &m)
Definition: Maps.h:1645
 
Vec3d applyJacobian(const Vec3d &in) const  override
Return the Jacobian of the linear second map applied to in. 
Definition: Maps.h:2108
 
UnitaryMap(const Vec3d &axis, double radians)
Definition: Maps.h:1631
 
T & x()
Reference to the component, e.g. v.x() = 4.5f;. 
Definition: Vec3.h:86
 
Vec3d applyJT(const Vec3d &in) const  final
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:1295
 
ScaleTranslateMap(const ScaleTranslateMap &other)
Definition: Maps.h:1207
 
Name type() const  override
Return UnitaryMap. 
Definition: Maps.h:1715
 
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const  override
Apply the Jacobian of this map to a vector. For a linear map this is equivalent to applying the map e...
Definition: Maps.h:1740
 
bool normalize(T eps=T(1.0e-7))
this = normalized this 
Definition: Vec3.h:363
 
void accumPostShear(Axis axis0, Axis axis1, double shear)
Modify the existing affine map by post-applying the given operation. 
Definition: Maps.h:519
 
Vec3d voxelSize(const Vec3d &) const  override
Return the lengths of the images of the segments (0,0,0)-(1,0,0), (0,0,0)-(0,1,0) and (0...
Definition: Maps.h:462
 
std::shared_ptr< T > SharedPtr
Definition: Types.h:95
 
bool isEqual(const MapBase &other) const  override
Return true if this map is equal to the given map. 
Definition: Maps.h:1079
 
Vec3d applyInverseJacobian(const Vec3d &in, const Vec3d &) const  final
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:750
 
OPENVDB_API Mat4d approxInverse(const Mat4d &mat)
Returns the left pseudoInverse of the input matrix when the 3x3 part is symmetric otherwise it zeros ...
 
bool hasUniformScale() const  override
Return false ( test if this is unitary with translation ) 
Definition: Maps.h:374
 
bool isLinear() const  override
Return true (a UnitaryMap is always linear). 
Definition: Maps.h:1720
 
void write(std::ostream &os) const  override
write serialization 
Definition: Maps.h:1795
 
std::string str() const  override
string serialization, useful for debuging 
Definition: Maps.h:831
 
MapBase::Ptr copy() const  override
Return a MapBase::Ptr to a deep copy of this map. 
Definition: Maps.h:354
 
Vec3d applyMap(const Vec3d &in) const  override
Return the image of in under the map. 
Definition: Maps.h:411
 
MapBase::Ptr inverseMap() const  override
Return a new map representing the inverse of this map. 
Definition: Maps.h:356
 
void writeString(std::ostream &os, const Name &name)
Definition: Name.h:33
 
double determinant() const  override
Return the determinant of the Jacobian of linear second map. 
Definition: Maps.h:2314
 
MapBase::Ptr preTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation...
Definition: Maps.h:562
 
bool isInvertible(const MatType &m)
Determine if a matrix is invertible. 
Definition: Mat.h:869
 
bool isIdentity() const 
Return true if the underlying matrix is approximately an identity. 
Definition: Maps.h:466
 
bool isDiagonal() const 
Definition: Maps.h:2642
 
double determinant() const  override
Return the determinant of the Jacobian. 
Definition: Maps.h:1778
 
MapBase::Ptr postScale(const Vec3d &s) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropraite operation...
Definition: Maps.h:598
 
Vec3d applyIJT(const Vec3d &in, const Vec3d &) const  override
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:1766
 
TranslationMap()
Definition: Maps.h:984
 
double determinant(const Vec3d &loc) const  override
Definition: Maps.h:2318
 
AffineMap::Ptr inverse() const 
Return AffineMap::Ptr to the inverse of this map. 
Definition: Maps.h:550
 
MapBase::Ptr preScale(const Vec3d &s) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given scale to the linear par...
Definition: Maps.h:2437
 
Mat3d applyIJC(const Mat3d &m) const  override
Return the Jacobian Curvature: zero for a linear map. 
Definition: Maps.h:447
 
Vec3d applyJT(const Vec3d &in) const  override
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:1759
 
Vec3d applyJT(const Vec3d &in, const Vec3d &) const  override
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:1757
 
void accumPreShear(Axis axis0, Axis axis1, double shear)
Modify the existing affine map by pre-applying the given operation. 
Definition: Maps.h:494
 
Axis
Definition: Math.h:972
 
bool isIdentity(const MatType &m)
Determine if a matrix is an identity matrix. 
Definition: Mat.h:860
 
void write(std::ostream &os) const  override
write serialization 
Definition: Maps.h:1360
 
Definition: Exceptions.h:61
 
MapBase::Ptr inverseMap() const  override
Not implemented, since there is currently no map type that can represent the inverse of a frustum...
Definition: Maps.h:2026
 
bool operator!=(const UnitaryMap &other) const 
Definition: Maps.h:1734
 
AffineMap::Ptr getAffineMap() const  override
Return a AffineMap equivalent to this map. 
Definition: Maps.h:851
 
Vec3d applyInverseJacobian(const Vec3d &in, const Vec3d &) const  override
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:422
 
bool isScale() const 
Return true if the map is equivalent to a ScaleMap. 
Definition: Maps.h:470
 
bool isAffine(const Mat4< T > &m)
Definition: Mat4.h:1305
 
bool isApproxEqual(const Type &a, const Type &b, const Type &tolerance)
Return true if a is equal to b to within the given tolerance. 
Definition: Math.h:431
 
MapBase()
Definition: Maps.h:247
 
static MapBase::Ptr create()
Return a MapBase::Ptr to a new AffineMap. 
Definition: Maps.h:352
 
bool isIdentity() const 
Return true if the map is equivalent to an identity. 
Definition: Maps.h:2051
 
Vec3d voxelSize() const  override
Return the lengths of the images of the segments (0,0,0)-(1,0,0), (0,0,0)-(0,1,0) and (0...
Definition: Maps.h:461
 
Mat3 inverse(T tolerance=0) const 
Definition: Mat3.h:465
 
Name type() const  override
Return the name of this map's concrete type (e.g., "AffineMap"). 
Definition: Maps.h:367
 
bool isUnitary(const MatType &m)
Determine if a matrix is unitary (i.e., rotation or reflection). 
Definition: Mat.h:889
 
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const  override
Return the Jacobian of the map applied to in. 
Definition: Maps.h:416
 
Vec3d voxelSize() const  override
Return the size of a voxel at the center of the near plane. 
Definition: Maps.h:2326
 
bool isScaleTranslate() const 
Return true if the map is equivalent to a ScaleTranslateMap. 
Definition: Maps.h:472
 
Abstract base class for maps. 
Definition: Maps.h:134
 
const BBoxd & getBBox() const 
Return the bounding box that defines the frustum in pre-image space. 
Definition: Maps.h:2363
 
Vec3d voxelSize(const Vec3d &) const  override
Return (1,1,1). 
Definition: Maps.h:1062
 
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropriate operation...
Definition: Maps.h:1116
 
const Vec3d & getInvScaleSqr() const 
Return the square of the scale. Used to optimize some finite difference calculations. 
Definition: Maps.h:1343
 
bool operator!=(const ScaleMap &other) const 
Definition: Maps.h:848
 
const Vec3d & getInvScaleSqr() const 
Return the square of the scale. Used to optimize some finite difference calculations. 
Definition: Maps.h:798
 
bool hasSimpleAffine() const 
Return true if the second map is a uniform scale, Rotation and translation. 
Definition: Maps.h:2372
 
MapBase::Ptr preTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given translation. 
Definition: Maps.h:1821
 
Name type() const  override
Return the name of this map's concrete type (e.g., "AffineMap"). 
Definition: Maps.h:709
 
ScaleTranslateMap(const ScaleMap &scale, const TranslationMap &translate)
Definition: Maps.h:1194
 
static MapBase::Ptr create()
Return a MapBase::Ptr to a new NonlinearFrustumMap. 
Definition: Maps.h:2019
 
bool hasUniformScale() const  override
Return false (by convention true) 
Definition: Maps.h:1015
 
Vec3d applyMap(const Vec3d &in) const  override
Return the image of in under the map. 
Definition: Maps.h:2097
 
Definition: Exceptions.h:59
 
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const  override
Return the Jacobian of the map applied to in. 
Definition: Maps.h:1022
 
Mat4 inverse(T tolerance=0) const 
Definition: Mat4.h:485
 
MapBase::Ptr postRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation to the ...
Definition: Maps.h:882
 
void setTranslation(const Vec3< T > &t)
Definition: Mat4.h:314
 
void read(std::istream &is) override
read serialization 
Definition: Maps.h:813
 
Vec3d applyMap(const Vec3d &in) const  final
Return the image of in under the map. 
Definition: Maps.h:726
 
Mat3d applyIJC(const Mat3d &mat) const  override
Return the Jacobian Curvature: zero for a linear map. 
Definition: Maps.h:1049
 
bool isLinear() const  final
Return true (a ScaleTranslateMap is always linear). 
Definition: Maps.h:1243
 
bool isEqual(const MapBase &other) const  override
Return true if this map is equal to the given map. 
Definition: Maps.h:839
 
Vec3d applyJT(const Vec3d &in, const Vec3d &) const  final
Return the Jacobian Transpose of the map applied to in. 
Definition: Maps.h:761
 
T * asPointer()
Definition: Vec3.h:95
 
bool operator==(const TranslationMap &other) const 
Definition: Maps.h:1081
 
MapBase::Ptr inverseMap() const  override
Return a new map representing the inverse of this map. 
Definition: Maps.h:995
 
Vec3d applyIJT(const Vec3d &in, const Vec3d &) const  final
Return the transpose of the inverse Jacobian of the map applied to in. 
Definition: Maps.h:1299
 
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const  override
Definition: Maps.h:450
 
MapBase::Ptr preRotate(double radians, Axis axis=X_AXIS) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation...
Definition: Maps.h:556
 
bool hasUniformScale() const  override
Return false (by convention true) 
Definition: Maps.h:1723
 
Vec3d applyInverseMap(const Vec3d &in) const  override
Return the pre-image of in under the map. 
Definition: Maps.h:2103
 
MapBase::Ptr postTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropriate operation...
Definition: Maps.h:1134
 
static bool isRegistered()
Definition: Maps.h:1705
 
Vec3d applyJacobian(const Vec3d &in) const  override
Return the Jacobian of the map applied to in. 
Definition: Maps.h:1024
 
#define OPENVDB_VERSION_NAME
The version namespace name for this library version. 
Definition: version.h.in:121
 
MapBase::Ptr postScale(const Vec3d &v) const  override
Return a MapBase::Ptr to a new map that is the result of appending the given scale. 
Definition: Maps.h:1862
 
void read(std::istream &is) override
read serialization 
Definition: Maps.h:1350
 
const AffineMap & secondMap() const 
Return MapBase::Ptr& to the second map. 
Definition: Maps.h:2366
 
const Vec3d & getTranslation() const 
Returns the translation. 
Definition: Maps.h:1340
 
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const  override
Definition: Maps.h:1771
 
MapBase::Ptr preRotate(double radians, Axis axis=X_AXIS) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given rotation to the linear ...
Definition: Maps.h:2423
 
bool isEqual(const MapBase &other) const  override
Return true if this map is equal to the given map. 
Definition: Maps.h:1379
 
bool hasUniformScale() const  final
Return true if the values have the same magitude (eg. -1, 1, -1 would be a rotation). 
Definition: Maps.h:716
 
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation...
Definition: Maps.h:574
 
static MapBase::Ptr create()
Return a MapBase::Ptr to a new ScaleMap. 
Definition: Maps.h:692
 
Name type() const  override
Return the name of this map's concrete type (e.g., "AffineMap"). 
Definition: Maps.h:1008
 
void write(std::ostream &os) const  override
write serialization 
Definition: Maps.h:530
 
bool operator!=(const TranslationMap &other) const 
Definition: Maps.h:1087
 
bool isLinear() const  override
Return false (a NonlinearFrustumMap is never linear). 
Definition: Maps.h:2045
 
MapBase::Ptr postRotate(double radians, Axis axis=X_AXIS) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropraite operation...
Definition: Maps.h:586
 
bool isDiagonal(const MatType &mat)
Determine if a matrix is diagonal. 
Definition: Mat.h:902
 
Vec3d applyMap(const Vec3d &in) const  override
Return the image of in under the map. 
Definition: Maps.h:1018
 
Vec3d applyInverseJacobian(const Vec3d &in, const Vec3d &) const  override
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:1746
 
void accumPreTranslation(const Vec3d &v)
Modify the existing affine map by pre-applying the given operation. 
Definition: Maps.h:489
 
MapBase::Ptr preScale(const Vec3d &s) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the appropraite operation...
Definition: Maps.h:568
 
SharedPtr< const MyType > ConstPtr
Definition: Maps.h:2593
 
Vec3d applyMap(const Vec3d &in) const  final
Return the image of under the map. 
Definition: Maps.h:1257
 
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const  final
Return the Jacobian of the map applied to in. 
Definition: Maps.h:1274
 
Vec3d applyInverseJacobian(const Vec3d &in, const Vec3d &isloc) const  override
Return the Inverse Jacobian defined at isloc of the map applied to in. 
Definition: Maps.h:2139
 
void write(std::ostream &os) const  override
write serialization 
Definition: Maps.h:822
 
std::string str() const  override
string serialization, useful for debuging 
Definition: Maps.h:1072
 
Vec3d applyInverseJacobian(const Vec3d &in, const Vec3d &) const  override
Return the Inverse Jacobian of the map applied to in (i.e. inverse map with out translation) ...
Definition: Maps.h:1028
 
double getGamma() const 
Definition: Maps.h:2360
 
CompoundMap(const MyType &other)
Definition: Maps.h:2603
 
Vec3d applyIJT(const Vec3d &in, const Vec3d &) const  override
Return the transpose of the inverse Jacobian (Identity for TranslationMap) of the map applied to in...
Definition: Maps.h:1044
 
void setFirstMap(const FirstMapType &first)
Definition: Maps.h:2665
 
OPENVDB_API SharedPtr< MapBase > simplify(SharedPtr< AffineMap > affine)
reduces an AffineMap to a ScaleMap or a ScaleTranslateMap when it can 
 
MapBase::Ptr postTranslate(const Vec3d &t) const  override
Return a MapBase::Ptr to a new map that is the result of postfixing the appropraite operation...
Definition: Maps.h:592
 
MapBase::Ptr preScale(const Vec3d &v) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given scale. 
Definition: Maps.h:1829
 
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218
 
void setToRotation(Axis axis, T angle)
Sets the matrix to a rotation about the given axis. 
Definition: Mat4.h:783
 
const Mat3d & getConstJacobianInv() const 
Definition: Maps.h:615
 
MapBase::Ptr inverseMap() const  override
Return a new map representing the inverse of this map. 
Definition: Maps.h:1700
 
MapBase::Ptr preRotate(double radians, Axis axis) const  override
Return a MapBase::Ptr to a new map that is the result of prepending the given rotation. 
Definition: Maps.h:1813
 
void accumPostScale(const Vec3d &v)
Modify the existing affine map by post-applying the given operation. 
Definition: Maps.h:509
 
static bool isRegistered()
Definition: Maps.h:999