Flow123d  jenkins-Flow123d-windows32-release-multijob-51
abscissa.cpp
Go to the documentation of this file.
1 #include <cmath>
2 
4 #include "stdio.h"
5 
7 
10 }
11 
13  id = generateId();
14 }
15 
16 TAbscissa::TAbscissa(const TPoint& PP0, const TPoint& PP1)
17 : TBisector(PP0, PP1)
18 {
19  id = generateId();
20 
21  ComputeLength();
22 }
23 
24 
26 : TBisector(ele)
27 {
28  id = generateId();
29 
30  ComputeLength();
31 }
32 
33 
34 
36 
37  *U = *(a.U);
38  *X0 = *(a.X0);
39 
40  length = a.length;
41 
42  return *this;
43 }
44 
46 }
47 
48 void TAbscissa::SetPoints(const TPoint& PP0, const TPoint& PP1) {
49  TBisector::SetPoints(PP0, PP1);
50  ComputeLength();
51 }
52 
54 
55  length = U->Length();
56 }
57 
59  return length;
60 }
61 
63  arma::vec3 minCoor;
64  arma::vec3 maxCoor;
65 
66  for (int i=0; i<3; ++i) {
67  minCoor(i) = GetMin(i+1);
68  maxCoor(i) = GetMax(i+1);
69  }
70 
71  boundingBox=BoundingBox(minCoor, maxCoor);
72 
73  return boundingBox;
74 }
75 
76 double TAbscissa::GetMin(int x) const {
77  if (U == NULL ) printf("U is null!");
78  if (U->Get(x) < 0 ) {
79  return U->Get(x)+X0->Get(x);
80  } else {
81  return X0->Get(x);
82  }
83 }
84 
85 double TAbscissa::GetMax(int x) const {
86  if (U->Get(x) > 0 ) {
87  return U->Get(x)+X0->Get(x);
88  } else {
89  return X0->Get(x);
90  }
91 }
double Length()
Definition: abscissa.cpp:58
Bounding box in 3d ambient space.
Definition: bounding_box.hh:55
BoundingBox boundingBox
Definition: abscissa.h:13
void SetPoints(const TPoint &, const TPoint &)
Definition: abscissa.cpp:48
double GetMax(int) const
Definition: abscissa.cpp:85
TPoint * X0
Definition: bisector.h:17
static int numberInstance
Definition: abscissa.h:10
double length
Definition: abscissa.h:15
Definition: point.h:10
void ComputeLength()
Definition: abscissa.cpp:53
BoundingBox & get_bounding_box()
Definition: abscissa.cpp:62
void SetPoints(const TPoint &, const TPoint &)
Definition: bisector.cpp:82
double Get(int) const
Definition: point.cpp:103
int generateId()
Definition: abscissa.cpp:8
TAbscissa & operator=(const TAbscissa &)
Definition: abscissa.cpp:35
double Length() const
Definition: vector.cpp:140
double GetMin(int) const
Definition: abscissa.cpp:76
~TAbscissa()
Definition: abscissa.cpp:45
void Get(double &, double &, double &) const
Definition: vector.cpp:144
TVector * U
Definition: bisector.h:18