1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <StdFail_NotDone.hxx>
16 #include <IntSurf_LineOn2S.hxx>
18 inline Standard_Boolean IntWalk_PWalking::IsDone() const {
22 inline Standard_Integer IntWalk_PWalking::NbPoints() const {
23 if(!done) StdFail_NotDone::Raise();
24 return line->NbPoints();
27 inline const IntSurf_PntOn2S& IntWalk_PWalking::Value
28 (const Standard_Integer Index) const
30 if (!done) StdFail_NotDone::Raise();
31 return line->Value(Index);
35 inline const Handle(IntSurf_LineOn2S)& IntWalk_PWalking::Line () const {
37 if (!done) StdFail_NotDone::Raise();
42 inline Standard_Boolean IntWalk_PWalking::TangentAtFirst() const{
43 if(!done) StdFail_NotDone::Raise();
47 inline Standard_Boolean IntWalk_PWalking::TangentAtLast() const{
48 if(!done) StdFail_NotDone::Raise();
52 inline Standard_Boolean IntWalk_PWalking::IsClosed() const{
53 if(!done) StdFail_NotDone::Raise();
57 inline const gp_Dir& IntWalk_PWalking::TangentAtLine
58 (Standard_Integer& Index) const
60 if(!done) StdFail_NotDone::Raise();
67 inline void IntWalk_PWalking::AddAPoint(Handle(IntSurf_LineOn2S)& theLine,
68 const IntSurf_PntOn2S& POn2S) {
70 Standard_Integer n=theLine->NbPoints();
72 gp_Vec V(POn2S.Value(),theLine->Value(n).Value());
73 Standard_Real u1,v1,u2,v2;
74 Standard_Real U1,V1,U2,V2;
75 POn2S.Parameters(u1,v1,u2,v2);
76 theLine->Value(n).Parameters(U1,V1,U2,V2);
77 printf("\n%3d: (%10.5g)(%+12.5g %+12.5g %+12.5g) (%+12.5g %+12.5g) (%+12.5g %+12.5g)",n,
78 V.Magnitude(),V.X(),V.Y(),V.Z(),U1-u1,V1-v1,U2-u2,V2-v2);