Go to the documentation of this file.
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; };
75 static const bool value =
true;
79 template<
typename T>
struct is_scale {
static const bool value =
false; };
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;
164 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;
180 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;
208 virtual Vec3d applyJacobian(
const Vec3d& in)
const = 0;
214 virtual Vec3d applyJacobian(
const Vec3d& in,
const Vec3d& domainPos)
const = 0;
218 virtual Vec3d applyInverseJacobian(
const Vec3d& in)
const = 0;
224 virtual Vec3d applyInverseJacobian(
const Vec3d& in,
const Vec3d& domainPos)
const = 0;
229 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&);
279 static void unregisterMap(
const Name&);
305 mMatrix(
Mat4d::identity()),
306 mMatrixInv(
Mat4d::identity()),
307 mJacobianInv(
Mat3d::identity()),
309 mVoxelSize(
Vec3d(1,1,1)),
318 Mat4d mat4(Mat4d::identity());
321 updateAcceleration();
328 "Tried to initialize an affine transform from a non-affine 4x4 matrix");
330 updateAcceleration();
335 mMatrix(other.mMatrix),
336 mMatrixInv(other.mMatrixInv),
337 mJacobianInv(other.mJacobianInv),
338 mDeterminant(other.mDeterminant),
339 mVoxelSize(other.mVoxelSize),
340 mIsDiagonal(other.mIsDiagonal),
341 mIsIdentity(other.mIsIdentity)
347 mMatrix(first.mMatrix * second.mMatrix)
349 updateAcceleration();
361 static bool isRegistered() {
return MapRegistry::isRegistered(AffineMap::mapType()); }
365 MapRegistry::registerMap(
366 AffineMap::mapType(),
379 Mat3d mat = mMatrix.getMat3();
380 const double det = mat.
det();
384 mat *= (1.0 / pow(std::abs(det), 1.0/3.0));
389 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
394 if (!mMatrix.eq(other.mMatrix)) {
return false; }
395 if (!mMatrixInv.eq(other.mMatrixInv)) {
return false; }
403 mMatrix = other.mMatrix;
404 mMatrixInv = other.mMatrixInv;
406 mJacobianInv = other.mJacobianInv;
407 mDeterminant = other.mDeterminant;
408 mVoxelSize = other.mVoxelSize;
409 mIsDiagonal = other.mIsDiagonal;
410 mIsIdentity = other.mIsIdentity;
426 return applyInverseJacobian(in);
431 return mMatrixInv.transform3x3(in);
440 return Vec3d( m[ 0] * in[0] + m[ 1] * in[1] + m[ 2] * in[2],
441 m[ 4] * in[0] + m[ 5] * in[1] + m[ 6] * in[2],
442 m[ 8] * in[0] + m[ 9] * in[1] + m[10] * in[2] );
451 return mJacobianInv.
transpose()* m * mJacobianInv;
462 Vec3d voxelSize()
const override {
return mVoxelSize; }
481 void accumPreRotation(
Axis axis,
double radians)
484 mMatrix.preRotate(axis, radians);
485 updateAcceleration();
490 updateAcceleration();
494 mMatrix.preTranslate(v);
495 updateAcceleration();
499 mMatrix.preShear(axis0, axis1,
shear);
500 updateAcceleration();
506 void accumPostRotation(
Axis axis,
double radians)
509 mMatrix.postRotate(axis, radians);
510 updateAcceleration();
514 mMatrix.postScale(v);
515 updateAcceleration();
519 mMatrix.postTranslate(v);
520 updateAcceleration();
524 mMatrix.postShear(axis0, axis1,
shear);
525 updateAcceleration();
531 void read(std::istream& is)
override { mMatrix.read(is); updateAcceleration(); }
533 void write(std::ostream& os)
const override { mMatrix.write(os); }
535 std::string
str()
const override
537 std::ostringstream buffer;
538 buffer <<
" - mat4:\n" << mMatrix.str() << std::endl;
539 buffer <<
" - voxel dimensions: " << mVoxelSize << std::endl;
562 affineMap->accumPreRotation(axis, radians);
568 affineMap->accumPreTranslation(t);
569 return StaticPtrCast<MapBase, AffineMap>(affineMap);
574 affineMap->accumPreScale(s);
575 return StaticPtrCast<MapBase, AffineMap>(affineMap);
580 affineMap->accumPreShear(axis0, axis1,
shear);
592 affineMap->accumPostRotation(axis, radians);
598 affineMap->accumPostTranslation(t);
599 return StaticPtrCast<MapBase, AffineMap>(affineMap);
604 affineMap->accumPostScale(s);
605 return StaticPtrCast<MapBase, AffineMap>(affineMap);
610 affineMap->accumPostShear(axis0, axis1,
shear);
621 void updateAcceleration() {
622 Mat3d mat3 = mMatrix.getMat3();
623 mDeterminant = mat3.
det();
627 "Tried to initialize an affine transform from a nearly singular matrix");
629 mMatrixInv = mMatrix.inverse();
634 mVoxelSize(0) = (applyMap(
Vec3d(1,0,0)) - pos).length();
635 mVoxelSize(1) = (applyMap(
Vec3d(0,1,0)) - pos).length();
636 mVoxelSize(2) = (applyMap(
Vec3d(0,0,1)) - pos).length();
647 bool mIsDiagonal, mIsIdentity;
663 mScaleValuesInverse(
Vec3d(1,1,1)),
664 mInvScaleSqr(1,1,1), mInvTwiceScale(0.5,0.5,0.5){}
675 mScaleValuesInverse = 1.0 / mScaleValues;
676 mInvScaleSqr = mScaleValuesInverse * mScaleValuesInverse;
677 mInvTwiceScale = mScaleValuesInverse / 2;
682 mScaleValues(other.mScaleValues),
683 mVoxelSize(other.mVoxelSize),
684 mScaleValuesInverse(other.mScaleValuesInverse),
685 mInvScaleSqr(other.mInvScaleSqr),
686 mInvTwiceScale(other.mInvTwiceScale)
701 static bool isRegistered() {
return MapRegistry::isRegistered(ScaleMap::mapType()); }
705 MapRegistry::registerMap(
720 std::abs(mScaleValues.x()), std::abs(mScaleValues.y()),
double(5e-7));
722 std::abs(mScaleValues.x()), std::abs(mScaleValues.z()),
double(5e-7));
730 in.
x() * mScaleValues.x(),
731 in.
y() * mScaleValues.y(),
732 in.
z() * mScaleValues.z());
738 in.
x() * mScaleValuesInverse.x(),
739 in.
y() * mScaleValuesInverse.y(),
740 in.
z() * mScaleValuesInverse.z());
750 return applyInverseJacobian(in);
771 for (
int i = 0; i < 3; i++) {
772 tmp.
setRow(i, in.
row(i) * mScaleValuesInverse(i));
774 for (
int i = 0; i < 3; i++) {
775 tmp.
setCol(i, tmp.
col(i) * mScaleValuesInverse(i));
786 return mScaleValues.x() * mScaleValues.y() * mScaleValues.z();
800 Vec3d voxelSize()
const override {
return mVoxelSize; }
808 void read(std::istream& is)
override
810 mScaleValues.read(is);
812 mScaleValuesInverse.read(is);
813 mInvScaleSqr.read(is);
814 mInvTwiceScale.read(is);
817 void write(std::ostream& os)
const override
819 mScaleValues.write(os);
820 mVoxelSize.write(os);
821 mScaleValuesInverse.write(os);
822 mInvScaleSqr.write(os);
823 mInvTwiceScale.write(os);
826 std::string
str()
const override
828 std::ostringstream buffer;
829 buffer <<
" - scale: " << mScaleValues << std::endl;
830 buffer <<
" - voxel dimensions: " << mVoxelSize << std::endl;
834 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
839 if (!mScaleValues.eq(other.mScaleValues)) {
return false; }
859 affineMap->accumPreRotation(axis, radians);
863 MapBase::Ptr preTranslate(
const Vec3d&)
const override;
864 MapBase::Ptr preScale(
const Vec3d&)
const override;
868 affineMap->accumPreShear(axis0, axis1,
shear);
880 affineMap->accumPostRotation(axis, radians);
883 MapBase::Ptr postTranslate(
const Vec3d&)
const override;
884 MapBase::Ptr postScale(
const Vec3d&)
const override;
888 affineMap->accumPostShear(axis0, axis1,
shear);
894 Vec3d mScaleValues, mVoxelSize, mScaleValuesInverse, mInvScaleSqr, mInvTwiceScale;
918 const Vec3d& invScale = getInvScale();
922 static bool isRegistered() {
return MapRegistry::isRegistered(UniformScaleMap::mapType()); }
925 MapRegistry::registerMap(
926 UniformScaleMap::mapType(),
927 UniformScaleMap::create);
933 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
953 ScaleMap::preScale(
const Vec3d& v)
const
955 const Vec3d new_scale(v * mScaleValues);
965 ScaleMap::postScale(
const Vec3d& v)
const
994 static bool isRegistered() {
return MapRegistry::isRegistered(TranslationMap::mapType()); }
998 MapRegistry::registerMap(
999 TranslationMap::mapType(),
1000 TranslationMap::create);
1024 return applyInverseJacobian(in);
1046 return applyIJC(mat);
1063 void read(std::istream& is)
override { mTranslation.read(is); }
1065 void write(std::ostream& os)
const override { mTranslation.write(os); }
1067 std::string
str()
const override
1069 std::ostringstream buffer;
1070 buffer <<
" - translation: " << mTranslation << std::endl;
1071 return buffer.str();
1074 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
1079 return mTranslation.eq(other.mTranslation);
1087 Mat4d matrix(Mat4d::identity());
1100 affineMap->accumPreRotation(axis, radians);
1114 affineMap->accumPreShear(axis0, axis1,
shear);
1125 affineMap->accumPostRotation(axis, radians);
1139 affineMap->accumPostShear(axis0, axis1,
shear);
1163 mTranslation(
Vec3d(0,0,0)),
1164 mScaleValues(
Vec3d(1,1,1)),
1165 mVoxelSize(
Vec3d(1,1,1)),
1166 mScaleValuesInverse(
Vec3d(1,1,1)),
1167 mInvScaleSqr(1,1,1),
1168 mInvTwiceScale(0.5,0.5,0.5)
1174 mTranslation(translate),
1175 mScaleValues(
scale),
1182 mScaleValuesInverse = 1.0 / mScaleValues;
1183 mInvScaleSqr = mScaleValuesInverse * mScaleValuesInverse;
1184 mInvTwiceScale = mScaleValuesInverse / 2;
1189 mTranslation(translate.getTranslation()),
1191 mVoxelSize(
std::abs(mScaleValues(0)),
1192 std::abs(mScaleValues(1)),
1193 std::abs(mScaleValues(2))),
1196 mInvScaleSqr = mScaleValuesInverse * mScaleValuesInverse;
1197 mInvTwiceScale = mScaleValuesInverse / 2;
1202 mTranslation(other.mTranslation),
1203 mScaleValues(other.mScaleValues),
1204 mVoxelSize(other.mVoxelSize),
1205 mScaleValuesInverse(other.mScaleValuesInverse),
1206 mInvScaleSqr(other.mInvScaleSqr),
1207 mInvTwiceScale(other.mInvTwiceScale)
1220 mScaleValuesInverse, -mScaleValuesInverse * mTranslation));
1223 static bool isRegistered() {
return MapRegistry::isRegistered(ScaleTranslateMap::mapType()); }
1227 MapRegistry::registerMap(
1228 ScaleTranslateMap::mapType(),
1229 ScaleTranslateMap::create);
1243 std::abs(mScaleValues.x()), std::abs(mScaleValues.y()),
double(5e-7));
1245 std::abs(mScaleValues.x()), std::abs(mScaleValues.z()),
double(5e-7));
1253 in.
x() * mScaleValues.x() + mTranslation.x(),
1254 in.
y() * mScaleValues.y() + mTranslation.y(),
1255 in.
z() * mScaleValues.z() + mTranslation.z());
1261 (in.
x() - mTranslation.x() ) * mScaleValuesInverse.x(),
1262 (in.
y() - mTranslation.y() ) * mScaleValuesInverse.y(),
1263 (in.
z() - mTranslation.z() ) * mScaleValuesInverse.z());
1291 in.
x() * mScaleValuesInverse.x(),
1292 in.
y() * mScaleValuesInverse.y(),
1293 in.
z() * mScaleValuesInverse.z());
1299 for (
int i=0; i<3; i++){
1300 tmp.
setRow(i, in.
row(i)*mScaleValuesInverse(i));
1302 for (
int i=0; i<3; i++){
1303 tmp.
setCol(i, tmp.
col(i)*mScaleValuesInverse(i));
1308 return applyIJC(in);
1315 return mScaleValues.x() * mScaleValues.y() * mScaleValues.z();
1335 void read(std::istream& is)
override
1337 mTranslation.read(is);
1338 mScaleValues.read(is);
1339 mVoxelSize.read(is);
1340 mScaleValuesInverse.read(is);
1341 mInvScaleSqr.read(is);
1342 mInvTwiceScale.read(is);
1345 void write(std::ostream& os)
const override
1347 mTranslation.write(os);
1348 mScaleValues.write(os);
1349 mVoxelSize.write(os);
1350 mScaleValuesInverse.write(os);
1351 mInvScaleSqr.write(os);
1352 mInvTwiceScale.write(os);
1355 std::string
str()
const override
1357 std::ostringstream buffer;
1358 buffer <<
" - translation: " << mTranslation << std::endl;
1359 buffer <<
" - scale: " << mScaleValues << std::endl;
1360 buffer <<
" - voxel dimensions: " << mVoxelSize << std::endl;
1361 return buffer.str();
1364 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
1369 if (!mScaleValues.eq(other.mScaleValues)) {
return false; }
1370 if (!mTranslation.eq(other.mTranslation)) {
return false; }
1380 affineMap->accumPostTranslation(mTranslation);
1390 affineMap->accumPreRotation(axis, radians);
1395 const Vec3d& s = mScaleValues;
1396 const Vec3d scaled_trans( t.
x() * s.
x(),
1407 affineMap->accumPreShear(axis0, axis1,
shear);
1418 affineMap->accumPostRotation(axis, radians);
1431 affineMap->accumPostShear(axis0, axis1,
shear);
1437 Vec3d mTranslation, mScaleValues, mVoxelSize, mScaleValuesInverse,
1438 mInvScaleSqr, mInvTwiceScale;
1443 ScaleMap::postTranslate(
const Vec3d& t)
const
1450 ScaleMap::preTranslate(
const Vec3d& t)
const
1453 const Vec3d& s = mScaleValues;
1454 const Vec3d scaled_trans( t.
x() * s.
x(),
1485 const Vec3d& scaleInv = getInvScale();
1486 const Vec3d& trans = getTranslation();
1492 return MapRegistry::isRegistered(UniformScaleTranslateMap::mapType());
1497 MapRegistry::registerMap(
1498 UniformScaleTranslateMap::mapType(), UniformScaleTranslateMap::create);
1504 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
1517 const Vec3d new_trans = this->getTranslation() +
scale * t;
1532 UniformScaleMap::postTranslate(
const Vec3d& t)
const
1540 UniformScaleMap::preTranslate(
const Vec3d& t)
const
1548 TranslationMap::preScale(
const Vec3d& v)
const
1559 TranslationMap::postScale(
const Vec3d& v)
const
1564 const Vec3d trans(mTranslation.x()*v.
x(),
1565 mTranslation.y()*v.
y(),
1566 mTranslation.z()*v.
z());
1573 ScaleTranslateMap::preScale(
const Vec3d& v)
const
1575 const Vec3d new_scale( v * mScaleValues );
1585 ScaleTranslateMap::postScale(
const Vec3d& v)
const
1587 const Vec3d new_scale( v * mScaleValues );
1588 const Vec3d new_trans( mTranslation.x()*v.
x(),
1589 mTranslation.y()*v.
y(),
1590 mTranslation.z()*v.
z() );
1637 Mat4d matrix(Mat4d::identity());
1646 "4x4 Matrix initializing unitary map was not unitary: not invertible");
1651 "4x4 Matrix initializing unitary map was not unitary: not affine");
1656 "4x4 Matrix initializing unitary map was not unitary: had translation");
1661 "4x4 Matrix initializing unitary map was not unitary");
1669 mAffineMap(other.mAffineMap)
1674 mAffineMap(*(first.getAffineMap()), *(second.getAffineMap()))
1690 static bool isRegistered() {
return MapRegistry::isRegistered(UnitaryMap::mapType()); }
1694 MapRegistry::registerMap(
1695 UnitaryMap::mapType(),
1696 UnitaryMap::create);
1710 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
1715 if (mAffineMap!=other.mAffineMap)
return false;
1732 return applyInverseJacobian(in);
1737 return mAffineMap.applyInverseJacobian(in);
1745 return applyInverseMap(in);
1757 return applyIJC(in);
1763 double determinant()
const override {
return mAffineMap.determinant(); }
1774 void read(std::istream& is)
override
1776 mAffineMap.read(is);
1780 void write(std::ostream& os)
const override
1782 mAffineMap.write(os);
1785 std::string
str()
const override
1787 std::ostringstream buffer;
1788 buffer << mAffineMap.str();
1789 return buffer.str();
1802 return StaticPtrCast<MapBase, UnitaryMap>(unitaryMap);
1809 affineMap->accumPreTranslation(t);
1817 affineMap->accumPreScale(v);
1825 affineMap->accumPreShear(axis0, axis1,
shear);
1835 return StaticPtrCast<MapBase, UnitaryMap>(unitaryMap);
1842 affineMap->accumPostTranslation(t);
1850 affineMap->accumPostScale(v);
1858 affineMap->accumPostShear(axis0, axis1,
shear);
1895 MapBase(),mBBox(bb), mTaper(taper), mDepth(depth)
1907 mBBox(bb), mTaper(taper), mDepth(depth)
1909 if (!secondMap->isLinear() ) {
1911 "The second map in the Frustum transfrom must be linear");
1913 mSecondMap = *( secondMap->getAffineMap() );
1920 mTaper(other.mTaper),
1921 mDepth(other.mDepth),
1922 mSecondMap(other.mSecondMap),
1923 mHasSimpleAffine(other.mHasSimpleAffine)
1944 const Vec3d& direction,
1947 double z_near,
double depth,
1955 "The frustum depth must be non-zero and positive");
1957 if (!(up.
length() > 0)) {
1959 "The frustum height must be non-zero and positive");
1961 if (!(aspect > 0)) {
1963 "The frustum aspect ratio must be non-zero and positive");
1967 "The frustum up orientation must be perpendicular to into-frustum direction");
1970 double near_plane_height = 2 * up.
length();
1971 double near_plane_width = aspect * near_plane_height;
1976 mDepth = depth / near_plane_width;
1977 double gamma = near_plane_width / z_near;
1978 mTaper = 1./(mDepth*gamma + 1.);
1980 Vec3d direction_unit = direction;
1983 Mat4d r1(Mat4d::identity());
1985 Mat4d r2(Mat4d::identity());
1989 Vec3d(near_plane_width, near_plane_width, near_plane_width));
2014 "inverseMap() is not implemented for NonlinearFrustumMap");
2016 static bool isRegistered() {
return MapRegistry::isRegistered(NonlinearFrustumMap::mapType()); }
2020 MapRegistry::registerMap(
2021 NonlinearFrustumMap::mapType(),
2022 NonlinearFrustumMap::create);
2043 const Vec3d e1(1,0,0);
2044 if (!applyMap(e1).eq(e1))
return false;
2046 const Vec3d e2(0,1,0);
2047 if (!applyMap(e2).eq(e2))
return false;
2049 const Vec3d e3(0,0,1);
2050 if (!applyMap(e3).eq(e3))
return false;
2055 bool isEqual(
const MapBase& other)
const override {
return isEqualBase(*
this, other); }
2059 if (mBBox!=other.mBBox)
return false;
2066 if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e)))
return false;
2069 if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e)))
return false;
2072 if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e)))
return false;
2075 if (!mSecondMap.applyMap(e).eq(other.mSecondMap.
applyMap(e)))
return false;
2084 return mSecondMap.applyMap(applyFrustumMap(in));
2090 return applyFrustumInverseMap(mSecondMap.applyInverseMap(in));
2099 Vec3d centered(isloc);
2100 centered = centered - mBBox.min();
2101 centered.
x() -= mXo;
2102 centered.
y() -= mYo;
2105 const double zprime = centered.
z()*mDepthOnLz;
2107 const double scale = (mGamma * zprime + 1.) / mLx;
2108 const double scale2 = mGamma * mDepthOnLz / mLx;
2110 const Vec3d tmp(
scale * in.
x() + scale2 * centered.
x()* in.
z(),
2111 scale * in.
y() + scale2 * centered.
y()* in.
z(),
2112 mDepthOnLz * in.
z());
2114 return mSecondMap.applyJacobian(tmp);
2121 return mSecondMap.applyInverseJacobian(in);
2128 Vec3d centered(isloc);
2129 centered = centered - mBBox.min();
2130 centered.
x() -= mXo;
2131 centered.
y() -= mYo;
2134 const double zprime = centered.
z()*mDepthOnLz;
2136 const double scale = (mGamma * zprime + 1.) / mLx;
2137 const double scale2 = mGamma * mDepthOnLz / mLx;
2140 Vec3d out = mSecondMap.applyInverseJacobian(in);
2142 out.
x() = (out.
x() - scale2 * centered.
x() * out.
z() / mDepthOnLz) /
scale;
2143 out.
y() = (out.
y() - scale2 * centered.
y() * out.
z() / mDepthOnLz) /
scale;
2144 out.
z() = out.
z() / mDepthOnLz;
2152 const Vec3d tmp = mSecondMap.applyJT(in);
2155 Vec3d centered(isloc);
2156 centered = centered - mBBox.min();
2157 centered.
x() -= mXo;
2158 centered.
y() -= mYo;
2161 const double zprime = centered.
z()*mDepthOnLz;
2163 const double scale = (mGamma * zprime + 1.) / mLx;
2164 const double scale2 = mGamma * mDepthOnLz / mLx;
2168 scale2 * centered.
x()* tmp.
x() +
2169 scale2 * centered.
y()* tmp.
y() +
2170 mDepthOnLz * tmp.
z());
2174 return mSecondMap.applyJT(in);
2190 const Vec3d loc = applyFrustumMap(ijk);
2191 const double s = mGamma * loc.
z() + 1.;
2196 " at the singular focal point (e.g. camera)");
2199 const double sinv = 1.0/s;
2200 const double pt0 = mLx * sinv;
2201 const double pt1 = mGamma * pt0;
2202 const double pt2 = pt1 * sinv;
2204 const Mat3d& jacinv = mSecondMap.getConstJacobianInv();
2207 Mat3d gradE(Mat3d::zero());
2208 for (
int j = 0; j < 3; ++j ) {
2209 gradE(0,j) = pt0 * jacinv(0,j) - pt2 * loc.
x()*jacinv(2,j);
2210 gradE(1,j) = pt0 * jacinv(1,j) - pt2 * loc.
y()*jacinv(2,j);
2211 gradE(2,j) = (1./mDepthOnLz) * jacinv(2,j);
2215 for (
int i = 0; i < 3; ++i) {
2216 result(i) = d1_is(0) * gradE(0,i) + d1_is(1) * gradE(1,i) + d1_is(2) * gradE(2,i);
2231 const Vec3d loc = applyFrustumMap(ijk);
2233 const double s = mGamma * loc.
z() + 1.;
2238 " at the singular focal point (e.g. camera)");
2242 const double sinv = 1.0/s;
2243 const double pt0 = mLx * sinv;
2244 const double pt1 = mGamma * pt0;
2245 const double pt2 = pt1 * sinv;
2246 const double pt3 = pt2 * sinv;
2248 const Mat3d& jacinv = mSecondMap.getConstJacobianInv();
2252 Mat3d matE0(Mat3d::zero());
2253 Mat3d matE1(Mat3d::zero());
2254 for(
int j = 0; j < 3; j++) {
2255 for (
int k = 0; k < 3; k++) {
2257 const double pt4 = 2. * jacinv(2,j) * jacinv(2,k) * pt3;
2259 matE0(j,k) = -(jacinv(0,j) * jacinv(2,k) + jacinv(2,j) * jacinv(0,k)) * pt2 +
2262 matE1(j,k) = -(jacinv(1,j) * jacinv(2,k) + jacinv(2,j) * jacinv(1,k)) * pt2 +
2268 Mat3d gradE(Mat3d::zero());
2269 for (
int j = 0; j < 3; ++j ) {
2270 gradE(0,j) = pt0 * jacinv(0,j) - pt2 * loc.
x()*jacinv(2,j);
2271 gradE(1,j) = pt0 * jacinv(1,j) - pt2 * loc.
y()*jacinv(2,j);
2272 gradE(2,j) = (1./mDepthOnLz) * jacinv(2,j);
2275 Mat3d result(Mat3d::zero());
2278 for (
int m = 0; m < 3; ++m ) {
2279 for (
int n = 0; n < 3; ++n) {
2280 for (
int i = 0; i < 3; ++i ) {
2281 for (
int j = 0; j < 3; ++j) {
2282 result(m, n) += gradE(j, m) * gradE(i, n) * d2_is(i, j);
2288 for (
int m = 0; m < 3; ++m ) {
2289 for (
int n = 0; n < 3; ++n) {
2291 matE0(m, n) * d1_is(0) + matE1(m, n) * d1_is(1);
2299 double determinant()
const override {
return mSecondMap.determinant();}
2305 double s = mGamma * loc.
z() + 1.0;
2306 double frustum_determinant = s * s * mDepthOnLzLxLx;
2307 return mSecondMap.determinant() * frustum_determinant;
2313 const Vec3d loc( 0.5*(mBBox.min().x() + mBBox.max().x()),
2314 0.5*(mBBox.min().y() + mBBox.max().y()),
2317 return voxelSize(loc);
2327 Vec3d out, pos = applyMap(loc);
2328 out(0) = (applyMap(loc +
Vec3d(1,0,0)) - pos).length();
2329 out(1) = (applyMap(loc +
Vec3d(0,1,0)) - pos).length();
2330 out(2) = (applyMap(loc +
Vec3d(0,0,1)) - pos).length();
2360 void read(std::istream& is)
override
2371 is.read(
reinterpret_cast<char*
>(&mTaper),
sizeof(
double));
2372 is.read(
reinterpret_cast<char*
>(&mDepth),
sizeof(
double));
2378 if(!MapRegistry::isRegistered(type)) {
2383 MapBase::Ptr proxy = math::MapRegistry::createMap(type);
2385 mSecondMap = *(proxy->getAffineMap());
2390 void write(std::ostream& os)
const override
2393 os.write(
reinterpret_cast<const char*
>(&mTaper),
sizeof(
double));
2394 os.write(
reinterpret_cast<const char*
>(&mDepth),
sizeof(
double));
2397 mSecondMap.write(os);
2401 std::string
str()
const override
2403 std::ostringstream buffer;
2404 buffer <<
" - taper: " << mTaper << std::endl;
2405 buffer <<
" - depth: " << mDepth << std::endl;
2406 buffer <<
" SecondMap: "<< mSecondMap.type() << std::endl;
2407 buffer << mSecondMap.str() << std::endl;
2408 return buffer.str();
2437 mBBox, mTaper, mDepth, mSecondMap.preShear(
shear, axis0, axis1)));
2466 mBBox, mTaper, mDepth, mSecondMap.postShear(
shear, axis0, axis1)));
2473 mLx = mBBox.extents().x();
2474 mLy = mBBox.extents().y();
2475 mLz = mBBox.extents().z();
2479 " must have at least two index points in each direction.");
2486 mGamma = (1./mTaper - 1) / mDepth;
2488 mDepthOnLz = mDepth/mLz;
2489 mDepthOnLzLxLx = mDepthOnLz/(mLx * mLx);
2492 mHasSimpleAffine =
true;
2493 Vec3d tmp = mSecondMap.voxelSize();
2496 if (!
isApproxEqual(tmp(0), tmp(1))) { mHasSimpleAffine =
false;
return; }
2497 if (!
isApproxEqual(tmp(0), tmp(2))) { mHasSimpleAffine =
false;
return; }
2499 Vec3d trans = mSecondMap.applyMap(
Vec3d(0,0,0));
2501 Vec3d tmp1 = mSecondMap.applyMap(
Vec3d(1,0,0)) - trans;
2502 Vec3d tmp2 = mSecondMap.applyMap(
Vec3d(0,1,0)) - trans;
2503 Vec3d tmp3 = mSecondMap.applyMap(
Vec3d(0,0,1)) - trans;
2506 if (!
isApproxEqual(tmp1.dot(tmp2), 0., 1.e-7)) { mHasSimpleAffine =
false;
return; }
2507 if (!
isApproxEqual(tmp2.dot(tmp3), 0., 1.e-7)) { mHasSimpleAffine =
false;
return; }
2508 if (!
isApproxEqual(tmp3.dot(tmp1), 0., 1.e-7)) { mHasSimpleAffine =
false;
return; }
2517 out = out - mBBox.min();
2522 out.z() *= mDepthOnLz;
2524 double scale = (mGamma * out.z() + 1.)/ mLx;
2533 Vec3d applyFrustumInverseMap(
const Vec3d& in)
const
2537 double invScale = mLx / (mGamma * out.z() + 1.);
2538 out.x() *= invScale;
2539 out.y() *= invScale;
2544 out.z() /= mDepthOnLz;
2547 out = out + mBBox.min();
2559 AffineMap mSecondMap;
2562 double mLx, mLy, mLz;
2563 double mXo, mYo, mGamma, mDepthOnLz, mDepthOnLzLxLx;
2566 bool mHasSimpleAffine;
2576 template<
typename FirstMapType,
typename SecondMapType>
2588 CompoundMap(
const FirstMapType& f,
const SecondMapType& s): mFirstMap(f), mSecondMap(s)
2590 updateAffineMatrix();
2594 mFirstMap(other.mFirstMap),
2595 mSecondMap(other.mSecondMap),
2596 mAffineMap(other.mAffineMap)
2602 return (FirstMapType::mapType() +
Name(
":") + SecondMapType::mapType());
2607 if (mFirstMap != other.mFirstMap)
return false;
2608 if (mSecondMap != other.mSecondMap)
return false;
2609 if (mAffineMap != other.mAffineMap)
return false;
2617 mFirstMap = other.mFirstMap;
2618 mSecondMap = other.mSecondMap;
2619 mAffineMap = other.mAffineMap;
2626 return mAffineMap.isIdentity();
2628 return mFirstMap.isIdentity()&&mSecondMap.isIdentity();
2634 return mAffineMap.isDiagonal();
2636 return mFirstMap.isDiagonal()&&mSecondMap.isDiagonal();
2647 "Constant affine matrix representation not possible for this nonlinear map");
2652 const FirstMapType&
firstMap()
const {
return mFirstMap; }
2653 const SecondMapType&
secondMap()
const {
return mSecondMap; }
2655 void setFirstMap(
const FirstMapType& first) { mFirstMap = first; updateAffineMatrix(); }
2656 void setSecondMap(
const SecondMapType& second) { mSecondMap = second; updateAffineMatrix(); }
2660 mAffineMap.read(is);
2662 mSecondMap.read(is);
2666 mAffineMap.write(os);
2667 mFirstMap.write(os);
2668 mSecondMap.write(os);
2672 void updateAffineMatrix()
2678 mAffineMap =
AffineMap(*first, *second);
2682 FirstMapType mFirstMap;
2683 SecondMapType mSecondMap;
2685 AffineMap mAffineMap;
2692 #endif // OPENVDB_MATH_MAPS_HAS_BEEN_INCLUDED
double getDepth() const
Return the unscaled frustm depth.
Definition: Maps.h:2343
ScaleMap(const Vec3d &scale)
Definition: Maps.h:666
static Name mapType()
Return NonlinearFrustumMap.
Definition: Maps.h:2027
void accumPostShear(Axis axis0, Axis axis1, double shear)
Definition: Maps.h:522
static void registerMap()
Definition: Maps.h:703
bool hasTranslation(const Mat4< T > &m)
Definition: Mat4.h:1328
AffineMap::Ptr getAffineMap() const override
Return AffineMap::Ptr to an AffineMap equivalent to *this.
Definition: Maps.h:1377
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:2124
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const override
Definition: Maps.h:1756
T & x()
Reference to the component, e.g. v.x() = 4.5f;.
Definition: Vec3.h:83
Mat4d getMat4() const
Return the matrix representation of this AffineMap.
Definition: Maps.h:616
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:1332
Name type() const override
Return the name of this map's concrete type (e.g., "AffineMap").
Definition: Maps.h:1003
OPENVDB_API SharedPtr< SymmetricMap > createSymmetricMap(const Mat3d &m)
Utility methods.
SharedPtr< const MyType > ConstPtr
Definition: Maps.h:2583
Mat3d applyIJC(const Mat3d &m) const override
Return the Jacobian Curvature: zero for a linear map.
Definition: Maps.h:450
std::string str() const override
string serialization, useful for debuging
Definition: Maps.h:1785
bool isIdentity(const MatType &m)
Determine if a matrix is an identity matrix.
Definition: Mat.h:865
AffineMap::Ptr getAffineMap() const
Definition: Maps.h:2640
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:1042
std::string str() const override
string serialization, useful for debuging
Definition: Maps.h:826
void setTaper(double t)
set the taper value, the ratio of nearplane width / far plane width
Definition: Maps.h:2337
bool isEqual(const MapBase &other) const override
Return true if this map is equal to the given map.
Definition: Maps.h:1364
static bool isRegistered()
Definition: Maps.h:361
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:793
bool isIdentity() const
Definition: Maps.h:2623
UnitaryMap(const UnitaryMap &first, const UnitaryMap &second)
Definition: Maps.h:1673
Vec3d applyMap(const Vec3d &in) const override
Return the image of in under the map.
Definition: Maps.h:1721
Vec3d applyJT(const Vec3d &in, const Vec3d &) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:1280
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:1155
bool operator!=(const NonlinearFrustumMap &other) const
Definition: Maps.h:2079
bool hasUniformScale() const override
Return true if the values have the same magitude (eg. -1, 1, -1 would be a rotation).
Definition: Maps.h:717
Vec3d voxelSize(const Vec3d &) const override
Definition: Maps.h:804
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:425
static Name mapType()
Definition: Maps.h:1233
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:430
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:1847
Ptr(*)() MapFactory
Definition: Maps.h:139
MapBase::Ptr inverseMap() const override
Return a new map representing the inverse of this map.
Definition: Maps.h:1685
void write(std::ostream &os) const override
write serialization
Definition: Maps.h:1065
UnitaryMap(Axis axis, double radians)
Definition: Maps.h:1623
bool isValid() const
Definition: Maps.h:2354
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:1731
AffineMap::Ptr getAffineMap() const override
Return AffineMap::Ptr to an AffineMap equivalent to *this.
Definition: Maps.h:1085
bool isApproxEqual(const Type &a, const Type &b)
Return true if a is equal to b to within the default floating-point comparison tolerance.
Definition: Math.h:351
T det() const
Determinant of matrix.
Definition: Mat3.h:500
Vec3d applyJT(const Vec3d &in) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:1035
UnitaryMap()
default constructor makes an Idenity.
Definition: Maps.h:1612
bool isDiagonal() const
Definition: Maps.h:2632
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const override
Definition: Maps.h:1307
double determinant() const override
Return the product of the scale values.
Definition: Maps.h:785
UnitaryMap(const Mat4d &m)
Definition: Maps.h:1642
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:638
Mat4< double > Mat4d
Definition: Mat4.h:1334
bool isScaleTranslate() const
Return true if the map is equivalent to a ScaleTranslateMap.
Definition: Maps.h:475
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:2456
static void registerMap()
Definition: Maps.h:1692
const Vec3d & getTranslation() const
Returns the translation.
Definition: Maps.h:1325
AffineMap::Ptr getAffineMap() const override
Return AffineMap::Ptr to an AffineMap equivalent to *this.
Definition: Maps.h:1792
float Round(float x)
Return x rounded to the nearest integer.
Definition: Math.h:766
ScaleMap(const ScaleMap &other)
Definition: Maps.h:680
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:2434
Vec3d voxelSize() const override
Return the size of a voxel at the center of the near plane.
Definition: Maps.h:2311
void read(std::istream &is)
Definition: Maps.h:2658
static bool isRegistered()
Definition: Maps.h:701
Vec3< T > col(int j) const
Get jth column, e.g. Vec3d v = m.col(0);.
Definition: Mat3.h:175
Vec3d applyJT(const Vec3d &in) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:1282
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const override
Definition: Maps.h:453
TranslationMap(const Vec3d &t)
Definition: Maps.h:980
OPENVDB_API SharedPtr< FullyDecomposedMap > createFullyDecomposedMap(const Mat4d &m)
General decomposition of a Matrix into a Unitary (e.g. rotation) following a Symmetric (e....
Vec3d applyIJT(const Vec3d &d1_is, const Vec3d &ijk) const override
Definition: Maps.h:2188
Int32 ValueType
Definition: Coord.h:33
SharedPtr< MapBase > Ptr
Definition: Maps.h:137
bool isLinear() const override
Return true (a UnitaryMap is always linear).
Definition: Maps.h:1705
Mat3< double > Mat3d
Definition: Mat3.h:816
Vec3d applyJacobian(const Vec3d &in) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:421
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:1136
std::string str() const override
string serialization, useful for debugging
Definition: Maps.h:535
Vec3d voxelSize() const override
Return (1,1,1).
Definition: Maps.h:1055
OPENVDB_API SharedPtr< MapBase > simplify(SharedPtr< AffineMap > affine)
reduces an AffineMap to a ScaleMap or a ScaleTranslateMap when it can
AffineMap(const Mat4d &m)
Definition: Maps.h:324
bool operator!=(const MyType &other) const
Definition: Maps.h:2613
MapBase::Ptr postTranslate(const Vec3d &t) const override
Definition: Maps.h:1129
Mat3d applyIJC(const Mat3d &in, const Vec3d &, const Vec3d &) const override
Definition: Maps.h:779
MapBase::Ptr copy() const override
Return a MapBase::Ptr to a deep copy of this map.
Definition: Maps.h:695
CompoundMap()
Definition: Maps.h:2586
double determinant() const override
Return the determinant of the Jacobian.
Definition: Maps.h:459
Vec3d applyJT(const Vec3d &in) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:760
Vec3d applyJacobian(const Vec3d &in) const override
Return the Jacobian of the linear second map applied to in.
Definition: Maps.h:2093
AffineMap(const Mat3d &m)
Definition: Maps.h:316
double determinant() const override
Return 1.
Definition: Maps.h:1052
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const override
Definition: Maps.h:1725
ScaleTranslateMap(const ScaleTranslateMap &other)
Definition: Maps.h:1200
void setDepth(double d)
set the frustum depth: distance between near and far plane = frustm depth * frustm x-width
Definition: Maps.h:2341
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:2151
bool hasUniformScale() const override
Return true if the scale values have the same magnitude (eg. -1, 1, -1 would be a rotation).
Definition: Maps.h:1240
Abstract base class for maps.
Definition: Maps.h:134
Mat3d applyIJC(const Mat3d &in) const override
Return the Jacobian Curvature: zero for a linear map.
Definition: Maps.h:768
void accumPostTranslation(const Vec3d &v)
Definition: Maps.h:517
Definition: Exceptions.h:61
static Name mapType()
Definition: Maps.h:2600
ScaleTranslateMap()
Definition: Maps.h:1161
static MapBase::Ptr create()
Return a MapBase::Ptr to a new TranslationMap.
Definition: Maps.h:986
CompoundMap< CompoundMap< UnitaryMap, ScaleMap >, UnitaryMap > SpectralDecomposedMap
Definition: Maps.h:45
@ X_AXIS
Definition: Math.h:850
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:1028
const Vec3d & getInvScale() const
Return 1/(scale)
Definition: Maps.h:797
Vec3d applyJacobian(const Vec3d &in) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:745
OPENVDB_API Mat4d approxInverse(const Mat4d &mat)
Returns the left pseudoInverse of the input matrix when the 3x3 part is symmetric otherwise it zeros ...
const SecondMapType & secondMap() const
Definition: Maps.h:2653
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:2413
bool isDiagonal(const MatType &mat)
Determine if a matrix is diagonal.
Definition: Mat.h:907
double determinant() const override
Return the determinant of the Jacobian of linear second map.
Definition: Maps.h:2299
MapBase::Ptr preTranslate(const Vec3d &t) const override
Definition: Maps.h:1104
Map traits.
Definition: Maps.h:55
OPENVDB_API SharedPtr< PolarDecomposedMap > createPolarDecomposedMap(const Mat3d &m)
Decomposes a general linear into translation following polar decomposition.
Vec3d voxelSize(const Vec3d &loc) const override
Returns the lengths of the images of the three segments from loc to loc + (1,0,0),...
Definition: Maps.h:2325
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:1814
bool operator==(const ScaleMap &other) const
Definition: Maps.h:836
double determinant(const Vec3d &) const override
Return 1.
Definition: Maps.h:1050
Name type() const override
Return the name of this map's concrete type (e.g., "AffineMap").
Definition: Maps.h:710
Vec3d applyJT(const Vec3d &in) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:1744
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:607
Vec3< T > row(int i) const
Get ith row, e.g. Vec3d v = m.row(1);.
Definition: Mat3.h:159
bool operator!=(const TranslationMap &other) const
Definition: Maps.h:1082
void accumPreTranslation(const Vec3d &v)
Definition: Maps.h:492
bool isIdentity() const
Return true if the map is equivalent to an identity.
Definition: Maps.h:2036
NonlinearFrustumMap()
Definition: Maps.h:1882
bool isLinear() const override
Return true (a ScaleTranslateMap is always linear).
Definition: Maps.h:1236
Mat3d applyIJC(const Mat3d &mat) const override
Return the Jacobian Curvature: zero for a linear map.
Definition: Maps.h:1044
Mat3 transpose() const
returns transpose of this
Definition: Mat3.h:475
Mat3d applyIJC(const Mat3d &in) const override
Return the Jacobian Curvature: zero for a linear map.
Definition: Maps.h:1755
void read(std::istream &is) override
read serialization
Definition: Maps.h:2360
SharedPtr< FullyDecomposedMap > createDecomposedMap()
on-demand decomposition of the affine map
Definition: Maps.h:544
AffineMap(const AffineMap &other)
Definition: Maps.h:333
Definition: Exceptions.h:59
std::string str() const override
string serialization, useful for debuging
Definition: Maps.h:1355
Vec4< T0 > transform(const Vec4< T0 > &v) const
Transform a Vec4 by post-multiplication.
Definition: Mat4.h:1017
Axis
Definition: Math.h:849
std::shared_ptr< T > SharedPtr
Definition: Types.h:91
Vec3d voxelSize() const override
Return the absolute values of the scale values.
Definition: Maps.h:1318
static void registerMap()
Definition: Maps.h:2018
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:2178
const Mat4d & getConstMat4() const
Definition: Maps.h:617
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:1267
Vec3d applyIJT(const Vec3d &in) const override
Return the transpose of the inverse Jacobian of the map applied to in.
Definition: Maps.h:1753
Vec3d applyJT(const Vec3d &in, const Vec3d &) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:1742
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:1017
Mat3d applyIJC(const Mat3d &mat, const Vec3d &, const Vec3d &) const override
Definition: Maps.h:1045
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:795
static MapBase::Ptr create()
Return a MapBase::Ptr to a new UnitaryMap.
Definition: Maps.h:1681
static Name mapType()
Return UnitaryMap.
Definition: Maps.h:1702
MapBase::Ptr postTranslate(const Vec3d &t) const override
Definition: Maps.h:1421
T & y()
Definition: Vec3.h:84
AffineMap::Ptr getAffineMap() const override
Return a AffineMap equivalent to this map.
Definition: Maps.h:846
MapBase::Ptr preScale(const Vec3d &s) const override
Definition: Maps.h:571
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:248
Vec3< double > Vec3d
Definition: Vec3.h:662
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:1751
Vec3d applyJT(const Vec3d &in, const Vec3d &) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:758
double determinant(const Vec3d &loc) const override
Definition: Maps.h:2303
bool operator==(const TranslationMap &other) const
Definition: Maps.h:1076
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:2420
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:2011
AffineMap::Ptr getAffineMap() const override
Return AffineMap::Ptr to a deep copy of the current AffineMap.
Definition: Maps.h:550
void accumPreScale(const Vec3d &v)
Definition: Maps.h:487
bool operator!=(const UnitaryMap &other) const
Definition: Maps.h:1719
A specialized linear transform that performs a translation.
Definition: Maps.h:972
Vec3d applyMap(const Vec3d &in) const override
Return the image of in under the map.
Definition: Maps.h:414
MapBase::Ptr postTranslate(const Vec3d &t) const override
Definition: Maps.h:595
Vec3d applyMap(const Vec3d &in) const override
Return the image of in under the map.
Definition: Maps.h:727
double determinant(const Vec3d &) const override
Return the determinant of the Jacobian, ignores argument.
Definition: Maps.h:1761
bool isInvertible(const MatType &m)
Determine if a matrix is invertible.
Definition: Mat.h:874
static void registerMap()
Definition: Maps.h:1225
Vec3d voxelSize() const override
Returns the lengths of the images of the segments (0,0,0) − (1,0,0), (0,0,0) − (0,...
Definition: Maps.h:1769
const BBoxd & getBBox() const
Return the bounding box that defines the frustum in pre-image space.
Definition: Maps.h:2348
Name type() const override
Return the name of this map's concrete type (e.g., "AffineMap").
Definition: Maps.h:1232
4x4 -matrix class.
Definition: Mat3.h:22
bool hasUniformScale() const override
Return false (by convention false)
Definition: Maps.h:2033
void accumPreShear(Axis axis0, Axis axis1, double shear)
Definition: Maps.h:497
Tolerance for floating-point comparison.
Definition: Math.h:90
void read(std::istream &is) override
read serialization
Definition: Maps.h:1063
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:1894
const Vec3d & getInvTwiceScale() const
Return 1/(2 scale). Used to optimize some finite difference calculations.
Definition: Maps.h:1330
Vec3d applyJT(const Vec3d &in) const override
Return the Jacobian Transpose of the second map applied to in.
Definition: Maps.h:2173
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:1855
bool operator!=(const ScaleTranslateMap &other) const
Definition: Maps.h:1374
Mat3d applyIJC(const Mat3d &in) const override
Return the Jacobian Curvature for the linear second map.
Definition: Maps.h:2224
double getTaper() const
Return the taper value.
Definition: Maps.h:2339
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
bool isDiagonal() const
Return true if the underylying matrix is diagonal.
Definition: Maps.h:471
double determinant() const override
Return the determinant of the Jacobian.
Definition: Maps.h:1763
MapBase::Ptr preTranslate(const Vec3d &t) const override
Definition: Maps.h:1393
SharedPtr< const MapBase > ConstPtr
Definition: Maps.h:138
void read(std::istream &is)
Unserialize this bounding box from the given stream.
Definition: Coord.h:496
MapBase::Ptr inverseMap() const override
Return a new map representing the inverse of this map.
Definition: Maps.h:359
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:749
T & z()
Definition: Vec3.h:85
Vec3d applyIJT(const Vec3d &in) const override
Return the transpose of the inverse Jacobian of the map applied to in.
Definition: Maps.h:1288
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:1822
static MapBase::Ptr create()
Return a MapBase::Ptr to a new AffineMap.
Definition: Maps.h:355
static bool isRegistered()
Definition: Maps.h:994
bool operator==(const UnitaryMap &other) const
Definition: Maps.h:1712
Vec3d voxelSize(const Vec3d &) const override
Return the absolute values of the scale values, ignores argument.
Definition: Maps.h:1320
bool isEqual(const MapBase &other) const override
Return true if this map is equal to the given map.
Definition: Maps.h:389
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:656
Vec3d applyJT(const Vec3d &in) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:438
bool operator==(const MyType &other) const
Definition: Maps.h:2605
void setSecondMap(const SecondMapType &second)
Definition: Maps.h:2656
Vec3d voxelSize(const Vec3d &) const override
Return (1,1,1).
Definition: Maps.h:1057
T * asPointer()
Definition: Vec3.h:92
void accumPostScale(const Vec3d &v)
Definition: Maps.h:512
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:2449
Vec3d asVec3d() const
Definition: Coord.h:144
void read(std::istream &is) override
read serialization
Definition: Maps.h:531
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:2427
A specialized linear transform that performs a unitary maping i.e. rotation and or reflection.
Definition: Maps.h:1605
Vec3d applyInverseMap(const Vec3d &in) const override
Return the pre-image of in under the map.
Definition: Maps.h:735
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:693
void setToRotation(const Quat< T > &q)
Set this matrix to the rotation matrix specified by the quaternion.
Definition: Mat3.h:274
Vec3d applyInverseMap(const Vec3d &in) const override
Return the pre-image of in under the map.
Definition: Maps.h:1015
MapBase::Ptr preTranslate(const Vec3d &t) const override
Definition: Maps.h:565
const Vec3d & getScale() const
Return the scale values that define the map.
Definition: Maps.h:790
ScaleMap()
Definition: Maps.h:662
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:754
bool operator==(const AffineMap &other) const
Definition: Maps.h:391
void write(std::ostream &os) const
Definition: Maps.h:2664
const Mat3d & getConstJacobianInv() const
Definition: Maps.h:618
A general linear transform using homogeneous coordinates to perform rotation, scaling,...
Definition: Maps.h:298
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:1039
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:1276
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:865
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:1905
Creates the composition of two maps, each of which could be a composition. In the case that each comp...
Definition: Maps.h:42
static bool isRegistered()
Definition: Maps.h:2016
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:1876
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
Definition: Vec3.h:471
bool isEqual(const MapBase &other) const override
Return true if this map is equal to the given map.
Definition: Maps.h:1710
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:1806
double determinant(const Vec3d &) const override
Return the product of the scale values, ignores argument.
Definition: Maps.h:783
Vec3d applyJacobian(const Vec3d &in, const Vec3d &isloc) const override
Return the Jacobian defined at isloc applied to in.
Definition: Maps.h:2095
const Coord & max() const
Definition: Coord.h:322
Vec3d applyInverseMap(const Vec3d &in) const override
Return the pre-image of in under the map.
Definition: Maps.h:2088
bool isLinear() const override
Return true (an AffineMap is always linear).
Definition: Maps.h:374
static Name mapType()
Definition: Maps.h:1004
static MapBase::Ptr create()
Return a MapBase::Ptr to a new ScaleMap.
Definition: Maps.h:693
static Name mapType()
Definition: Maps.h:371
Mat3< T > getMat3() const
Definition: Mat4.h:316
bool isLinear() const override
Return false (a NonlinearFrustumMap is never linear).
Definition: Maps.h:2030
const Coord & min() const
Definition: Coord.h:321
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:1273
void writeString(std::ostream &os, const Name &name)
Definition: Name.h:31
void write(std::ostream &os) const override
write serialization
Definition: Maps.h:1780
Vec3d applyIJT(const Vec3d &in) const override
Return the transpose of the inverse Jacobian of the map applied to in.
Definition: Maps.h:448
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:1111
static void registerMap()
Definition: Maps.h:363
bool hasUniformScale() const override
Return false ( test if this is unitary with translation )
Definition: Maps.h:377
bool isEqual(const MapBase &other) const override
Return true if this map is equal to the given map.
Definition: Maps.h:834
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:1943
UnitaryMap(const Mat3d &m)
Definition: Maps.h:1630
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:1831
SharedPtr< UnitaryMap > Ptr
Definition: Maps.h:1608
AffineMap & operator=(const AffineMap &other)
Definition: Maps.h:401
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:1736
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:154
static MapBase::Ptr create()
Return a MapBase::Ptr to a new NonlinearFrustumMap.
Definition: Maps.h:2004
static bool isEqualBase(const MapT &self, const MapBase &other)
Definition: Maps.h:250
void read(std::istream &is) override
read serialization
Definition: Maps.h:808
Vec3d applyJacobian(const Vec3d &in) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:1019
MapBase::Ptr copy() const override
Returns a MapBase::Ptr to a deep copy of *this.
Definition: Maps.h:1683
Vec3d applyJacobian(const Vec3d &in) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:1269
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:419
void setCol(int j, const Vec3< T > &v)
Set jth column to vector v.
Definition: Mat3.h:166
static MapBase::Ptr create()
Return a MapBase::Ptr to a new ScaleTranslateMap.
Definition: Maps.h:1213
bool hasSimpleAffine() const
Return true if the second map is a uniform scale, Rotation and translation.
Definition: Maps.h:2357
void setToRotation(Axis axis, T angle)
Sets the matrix to a rotation about the given axis.
Definition: Mat4.h:802
void read(std::istream &is) override
read serialization
Definition: Maps.h:1335
void write(std::ostream &os) const override
write serialization
Definition: Maps.h:2390
bool isUnitary(const MatType &m)
Determine if a matrix is unitary (i.e., rotation or reflection).
Definition: Mat.h:894
SharedPtr< MyType > Ptr
Definition: Maps.h:2582
bool operator==(const ScaleTranslateMap &other) const
Definition: Maps.h:1366
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:1798
Mat3 inverse(T tolerance=0) const
Definition: Mat3.h:486
AffineMap::Ptr getAffineMap() const override
Definition: Maps.h:2334
T length() const
Length of the vector.
Definition: Vec3.h:198
Vec3d applyJacobian(const Vec3d &in, const Vec3d &) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:743
void write(std::ostream &os) const override
write serialization
Definition: Maps.h:1345
Mat3d applyIJC(const Mat3d &d2_is, const Vec3d &d1_is, const Vec3d &ijk) const override
Definition: Maps.h:2229
math::BBox< Vec3d > BBoxd
Definition: Types.h:61
bool isEqual(const MapBase &other) const override
Return true if this map is equal to the given map.
Definition: Maps.h:2055
MapBase::Ptr copy() const override
Return a MapBase::Ptr to a deep copy of this map.
Definition: Maps.h:2006
const Vec3d & getScale() const
Returns the scale values.
Definition: Maps.h:1323
TranslationMap(const TranslationMap &other)
Definition: Maps.h:981
OPENVDB_API uint32_t getFormatVersion(std::ios_base &)
Return the file format version number associated with the given input stream.
Name type() const override
Return UnitaryMap.
Definition: Maps.h:1700
Vec3d applyJT(const Vec3d &in, const Vec3d &) const override
Return the Jacobian Transpose of the map applied to in.
Definition: Maps.h:1033
const Vec3d & getInvScaleSqr() const
Return the square of the scale. Used to optimize some finite difference calculations.
Definition: Maps.h:1328
bool operator!=(const ScaleMap &other) const
Definition: Maps.h:843
Vec3d voxelSize(const Vec3d &) const override
Definition: Maps.h:465
double getGamma() const
Definition: Maps.h:2345
CompoundMap(const MyType &other)
Definition: Maps.h:2593
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:764
MyType & operator=(const MyType &other)
Definition: Maps.h:2615
MapBase::Ptr inverseMap() const override
Return a new map representing the inverse of this map.
Definition: Maps.h:697
bool hasUniformScale() const override
Return false (by convention true)
Definition: Maps.h:1708
std::string str() const override
string serialization, useful for debuging
Definition: Maps.h:2401
UnitaryMap(const UnitaryMap &other)
Definition: Maps.h:1667
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:2120
double determinant() const override
Return the product of the scale values.
Definition: Maps.h:1314
CompoundMap(const FirstMapType &f, const SecondMapType &s)
Definition: Maps.h:2588
UnitaryMap(const Vec3d &axis, double radians)
Definition: Maps.h:1616
MapBase::Ptr copy() const override
Return a MapBase::Ptr to a deep copy of this map.
Definition: Maps.h:1215
void setMat3(const Mat3< T > &m)
Set upper left to a Mat3.
Definition: Mat4.h:309
MapBase::Ptr postScale(const Vec3d &s) const override
Definition: Maps.h:601
bool hasUniformScale() const override
Return false (by convention true)
Definition: Maps.h:1010
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:1404
std::string Name
Definition: Name.h:17
Vec3d applyMap(const Vec3d &in) const override
Return the image of under the map.
Definition: Maps.h:1250
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,...
Definition: Maps.h:1770
NonlinearFrustumMap(const NonlinearFrustumMap &other)
Definition: Maps.h:1917
void write(std::ostream &os) const override
write serialization
Definition: Maps.h:817
static bool isRegistered()
Definition: Maps.h:1690
#define OPENVDB_VERSION_NAME
Definition: version.h:108
Name type() const override
Return the name of this map's concrete type (e.g., "AffineMap").
Definition: Maps.h:370
MapBase()
Definition: Maps.h:247
void setFirstMap(const FirstMapType &first)
Definition: Maps.h:2655
const FirstMapType & firstMap() const
Definition: Maps.h:2652
MatType scale(const Vec3< typename MatType::value_type > &s)
Return a matrix that scales by s.
Definition: Mat.h:620
ScaleTranslateMap(const ScaleMap &scale, const TranslationMap &translate)
Definition: Maps.h:1187
const AffineMap & secondMap() const
Return MapBase::Ptr& to the second map.
Definition: Maps.h:2351
bool isIdentity() const
Return true if the underlying matrix is approximately an identity.
Definition: Maps.h:469
AffineMap()
Definition: Maps.h:304
bool isLinear() const override
Return true (a ScaleMap is always linear).
Definition: Maps.h:714
Mat3d applyIJC(const Mat3d &in) const override
Return the Jacobian Curvature: zero for a linear map.
Definition: Maps.h:1296
T dot(const Vec3< T > &v) const
Dot product.
Definition: Vec3.h:189
bool normalize(T eps=T(1.0e-7))
this = normalized this
Definition: Vec3.h:360
bool isScale() const
Return true if the map is equivalent to a ScaleMap.
Definition: Maps.h:473
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:1839
Threadsafe singleton object for accessing the map type-name dictionary. Associates a map type-name wi...
Definition: Maps.h:262
bool operator==(const NonlinearFrustumMap &other) const
Definition: Maps.h:2057
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:1023
double determinant(const Vec3d &) const override
Return the determinant of the Jacobian, ignores argument.
Definition: Maps.h:457
MapBase::Ptr copy() const override
Return a MapBase::Ptr to a deep copy of this map.
Definition: Maps.h:988
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:1286
@ OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX
Definition: version.h:194
static void registerMap()
Definition: Maps.h:996
TranslationMap()
Definition: Maps.h:979
AffineMap::Ptr inverse() const
Return AffineMap::Ptr to the inverse of this map.
Definition: Maps.h:553
void setTranslation(const Vec3< T > &t)
Definition: Mat4.h:333
Mat4 inverse(T tolerance=0) const
Definition: Mat4.h:504
Vec3d applyJT(const Vec3d &in, const Vec3d &) const override
Definition: Maps.h:436
Vec3d applyInverseMap(const Vec3d &in) const override
Return the pre-image of in under the map.
Definition: Maps.h:1723
Definition: Exceptions.h:13
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:2442
static bool isRegistered()
Definition: Maps.h:1223
bool isLinear() const override
Return true (a TranslationMap is always linear).
Definition: Maps.h:1007
Name readString(std::istream &is)
Definition: Name.h:20
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:2463
MapBase::Ptr inverseMap() const override
Return a new map representing the inverse of this map.
Definition: Maps.h:990
void write(std::ostream &os) const override
write serialization
Definition: Maps.h:533
bool operator!=(const AffineMap &other) const
Definition: Maps.h:399
static Name mapType()
Definition: Maps.h:711
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:446
double determinant(const Vec3d &) const override
Return the product of the scale values, ignores argument.
Definition: Maps.h:1312
Vec3d applyMap(const Vec3d &in) const override
Return the image of in under the map.
Definition: Maps.h:2082
void setRow(int i, const Vec3< T > &v)
Set ith row to vector v.
Definition: Mat3.h:148
MapBase::Ptr preShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:577
Vec3d applyIJT(const Vec3d &in) const override
Return the transpose of the inverse Jacobian of the map applied to in.
Definition: Maps.h:766
std::string str() const override
string serialization, useful for debuging
Definition: Maps.h:1067
Vec3d applyMap(const Vec3d &in) const override
Return the image of in under the map.
Definition: Maps.h:1013
Name type() const override
Return NonlinearFrustumMap.
Definition: Maps.h:2025
MapBase::Ptr copy() const override
Return a MapBase::Ptr to a deep copy of this map.
Definition: Maps.h:357
bool isEqual(const MapBase &other) const override
Return true if this map is equal to the given map.
Definition: Maps.h:1074
Name type() const
Definition: Maps.h:2599
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:82
Vec3d applyJacobian(const Vec3d &in) const override
Return the Jacobian of the map applied to in.
Definition: Maps.h:1727
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:885
SharedPtr< AffineMap > Ptr
Definition: Maps.h:301
void read(std::istream &is) override
read serialization
Definition: Maps.h:1774
Vec3d applyInverseMap(const Vec3d &in) const override
Return the pre-image of under the map.
Definition: Maps.h:1258
MapBase::Ptr postShear(double shear, Axis axis0, Axis axis1) const override
Definition: Maps.h:1428
bool isType() const
Return true if this map is of concrete type MapT (e.g., AffineMap).
Definition: Maps.h:150
bool isAffine(const Mat4< T > &m)
Definition: Mat4.h:1323
AffineMap(const AffineMap &first, const AffineMap &second)
constructor that merges the matrixes for two affine maps
Definition: Maps.h:346
ScaleTranslateMap(const Vec3d &scale, const Vec3d &translate)
Definition: Maps.h:1172
std::map< Name, MapBase::MapFactory > MapDictionary
Definition: Maps.h:265
Definition: Exceptions.h:56
MapBase::Ptr inverseMap() const override
Return a new map representing the inverse of this map.
Definition: Maps.h:1217
Vec3d applyInverseMap(const Vec3d &in) const override
Return the pre-image of in under the map.
Definition: Maps.h:416
const Vec3d & getTranslation() const
Return the translation vector.
Definition: Maps.h:1060