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 | |
42cf5bc1 |
24 | #include <Standard_Real.hxx> |
25 | #include <Standard_Boolean.hxx> |
681f3919 |
26 | #include <gp_XYZ.hxx> |
27 | #include <gp_XY.hxx> |
42cf5bc1 |
28 | |
29 | |
30 | |
681f3919 |
31 | class HLRAlgo_BiPoint |
42cf5bc1 |
32 | { |
33 | public: |
681f3919 |
34 | struct IndicesT |
35 | { |
d533dafb |
36 | IndicesT() |
37 | : ShapeIndex(-1), |
38 | FaceConex1(0), |
39 | Face1Pt1(0), |
40 | Face1Pt2(0), |
41 | FaceConex2(0), |
42 | Face2Pt1(0), |
43 | Face2Pt2(0), |
44 | MinSeg(0), |
45 | MaxSeg(0), |
46 | SegFlags(0) |
47 | { |
48 | } |
681f3919 |
49 | Standard_Integer ShapeIndex; |
50 | Standard_Integer FaceConex1; |
51 | Standard_Integer Face1Pt1; |
52 | Standard_Integer Face1Pt2; |
53 | Standard_Integer FaceConex2; |
54 | Standard_Integer Face2Pt1; |
55 | Standard_Integer Face2Pt2; |
56 | Standard_Integer MinSeg; |
57 | Standard_Integer MaxSeg; |
58 | Standard_Integer SegFlags; |
59 | }; |
60 | |
61 | struct PointsT |
62 | { |
63 | gp_XYZ Pnt1; |
64 | gp_XYZ Pnt2; |
65 | gp_XYZ PntP1; |
66 | gp_XYZ PntP2; |
67 | |
68 | gp_XY PntP12D() const |
69 | { |
70 | return gp_XY(PntP1.X(), PntP1.Y()); |
71 | } |
72 | |
73 | gp_XY PntP22D() const |
74 | { |
75 | return gp_XY(PntP2.X(), PntP2.Y()); |
76 | } |
77 | }; |
42cf5bc1 |
78 | |
79 | DEFINE_STANDARD_ALLOC |
80 | |
dde68833 |
81 | HLRAlgo_BiPoint() {} |
82 | |
42cf5bc1 |
83 | 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); |
84 | |
dde68833 |
85 | 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 |
86 | |
87 | 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); |
88 | |
dde68833 |
89 | 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 |
90 | |
91 | 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); |
92 | |
dde68833 |
93 | 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 |
94 | |
681f3919 |
95 | Standard_Boolean Rg1Line() const |
96 | { |
97 | return (myIndices.SegFlags & EMskRg1Line) != 0; |
98 | } |
42cf5bc1 |
99 | |
dde68833 |
100 | void Rg1Line (const Standard_Boolean B) |
101 | { |
681f3919 |
102 | if (B) myIndices.SegFlags |= EMskRg1Line; |
103 | else myIndices.SegFlags &= ~EMskRg1Line; |
dde68833 |
104 | } |
42cf5bc1 |
105 | |
681f3919 |
106 | Standard_Boolean RgNLine() const |
107 | { |
108 | return (myIndices.SegFlags & EMskRgNLine) != 0; |
109 | } |
42cf5bc1 |
110 | |
dde68833 |
111 | void RgNLine (const Standard_Boolean B) |
112 | { |
681f3919 |
113 | if (B) myIndices.SegFlags |= EMskRgNLine; |
114 | else myIndices.SegFlags &= ~EMskRgNLine; |
dde68833 |
115 | } |
42cf5bc1 |
116 | |
681f3919 |
117 | Standard_Boolean OutLine() const |
118 | { |
119 | return (myIndices.SegFlags & EMskOutLine) != 0; |
120 | } |
42cf5bc1 |
121 | |
dde68833 |
122 | void OutLine (const Standard_Boolean B) |
123 | { |
681f3919 |
124 | if (B) myIndices.SegFlags |= EMskOutLine; |
125 | else myIndices.SegFlags &= ~EMskOutLine; |
dde68833 |
126 | } |
42cf5bc1 |
127 | |
681f3919 |
128 | Standard_Boolean IntLine() const |
129 | { |
130 | return (myIndices.SegFlags & EMskIntLine) != 0; |
131 | } |
42cf5bc1 |
132 | |
dde68833 |
133 | void IntLine (const Standard_Boolean B) |
134 | { |
681f3919 |
135 | if (B) myIndices.SegFlags |= EMskIntLine; |
136 | else myIndices.SegFlags &= ~EMskIntLine; |
dde68833 |
137 | } |
42cf5bc1 |
138 | |
681f3919 |
139 | Standard_Boolean Hidden() const |
140 | { |
141 | return (myIndices.SegFlags & EMskHidden) != 0; |
142 | } |
42cf5bc1 |
143 | |
dde68833 |
144 | void Hidden (const Standard_Boolean B) |
145 | { |
681f3919 |
146 | if (B) myIndices.SegFlags |= EMskHidden; |
147 | else myIndices.SegFlags &= ~EMskHidden; |
dde68833 |
148 | } |
42cf5bc1 |
149 | |
681f3919 |
150 | IndicesT& Indices() |
151 | { |
152 | return myIndices; |
153 | } |
42cf5bc1 |
154 | |
681f3919 |
155 | PointsT& Points() |
156 | { |
157 | return myPoints; |
158 | } |
42cf5bc1 |
159 | |
dde68833 |
160 | protected: |
42cf5bc1 |
161 | |
dde68833 |
162 | enum EMskFlags |
163 | { |
164 | EMskRg1Line = 1, |
165 | EMskRgNLine = 2, |
166 | EMskOutLine = 4, |
167 | EMskIntLine = 8, |
168 | EMskHidden = 16 |
169 | }; |
42cf5bc1 |
170 | |
dde68833 |
171 | private: |
681f3919 |
172 | IndicesT myIndices; |
173 | PointsT myPoints; |
42cf5bc1 |
174 | |
dde68833 |
175 | }; |
42cf5bc1 |
176 | |
177 | #endif // _HLRAlgo_BiPoint_HeaderFile |