1 // Created on: 1995-10-23
2 // Created by: Yves FRICAUD
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _BRepOffset_Tool_HeaderFile
18 #define _BRepOffset_Tool_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopAbs_Orientation.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TopTools_ListOfShape.hxx>
27 #include <TopAbs_State.hxx>
28 #include <Standard_Real.hxx>
29 #include <TopTools_DataMapOfShapeShape.hxx>
30 #include <TopTools_DataMapOfShapeListOfShape.hxx>
31 #include <TopTools_MapOfShape.hxx>
32 #include <TopTools_IndexedMapOfShape.hxx>
36 class BRepOffset_Analyse;
52 //! <V1> is the FirstVertex ,<V2> is the Last Vertex of <Edge>
53 //! taking account the orientation of Edge.
54 Standard_EXPORT static void EdgeVertices (const TopoDS_Edge& E, TopoDS_Vertex& V1, TopoDS_Vertex& V2);
56 //! returns the cumul of the orientation of <Edge>
57 //! and thc containing wire in <Face>
58 Standard_EXPORT static TopAbs_Orientation OriEdgeInFace (const TopoDS_Edge& E, const TopoDS_Face& F);
60 //! <E> is a section between <F1> and <F2>. Computes
61 //! <O1> the orientation of <E> in <F1> influenced by <F2>.
63 Standard_EXPORT static void OrientSection (const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2, TopAbs_Orientation& O1, TopAbs_Orientation& O2);
65 //! Looks for the common Vertices and Edges between faces <theF1> and <theF2>.<br>
66 //! Returns TRUE if common shapes have been found.<br>
67 //! <theLE> will contain the found common edges;<br>
68 //! <theLV> will contain the found common vertices.
69 Standard_EXPORT static Standard_Boolean FindCommonShapes(const TopoDS_Face& theF1,
70 const TopoDS_Face& theF2,
71 TopTools_ListOfShape& theLE,
72 TopTools_ListOfShape& theLV);
74 //! Looks for the common shapes of type <theType> between shapes <theS1> and <theS2>.<br>
75 //! Returns TRUE if common shapes have been found.<br>
76 //! <theLSC> will contain the found common shapes.
77 Standard_EXPORT static Standard_Boolean FindCommonShapes(const TopoDS_Shape& theS1,
78 const TopoDS_Shape& theS2,
79 const TopAbs_ShapeEnum theType,
80 TopTools_ListOfShape& theLSC);
82 //! Computes the Section betwwen <F1> and <F2> the
83 //! edges solution are stored in <LInt1> with the
84 //! orientation on <F1>, the sames edges are stored in
85 //! <Lint2> with the orientation on <F2>.
86 Standard_EXPORT static void Inter3D (const TopoDS_Face& F1, const TopoDS_Face& F2, TopTools_ListOfShape& LInt1, TopTools_ListOfShape& LInt2, const TopAbs_State Side, const TopoDS_Edge& RefEdge, const Standard_Boolean IsRefEdgeDefined = Standard_False);
88 //! Find if the edges <Edges> of the face <F2> are on
90 //! Set in <LInt1> <LInt2> the updated edges.
91 //! If all the edges are computed, returns true.
92 Standard_EXPORT static Standard_Boolean TryProject (const TopoDS_Face& F1, const TopoDS_Face& F2, const TopTools_ListOfShape& Edges, TopTools_ListOfShape& LInt1, TopTools_ListOfShape& LInt2, const TopAbs_State Side, const Standard_Real TolConf);
94 Standard_EXPORT static void PipeInter (const TopoDS_Face& F1, const TopoDS_Face& F2, TopTools_ListOfShape& LInt1, TopTools_ListOfShape& LInt2, const TopAbs_State Side);
96 Standard_EXPORT static void Inter2d (const TopoDS_Face& F, const TopoDS_Edge& E1, const TopoDS_Edge& E2, TopTools_ListOfShape& LV, const Standard_Real Tol);
98 Standard_EXPORT static void InterOrExtent (const TopoDS_Face& F1, const TopoDS_Face& F2, TopTools_ListOfShape& LInt1, TopTools_ListOfShape& LInt2, const TopAbs_State Side);
100 Standard_EXPORT static void CheckBounds (const TopoDS_Face& F, const BRepOffset_Analyse& Analyse, Standard_Boolean& enlargeU, Standard_Boolean& enlargeVfirst, Standard_Boolean& enlargeVlast);
102 //! if <ChangeGeom> is TRUE , the surface can be
104 //! if <UpdatePCurve> is TRUE, update the pcurves of the
105 //! edges of <F> on the new surface.if the surface has been changed,
106 //! Returns True if The Surface of <NF> has changed.
107 Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F, TopoDS_Face& NF, const Standard_Boolean ChangeGeom, const Standard_Boolean UpDatePCurve = Standard_False, const Standard_Boolean enlargeU = Standard_True, const Standard_Boolean enlargeVfirst = Standard_True, const Standard_Boolean enlargeVlast = Standard_True);
109 Standard_EXPORT static void ExtentFace (const TopoDS_Face& F, TopTools_DataMapOfShapeShape& ConstShapes, TopTools_DataMapOfShapeShape& ToBuild, const TopAbs_State Side, const Standard_Real TolConf, TopoDS_Face& NF);
111 //! Via the wire explorer store in <NOnV1> for
112 //! an Edge <E> of <W> his Edge neighbour on the first
113 //! vertex <V1> of <E>.
114 //! Store in NOnV2 the Neighbour of <E>on the last
115 //! vertex <V2> of <E>.
116 Standard_EXPORT static void BuildNeighbour (const TopoDS_Wire& W, const TopoDS_Face& F, TopTools_DataMapOfShapeShape& NOnV1, TopTools_DataMapOfShapeShape& NOnV2);
118 //! Store in MVE for a vertex <V> in <S> the incident
119 //! edges <E> in <S>.
120 //! An Edge is Store only one Time for a vertex.
121 Standard_EXPORT static void MapVertexEdges (const TopoDS_Shape& S, TopTools_DataMapOfShapeListOfShape& MVE);
123 //! Remove the non valid part of an offsetshape
124 //! 1 - Remove all the free boundary and the faces
125 //! connex to such edges.
126 //! 2 - Remove all the shapes not valid in the result
127 //! (according to the side of offseting)
128 //! in this verion only the first point is implemented.
129 Standard_EXPORT static TopoDS_Shape Deboucle3D (const TopoDS_Shape& S, const TopTools_MapOfShape& Boundary);
131 Standard_EXPORT static void CorrectOrientation (const TopoDS_Shape& SI, const TopTools_IndexedMapOfShape& NewEdges, Handle(BRepAlgo_AsDes)& AsDes, BRepAlgo_Image& InitOffset, const Standard_Real Offset);
133 Standard_EXPORT static Standard_Real Gabarit (const Handle(Geom_Curve)& aCurve);
135 //! Compares the normal directions of the planar faces and returns
136 //! TRUE if the directions are the same with the given precision.<br>
137 Standard_EXPORT static Standard_Boolean CheckPlanesNormals(const TopoDS_Face& theFace1,
138 const TopoDS_Face& theFace2,
139 const Standard_Real theTolAng = 1.e-8);
147 #endif // _BRepOffset_Tool_HeaderFile