MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMultiwayAligningTransform.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRRigidXf3.h"
5#include <memory>
6
7namespace MR
8{
9
13
18{
19public:
21
23 MRMESH_API explicit MultiwayAligningTransform( int numObjs );
24
27
29
31 MRMESH_API void reset( int numObjs );
32
35 MRMESH_API void add( int objA, const Vector3d& pA, int objB, const Vector3d& pB, double w = 1 );
36
39 void add( int objA, const Vector3f& pA, int objB, const Vector3f& pB, float w = 1 ) { add( objA, Vector3d( pA ), objB, Vector3d( pB ), w ); }
40
44 MRMESH_API void add( int objA, const Vector3d& pA, int objB, const Vector3d& pB, const Vector3d& n, double w = 1 );
45
49 void add( int objA, const Vector3f& pA, int objB, const Vector3f& pB, const Vector3f& n, float w = 1 ) { add( objA, Vector3d( pA ), objB, Vector3d( pB ), Vector3d( n ), w ); }
50
53
57 {
59 double rot = 0; // length units
60
62 double shift = 0; // dimensionless
63 };
64
68 [[nodiscard]] MRMESH_API std::vector<RigidXf3d> solve( const Stabilizer & stab ) const;
69 [[nodiscard]] std::vector<RigidXf3d> solve() const { return solve( {} ); }
70
71private:
72 class Impl;
73 std::unique_ptr<Impl> impl_;
74};
75
77
78} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
Definition MRMultiwayAligningTransform.h:18
void add(int objA, const Vector3f &pA, int objB, const Vector3f &pB, const Vector3f &n, float w=1)
Definition MRMultiwayAligningTransform.h:49
MRMESH_API void add(const MultiwayAligningTransform &r)
appends links accumulated in (r) into this
MRMESH_API void add(int objA, const Vector3d &pA, int objB, const Vector3d &pB, const Vector3d &n, double w=1)
std::vector< RigidXf3d > solve() const
Definition MRMultiwayAligningTransform.h:69
MRMESH_API MultiwayAligningTransform()
MRMESH_API MultiwayAligningTransform(int numObjs)
initializes internal data to start registering given number of objects
MRMESH_API void reset(int numObjs)
reinitializes internal data to start registering given number of objects
void add(int objA, const Vector3f &pA, int objB, const Vector3f &pB, float w=1)
Definition MRMultiwayAligningTransform.h:39
MRMESH_API void add(int objA, const Vector3d &pA, int objB, const Vector3d &pB, double w=1)
MRMESH_API MultiwayAligningTransform(MultiwayAligningTransform &&) noexcept
MRMESH_API std::vector< RigidXf3d > solve(const Stabilizer &stab) const
Definition MRCameraOrientationPlugin.h:8
Definition MRMultiwayAligningTransform.h:57
double shift
any not-zero number stabilizes solution for translation
Definition MRMultiwayAligningTransform.h:62
double rot
any not-zero number stabilizes solution for rotation angles
Definition MRMultiwayAligningTransform.h:59