0022627: Change OCCT memory management defaults
[occt.git] / src / IntSurf / IntSurf.cxx
CommitLineData
7fd59977 1
2
3#include <IntSurf.ixx>
4
5#include <Precision.hxx>
6#include <gp.hxx>
7#include <gp_Dir.hxx>
8#include <gp_Vec.hxx>
9#include <IntSurf_Transition.hxx>
10
11//--------------------------------------------------------------
12//-- IntSurf::MakeTransition(Vtgint,Vtgrst,Normale,Transline,Transarc);
13//--
14
15
16//-- tgFirst = Tangente Ligne Intersection
17//-- tgSecond = Tangenet Restriction
18//-- Normale = Normale a la surface
19void IntSurf::MakeTransition (const gp_Vec& TgFirst,
20 const gp_Vec& TgSecond,
21 const gp_Dir& Normale,
22 IntSurf_Transition& TFirst,
23 IntSurf_Transition& TSecond)
24
25{
26
27
28 // Effectuer le produit mixte normale, tangente 1, tangente 2
29 // pour avoir le type de la transition.
30
31 gp_Vec pvect(TgSecond.Crossed(TgFirst));
32
33 Standard_Real NTgSecond = TgSecond.Magnitude();
34 Standard_Real NTgFirst = TgFirst.Magnitude();
35 Standard_Real NTgSecondNTgFirstAngular = NTgSecond*NTgFirst*Precision::Angular();
36
37 if(NTgFirst <= Precision::Confusion()) {
38 TFirst.SetValue(Standard_True,IntSurf_Undecided);
39 TSecond.SetValue(Standard_True,IntSurf_Undecided);
40 }
41 else if ( (NTgSecond <= Precision::Confusion())
42 || (pvect.Magnitude()<= NTgSecondNTgFirstAngular)) {
43 TFirst.SetValue(Standard_True,IntSurf_Unknown,TgFirst.Dot(TgSecond)<0.0);
44 TSecond.SetValue(Standard_True,IntSurf_Unknown,TgFirst.Dot(TgSecond)<0.0);
45 }
46 else {
47 Standard_Real yu = pvect.Dot(Normale);
48 yu/=NTgSecond*NTgFirst;
49 if (yu>0.0001) {
50 TFirst.SetValue(Standard_False,IntSurf_In);
51 TSecond.SetValue(Standard_False,IntSurf_Out);
52 }
53 else if(yu<-0.0001) {
54 TFirst.SetValue(Standard_False,IntSurf_Out);
55 TSecond.SetValue(Standard_False,IntSurf_In);
56 }
57 else {
58#if 0
59 //-- MODIF XAB
60 gp_Vec V1(TgSecond.X() / NTgSecond,TgSecond.Y() / NTgSecond, TgSecond.Z() / NTgSecond);
61 gp_Vec V2(TgFirst.X() / NTgFirst,TgFirst.Y() / NTgFirst, TgFirst.Z() / NTgFirst);
62
63 pvect = V1.Crossed(V2);
64 yu = pvect.Dot(Normale);
65
66 if (yu>0.0000001) {
67 TFirst.SetValue(Standard_False,IntSurf_In);
68 TSecond.SetValue(Standard_False,IntSurf_Out);
69 }
70 else if(yu<-0.0000001) {
71 TFirst.SetValue(Standard_False,IntSurf_Out);
72 TSecond.SetValue(Standard_False,IntSurf_In);
73 }
74 else {
75 TFirst.SetValue(Standard_True,IntSurf_Undecided);
76 TSecond.SetValue(Standard_True,IntSurf_Undecided);
77 }
78
79#else
80 TFirst.SetValue(Standard_True,IntSurf_Undecided);
81 TSecond.SetValue(Standard_True,IntSurf_Undecided);
82
83#endif
84
85
86
87 }
88 }
89}
90
91
92
93
94