4 #ifndef OPENVDB_MATH_TRANSFORM_HAS_BEEN_INCLUDED
5 #define OPENVDB_MATH_TRANSFORM_HAS_BEEN_INCLUDED
54 static Transform::Ptr createLinearTransform(
double voxelSize = 1.0);
57 double depth,
double voxelSize = 1.0);
61 bool isLinear()
const {
return mMap->isLinear(); }
76 void preTranslate(
const Vec3d&);
77 void preScale(
const Vec3d&);
78 void preScale(
double);
80 void preMult(
const Mat4d&);
81 void preMult(
const Mat3d&);
84 void postTranslate(
const Vec3d&);
85 void postScale(
const Vec3d&);
86 void postScale(
double);
88 void postMult(
const Mat4d&);
89 void postMult(
const Mat3d&);
138 template<
typename MapType>
typename MapType::Ptr map();
139 template<
typename MapType>
typename MapType::ConstPtr map()
const;
140 template<
typename MapType>
typename MapType::ConstPtr constMap()
const;
144 void read(std::istream&);
146 void write(std::ostream&)
const;
151 void print(std::ostream& os = std::cout,
const std::string& indent =
"")
const;
167 template<
typename MapType>
168 inline typename MapType::Ptr
171 if (mMap->type() == MapType::mapType()) {
172 return StaticPtrCast<MapType>(mMap);
174 return typename MapType::Ptr();
178 template<
typename MapType>
179 inline typename MapType::ConstPtr
182 return ConstPtrCast<const MapType>(
183 const_cast<Transform*
>(
this)->map<MapType>());
187 template<
typename MapType>
188 inline typename MapType::ConstPtr
191 return map<MapType>();
199 template<
typename ResolvedMapType,
typename OpType>
203 ResolvedMapType& resolvedMap = *transform.
map<ResolvedMapType>();
204 op.template operator()<ResolvedMapType>(resolvedMap);
208 template<
typename ResolvedMapType,
typename OpType>
212 const ResolvedMapType& resolvedMap = *transform.
map<ResolvedMapType>();
213 op.template operator()<ResolvedMapType>(resolvedMap);
231 template<
typename TransformType,
typename OpType>
235 using namespace openvdb;
237 const Name mapType = transform.mapType();
239 doProcessTypedMap<UniformScaleMap, OpType>(
transform, op);
242 doProcessTypedMap<UniformScaleTranslateMap, OpType>(
transform, op);
245 doProcessTypedMap<ScaleMap, OpType>(
transform, op);
248 doProcessTypedMap<ScaleTranslateMap, OpType>(
transform, op);
251 doProcessTypedMap<UnitaryMap, OpType>(
transform, op);
254 doProcessTypedMap<AffineMap, OpType>(
transform, op);
257 doProcessTypedMap<TranslationMap, OpType>(
transform, op);
260 doProcessTypedMap<NonlinearFrustumMap, OpType>(
transform, op);
271 #endif // OPENVDB_MATH_TRANSFORM_HAS_BEEN_INCLUDED
static Name mapType()
Return NonlinearFrustumMap.
MatType shear(Axis axis0, Axis axis1, typename MatType::value_type shear)
Set the matrix to a shear along axis0 by a fraction of axis1.
IMATH_HOSTDEVICE constexpr int floor(T x) IMATH_NOEXCEPT
GLsizei const GLchar *const * string
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
bool isIdentity(const MatType &m)
Determine if a matrix is an identity matrix.
#define OPENVDB_USE_VERSION_NAMESPACE
SharedPtr< const MapBase > ConstPtr
Signed (x, y, z) 32-bit integer coordinates.
std::shared_ptr< T > SharedPtr
OPENVDB_API void calculateBounds(const Transform &t, const Vec3d &minWS, const Vec3d &maxWS, Vec3d &minIS, Vec3d &maxIS)
Calculate an axis-aligned bounding box in index space from an axis-aligned bounding box in world spac...
Axis-aligned bounding box of signed integer coordinates.
void doProcessTypedMap(Transform &transform, OpType &op)
Helper function used internally by processTypedMap()
vfloat4 round(const vfloat4 &a)
GA_API const UT_StringHolder transform
GLint GLint GLsizei GLsizei GLsizei depth
static Name mapType()
Return UnitaryMap.
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
Abstract base class for maps.
OIIO_FORCEINLINE OIIO_HOSTDEVICE T radians(T deg)
Convert degrees to radians.
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
bool operator==(const Vec3< T0 > &v0, const Vec3< T1 > &v1)
Equality operator, does exact floating point comparisons.
bool processTypedMap(TransformType &transform, OpType &op)
Utility function that, given a generic map pointer, calls a functor on the fully-resoved map...
std::ostream & operator<<(std::ostream &os, const BBox< Vec3T > &b)