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& Pnt)
27 inline void IntPatch_WLine::Replace (const Standard_Integer Index,
28 const IntPatch_Point& Pnt)
33 inline void IntPatch_WLine::SetFirstPoint (const Standard_Integer IndFirst)
39 inline void IntPatch_WLine::SetLastPoint (const Standard_Integer IndLast)
45 inline Standard_Integer IntPatch_WLine::NbPnts () const
47 return curv->NbPoints();
50 inline const IntSurf_PntOn2S& IntPatch_WLine::Point (const Standard_Integer Index) const
52 return curv->Value(Index);
55 inline Standard_Boolean IntPatch_WLine::HasFirstPoint () const
60 inline Standard_Boolean IntPatch_WLine::HasLastPoint () const
65 inline const IntPatch_Point& IntPatch_WLine::FirstPoint () const
67 if (!fipt) {Standard_DomainError::Raise();}
71 inline const IntPatch_Point& IntPatch_WLine::LastPoint () const
73 if (!lapt) {Standard_DomainError::Raise();}
77 inline const IntPatch_Point& IntPatch_WLine::FirstPoint (Standard_Integer& Indfirst) const
79 if (!fipt) {Standard_DomainError::Raise();}
84 inline const IntPatch_Point& IntPatch_WLine::LastPoint (Standard_Integer& Indlast) const
86 if (!lapt) {Standard_DomainError::Raise();}
91 inline Standard_Integer IntPatch_WLine::NbVertex () const
96 inline const IntPatch_Point& IntPatch_WLine::Vertex (const Standard_Integer Index) const
101 inline IntPatch_Point& IntPatch_WLine::ChangeVertex (const Standard_Integer Index)
106 inline void IntPatch_WLine::ClearVertexes()
111 inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
113 if((theIndex < 1) || (theIndex > NbVertex()))
114 Standard_OutOfRange::Raise("Cannot delete not existing vertex");
115 svtx.Remove(theIndex);
118 inline void IntPatch_WLine::InsertVertexBefore( const Standard_Integer theIndex,
119 const IntPatch_Point& thePnt)
121 const Standard_Integer aNbVertexes = NbVertex();
122 Standard_Integer anIndex = Max(theIndex, 1);
124 if(anIndex > aNbVertexes)
127 svtx.InsertBefore(theIndex, thePnt);