0031499: Boolean Operations - Custom fuzzy value corrupts the result of CUT
[occt.git] / src / IntPatch / IntPatch_ALine.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 <Precision.hxx>
19#include <IntPatch_Point.hxx>
20
21
22inline void IntPatch_ALine::Replace (const Standard_Integer Index, const IntPatch_Point& Pnt)
23{
24 svtx(Index) = Pnt;
25}
26
27inline void IntPatch_ALine::SetFirstPoint (const Standard_Integer IndFirst)
28{
29 fipt = Standard_True;
30 indf = IndFirst;
31}
32
33inline void IntPatch_ALine::SetLastPoint (const Standard_Integer IndLast)
34{
35 lapt = Standard_True;
36 indl = IndLast;
37}
38
39inline 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
47inline 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
55inline gp_Pnt IntPatch_ALine::Value (const Standard_Real U)
56{
57 return curv.Value(U);// Value leve l exception DomainError
58}
59
60inline 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
3306fdd9 65inline void IntPatch_ALine::FindParameter(const gp_Pnt& theP,
66 TColStd_ListOfReal& theParams) const
7fd59977 67{
3306fdd9 68 curv.FindParameter(theP, theParams);
7fd59977 69}
70
71inline Standard_Boolean IntPatch_ALine::HasFirstPoint () const
72{
73 return fipt;
74}
75
76inline Standard_Boolean IntPatch_ALine::HasLastPoint () const
77{
78 return lapt;
79}
80
81inline const IntPatch_Point& IntPatch_ALine::FirstPoint () const
82{
9775fa61 83 if (!fipt) {throw Standard_DomainError();}
7fd59977 84 return svtx(indf);
85}
86
87inline const IntPatch_Point& IntPatch_ALine::LastPoint () const
88{
9775fa61 89 if (!lapt) {throw Standard_DomainError();}
7fd59977 90 return svtx(indl);
91}
92
93inline Standard_Integer IntPatch_ALine::NbVertex () const
94{
95 return svtx.Length();
96}
97
98inline const IntPatch_Point& IntPatch_ALine::Vertex (const Standard_Integer Index) const
99{
100 return svtx(Index);
101}