1 // Created on: 1991-05-27
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <Standard_DomainError.hxx>
18 #include <IntSurf_LineOn2S.hxx>
19 #include <IntPatch_Point.hxx>
22 inline void IntPatch_WLine::AddVertex (const IntPatch_Point& thePnt,
23 const Standard_Boolean theIsPrepend)
31 inline void IntPatch_WLine::Replace (const Standard_Integer Index,
32 const IntPatch_Point& Pnt)
37 inline void IntPatch_WLine::SetFirstPoint (const Standard_Integer IndFirst)
43 inline void IntPatch_WLine::SetLastPoint (const Standard_Integer IndLast)
49 inline Standard_Integer IntPatch_WLine::NbPnts () const
51 return curv->NbPoints();
54 inline const IntSurf_PntOn2S& IntPatch_WLine::Point (const Standard_Integer Index) const
56 return curv->Value(Index);
59 inline Standard_Boolean IntPatch_WLine::HasFirstPoint () const
64 inline Standard_Boolean IntPatch_WLine::HasLastPoint () const
69 inline const IntPatch_Point& IntPatch_WLine::FirstPoint () const
71 if (!fipt) {Standard_DomainError::Raise();}
75 inline const IntPatch_Point& IntPatch_WLine::LastPoint () const
77 if (!lapt) {Standard_DomainError::Raise();}
81 inline const IntPatch_Point& IntPatch_WLine::FirstPoint (Standard_Integer& Indfirst) const
83 if (!fipt) {Standard_DomainError::Raise();}
88 inline const IntPatch_Point& IntPatch_WLine::LastPoint (Standard_Integer& Indlast) const
90 if (!lapt) {Standard_DomainError::Raise();}
95 inline Standard_Integer IntPatch_WLine::NbVertex () const
100 inline const IntPatch_Point& IntPatch_WLine::Vertex (const Standard_Integer Index) const
105 inline IntPatch_Point& IntPatch_WLine::ChangeVertex (const Standard_Integer Index)
110 inline void IntPatch_WLine::ClearVertexes()
115 inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
117 if((theIndex < 1) || (theIndex > NbVertex()))
118 Standard_OutOfRange::Raise("Cannot delete not existing vertex");
119 svtx.Remove(theIndex);
122 inline void IntPatch_WLine::InsertVertexBefore( const Standard_Integer theIndex,
123 const IntPatch_Point& thePnt)
125 const Standard_Integer aNbVertexes = NbVertex();
126 Standard_Integer anIndex = Max(theIndex, 1);
128 if(anIndex > aNbVertexes)
131 svtx.InsertBefore(theIndex, thePnt);