0027780: Face-face intersection produces 2D curve that has reversed derivative at...
[occt.git] / src / IntPatch / IntPatch_RLine.lxx
CommitLineData
b311480e 1// Created on: 1992-04-06
2// Created by: Jacques GOUSSARD
3// Copyright (c) 1992-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <Standard_DomainError.hxx>
18#include <IntSurf_LineOn2S.hxx>
19#include <IntPatch_Point.hxx>
20
21
22inline const Handle(Adaptor2d_HCurve2d)& IntPatch_RLine::ArcOnS1() const
23{
24 return theArcOnS1;
25}
26
27inline const Handle(Adaptor2d_HCurve2d)& IntPatch_RLine::ArcOnS2() const
28{
29 return theArcOnS2;
30}
31
32//-- Il faut mettre cet include ici , car l include fait un define Handle(Adaptor2d_HCurve2d) ...
33//-- et en fin de fichier un undef Handle(Adaptor2d_HCurve2d) ...
34
b8f67cc2 35inline void IntPatch_RLine::AddVertex (const IntPatch_Point& thePnt,
36 const Standard_Boolean theIsPrepend)
7fd59977 37{
b8f67cc2 38 if(theIsPrepend)
39 svtx.Prepend(thePnt);
40 else
41 svtx.Append(thePnt);
7fd59977 42}
43
44inline void IntPatch_RLine::Replace (const Standard_Integer Index,
45 const IntPatch_Point& Pnt)
46{
47 svtx(Index) = Pnt;
48}
49
50inline void IntPatch_RLine::SetFirstPoint (const Standard_Integer IndFirst)
51{
52 fipt = Standard_True;
53 indf = IndFirst;
54}
55
56inline void IntPatch_RLine::SetLastPoint (const Standard_Integer IndLast)
57{
58 lapt = Standard_True;
59 indl = IndLast;
60}
61
62inline void IntPatch_RLine::Add(const Handle(IntSurf_LineOn2S)& L)
63{
64 curv = L;
65}
66
67inline Standard_Boolean IntPatch_RLine::IsArcOnS1() const
68{
69 return onS1;
70}
71
72inline Standard_Boolean IntPatch_RLine::IsArcOnS2() const
73{
74 return onS2;
75}
76
77inline Standard_Boolean IntPatch_RLine::HasFirstPoint () const
78{
79 return fipt;
80}
81
82inline Standard_Boolean IntPatch_RLine::HasLastPoint () const
83{
84 return lapt;
85}
86
87inline const IntPatch_Point& IntPatch_RLine::FirstPoint () const
88{
89 if (!fipt) {Standard_DomainError::Raise();}
90 return svtx(indf);
91}
92
93inline const IntPatch_Point& IntPatch_RLine::LastPoint () const
94{
95 if (!lapt) {Standard_DomainError::Raise();}
96 return svtx(indl);
97}
98
99inline Standard_Integer IntPatch_RLine::NbVertex () const
100{
101 return svtx.Length();
102}
103
104inline const IntPatch_Point& IntPatch_RLine::Vertex (const Standard_Integer Index) const
105{
106 return svtx(Index);
107}
108
eee615ad 109inline IntPatch_Point& IntPatch_RLine::ChangeVertex (const Standard_Integer Index)
110{
111 return svtx(Index);
112}
113
114inline void IntPatch_RLine::RemoveVertex(const Standard_Integer theIndex)
115{
116 if((theIndex < 1) || (theIndex > NbVertex()))
117 Standard_OutOfRange::Raise("Cannot delete not existing vertex");
118 svtx.Remove(theIndex);
119}
120
7fd59977 121inline Standard_Boolean IntPatch_RLine::HasPolygon () const
122{
123 return (!curv.IsNull());
124}
125
126inline Standard_Integer IntPatch_RLine::NbPnts () const
127{
128 if (curv.IsNull()) {Standard_DomainError::Raise();}
129 return curv->NbPoints();
130}
131
132inline const IntSurf_PntOn2S& IntPatch_RLine::Point (const Standard_Integer Index) const
133{
134 if (curv.IsNull()) {Standard_DomainError::Raise();}
135 return curv->Value(Index);
136}
77dbd1f1 137
138inline Handle(IntSurf_LineOn2S) IntPatch_RLine::Curve() const
139{
140 return(curv);
141}