/
Point.cpp
51 lines (43 loc) · 908 Bytes
/
Point.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <fstream>
#include <utility>
#include <string>
#include "Point.hpp"
using namespace std;
ostream& operator<< (ostream& out, Point& point)
{
out << point.name << " ";
out << point.coord.first << " ";
out << point.coord.second;
return out;
}
istream& operator>> (istream& in, Point& point)
{
in >> point.name;
in >> point.coord.first;
in >> point.coord.second;
return in;
}
/*Point::Point(const Point& point) {
name = point.name;
coord = point.coord;
specifier = point.specifier;
}*/
void Point::setName(std::string _name){
name = _name;
}
void Point::setCoord(std::pair<float, float> _coord) {
coord = _coord;
}
void Point::defineSpecifier() {
specifier = 1;
}
string Point::getName(){
return name;
}
string Point::getSpecifier(){
return specifier;
}
pair<float,float> Point::getCoord(){
return coord;
}