b311480e |
1 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
d5f74e42 |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
7fd59977 |
14 | |
0797d9d3 |
15 | #ifndef OCCT_DEBUG |
7fd59977 |
16 | #define No_Standard_RangeError |
17 | #define No_Standard_OutOfRange |
18 | #endif |
19 | |
42cf5bc1 |
20 | |
21 | #include <gp.hxx> |
22 | #include <gp_Pln.hxx> |
23 | #include <gp_Pnt.hxx> |
24 | #include <IntAna_Int3Pln.hxx> |
7fd59977 |
25 | #include <math_Gauss.hxx> |
26 | #include <math_Matrix.hxx> |
27 | #include <math_Vector.hxx> |
42cf5bc1 |
28 | #include <Standard_DomainError.hxx> |
29 | #include <StdFail_NotDone.hxx> |
7fd59977 |
30 | |
d533dafb |
31 | IntAna_Int3Pln::IntAna_Int3Pln() |
32 | : done(Standard_False), |
33 | empt(Standard_True) |
34 | { |
35 | } |
7fd59977 |
36 | |
37 | |
38 | IntAna_Int3Pln::IntAna_Int3Pln (const gp_Pln& P1, const gp_Pln& P2, |
39 | const gp_Pln& P3) { |
40 | |
41 | Perform(P1,P2,P3); |
42 | } |
43 | |
44 | void IntAna_Int3Pln::Perform (const gp_Pln& P1, const gp_Pln& P2, |
45 | const gp_Pln& P3) { |
46 | |
47 | done=Standard_False; |
7e59624d |
48 | math_Matrix M(1,3,1,3); |
49 | math_Vector V(1,3); |
7fd59977 |
50 | |
51 | P1.Coefficients(M(1,1),M(1,2),M(1,3),V(1)); |
52 | P2.Coefficients(M(2,1),M(2,2),M(2,3),V(2)); |
53 | P3.Coefficients(M(3,1),M(3,2),M(3,3),V(3)); |
54 | |
55 | math_Gauss Resol(M,gp::Resolution()); |
56 | |
57 | if (!Resol.IsDone()) { |
58 | empt=Standard_True; |
59 | } |
60 | else { |
61 | empt=Standard_False; |
62 | V=-V; |
63 | Resol.Solve(V); |
64 | pnt.SetCoord(V(1),V(2),V(3)); |
65 | } |
66 | done=Standard_True; |
67 | } |
68 | |
69 | |
70 | |