MeshLib Documentation
Loading...
Searching...
No Matches
MR2to3.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVector2.h"
4#include "MRVector3.h"
5#include "MRMatrix2.h"
6#include "MRMatrix3.h"
7#include "MRAffineXf.h"
8
9namespace MR
10{
11
13
19
20template <typename T>
21[[nodiscard]] inline Vector3<T> to3dim( const Vector2<T> & v )
22{
23 return { v.x, v.y, T{0} };
24}
25
26template <typename T>
27[[nodiscard]] inline Vector2<T> to2dim( const Vector3<T> & v )
28{
29 return { v.x, v.y };
30}
31
32template <typename T>
33[[nodiscard]] inline Matrix3<T> to3dim( const Matrix2<T> & m )
34{
35 return { to3dim( m.x ), to3dim( m.y ), Vector3<T>::plusZ() };
36}
37
38template <typename T>
39[[nodiscard]] inline Matrix2<T> to2dim( const Matrix3<T> & m )
40{
41 return { to2dim( m.x ), to2dim( m.y ) };
42}
43
44template <typename T>
45[[nodiscard]] inline AffineXf3<T> to3dim( const AffineXf2<T> & xf )
46{
47 return { to3dim( xf.A ), to3dim( xf.b ) };
48}
49
50template <typename T>
51[[nodiscard]] inline AffineXf2<T> to2dim( const AffineXf3<T> & xf )
52{
53 return { to2dim( xf.A ), to2dim( xf.b ) };
54}
55
57
58} // namespace MR
Vector3< T > to3dim(const Vector2< T > &v)
Definition MR2to3.h:21
Vector2< T > to2dim(const Vector3< T > &v)
Definition MR2to3.h:27
Definition MRCameraOrientationPlugin.h:8
Definition MRMesh/MRAffineXf.h:14
V b
Definition MRMesh/MRAffineXf.h:19
M A
Definition MRMesh/MRAffineXf.h:18
Definition MRMatrix2.h:13
Vector2< T > x
rows, identity matrix by default
Definition MRMatrix2.h:18
Vector2< T > y
Definition MRMatrix2.h:19
Definition MRMesh/MRMatrix3.h:13
Vector3< T > x
rows, identity matrix by default
Definition MRMesh/MRMatrix3.h:18
Vector3< T > y
Definition MRMesh/MRMatrix3.h:19
Definition MRVector2.h:18
T x
Definition MRVector2.h:24
T y
Definition MRVector2.h:24
Definition MRMesh/MRVector3.h:19
T x
Definition MRMesh/MRVector3.h:25
T y
Definition MRMesh/MRVector3.h:25
static constexpr Vector3 plusZ() noexcept
Definition MRMesh/MRVector3.h:35