1 // Created on: 1992-02-18
2 // Created by: Christophe MARION
3 // Copyright (c) 1992-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.
22 #include <HLRAlgo_EdgeStatus.hxx>
23 #include <Standard_OutOfRange.hxx>
25 //=======================================================================
26 //function : HLRAlgo_EdgeStatus
28 //=======================================================================
29 HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus()
39 //=======================================================================
40 //function : HLRAlgo_EdgeStatus
42 //=======================================================================
44 HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus (const Standard_Real Start,
45 const Standard_ShortReal TolStart,
46 const Standard_Real End ,
47 const Standard_ShortReal TolEnd) :
50 myTolStart (TolStart),
58 //=======================================================================
59 //function : Initialize
61 //=======================================================================
63 void HLRAlgo_EdgeStatus::Initialize (const Standard_Real Start,
64 const Standard_ShortReal TolStart,
65 const Standard_Real End ,
66 const Standard_ShortReal TolEnd)
69 myTolStart = TolStart;
75 //=======================================================================
76 //function : NbVisiblePart
78 //=======================================================================
80 Standard_Integer HLRAlgo_EdgeStatus::NbVisiblePart () const
82 if (AllHidden ()) return 0;
83 else if (AllVisible()) return 1;
84 else return myVisibles.NbIntervals();
87 //=======================================================================
88 //function : VisiblePart
90 //=======================================================================
92 void HLRAlgo_EdgeStatus::VisiblePart (const Standard_Integer Index,
94 Standard_ShortReal& TolStart,
96 Standard_ShortReal& TolEnd ) const
98 if (AllVisible()) Bounds(Start,TolStart,End,TolEnd);
99 else myVisibles.Value(Index).Bounds(Start,TolStart,End,TolEnd);
102 //=======================================================================
105 //=======================================================================
107 void HLRAlgo_EdgeStatus::Hide (const Standard_Real Start ,
108 const Standard_ShortReal TolStart,
109 const Standard_Real End ,
110 const Standard_ShortReal TolEnd ,
111 const Standard_Boolean OnFace ,
112 const Standard_Boolean)
116 myVisibles = Intrv_Intervals
117 (Intrv_Interval(myStart,myTolStart,myEnd,myTolEnd));
118 AllVisible(Standard_False);
120 myVisibles.Subtract(Intrv_Interval(Start,TolStart,End,TolEnd));
121 if (!AllHidden()) AllHidden(myVisibles.NbIntervals() == 0);