OGS
GeoLib/Point.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7
8// GeoLib
9#include "GeoObject.h"
10
11// MathLib
13
14namespace GeoLib
15{
16// forward declaration
17class PointVec;
18
20{
21public:
22 Point() = default;
23
24 Point(double x1, double x2, double x3,
25 std::size_t id = std::numeric_limits<std::size_t>::max())
26 : MathLib::Point3dWithID(std::array<double, 3>({{x1, x2, x3}}), id)
27 {
28 }
29
30 Point(MathLib::Point3d const& x, std::size_t id)
31 : MathLib::Point3dWithID(x, id)
32 {
33 }
34
35 explicit Point(std::array<double, 3> const& x,
36 std::size_t id = std::numeric_limits<std::size_t>::max())
37 : MathLib::Point3dWithID(x, id)
38 {
39 }
40
42 GEOTYPE getGeoType() const override { return GEOTYPE::POINT; }
43
44protected:
45 friend PointVec;
46};
47
48} // namespace GeoLib
This class manages pointers to Points in a std::vector along with a name. It also handles the deletio...
Definition PointVec.h:25
Point()=default
Point(std::array< double, 3 > const &x, std::size_t id=std::numeric_limits< std::size_t >::max())
Point(MathLib::Point3d const &x, std::size_t id)
Point(double x1, double x2, double x3, std::size_t id=std::numeric_limits< std::size_t >::max())
GEOTYPE getGeoType() const override
return a geometry type
Point3dWithID(double x0, double x1, double x2, std::size_t id=std::numeric_limits< std::size_t >::max())
GEOTYPE
Definition GeoType.h:12