42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _HLRAlgo_EdgeStatus_HeaderFile |
18 | #define _HLRAlgo_EdgeStatus_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Real.hxx> |
25 | #include <Standard_ShortReal.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <Intrv_Intervals.hxx> |
28 | #include <Standard_Integer.hxx> |
29 | class Standard_OutOfRange; |
30 | |
31 | |
32 | //! This class describes the Hidden Line status of an |
33 | //! Edge. It contains : |
34 | //! |
35 | //! The Bounds of the Edge and their tolerances |
36 | //! |
37 | //! Two flags indicating if the edge is full visible |
38 | //! or full hidden. |
39 | //! |
40 | //! The Sequence of visible Intervals on the Edge. |
41 | class HLRAlgo_EdgeStatus |
42 | { |
43 | public: |
44 | |
45 | DEFINE_STANDARD_ALLOC |
46 | |
47 | |
48 | Standard_EXPORT HLRAlgo_EdgeStatus(); |
49 | |
50 | //! Creates a new EdgeStatus. Default visible. The |
51 | //! Edge is bounded by the interval <Start>, <End> |
52 | //! with the tolerances <TolStart>, <TolEnd>. |
53 | Standard_EXPORT HLRAlgo_EdgeStatus(const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd); |
54 | |
55 | //! Initialize an EdgeStatus. Default visible. The |
56 | //! Edge is bounded by the interval <Start>, <End> |
57 | //! with the tolerances <TolStart>, <TolEnd>. |
58 | Standard_EXPORT void Initialize (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd); |
dde68833 |
59 | |
60 | void Bounds (Standard_Real& theStart, Standard_ShortReal& theTolStart, Standard_Real& theEnd, Standard_ShortReal& theTolEnd) const |
61 | { |
62 | theStart = myStart; |
63 | theTolStart = myTolStart; |
64 | theEnd = myEnd; |
65 | theTolEnd = myTolEnd; |
66 | } |
67 | |
42cf5bc1 |
68 | Standard_EXPORT Standard_Integer NbVisiblePart() const; |
69 | |
70 | Standard_EXPORT void VisiblePart (const Standard_Integer Index, Standard_Real& Start, Standard_ShortReal& TolStart, Standard_Real& End, Standard_ShortReal& TolEnd) const; |
71 | |
72 | //! Hides the interval <Start>, <End> with the |
73 | //! tolerances <TolStart>, <TolEnd>. This interval is |
74 | //! subtracted from the visible parts. If the hidden |
75 | //! part is on ( or under ) the face the flag <OnFace> |
76 | //! is True ( or False ). If the hidden part is on ( |
77 | //! or inside ) the boundary of the face the flag |
78 | //! <OnBoundary> is True ( or False ). |
79 | Standard_EXPORT void Hide (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd, const Standard_Boolean OnFace, const Standard_Boolean OnBoundary); |
42cf5bc1 |
80 | |
dde68833 |
81 | //! Hide the whole Edge. |
82 | void HideAll() |
83 | { |
84 | AllVisible(Standard_False); |
85 | AllHidden (Standard_True); |
86 | } |
42cf5bc1 |
87 | |
dde68833 |
88 | //! Show the whole Edge. |
89 | void ShowAll() |
90 | { |
91 | AllVisible(Standard_True); |
92 | AllHidden (Standard_False); |
93 | } |
42cf5bc1 |
94 | |
dde68833 |
95 | Standard_Boolean AllHidden() const { return myAllHidden; } |
42cf5bc1 |
96 | |
dde68833 |
97 | void AllHidden (const Standard_Boolean B) { myAllHidden = B; } |
42cf5bc1 |
98 | |
dde68833 |
99 | Standard_Boolean AllVisible() const { return myAllVisible; } |
42cf5bc1 |
100 | |
dde68833 |
101 | void AllVisible (const Standard_Boolean B) { myAllVisible = B; } |
42cf5bc1 |
102 | |
103 | private: |
104 | |
42cf5bc1 |
105 | Standard_Real myStart; |
106 | Standard_Real myEnd; |
107 | Standard_ShortReal myTolStart; |
108 | Standard_ShortReal myTolEnd; |
dde68833 |
109 | Standard_Boolean myAllHidden; |
110 | Standard_Boolean myAllVisible; |
42cf5bc1 |
111 | Intrv_Intervals myVisibles; |
112 | |
42cf5bc1 |
113 | }; |
114 | |
42cf5bc1 |
115 | #endif // _HLRAlgo_EdgeStatus_HeaderFile |