1 // Created on: 1999-02-19
2 // Created by: Sergey KHROMOV
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and / or modify it
9 // under the terms of the GNU Lesser General Public version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 static Standard_Boolean NotParallel(gp_Vec& T, gp_Vec& V)
21 if (V.CrossMagnitude(T) > 1.e-12)
24 if (V.CrossMagnitude(T) > 1.e-12)
27 if (V.CrossMagnitude(T) > 1.e-12)
29 return Standard_False;
32 Standard_Boolean AppParCurves_Variational::InitTthetaF(const Standard_Integer ndimen,
33 const AppParCurves_Constraint typcon,
34 const Standard_Integer begin,
35 const Standard_Integer jndex)
37 if ((ndimen < 2)||(ndimen >3))
38 return Standard_False;
40 gp_Vec theta1, theta2;
42 Standard_Real XX, XY, YY, XZ, YZ, ZZ;
44 if ((typcon == AppParCurves_TangencyPoint)||(typcon == AppParCurves_CurvaturePoint))
46 T.SetX(myTabConstraints->Value(jndex));
47 T.SetY(myTabConstraints->Value(jndex + 1));
49 T.SetZ(myTabConstraints->Value(jndex + 2));
59 if (!NotParallel(T, V))
60 return Standard_False;
63 myTtheta->SetValue(begin, theta1.X());
64 myTtheta->SetValue(begin + 1, theta1.Y());
69 myTtheta->SetValue(begin + 2, theta1.Z());
70 myTtheta->SetValue(begin + 3, theta2.X());
71 myTtheta->SetValue(begin + 4, theta2.Y());
72 myTtheta->SetValue(begin + 5, theta2.Z());
75 // Calculation of myTfthet
76 if (typcon == AppParCurves_CurvaturePoint)
83 F.SetX(YY * theta1.X() - XY * theta1.Y());
84 F.SetY(XX * theta1.Y() - XY * theta1.X());
85 myTfthet->SetValue(begin, F.X());
86 myTfthet->SetValue(begin + 1, F.Y());
94 F.SetX((ZZ + YY) * theta1.X() - XY * theta1.Y() - XZ * theta1.Z());
95 F.SetY((XX + ZZ) * theta1.Y() - XY * theta1.X() - YZ * theta1.Z());
96 F.SetZ((XX + YY) * theta1.Z() - XZ * theta1.X() - YZ * theta1.Y());
97 myTfthet->SetValue(begin, F.X());
98 myTfthet->SetValue(begin + 1, F.Y());
99 myTfthet->SetValue(begin + 2, F.Z());
100 F.SetX((ZZ + YY) * theta2.X() - XY * theta2.Y() - XZ * theta2.Z());
101 F.SetY((XX + ZZ) * theta2.Y() - XY * theta2.X() - YZ * theta2.Z());
102 F.SetZ((XX + YY) * theta2.Z() - XZ * theta2.X() - YZ * theta2.Y());
103 myTfthet->SetValue(begin + 3, F.X());
104 myTfthet->SetValue(begin + 4, F.Y());
105 myTfthet->SetValue(begin + 5, F.Z());
109 return Standard_True;