42cf5bc1 |
1 | // Created on: 1995-06-22 |
2 | // Created by: Christophe MARION |
3 | // Copyright (c) 1995-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_BiPoint_HeaderFile |
18 | #define _HLRAlgo_BiPoint_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Integer.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <Standard_Boolean.hxx> |
681f3919 |
27 | #include <gp_XYZ.hxx> |
28 | #include <gp_XY.hxx> |
42cf5bc1 |
29 | |
30 | |
31 | |
681f3919 |
32 | class HLRAlgo_BiPoint |
42cf5bc1 |
33 | { |
34 | public: |
681f3919 |
35 | struct IndicesT |
36 | { |
37 | Standard_Integer ShapeIndex; |
38 | Standard_Integer FaceConex1; |
39 | Standard_Integer Face1Pt1; |
40 | Standard_Integer Face1Pt2; |
41 | Standard_Integer FaceConex2; |
42 | Standard_Integer Face2Pt1; |
43 | Standard_Integer Face2Pt2; |
44 | Standard_Integer MinSeg; |
45 | Standard_Integer MaxSeg; |
46 | Standard_Integer SegFlags; |
47 | }; |
48 | |
49 | struct PointsT |
50 | { |
51 | gp_XYZ Pnt1; |
52 | gp_XYZ Pnt2; |
53 | gp_XYZ PntP1; |
54 | gp_XYZ PntP2; |
55 | |
56 | gp_XY PntP12D() const |
57 | { |
58 | return gp_XY(PntP1.X(), PntP1.Y()); |
59 | } |
60 | |
61 | gp_XY PntP22D() const |
62 | { |
63 | return gp_XY(PntP2.X(), PntP2.Y()); |
64 | } |
65 | }; |
42cf5bc1 |
66 | |
67 | DEFINE_STANDARD_ALLOC |
68 | |
dde68833 |
69 | HLRAlgo_BiPoint() {} |
70 | |
42cf5bc1 |
71 | Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); |
72 | |
dde68833 |
73 | Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer flag); |
42cf5bc1 |
74 | |
75 | Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); |
76 | |
dde68833 |
77 | Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer flag); |
42cf5bc1 |
78 | |
79 | Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl); |
80 | |
dde68833 |
81 | Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer flag); |
42cf5bc1 |
82 | |
681f3919 |
83 | Standard_Boolean Rg1Line() const |
84 | { |
85 | return (myIndices.SegFlags & EMskRg1Line) != 0; |
86 | } |
42cf5bc1 |
87 | |
dde68833 |
88 | void Rg1Line (const Standard_Boolean B) |
89 | { |
681f3919 |
90 | if (B) myIndices.SegFlags |= EMskRg1Line; |
91 | else myIndices.SegFlags &= ~EMskRg1Line; |
dde68833 |
92 | } |
42cf5bc1 |
93 | |
681f3919 |
94 | Standard_Boolean RgNLine() const |
95 | { |
96 | return (myIndices.SegFlags & EMskRgNLine) != 0; |
97 | } |
42cf5bc1 |
98 | |
dde68833 |
99 | void RgNLine (const Standard_Boolean B) |
100 | { |
681f3919 |
101 | if (B) myIndices.SegFlags |= EMskRgNLine; |
102 | else myIndices.SegFlags &= ~EMskRgNLine; |
dde68833 |
103 | } |
42cf5bc1 |
104 | |
681f3919 |
105 | Standard_Boolean OutLine() const |
106 | { |
107 | return (myIndices.SegFlags & EMskOutLine) != 0; |
108 | } |
42cf5bc1 |
109 | |
dde68833 |
110 | void OutLine (const Standard_Boolean B) |
111 | { |
681f3919 |
112 | if (B) myIndices.SegFlags |= EMskOutLine; |
113 | else myIndices.SegFlags &= ~EMskOutLine; |
dde68833 |
114 | } |
42cf5bc1 |
115 | |
681f3919 |
116 | Standard_Boolean IntLine() const |
117 | { |
118 | return (myIndices.SegFlags & EMskIntLine) != 0; |
119 | } |
42cf5bc1 |
120 | |
dde68833 |
121 | void IntLine (const Standard_Boolean B) |
122 | { |
681f3919 |
123 | if (B) myIndices.SegFlags |= EMskIntLine; |
124 | else myIndices.SegFlags &= ~EMskIntLine; |
dde68833 |
125 | } |
42cf5bc1 |
126 | |
681f3919 |
127 | Standard_Boolean Hidden() const |
128 | { |
129 | return (myIndices.SegFlags & EMskHidden) != 0; |
130 | } |
42cf5bc1 |
131 | |
dde68833 |
132 | void Hidden (const Standard_Boolean B) |
133 | { |
681f3919 |
134 | if (B) myIndices.SegFlags |= EMskHidden; |
135 | else myIndices.SegFlags &= ~EMskHidden; |
dde68833 |
136 | } |
42cf5bc1 |
137 | |
681f3919 |
138 | IndicesT& Indices() |
139 | { |
140 | return myIndices; |
141 | } |
42cf5bc1 |
142 | |
681f3919 |
143 | PointsT& Points() |
144 | { |
145 | return myPoints; |
146 | } |
42cf5bc1 |
147 | |
dde68833 |
148 | protected: |
42cf5bc1 |
149 | |
dde68833 |
150 | enum EMskFlags |
151 | { |
152 | EMskRg1Line = 1, |
153 | EMskRgNLine = 2, |
154 | EMskOutLine = 4, |
155 | EMskIntLine = 8, |
156 | EMskHidden = 16 |
157 | }; |
42cf5bc1 |
158 | |
dde68833 |
159 | private: |
681f3919 |
160 | IndicesT myIndices; |
161 | PointsT myPoints; |
42cf5bc1 |
162 | |
dde68833 |
163 | }; |
42cf5bc1 |
164 | |
165 | #endif // _HLRAlgo_BiPoint_HeaderFile |