0027664: Incomplete intersection curve from the attached shapes
[occt.git] / src / IntPatch / IntPatch_ALine.lxx
1 // Created on: 1992-04-06
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <Standard_DomainError.hxx>
18 #include <Precision.hxx>
19 #include <IntPatch_Point.hxx>
20
21
22 inline void IntPatch_ALine::Replace (const Standard_Integer Index, const IntPatch_Point& Pnt)
23 {
24   svtx(Index) = Pnt;
25 }
26
27 inline void IntPatch_ALine::SetFirstPoint (const Standard_Integer IndFirst)
28 {
29   fipt = Standard_True;
30   indf = IndFirst;
31 }
32
33 inline void IntPatch_ALine::SetLastPoint (const Standard_Integer IndLast)
34 {
35   lapt = Standard_True;
36   indl = IndLast;
37 }
38
39 inline Standard_Real IntPatch_ALine::FirstParameter (Standard_Boolean& IsIncluded) const
40 {
41   Standard_Real bid,first;
42   curv.Domain(first,bid);
43   IsIncluded = !curv.IsFirstOpen();
44   return first;
45 }
46
47 inline Standard_Real IntPatch_ALine::LastParameter (Standard_Boolean& IsIncluded) const
48 {
49   Standard_Real bid,last;
50   curv.Domain(bid,last);
51   IsIncluded = !curv.IsLastOpen();
52   return last;
53 }
54
55 inline gp_Pnt IntPatch_ALine::Value (const Standard_Real U)
56 {
57   return curv.Value(U);// Value leve l exception DomainError
58 }
59
60 inline Standard_Boolean IntPatch_ALine::D1(const Standard_Real U, gp_Pnt& P, gp_Vec& Du)
61 {
62   return curv.D1u(U,P,Du); // D1u leve l exception DomainError
63 }
64
65 inline Standard_Boolean IntPatch_ALine::FindParameter(const gp_Pnt& P, Standard_Real& Para) const
66 {
67   return curv.FindParameter(P,Para);
68 }
69
70 inline Standard_Boolean IntPatch_ALine::HasFirstPoint () const
71 {
72   return fipt;
73 }
74
75 inline Standard_Boolean IntPatch_ALine::HasLastPoint () const
76 {
77   return lapt;
78 }
79
80 inline const IntPatch_Point& IntPatch_ALine::FirstPoint () const
81 {
82   if (!fipt) {Standard_DomainError::Raise();}
83   return svtx(indf);
84 }
85
86 inline const IntPatch_Point& IntPatch_ALine::LastPoint () const
87 {
88   if (!lapt) {Standard_DomainError::Raise();}
89   return svtx(indl);
90 }
91
92 inline Standard_Integer IntPatch_ALine::NbVertex () const
93 {
94   return svtx.Length();
95 }
96
97 inline const IntPatch_Point& IntPatch_ALine::Vertex (const Standard_Integer Index) const
98 {
99   return svtx(Index);
100 }