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>
24 //=======================================================================
25 //function : HLRAlgo_EdgeStatus
27 //=======================================================================
28 HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus()
38 //=======================================================================
39 //function : HLRAlgo_EdgeStatus
41 //=======================================================================
43 HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus (const Standard_Real Start,
44 const Standard_ShortReal TolStart,
45 const Standard_Real End ,
46 const Standard_ShortReal TolEnd) :
49 myTolStart (TolStart),
57 //=======================================================================
58 //function : Initialize
60 //=======================================================================
62 void HLRAlgo_EdgeStatus::Initialize (const Standard_Real Start,
63 const Standard_ShortReal TolStart,
64 const Standard_Real End ,
65 const Standard_ShortReal TolEnd)
68 myTolStart = TolStart;
74 //=======================================================================
75 //function : NbVisiblePart
77 //=======================================================================
79 Standard_Integer HLRAlgo_EdgeStatus::NbVisiblePart () const
81 if (AllHidden ()) return 0;
82 else if (AllVisible()) return 1;
83 else return myVisibles.NbIntervals();
86 //=======================================================================
87 //function : VisiblePart
89 //=======================================================================
91 void HLRAlgo_EdgeStatus::VisiblePart (const Standard_Integer Index,
93 Standard_ShortReal& TolStart,
95 Standard_ShortReal& TolEnd ) const
97 if (AllVisible()) Bounds(Start,TolStart,End,TolEnd);
98 else myVisibles.Value(Index).Bounds(Start,TolStart,End,TolEnd);
101 //=======================================================================
104 //=======================================================================
106 void HLRAlgo_EdgeStatus::Hide (const Standard_Real Start ,
107 const Standard_ShortReal TolStart,
108 const Standard_Real End ,
109 const Standard_ShortReal TolEnd ,
110 const Standard_Boolean OnFace ,
111 const Standard_Boolean)
115 myVisibles = Intrv_Intervals
116 (Intrv_Interval(myStart,myTolStart,myEnd,myTolEnd));
117 AllVisible(Standard_False);
119 myVisibles.Subtract(Intrv_Interval(Start,TolStart,End,TolEnd));
120 if (!AllHidden()) AllHidden(myVisibles.NbIntervals() == 0);