Flow123d  release_2.2.0-914-gf1a3a4f
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/mesh_types.hh"
25 #include "mesh/bounding_box.hh"
26 //#include "mesh/elements.h"
27 
28 namespace ngh {
29 
30 
31 class TTriangle {
32 private:
33  static int numberInstance;
34  int id;
35 
39 
43 
45 
47 
48  double area;
49 
50  int generateId();
51 
52  void ComputeArea();
53 
54 public:
55  TTriangle();
56  TTriangle(const TTriangle&);
57  TTriangle(const TPoint&, const TPoint&, const TPoint&);
58  TTriangle(const Element&);
59  void update();
60 
61  ~TTriangle();
62 
63  TTriangle & operator =(const TTriangle &t);
64 
65  const TPlain &GetPlain() const;
66  const TAbscissa &GetAbscissa(int) const;
67  const TPoint &GetPoint(int) const;
68 
69  void SetPoints(const TPoint&, const TPoint&, const TPoint&);
70 
71  double GetMin(int) const;
72  double GetMax(int) const;
73 
74  double GetArea();
76 
77  bool IsInner(const TPoint&) const;
78 
79  static int getNumInstances() {
81  }
82 };
83 
84 } // namespace ngh
85 
86 #endif
87 
Bounding box in 3d ambient space.
Definition: bounding_box.hh:45
double GetArea()
Definition: triangle.cpp:148
TAbscissa * A2
Definition: triangle.h:41
BoundingBox boundingBox
Definition: triangle.h:46
double GetMin(int) const
Definition: triangle.cpp:165
double area
Definition: triangle.h:48
TTriangle & operator=(const TTriangle &t)
Definition: triangle.cpp:191
Definition: abscissa.h:25
TAbscissa * A3
Definition: triangle.h:42
const TPoint & GetPoint(int) const
Definition: triangle.cpp:117
TPoint X2
Definition: triangle.h:37
TPoint X3
Definition: triangle.h:38
void update()
Definition: triangle.cpp:73
static int numberInstance
Definition: triangle.h:33
void ComputeArea()
Definition: triangle.cpp:143
TPoint X1
Definition: triangle.h:36
static int getNumInstances()
Definition: triangle.h:79
double GetMax(int) const
Definition: triangle.cpp:178
const TPlain & GetPlain() const
Definition: triangle.cpp:99
TAbscissa * A1
Definition: triangle.h:40
const TAbscissa & GetAbscissa(int) const
Definition: triangle.cpp:103
int generateId()
Definition: triangle.cpp:26
bool IsInner(const TPoint &) const
Definition: triangle.cpp:205
void SetPoints(const TPoint &, const TPoint &, const TPoint &)
Definition: triangle.cpp:129
TPlain * pl
Definition: triangle.h:44
BoundingBox & get_bounding_box()
Definition: triangle.cpp:152