0022627: Change OCCT memory management defaults
[occt.git] / src / IntPatch / IntPatch_WLine.lxx
1 // File:        IntPatch_WLine.lxx
2 // Created:     Mon May 27 13:18:45 1991
3 // Author:      Isabelle GRIGNON
4 // Copyright:   OPEN CASCADE 1991, 1992
5
6 #include <Standard_DomainError.hxx>
7 #include <IntSurf_LineOn2S.hxx>
8 #include <IntPatch_Point.hxx>
9
10
11 inline void IntPatch_WLine::AddVertex (const IntPatch_Point& Pnt)
12 {
13   svtx.Append(Pnt);
14 }
15
16 inline void IntPatch_WLine::Replace (const Standard_Integer Index,
17                                      const IntPatch_Point& Pnt)
18 {
19   svtx(Index) = Pnt;
20 }
21
22 inline void IntPatch_WLine::SetFirstPoint (const Standard_Integer IndFirst)
23 {
24   fipt = Standard_True;
25   indf = IndFirst;
26 }
27
28 inline void IntPatch_WLine::SetLastPoint (const Standard_Integer IndLast)
29 {
30   lapt = Standard_True;
31   indl = IndLast;
32 }
33
34 inline Standard_Integer IntPatch_WLine::NbPnts () const
35 {
36   return curv->NbPoints();
37 }
38
39 inline const IntSurf_PntOn2S& IntPatch_WLine::Point (const Standard_Integer Index) const
40 {
41   return curv->Value(Index);
42 }
43
44 inline Standard_Boolean IntPatch_WLine::HasFirstPoint () const
45 {
46   return fipt;
47 }
48
49 inline Standard_Boolean IntPatch_WLine::HasLastPoint () const
50 {
51   return lapt;
52 }
53
54 inline const IntPatch_Point& IntPatch_WLine::FirstPoint () const
55 {
56   if (!fipt) {Standard_DomainError::Raise();}
57   return svtx(indf);
58 }
59
60 inline const IntPatch_Point& IntPatch_WLine::LastPoint () const
61 {
62   if (!lapt) {Standard_DomainError::Raise();}
63   return svtx(indl);
64 }
65
66 inline const IntPatch_Point& IntPatch_WLine::FirstPoint (Standard_Integer& Indfirst) const
67 {
68   if (!fipt) {Standard_DomainError::Raise();}
69   Indfirst = indf;
70   return svtx(indf);
71 }
72
73 inline const IntPatch_Point& IntPatch_WLine::LastPoint (Standard_Integer& Indlast) const
74 {
75   if (!lapt) {Standard_DomainError::Raise();}
76   Indlast = indl;
77   return svtx(indl);
78 }
79
80 inline Standard_Integer IntPatch_WLine::NbVertex () const
81 {
82   return svtx.Length();
83 }
84
85 inline const IntPatch_Point& IntPatch_WLine::Vertex (const Standard_Integer Index) const
86 {
87   return svtx(Index);
88 }