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