OGS
LineSegment.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 "Point.h"
7
8namespace GeoLib
9{
10
11class LineSegment final
12{
13public:
19 LineSegment(GeoLib::Point* const a, GeoLib::Point* const b,
20 bool point_mem_management_by_line_segment = false);
21
22 LineSegment(LineSegment&& line_segment);
23 LineSegment(LineSegment const& line_segment);
24
26
28 LineSegment& operator=(LineSegment&& line_segment);
29
30 GeoLib::Point const& getBeginPoint() const;
32
33 GeoLib::Point const& getEndPoint() const;
35
36private:
37 GeoLib::Point* _a = nullptr;
38 GeoLib::Point* _b = nullptr;
40};
41
42std::ostream& operator<<(std::ostream& os, LineSegment const& s);
43
44std::ostream& operator<<(std::ostream& os,
45 std::pair<GeoLib::LineSegment const&,
46 GeoLib::LineSegment const&> const& seg_pair);
47
54bool operator==(LineSegment const& s0, LineSegment const& s1);
55
56} // namespace GeoLib
bool _point_mem_management_by_line_segment
Definition LineSegment.h:39
GeoLib::Point const & getBeginPoint() const
GeoLib::Point * _b
Definition LineSegment.h:38
LineSegment & operator=(LineSegment const &rhs)
GeoLib::Point const & getEndPoint() const
LineSegment(GeoLib::Point *const a, GeoLib::Point *const b, bool point_mem_management_by_line_segment=false)
GeoLib::Point * _a
Definition LineSegment.h:37
bool operator==(LineSegment const &s0, LineSegment const &s1)
std::ostream & operator<<(std::ostream &os, LineSegment const &s)