b311480e |
1 | // Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
b311480e |
14 | |
7fd59977 |
15 | #include <StdFail_NotDone.hxx> |
16 | #include <IntSurf_LineOn2S.hxx> |
17 | |
18 | inline Standard_Boolean IntWalk_PWalking::IsDone() const { |
19 | return done; |
20 | } |
21 | |
22 | inline Standard_Integer IntWalk_PWalking::NbPoints() const { |
9775fa61 |
23 | if(!done) throw StdFail_NotDone(); |
7fd59977 |
24 | return line->NbPoints(); |
25 | } |
26 | |
27 | inline const IntSurf_PntOn2S& IntWalk_PWalking::Value |
28 | (const Standard_Integer Index) const |
29 | { |
9775fa61 |
30 | if (!done) throw StdFail_NotDone(); |
7fd59977 |
31 | return line->Value(Index); |
32 | } |
33 | |
34 | |
35 | inline const Handle(IntSurf_LineOn2S)& IntWalk_PWalking::Line () const { |
36 | |
9775fa61 |
37 | if (!done) throw StdFail_NotDone(); |
7fd59977 |
38 | return line; |
39 | } |
40 | |
41 | |
42 | inline Standard_Boolean IntWalk_PWalking::TangentAtFirst() const{ |
9775fa61 |
43 | if(!done) throw StdFail_NotDone(); |
7fd59977 |
44 | return tgfirst; |
45 | } |
46 | |
47 | inline Standard_Boolean IntWalk_PWalking::TangentAtLast() const{ |
9775fa61 |
48 | if(!done) throw StdFail_NotDone(); |
7fd59977 |
49 | return tglast; |
50 | } |
51 | |
52 | inline Standard_Boolean IntWalk_PWalking::IsClosed() const{ |
9775fa61 |
53 | if(!done) throw StdFail_NotDone(); |
7fd59977 |
54 | return close; |
55 | } |
56 | |
57 | inline const gp_Dir& IntWalk_PWalking::TangentAtLine |
58 | (Standard_Integer& Index) const |
59 | { |
9775fa61 |
60 | if(!done) throw StdFail_NotDone(); |
7fd59977 |
61 | Index = indextg; |
62 | return tgdir; |
63 | } |
64 | |
65 | #define REGLAGE 0 |
66 | |
67 | inline void IntWalk_PWalking::AddAPoint(Handle(IntSurf_LineOn2S)& theLine, |
68 | const IntSurf_PntOn2S& POn2S) { |
69 | #if REGLAGE |
70 | Standard_Integer n=theLine->NbPoints(); |
71 | if(n) { |
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); |
79 | fflush(stdout); |
80 | } |
81 | #endif |
82 | theLine->Add(POn2S); |
83 | } |
84 | |
85 | |