Flow123d  release_2.1.2-337-g6b7a56b
point.h
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file point.h
15  * @brief
16  */
17 
18 #ifndef pointH
19 #define pointH
20 
21 #include <iostream>
22 
23 #include "myvector.h"
24 
25 class TVector;
26 
27 class TPoint {
28 private:
29  static int numberInstance;
30  int id;
31 
32  double x;
33  double y;
34  double z;
35 
36  int generateId();
37 
38 public:
39  TPoint();
40  TPoint(double, double, double);
41  TPoint(const TPoint&);
42  ~TPoint();
43 
46  bool operator ==(TPoint*);
47 
48  TPoint & operator =(const TPoint&);
49  TPoint & operator =(const TVector&);
50  TVector operator -(const TPoint&) const;
51  TPoint operator +(const TPoint&) const;
52  bool operator ==(const TPoint&) const;
53  friend std::ostream & operator <<(std::ostream&, const TPoint&);
54 
55  void SetCoord(double, double, double);
56  void SetCoord(const TVector&);
57 
58  double X() const;
59  double Y() const;
60  double Z() const;
61 
62  double Get(int) const;
63 
64  static int getNumInstances() {
66  }
67 };
68 
69 #endif
double y
Definition: point.h:33
friend std::ostream & operator<<(std::ostream &, const TPoint &)
Definition: point.cpp:134
static int getNumInstances()
Definition: point.h:64
TPoint * operator+(TPoint *)
TPoint * operator=(TPoint *)
double X() const
Definition: point.cpp:108
Definition: point.h:27
int generateId()
Definition: point.cpp:28
double Y() const
Definition: point.cpp:112
void SetCoord(double, double, double)
Definition: point.cpp:96
TVector operator-(const TPoint &) const
Definition: point.cpp:82
double Z() const
Definition: point.cpp:116
double x
Definition: point.h:32
bool operator==(TPoint *)
TPoint()
Definition: point.cpp:32
double Get(int) const
Definition: point.cpp:120
static int numberInstance
Definition: point.h:29
double z
Definition: point.h:34
int id
Definition: point.h:30
~TPoint()
Definition: point.cpp:56