Flow123d
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
flow123d
src
mesh
ngh
include
intersectionLocal.h
Go to the documentation of this file.
1
#ifndef IntersectionLocalH
2
#define IntersectionLocalH
3
4
#include <iostream>
5
#include <vector>
6
#include <stdio.h>
7
8
using namespace
std;
9
10
11
//class IntersectionPoint - dva vektory lokalnich souradnic
12
class
IntersectionPoint
{
13
public
:
14
IntersectionPoint
(
const
std::vector<double>
&c1,
const
std::vector<double>
&c2)
15
: coord1(c1), coord2(c2) {}
16
IntersectionPoint
(
const
IntersectionPoint
&LC)
17
: coord1(LC.coord1), coord2(LC.coord2) {}
18
inline
const
std::vector<double>
&
el1_coord
()
const
19
{
return
coord1;}
20
inline
const
std::vector<double>
&
el2_coord
()
const
21
{
return
coord2;}
22
bool
operator ==
(
const
IntersectionPoint
&);
23
protected
:
24
std::vector<double>
coord1
;
25
std::vector<double>
coord2
;
26
27
friend
class
IntersectionLocal
;
28
friend
IntersectionPoint
*
interpolate
(
IntersectionPoint
&A1,
IntersectionPoint
&A2,
double
t);
29
};
30
IntersectionPoint
*
interpolate
(
const
IntersectionPoint
&A1,
const
IntersectionPoint
&A2,
double
t);
31
32
33
class
IntersectionLocal
{
34
public
:
35
typedef
enum
{
36
point
,
37
line
,
38
area
39
} IntersectionType;
40
41
IntersectionLocal
(IntersectionType i_type);
42
IntersectionLocal
(
IntersectionLocal
*);
43
~
IntersectionLocal
();
44
45
//void set_elements(TElement *elem1, TElement *elem2); //metoda na naplneni ele1, ele2
46
void
add_local_coord(
const
std::vector<double>
&coordin1,
const
std::vector<double>
&coordin2);
//metoda na pridani souradnic do i_points
47
void
add_local_point(
IntersectionPoint
*InPoint);
48
void
print(FILE *out_file);
49
50
//void AddNewLocalcoord(); //doplnit predavany parametr, pridat novou i_points
51
52
static
int
getNumInstances
() {
53
return
IntersectionLocal::numberInstance
;
54
}
55
56
inline
IntersectionType
get_type
()
const
57
{
return
type; }
58
inline
unsigned
int
n_points
()
const
{
59
return
i_points.size();
60
}
61
inline
const
IntersectionPoint
*
get_point
(
const
unsigned
int
index)
const
62
{
63
if
(index >= i_points.size() )
return
NULL;
64
else
return
i_points[index];
65
}
66
67
private
:
68
static
int
numberInstance
;
69
int
id
;
70
71
std::vector<IntersectionPoint *>
i_points
;
//vektor ukazatelu na dvojice lokal. souradnic
72
IntersectionType
type
;
73
74
75
int
generateId();
76
};
77
78
#endif
/* IntersectionLocalH */
Generated on Thu May 29 2014 23:14:49 for Flow123d by
1.8.4