Flow123d  release_1.8.2-1603-g0109a2b
triangle.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 triangle.h
15  * @brief
16  */
17 
18 #ifndef triangleH
19 #define triangleH
20 
21 #include "point.h"
22 #include "plain.h"
23 #include "abscissa.h"
24 #include "mesh/bounding_box.hh"
25 #include "mesh/elements.h"
26 
27 class TTriangle {
28 private:
29  static int numberInstance;
30  int id;
31 
35 
39 
41 
43 
44  double area;
45 
46  int generateId();
47 
48  void ComputeArea();
49 
50 public:
51  TTriangle();
52  TTriangle(const TTriangle&);
53  TTriangle(const TPoint&, const TPoint&, const TPoint&);
54  TTriangle(const Element&);
55  void update();
56 
57  ~TTriangle();
58 
59  TTriangle & operator =(const TTriangle &t);
60 
61  const TPlain &GetPlain() const;
62  const TAbscissa &GetAbscissa(int) const;
63  const TPoint &GetPoint(int) const;
64 
65  void SetPoints(const TPoint&, const TPoint&, const TPoint&);
66 
67  double GetMin(int) const;
68  double GetMax(int) const;
69 
70  double GetArea();
72 
73  bool IsInner(const TPoint&) const;
74 
75  static int getNumInstances() {
77  }
78 };
79 
80 #endif
81 
TAbscissa * A1
Definition: triangle.h:36
Bounding box in 3d ambient space.
Definition: bounding_box.hh:45
double GetMin(int) const
Definition: triangle.cpp:164
static int numberInstance
Definition: triangle.h:29
void ComputeArea()
Definition: triangle.cpp:142
TPoint X2
Definition: triangle.h:33
TPoint X3
Definition: triangle.h:34
Definition: plain.h:24
int id
Definition: triangle.h:30
int generateId()
Definition: triangle.cpp:25
double GetArea()
Definition: triangle.cpp:147
TTriangle & operator=(const TTriangle &t)
Definition: triangle.cpp:190
TPoint X1
Definition: triangle.h:32
bool IsInner(const TPoint &) const
Definition: triangle.cpp:204
const TPoint & GetPoint(int) const
Definition: triangle.cpp:116
Definition: point.h:27
void SetPoints(const TPoint &, const TPoint &, const TPoint &)
Definition: triangle.cpp:128
~TTriangle()
Definition: triangle.cpp:82
BoundingBox & get_bounding_box()
Definition: triangle.cpp:151
double GetMax(int) const
Definition: triangle.cpp:177
const TPlain & GetPlain() const
Definition: triangle.cpp:98
double area
Definition: triangle.h:44
TAbscissa * A3
Definition: triangle.h:38
TAbscissa * A2
Definition: triangle.h:37
static int getNumInstances()
Definition: triangle.h:75
BoundingBox boundingBox
Definition: triangle.h:42
const TAbscissa & GetAbscissa(int) const
Definition: triangle.cpp:102
void update()
Definition: triangle.cpp:72
TPlain * pl
Definition: triangle.h:40