7fd59977 |
1 | // File: ApproxInt_WLine.gxx |
2 | // Created: Mon Nov 8 10:00:00 1993 |
3 | // Author: lbr |
4 | // Copyright: Matra Datavision 1993 |
5 | |
6 | |
7 | |
8 | |
9 | ApproxInt_WLine::ApproxInt_WLine(const TheCurve& CurveXYZ, |
10 | const TheCurve2d& CurveUV1, |
11 | const TheCurve2d& CurveUV2) { |
12 | curvxyz = CurveXYZ; |
13 | curvuv1 = CurveUV1; |
14 | curvuv2 = CurveUV2; |
15 | } |
16 | |
17 | |
18 | ApproxInt_WLine::ApproxInt_WLine(const Handle(IntSurf_LineOn2S)& lin, |
19 | const Standard_Boolean ) |
20 | :linon2s(lin) |
21 | { |
22 | } |
23 | |
24 | Standard_Integer ApproxInt_WLine::NbPnts() const { |
25 | if(!curvxyz.IsNull()) |
26 | return(curvxyz->NbPoles()); |
27 | if(!curvuv1.IsNull()) |
28 | return(curvuv1->NbPoles()); |
29 | if(!curvuv2.IsNull()) |
30 | return(curvuv2->NbPoles()); |
31 | return(linon2s->NbPoints()); |
32 | } |
33 | |
34 | IntSurf_PntOn2S ApproxInt_WLine::Point(const Standard_Integer Index) { |
35 | if(!linon2s.IsNull()) { |
36 | if(linon2s->NbPoints()) { |
37 | return(linon2s->Value(Index)); |
38 | } |
39 | } |
40 | gp_Pnt2d P1,P2; |
41 | gp_Pnt P; |
42 | if(!curvxyz.IsNull()) |
43 | P = curvxyz->Pole(Index); |
44 | if(!curvuv1.IsNull()) |
45 | P1 = curvuv1->Pole(Index); |
46 | if(!curvuv2.IsNull()) |
47 | P2 = curvuv2->Pole(Index); |
48 | |
49 | pnton2s.SetValue(P, |
50 | P1.X(), |
51 | P1.Y(), |
52 | P2.X(), |
53 | P2.Y()); |
54 | return(pnton2s); |
55 | } |
56 | |