OGS
Point3dWithID.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <limits>
16
17#include "Point3d.h"
18
19namespace MathLib
20{
25class Point3dWithID: public Point3d {
26public:
33 Point3dWithID(double x0, double x1, double x2,
34 std::size_t id = std::numeric_limits<std::size_t>::max())
35 : Point3d(std::array<double, 3>({{x0, x1, x2}})), id_(id)
36 {}
37
42 explicit Point3dWithID(
43 std::array<double, 3> const& coords,
44 std::size_t id = std::numeric_limits<std::size_t>::max())
45 : Point3d(coords), id_(id)
46 {}
47
52 explicit Point3dWithID(
53 MathLib::Point3d const& pnt,
54 std::size_t id = std::numeric_limits<std::size_t>::max())
55 : MathLib::Point3d(pnt), id_(id)
56 {}
57
60 Point3dWithID() : id_(std::numeric_limits<std::size_t>::max()) {}
61
62 std::size_t getID() const { return id_; }
63
64protected:
66 void setID(std::size_t id) { id_ = id; }
67
68private:
69 std::size_t id_;
70};
71
72} // namespace MathLib
Definition of the Point3d class.
std::size_t getID() const
Point3dWithID(MathLib::Point3d const &pnt, std::size_t id=std::numeric_limits< std::size_t >::max())
Point3dWithID(double x0, double x1, double x2, std::size_t id=std::numeric_limits< std::size_t >::max())
void setID(std::size_t id)
Sets the ID of a node to the given value.
Point3dWithID(std::array< double, 3 > const &coords, std::size_t id=std::numeric_limits< std::size_t >::max())