Ponca  84886bac0b52a686e88046a375da13f12f2b87d2
Point Cloud Analysis library
Loading...
Searching...
No Matches
pointTypes.h
1/*
2This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
14namespace Ponca {
16
18 template<typename _Scalar, int _Dim>
20 {
21 public:
22 enum {Dim = _Dim};
23 typedef _Scalar Scalar;
24 typedef Eigen::Matrix<Scalar, Dim, 1> VectorType;
25 typedef Eigen::Matrix<Scalar, Dim, Dim> MatrixType;
26
27 PONCA_MULTIARCH inline PointPositionNormal(
28 const VectorType &pos = VectorType::Zero(),
29 const VectorType& normal = VectorType::Zero()
30 ) : m_pos(pos), m_normal(normal) {}
31
32 PONCA_MULTIARCH [[nodiscard]] inline const VectorType& pos() const { return m_pos; }
33 PONCA_MULTIARCH [[nodiscard]] inline const VectorType& normal() const { return m_normal; }
34 PONCA_MULTIARCH [[nodiscard]] inline VectorType& pos() { return m_pos; }
35 PONCA_MULTIARCH [[nodiscard]] inline VectorType& normal() { return m_normal; }
36
37 private:
38 VectorType m_pos, m_normal;
39 };
41
44 template<typename _Scalar, int _Dim>
46 {
47 public:
48 enum {Dim = _Dim};
49 typedef _Scalar Scalar;
50 typedef Eigen::Matrix<Scalar, Dim, 1> VectorType;
51 typedef Eigen::Matrix<Scalar, Dim, Dim> MatrixType;
52
53 PONCA_MULTIARCH inline PointPosition(
54 const VectorType &pos = VectorType::Zero()
55 ) : m_pos(pos) {}
56
57 PONCA_MULTIARCH [[nodiscard]] inline const VectorType& pos() const { return m_pos; }
58 PONCA_MULTIARCH [[nodiscard]] inline VectorType& pos() { return m_pos; }
59
60 private:
61 VectorType m_pos;
62 };
64
65
75 template<typename _Scalar, int _Dim>
77 {
78 public:
79 enum {Dim = _Dim};
80 typedef _Scalar Scalar;
81 typedef Eigen::Matrix<Scalar, Dim, 1> VectorType;
82 typedef Eigen::Matrix<Scalar, Dim, Dim> MatrixType;
83
84 PONCA_MULTIARCH inline PointPositionNormalBinding(
85 const Scalar* _interlacedArray, int _pId
86 ) : m_pos (Eigen::Map< const VectorType >(_interlacedArray + Dim*2*_pId )),
87 m_normal(Eigen::Map< const VectorType >(_interlacedArray + Dim*2*_pId+Dim))
88 {}
89
90 PONCA_MULTIARCH [[nodiscard]] inline const Eigen::Map< const VectorType >& pos() const { return m_pos; }
91 PONCA_MULTIARCH [[nodiscard]] inline const Eigen::Map< const VectorType >& normal() const { return m_normal; }
92
93 private:
94 Eigen::Map< const VectorType > m_pos, m_normal;
95 };
96}
[PointPositionNormal]
Definition pointTypes.h:20
[PointPositionNormal]
Definition pointTypes.h:46
This Source Code Form is subject to the terms of the Mozilla Public License, v.