38 double U[ 3 ], V[ 3 ];
55 for (
int i = 0; i < 3; i++) {
65 for (
int i = 0; i < 3; i++) {
66 if ((i != r1) && !
IsZero(U[ i ])) {
70 if ((i != r2) && !
IsZero(V[ i ])) {
77 if ((r1 == -1) || (r2 == -1)) {
83 for (
int i = 0; i < 3; i++) {
84 if ((r1 != i) && (r2 != i)) {
91 A.
Set(1, 2, -V[ r1 ]);
93 A.
Set(2, 2, -V[ r2 ]);
164 }
else if ( pos ==
same ) {
171 if (dot_product < 0 ) {
178 double loc_begin_A1, loc_end_A1, loc_begin_A2, loc_end_A2;
196 double X1=0, X2=0, Y1=0, Y2=0;
198 if ((loc_begin_A2 < 0) && (loc_end_A2 < 0)) {
203 if ((loc_begin_A2 < 0) && (loc_end_A2 >= 0) && (loc_end_A2 < 1)) {
210 if ((loc_begin_A2 >= 0) && (loc_end_A2 >= 0) && (loc_end_A2 < 1)) {
217 if ((loc_begin_A2 >= 0) && (loc_begin_A2 < 1) && (loc_end_A2 >= 1)) {
224 if ((loc_begin_A2 >= 1) && (loc_end_A2 >= 1)) {
229 if ((loc_begin_A2 < 0) && (loc_end_A2 >= 1)) {
235 OLD_ASSERT(X1==0 && X2==0 && Y1==0 && Y2==0,
"Uncovered situation.");
286 }
else if ( pos ==
same ) {
305 double loc_begin_A, loc_end_A;
306 loc_begin_A = (t1 > 0) ? t1 : 0;
307 loc_end_A = (t2 < 1) ? t2 : 1;
340 TPosition &pos,
double &t1,
double &t2) {
351 TPosition &pos,
double &t1,
double &t2) {
361 TPosition &pos,
double &t2,
double &t1) {
376 sqrt(pow(P.
GetA(), 2) + pow(P.
GetB(), 2) + pow(P.
GetC(), 2));
382 dis = sqrt(pow(P1.
X() - P2.
X(), 2) + pow(P1.
Y() - P2.
Y(), 2) +
383 pow(P1.
Z() - P2.
Z(), 2));
407 for (i = 1; i <= 3; i++)
412 u1 = v1 = u2 = v2 = -1;
440 for (i = 1; i <= 3; i++) {
454 if (u1 != -1 && v1 != -1)
482 for (i = 1; i <= 3; i++) {
489 aa(i-1,1) = (-P.
GetU().
Get(i));
490 aa(i-1,2) = (-P.
GetV().
Get(i));
493 arma::solve(xx, aa, bb);
644 loc_tria_coord_01[0]=0;
645 loc_tria_coord_01[1]=0;
647 loc_tria_coord_02[0]=1;
648 loc_tria_coord_02[1]=0;
650 loc_tria_coord_03[0]=0;
651 loc_tria_coord_03[1]=1;
655 if (insec_tmp != NULL) {
681 if (insec_tmp != NULL) {
702 if (insec_tmp != NULL) {
729 if (*(insec_point_tmp[0]) == *(insec_point_tmp[0])) {
733 for (
int i = 0; i < cit; i++) {
734 if (*(insec_point_tmp[i]) == *(insec_point_tmp[(i+1)%3])) {
739 delete insec_point_tmp[(i+1)%3];
745 insec_point_tmp[0] = insec_point_tmp[i];
746 insec_point_tmp[1] = tmp;
753 cout <<
"cit = " << cit << endl;
754 THROW( ExcAssertMsg() << EI_Message(
"Error - pocet bodu pruniku != 2.\n") );
757 if (*(insec_point_tmp[0]) == *(insec_point_tmp[1])) {
761 delete insec_point_tmp[1];
804 if (t1 < 0 - epsilon || t1 > 1 +
epsilon) {
828 if (A1_t < 0) A1_t = 0;
829 if (A2_t > 1) A2_t = 1;
965 coef = fabs(tt[1] - tt[0]);
972 for (
int i = 1; i <= 4; i++) {
986 if (tt1 < 0) tt1 = 0;
987 if (tt2 > 1) tt2 = 1;
988 coef = fabs(tt2 - tt1);
1008 if (tt[0] < 0) tt[0] = 0;
1009 if (tt[1] > 1) tt[1] = 1;
1010 coef = fabs(tt[1] - tt[0]);
1035 for (
int i = 1; i <= 3; i++) {
1044 for (
int i = 1; i <= 3; i++) {
1045 for (
int j = 1; j <= 4; j++) {
1065 for (
int i = 1; i <= 6; i++) {
1099 for (
int i = 1; i <= 3; i++) {
1101 if (a.GetMin(i) > b.GetMax(i) +
epsilon || a.GetMax(i) < b.GetMin(i) -
epsilon) {
void SetVector(const TVector &)
const TVector & GetVector() const
const TPoint & GetPoint() const
bool ArePerpendicular(const TVector &, const TVector &)
double Distance(const TBisector &B, const TPoint &P)
IntersectionPoint * interpolate(const IntersectionPoint &A1, const IntersectionPoint &A2, double t)
const IntersectionPoint * get_point(const unsigned int index) const
bool AreParallel(const TVector &, const TVector &)
const std::vector< double > & el2_coord() const
const TPoint & GetPoint() const
void SetPoint(const TPoint &)
void GetIntersection(const TBisector &B1, const TBisector &B2, TPosition &pos, double &t1, double &t2)
bool IsInner(const TPoint &) const
const TPoint & GetPoint(int) const
const TTriangle & GetTriangle(int) const
const std::vector< double > & el1_coord() const
const TVector & GetU() const
TVector Cross(const TVector &, const TVector &)
const TAbscissa & GetAbscissa(int) const
void add_local_coord(const std::vector< double > &coordin1, const std::vector< double > &coordin2)
void GetParameter(const TPoint &, double &, bool &) const
const TVector & GetV() const
enum Intersections TIntersectionType
bool Belong(const TPoint &) const
bool Belong(const TPoint &) const
const TPlain & GetPlain() const
void Set(int, int, double)
const TVector & GetNormal() const
const TAbscissa & GetAbscissa(int) const
void Get(double &, double &, double &) const
bool QuickIntersectionTest(const A &a, const B &b)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
TNSolutions Gauss(const TMatrix &, TMVector *, const TMVector &)
double Dot(const TVector &, const TVector &)
IntersectionType get_type() const
void add_local_point(IntersectionPoint *InPoint)
bool IsInner(const TPoint &) const
bool IsEqual(double, double)