OGS
LineSegment.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "Point.h"
13 
14 namespace GeoLib
15 {
16 
17 class LineSegment final
18 {
19 public:
25  LineSegment(GeoLib::Point* const a, GeoLib::Point* const b,
26  bool point_mem_management_by_line_segment = false);
27 
28  LineSegment(LineSegment&& line_segment);
29  LineSegment(LineSegment const& line_segment);
30 
31  ~LineSegment();
32 
34  LineSegment& operator=(LineSegment&& line_segment);
35 
36  GeoLib::Point const& getBeginPoint() const;
38 
39  GeoLib::Point const& getEndPoint() const;
41 
42 private:
43  GeoLib::Point* _a = nullptr;
44  GeoLib::Point* _b = nullptr;
46 };
47 
48 std::ostream& operator<< (std::ostream& os, LineSegment const& s);
49 
50 std::ostream& operator<<(std::ostream& os,
51  std::pair<GeoLib::LineSegment const&,
52  GeoLib::LineSegment const&> const& seg_pair);
53 
60 bool operator==(LineSegment const& s0, LineSegment const& s1);
61 
62 } // namespace GeoLib
bool _point_mem_management_by_line_segment
Definition: LineSegment.h:45
GeoLib::Point const & getBeginPoint() const
Definition: LineSegment.cpp:66
GeoLib::Point * _b
Definition: LineSegment.h:44
LineSegment & operator=(LineSegment const &rhs)
GeoLib::Point const & getEndPoint() const
Definition: LineSegment.cpp:76
LineSegment(GeoLib::Point *const a, GeoLib::Point *const b, bool point_mem_management_by_line_segment=false)
Definition: LineSegment.cpp:14
GeoLib::Point * _a
Definition: LineSegment.h:43
bool operator==(LineSegment const &s0, LineSegment const &s1)
std::ostream & operator<<(std::ostream &os, LineSegment const &s)
Definition: LineSegment.cpp:86