0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BOPTools / BOPTools_AlgoTools3D.hxx
CommitLineData
42cf5bc1 1// Created by: Peter KURNEV
2// Copyright (c) 1999-2014 OPEN CASCADE SAS
3//
4// This file is part of Open CASCADE Technology software library.
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
11//
12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
14
15#ifndef _BOPTools_AlgoTools3D_HeaderFile
16#define _BOPTools_AlgoTools3D_HeaderFile
17
18#include <Standard.hxx>
19#include <Standard_DefineAlloc.hxx>
20#include <Standard_Handle.hxx>
21
22#include <Standard_Real.hxx>
23#include <Standard_Integer.hxx>
24#include <Standard_Boolean.hxx>
25class TopoDS_Edge;
26class TopoDS_Face;
27class gp_Dir;
28class Geom_Surface;
29class gp_Pnt;
30class IntTools_Context;
31class gp_Pnt2d;
32class TopoDS_Shape;
33
34
35
36//! The class contains handy static functions
37//! dealing with the topology
38//! This is the copy of BOPTools_AlgoTools3D.cdl file
39class BOPTools_AlgoTools3D
40{
41public:
42
43 DEFINE_STANDARD_ALLOC
44
45
46
47 //! Make the edge <aSp> seam edge for the face <aF>
48 Standard_EXPORT static void DoSplitSEAMOnFace (const TopoDS_Edge& aSp, const TopoDS_Face& aF);
49
50
51 //! Computes normal to the face <aF> for the point on the edge <aE>
52 //! at parameter <aT>
53 Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, gp_Dir& aD);
54
55
56 //! Computes normal to the face <aF> for the point on the edge <aE>
57 //! at arbitrary intermediate parameter
58 Standard_EXPORT static void GetNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, gp_Dir& aD);
59
60
61 //! Returns 1 if scalar product aNF1* aNF2>0.
62 //! Returns 0 if directions aNF1 aNF2 coinside
63 //! Returns -1 if scalar product aNF1* aNF2<0.
64 Standard_EXPORT static Standard_Integer SenseFlag (const gp_Dir& aNF1, const gp_Dir& aNF2);
65
66
67 //! Compute normal <aD> to surface <aS> in point (U,V)
68 //! Returns TRUE if directions aD1U, aD1V coinside
69 Standard_EXPORT static Standard_Boolean GetNormalToSurface (const Handle(Geom_Surface)& aS, const Standard_Real U, const Standard_Real V, gp_Dir& aD);
70
71
72 //! Computes normal to the face <aF> for the 3D-point that
73 //! belonds to the edge <aE> at parameter <aT>.
74 //! Output:
75 //! aPx - the 3D-point where the normal computed
76 //! aD - the normal;
77 //!
78 //! Warning:
79 //! The normal is computed not exactly in the point on the
80 //! edge, but in point that is near to the edge towards to
81 //! the face material (so, we'll have approx. normal)
82 Standard_EXPORT static void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, gp_Pnt& aPx, gp_Dir& aD, Handle(IntTools_Context)& theContext);
83
84 Standard_EXPORT static void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& theE, const TopoDS_Face& theF, const Standard_Real aT, gp_Pnt& aP, gp_Dir& aDNF, const Standard_Real aDt2D);
85
86
87 //! Compute the point <aPx>, (<aP2D>) that is near to
88 //! the edge <aE> at parameter <aT> towards to the
89 //! material of the face <aF>. The value of shifting in
90 //! 2D is <aDt2D>
91 Standard_EXPORT static void PointNearEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, const Standard_Real aDt2D, gp_Pnt2d& aP2D, gp_Pnt& aPx);
92
93
94 //! Computes the point <aPx>, (<aP2D>) that is near to
95 //! the edge <aE> at parameter <aT> towards to the
96 //! material of the face <aF>. The value of shifting in
97 //! 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d()
98 Standard_EXPORT static void PointNearEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, const Standard_Real aT, gp_Pnt2d& aP2D, gp_Pnt& aPx, Handle(IntTools_Context)& theContext);
99
100
101 //! Compute the point <aPx>, (<aP2D>) that is near to
102 //! the edge <aE> at arbitrary parameter towards to the
103 //! material of the face <aF>. The value of shifting in
104 //! 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d()
105 Standard_EXPORT static void PointNearEdge (const TopoDS_Edge& aE, const TopoDS_Face& aF, gp_Pnt2d& aP2D, gp_Pnt& aPx, Handle(IntTools_Context)& theContext);
106
107
108 //! Returns simple step value that is used in 2D-computations
109 //! = 1.e-5
110 Standard_EXPORT static Standard_Real MinStepIn2d();
111
112
113 //! Returns TRUE if the shape <aS> does not contain
114 //! geometry information (e.g. empty compound)
115 Standard_EXPORT static Standard_Boolean IsEmptyShape (const TopoDS_Shape& aS);
116
117
118 //! Get the edge <aER> from the face <aF> that is the same as
119 //! the edge <aE>
120 Standard_EXPORT static void OrientEdgeOnFace (const TopoDS_Edge& aE, const TopoDS_Face& aF, TopoDS_Edge& aER);
121
122 //! Computes a point <theP> inside the face <theF>. <br>
123 //! <theP2D> - 2D representation of <theP> <br>
124 //! on the surface of <theF> <br>
125 //! Returns 0 in case of success. <br>
126 Standard_EXPORT static Standard_Integer PointInFace (const TopoDS_Face& theF, gp_Pnt& theP, gp_Pnt2d& theP2D, Handle(IntTools_Context)& theContext);
127
128
129
130
131protected:
132
133
134
135
136
137private:
138
139
140
141
142
143};
144
145
146
147
148
149
150
151#endif // _BOPTools_AlgoTools3D_HeaderFile