42cf5bc1 |
1 | // Created on: 1991-06-18 |
2 | // Created by: Didier PIFFAULT |
3 | // Copyright (c) 1991-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 _Intf_SectionPoint_HeaderFile |
18 | #define _Intf_SectionPoint_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Pnt.hxx> |
25 | #include <Intf_PIType.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <Standard_Real.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | class gp_Pnt; |
30 | class gp_Pnt2d; |
31 | |
32 | |
33 | //! Describes an intersection point between polygons and |
34 | //! polyedra. |
35 | class Intf_SectionPoint |
36 | { |
37 | public: |
38 | |
39 | DEFINE_STANDARD_ALLOC |
40 | |
41 | |
42 | //! Returns the location of the SectionPoint. |
43 | Standard_EXPORT const gp_Pnt& Pnt() const; |
44 | |
45 | //! Returns the cumulated Parameter of the SectionPoint on the |
46 | //! first element. |
47 | Standard_Real ParamOnFirst() const; |
48 | |
49 | //! Returns the cumulated Parameter of the section point on the |
50 | //! second element. |
51 | Standard_Real ParamOnSecond() const; |
52 | |
53 | //! Returns the type of the section point on the first element. |
54 | Intf_PIType TypeOnFirst() const; |
55 | |
56 | //! Returns the type of the section point on the second |
57 | //! element. |
58 | Intf_PIType TypeOnSecond() const; |
59 | |
60 | Standard_EXPORT void InfoFirst (Intf_PIType& Dim, Standard_Integer& Add1, Standard_Integer& Add2, Standard_Real& Param) const; |
61 | |
62 | //! Gives the datas about the first argument of the |
63 | //! Interference. |
64 | Standard_EXPORT void InfoFirst (Intf_PIType& Dim, Standard_Integer& Addr, Standard_Real& Param) const; |
65 | |
66 | Standard_EXPORT void InfoSecond (Intf_PIType& Dim, Standard_Integer& Add1, Standard_Integer& Add2, Standard_Real& Param) const; |
67 | |
68 | //! Gives the datas about the second argument of the |
69 | //! Interference. |
70 | Standard_EXPORT void InfoSecond (Intf_PIType& Dim, Standard_Integer& Addr, Standard_Real& Param) const; |
71 | |
72 | //! Gives the incidence at this section point. The incidence |
73 | //! between the two triangles is given by the cosine. The best |
74 | //! incidence is 0. (PI/2). The worst is 1. (null angle). |
75 | Standard_EXPORT Standard_Real Incidence() const; |
76 | |
77 | //! Returns True if the two SectionPoint have the same logical |
78 | //! informations. |
79 | Standard_Boolean IsEqual (const Intf_SectionPoint& Other) const; |
80 | Standard_Boolean operator== (const Intf_SectionPoint& Other) const |
81 | { |
82 | return IsEqual(Other); |
83 | } |
84 | |
85 | //! Returns True if the two SectionPoints are on the same edge |
86 | //! of the first or the second element. |
87 | Standard_EXPORT Standard_Boolean IsOnSameEdge (const Intf_SectionPoint& Other) const; |
88 | |
89 | Standard_EXPORT Intf_SectionPoint(); |
90 | |
91 | //! Builds a SectionPoint with the respective dimensions |
92 | //! (vertex edge or face) of the concerned arguments and their |
93 | //! addresses in the Topological structure. |
94 | Standard_EXPORT Intf_SectionPoint(const gp_Pnt& Where, const Intf_PIType DimeO, const Standard_Integer AddrO1, const Standard_Integer AddrO2, const Standard_Real ParamO, const Intf_PIType DimeT, const Standard_Integer AddrT1, const Standard_Integer AddrT2, const Standard_Real ParamT, const Standard_Real Incid); |
95 | |
96 | //! Builds a SectionPoint 2d with the respective dimensions |
97 | //! (vertex or edge) of the concerned arguments and their |
98 | //! addresses in the Topological structure. |
99 | Standard_EXPORT Intf_SectionPoint(const gp_Pnt2d& Where, const Intf_PIType DimeO, const Standard_Integer AddrO1, const Standard_Real ParamO, const Intf_PIType DimeT, const Standard_Integer AddrT1, const Standard_Real ParamT, const Standard_Real Incid); |
100 | |
101 | //! Merges two SectionPoints. |
102 | Standard_EXPORT void Merge (Intf_SectionPoint& Other); |
103 | |
104 | Standard_EXPORT void Dump (const Standard_Integer Indent) const; |
105 | |
106 | |
107 | |
108 | |
109 | protected: |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | private: |
116 | |
117 | |
118 | |
119 | gp_Pnt myPnt; |
120 | Intf_PIType DimenObje; |
121 | Standard_Integer IndexO1; |
122 | Standard_Integer IndexO2; |
123 | Standard_Real ParamObje; |
124 | Intf_PIType DimenTool; |
125 | Standard_Integer IndexT1; |
126 | Standard_Integer IndexT2; |
127 | Standard_Real ParamTool; |
128 | Standard_Real Incide; |
129 | |
130 | |
131 | }; |
132 | |
133 | |
134 | #include <Intf_SectionPoint.lxx> |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | #endif // _Intf_SectionPoint_HeaderFile |