4#ifndef OPENVDB_MATH_TRANSFORM_HAS_BEEN_INCLUDED
5#define OPENVDB_MATH_TRANSFORM_HAS_BEEN_INCLUDED
57 double depth,
double voxelSize = 1.0);
61 bool isLinear()
const {
return mMap->isLinear(); }
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;
151 void print(std::ostream& os = std::cout,
const std::string& indent =
"")
const;
167template<
typename MapType>
168inline typename MapType::Ptr
171 if (mMap->type() == MapType::mapType()) {
172 return StaticPtrCast<MapType>(mMap);
174 return typename MapType::Ptr();
178template<
typename MapType>
179inline typename MapType::ConstPtr
180Transform::map()
const
182 return ConstPtrCast<const MapType>(
183 const_cast<Transform*
>(
this)->map<MapType>());
187template<
typename MapType>
188inline typename MapType::ConstPtr
189Transform::constMap()
const
191 return map<MapType>();
199template<
typename ResolvedMapType,
typename OpType>
203 ResolvedMapType& resolvedMap = *transform.
map<ResolvedMapType>();
204 op.template operator()<ResolvedMapType>(resolvedMap);
208template<
typename ResolvedMapType,
typename OpType>
212 const ResolvedMapType& resolvedMap = *transform.
map<ResolvedMapType>();
213 op.template operator()<ResolvedMapType>(resolvedMap);
231template<
typename TransformType,
typename OpType>
237 const Name mapType = transform.mapType();
238 if (mapType == UniformScaleMap::mapType()) {
239 doProcessTypedMap<UniformScaleMap, OpType>(transform, op);
241 }
else if (mapType == UniformScaleTranslateMap::mapType()) {
242 doProcessTypedMap<UniformScaleTranslateMap, OpType>(transform, op);
244 }
else if (mapType == ScaleMap::mapType()) {
245 doProcessTypedMap<ScaleMap, OpType>(transform, op);
247 }
else if (mapType == ScaleTranslateMap::mapType()) {
248 doProcessTypedMap<ScaleTranslateMap, OpType>(transform, op);
250 }
else if (mapType == UnitaryMap::mapType()) {
251 doProcessTypedMap<UnitaryMap, OpType>(transform, op);
253 }
else if (mapType == AffineMap::mapType()) {
254 doProcessTypedMap<AffineMap, OpType>(transform, op);
256 }
else if (mapType == TranslationMap::mapType()) {
257 doProcessTypedMap<TranslationMap, OpType>(transform, op);
259 }
else if (mapType == NonlinearFrustumMap::mapType()) {
260 doProcessTypedMap<NonlinearFrustumMap, OpType>(transform, op);
Axis-aligned bounding box of signed integer coordinates.
Definition: Coord.h:248
Signed (x, y, z) 32-bit integer coordinates.
Definition: Coord.h:25
Vec3d asVec3d() const
Definition: Coord.h:143
static Coord round(const Vec3< T > &xyz)
Return xyz rounded to the closest integer coordinates (cell centered conversion).
Definition: Coord.h:50
static Coord floor(const Vec3< T > &xyz)
Return the largest integer coordinates that are not greater than xyz (node centered conversion).
Definition: Coord.h:56
Abstract base class for maps.
Definition: Maps.h:135
SharedPtr< MapBase > Ptr
Definition: Maps.h:137
SharedPtr< const MapBase > ConstPtr
Definition: Maps.h:138
A specialized Affine transform that scales along the principal axis the scaling need not be uniform i...
Definition: Maps.h:670
bool processTypedMap(TransformType &transform, OpType &op)
Utility function that, given a generic map pointer, calls a functor on the fully-resoved map.
Definition: Transform.h:233
void doProcessTypedMap(const Transform &transform, OpType &op)
Helper function used internally by processTypedMap()
Definition: Transform.h:210
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:710
OPENVDB_API std::ostream & operator<<(std::ostream &, const Transform &)
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
Definition: Math.h:904
@ X_AXIS
Definition: Math.h:905
std::string Name
Definition: Name.h:17
std::shared_ptr< T > SharedPtr
Definition: Types.h:114
Definition: Exceptions.h:13
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:202