Flow123d  jenkins-Flow123d-windows32-release-multijob-28
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 // delete P0;
47 // delete P1;
48 }
49 
50 void TAbscissa::SetPoints(const TPoint& PP0, const TPoint& PP1) {
51 // *P0 = PP0;
52 // *P1 = PP1;
53 
54  TBisector::SetPoints(PP0, PP1);
55  ComputeLength();
56 }
57 
59 
60  length = U->Length();
61 }
62 
64  return length;
65 }
66 
68  arma::vec3 minCoor;
69  arma::vec3 maxCoor;
70 
71  for (int i=0; i<3; ++i) {
72  minCoor(i) = GetMin(i+1);
73  maxCoor(i) = GetMax(i+1);
74  }
75 
76  boundingBox=BoundingBox(minCoor, maxCoor);
77 
78  return boundingBox;
79 }
80 
81 double TAbscissa::GetMin(int x) const {
82  if (U == NULL ) printf("U is null!");
83  if (U->Get(x) < 0 ) {
84  return U->Get(x)+X0->Get(x);
85  } else {
86  return X0->Get(x);
87  }
88 }
89 
90 double TAbscissa::GetMax(int x) const {
91  if (U->Get(x) > 0 ) {
92  return U->Get(x)+X0->Get(x);
93  } else {
94  return X0->Get(x);
95  }
96 }
double Length()
Definition: abscissa.cpp:63
Bounding box in 3d ambient space.
Definition: bounding_box.hh:55
BoundingBox boundingBox
Definition: abscissa.h:16
void SetPoints(const TPoint &, const TPoint &)
Definition: abscissa.cpp:50
double GetMax(int) const
Definition: abscissa.cpp:90
TPoint * X0
Definition: bisector.h:17
static int numberInstance
Definition: abscissa.h:10
double length
Definition: abscissa.h:18
Definition: point.h:11
void ComputeLength()
Definition: abscissa.cpp:58
BoundingBox & get_bounding_box()
Definition: abscissa.cpp:67
void SetPoints(const TPoint &, const TPoint &)
Definition: bisector.cpp:85
double Get(int) const
Definition: point.cpp:122
int generateId()
Definition: abscissa.cpp:8
TAbscissa & operator=(const TAbscissa &)
Definition: abscissa.cpp:35
double Length() const
Definition: vector.cpp:143
double GetMin(int) const
Definition: abscissa.cpp:81
~TAbscissa()
Definition: abscissa.cpp:45
void Get(double &, double &, double &) const
Definition: vector.cpp:147
TVector * U
Definition: bisector.h:18