Adds vc/core/types/Transforms.hpp which provides a common interface for transforming meshes, point sets, and the values in PPMs. Currently only implements AffineTransform but more to come.
#include "vc/core/types/Transforms.hpp"
using namespace volcart;
// Compose an affine transform with multiple transformations
auto tfm = AffineTransform::New();
tfm->translate(1, 2, 3);
tfm->rotate(45, 0, 1, 0);
tfm->scale(1, 2, 3);
// Apply the transform to a point
auto pt = tfm->applyPoint({0,0,0});
// Apply the transform to a direction vector
auto vec = tfm->applyVector({0, 0, 1});
// Apply the transform to a mesh, point set, PPM
mesh = ApplyTransform(mesh, tfm);
points = ApplyTransform(points, tfm); // Supports PointSet<cv::Vec3d> and OrderedPointSet<cv::Vec3d>
ppm = ApplyTransform(ppm, tfm);
Other important changes
Moves DeepCopy to vc/core/ITKMesh.hpp
Add ApplyTransformNode<T> generic class and aliases: TransformMeshNode, TransformPPMNode
Adds
vc/core/types/Transforms.hpp
which provides a common interface for transforming meshes, point sets, and the values in PPMs. Currently only implementsAffineTransform
but more to come.Other important changes
DeepCopy
tovc/core/ITKMesh.hpp
ApplyTransformNode<T>
generic class and aliases:TransformMeshNode
,TransformPPMNode