40 double U[ 3 ], V[ 3 ];
57 for (
int i = 0; i < 3; i++) {
67 for (
int i = 0; i < 3; i++) {
68 if ((i != r1) && !
IsZero(U[ i ])) {
72 if ((i != r2) && !
IsZero(V[ i ])) {
79 if ((r1 == -1) || (r2 == -1)) {
85 for (
int i = 0; i < 3; i++) {
86 if ((r1 != i) && (r2 != i)) {
93 A.
Set(1, 2, -V[ r1 ]);
95 A.
Set(2, 2, -V[ r2 ]);
166 }
else if ( pos ==
same ) {
173 if (dot_product < 0 ) {
180 double loc_begin_A1, loc_end_A1, loc_begin_A2, loc_end_A2;
198 double X1=0, X2=0, Y1=0, Y2=0;
200 if ((loc_begin_A2 < 0) && (loc_end_A2 < 0)) {
205 if ((loc_begin_A2 < 0) && (loc_end_A2 >= 0) && (loc_end_A2 < 1)) {
212 if ((loc_begin_A2 >= 0) && (loc_end_A2 >= 0) && (loc_end_A2 < 1)) {
219 if ((loc_begin_A2 >= 0) && (loc_begin_A2 < 1) && (loc_end_A2 >= 1)) {
226 if ((loc_begin_A2 >= 1) && (loc_end_A2 >= 1)) {
231 if ((loc_begin_A2 < 0) && (loc_end_A2 >= 1)) {
237 OLD_ASSERT(X1==0 && X2==0 && Y1==0 && Y2==0,
"Uncovered situation.");
288 }
else if ( pos ==
same ) {
307 double loc_begin_A, loc_end_A;
308 loc_begin_A = (t1 > 0) ? t1 : 0;
309 loc_end_A = (t2 < 1) ? t2 : 1;
342 TPosition &pos,
double &t1,
double &t2) {
353 TPosition &pos,
double &t1,
double &t2) {
363 TPosition &pos,
double &t2,
double &t1) {
378 sqrt(pow(P.
GetA(), 2) + pow(P.
GetB(), 2) + pow(P.
GetC(), 2));
384 dis = sqrt(pow(P1.
X() - P2.
X(), 2) + pow(P1.
Y() - P2.
Y(), 2) +
385 pow(P1.
Z() - P2.
Z(), 2));
409 for (i = 1; i <= 3; i++)
414 u1 = v1 = u2 = v2 = -1;
442 for (i = 1; i <= 3; i++) {
456 if (u1 != -1 && v1 != -1)
484 for (i = 1; i <= 3; i++) {
491 aa(i-1,1) = (-P.
GetU().
Get(i));
492 aa(i-1,2) = (-P.
GetV().
Get(i));
495 arma::solve(xx, aa, bb);
646 loc_tria_coord_01[0]=0;
647 loc_tria_coord_01[1]=0;
649 loc_tria_coord_02[0]=1;
650 loc_tria_coord_02[1]=0;
652 loc_tria_coord_03[0]=0;
653 loc_tria_coord_03[1]=1;
657 if (insec_tmp != NULL) {
683 if (insec_tmp != NULL) {
698 delete insec_point_tmp[0];
705 if (insec_tmp != NULL) {
720 delete insec_point_tmp[0];
721 delete insec_point_tmp[1];
734 if (*(insec_point_tmp[0]) == *(insec_point_tmp[0])) {
738 for (
int i = 0; i < cit; i++) {
739 if (*(insec_point_tmp[i]) == *(insec_point_tmp[(i+1)%3])) {
744 delete insec_point_tmp[(i+1)%3];
750 insec_point_tmp[0] = insec_point_tmp[i];
751 insec_point_tmp[1] = tmp;
758 cout <<
"cit = " << cit << endl;
759 THROW( ExcAssertMsg() << EI_Message(
"Error - pocet bodu pruniku != 2.\n") );
762 if (*(insec_point_tmp[0]) == *(insec_point_tmp[1])) {
766 delete insec_point_tmp[1];
836 if (A1_t < 0) A1_t = 0;
837 if (A2_t > 1) A2_t = 1;
975 coef = fabs(tt[1] - tt[0]);
982 for (
int i = 1; i <= 4; i++) {
996 if (tt1 < 0) tt1 = 0;
997 if (tt2 > 1) tt2 = 1;
998 coef = fabs(tt2 - tt1);
1021 if (tt[0] < 0) tt[0] = 0;
1022 if (tt[1] > 1) tt[1] = 1;
1023 coef = fabs(tt[1] - tt[0]);
1035 if (insec !=
nullptr)
delete insec;
1052 for (
int i = 1; i <= 3; i++) {
1061 for (
int i = 1; i <= 3; i++) {
1062 for (
int j = 1; j <= 4; j++) {
1083 for (
int i = 1; i <= 6; i++) {
1118 for (
int i = 1; i <= 3; i++) {
1120 if (a.GetMin(i) > b.GetMax(i) +
epsilon || a.GetMax(i) < b.GetMin(i) -
epsilon) {
const TPoint & GetPoint() const
enum ngh::Positions TPosition
void Set(int, int, double)
const TVector & GetNormal() const
const TAbscissa & GetAbscissa(int) const
bool QuickIntersectionTest(const A &a, const B &b)
bool IsInner(const TPoint &) const
const IntersectionPoint * get_point(const unsigned int index) const
IntersectionType get_type() const
void Get(double &, double &, double &) const
const TPoint & GetPoint(int) const
const TVector & GetVector() const
const TPoint & GetPoint() const
static constexpr bool value
const std::vector< double > & el2_coord() const
double Distance(const TBisector &, const TPoint &)
void GetParameter(const TPoint &, double &, bool &) const
void add_local_coord(const std::vector< double > &coordin1, const std::vector< double > &coordin2)
bool AreParallel(const TVector &, const TVector &)
void add_local_point(IntersectionPoint *InPoint)
const TVector & GetV() const
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value andis_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects
const std::vector< double > & el1_coord() const
bool Belong(const TPoint &) const
void SetPoint(const TPoint &)
TNSolutions Gauss(const TMatrix &, TMVector *, const TMVector &)
double Dot(const TVector &, const TVector &)
void GetIntersection(const TPlain &P, const TBisector &B, TPosition &pos, double &t)
bool ArePerpendicular(const TVector &, const TVector &)
enum ngh::Intersections TIntersectionType
const TPlain & GetPlain() const
const TAbscissa & GetAbscissa(int) const
bool IsInner(const TPoint &) const
const TTriangle & GetTriangle(int) const
bool Belong(const TPoint &) const
TVector Cross(const TVector &, const TVector &)
void SetVector(const TVector &)
const TVector & GetU() const
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
IntersectionPoint * interpolate(const IntersectionPoint &A1, const IntersectionPoint &A2, double t)
bool IsEqual(double, double)