Flow123d  release_2.2.0-914-gf1a3a4f
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 namespace ngh {
26 
27 class TVector;
28 
29 class TPoint {
30 private:
31  static int numberInstance;
32  int id;
33 
34  double x;
35  double y;
36  double z;
37 
38  int generateId();
39 
40 public:
41  TPoint();
42  TPoint(double, double, double);
43  TPoint(const TPoint&);
44  ~TPoint();
45 
48  bool operator ==(TPoint*);
49 
50  TPoint & operator =(const TPoint&);
51  TPoint & operator =(const TVector&);
52  TVector operator -(const TPoint&) const;
53  TPoint operator +(const TPoint&) const;
54  bool operator ==(const TPoint&) const;
55  friend std::ostream & operator <<(std::ostream&, const TPoint&);
56 
57  void SetCoord(double, double, double);
58  void SetCoord(const TVector&);
59 
60  double X() const;
61  double Y() const;
62  double Z() const;
63 
64  double Get(int) const;
65 
66  static int getNumInstances() {
68  }
69 };
70 
71 } // namespace ngh
72 
73 #endif
int id
Definition: point.h:32
Definition: abscissa.h:25
double z
Definition: point.h:36
double Get(int) const
Definition: point.cpp:123
double y
Definition: point.h:35
TVector operator-(const TPoint &) const
Definition: point.cpp:85
double Y() const
Definition: point.cpp:115
friend std::ostream & operator<<(std::ostream &, const TPoint &)
Definition: point.cpp:137
TPoint * operator=(TPoint *)
TPoint * operator+(TPoint *)
static int getNumInstances()
Definition: point.h:66
double x
Definition: point.h:34
double X() const
Definition: point.cpp:111
double Z() const
Definition: point.cpp:119
int generateId()
Definition: point.cpp:31
void SetCoord(double, double, double)
Definition: point.cpp:99
bool operator==(TPoint *)
static int numberInstance
Definition: point.h:31