1 // File: gce_MakeLin2d.cxx
2 // Created: Wed Sep 2 11:35:00 1992
6 #include <gce_MakeLin2d.ixx>
8 #include <StdFail_NotDone.hxx>
10 //=========================================================================
11 // Creation d une ligne 2d de gp a partir d un Ax2d de gp. +
12 //=========================================================================
14 gce_MakeLin2d::gce_MakeLin2d(const gp_Ax2d& A)
16 TheLin2d = gp_Lin2d(A);
20 //=========================================================================
21 // Creation d une ligne 2d de gp a partir de son origine P (Pnt2d de gp)+
22 // et d une direction V (Dir2d de gp). +
23 //=========================================================================
25 gce_MakeLin2d::gce_MakeLin2d(const gp_Pnt2d& P,
28 TheLin2d = gp_Lin2d(P,V);
32 //=========================================================================
33 // Creation d une ligne 2d de gp a partir des parametres de son +
35 //=========================================================================
37 gce_MakeLin2d::gce_MakeLin2d(const Standard_Real A,
38 const Standard_Real B,
39 const Standard_Real C)
41 if (A*A + B*B <= gp::Resolution()) {
42 TheError = gce_NullAxis;
45 TheLin2d = gp_Lin2d(A,B,C);
50 //=========================================================================
51 // Creation d une ligne 2d de gp passant par les deux points <P1> et +
53 //=========================================================================
55 gce_MakeLin2d::gce_MakeLin2d(const gp_Pnt2d& P1,
58 if (P1.Distance(P2) >= gp::Resolution()) {
59 TheLin2d = gp_Lin2d(P1,gp_Dir2d(P2.XY()-P1.XY()));
63 TheError = gce_ConfusedPoints;
67 //=========================================================================
68 // Creation d une ligne 2d de gp <TheLine> parallele a une autre ligne +
69 // <Line1> passant par le point <Point1>. +
70 //=========================================================================
72 gce_MakeLin2d::gce_MakeLin2d(const gp_Lin2d& Line,
73 const gp_Pnt2d& Point)
75 TheLin2d = gp_Lin2d(Point,Line.Direction());
79 //=========================================================================
80 // Creation d une ligne 2d de gp <TheLine> parallele a une autre ligne +
81 // <Line1> a une distance <Dist1>. +
82 //=========================================================================
84 gce_MakeLin2d::gce_MakeLin2d(const gp_Lin2d& Line,
85 const Standard_Real Dist)
87 gp_Pnt2d Point(Line.Location().XY()+
88 Dist*gp_XY(-Line.Direction().Y(),Line.Direction().X()));
89 TheLin2d = gp_Lin2d(Point,Line.Direction());
93 gp_Lin2d gce_MakeLin2d::Value() const
95 StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
99 gp_Lin2d gce_MakeLin2d::Operator() const
104 gce_MakeLin2d::operator gp_Lin2d () const