1 // Created on: 1993-06-17
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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 _TopOpeBRepDS_BuildTool_HeaderFile
18 #define _TopOpeBRepDS_BuildTool_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRep_Builder.hxx>
25 #include <TopOpeBRepTool_CurveTool.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TopOpeBRepTool_OutCurveType.hxx>
28 #include <Standard_Real.hxx>
29 #include <Standard_Integer.hxx>
30 #include <TopAbs_Orientation.hxx>
31 class TopOpeBRepTool_GeomTool;
33 class TopOpeBRepDS_Point;
34 class TopOpeBRepDS_Curve;
35 class TopOpeBRepDS_DataStructure;
37 class TopOpeBRepDS_Surface;
41 class TopOpeBRepDS_HDataStructure;
46 //! Provides a Tool to build topologies. Used to
47 //! instantiate the Builder algorithm.
48 class TopOpeBRepDS_BuildTool
55 Standard_EXPORT TopOpeBRepDS_BuildTool();
57 Standard_EXPORT TopOpeBRepDS_BuildTool(const TopOpeBRepTool_OutCurveType OutCurveType);
59 Standard_EXPORT TopOpeBRepDS_BuildTool(const TopOpeBRepTool_GeomTool& GT);
61 Standard_EXPORT const TopOpeBRepTool_GeomTool& GetGeomTool() const;
63 Standard_EXPORT TopOpeBRepTool_GeomTool& ChangeGeomTool();
65 Standard_EXPORT void MakeVertex (TopoDS_Shape& V, const TopOpeBRepDS_Point& P) const;
67 Standard_EXPORT void MakeEdge (TopoDS_Shape& E, const TopOpeBRepDS_Curve& C) const;
69 Standard_EXPORT void MakeEdge (TopoDS_Shape& E, const TopOpeBRepDS_Curve& C, const TopOpeBRepDS_DataStructure& DS) const;
71 Standard_EXPORT void MakeEdge (TopoDS_Shape& E, const Handle(Geom_Curve)& C, const Standard_Real Tol) const;
73 Standard_EXPORT void MakeEdge (TopoDS_Shape& E) const;
75 Standard_EXPORT void MakeWire (TopoDS_Shape& W) const;
77 Standard_EXPORT void MakeFace (TopoDS_Shape& F, const TopOpeBRepDS_Surface& S) const;
79 Standard_EXPORT void MakeShell (TopoDS_Shape& Sh) const;
81 Standard_EXPORT void MakeSolid (TopoDS_Shape& S) const;
83 //! Make an edge <Eou> with the curve of the edge <Ein>
84 Standard_EXPORT void CopyEdge (const TopoDS_Shape& Ein, TopoDS_Shape& Eou) const;
86 Standard_EXPORT void GetOrientedEdgeVertices (TopoDS_Edge& E, TopoDS_Vertex& Vmin, TopoDS_Vertex& Vmax, Standard_Real& Parmin, Standard_Real& Parmax) const;
88 Standard_EXPORT void UpdateEdgeCurveTol (const TopoDS_Face& F1, const TopoDS_Face& F2, TopoDS_Edge& E, const Handle(Geom_Curve)& C3Dnew, const Standard_Real tol3d, const Standard_Real tol2d1, const Standard_Real tol2d2, Standard_Real& newtol, Standard_Real& newparmin, Standard_Real& newparmax) const;
90 Standard_EXPORT void ApproxCurves (const TopOpeBRepDS_Curve& C, TopoDS_Edge& E, Standard_Integer& inewC, const Handle(TopOpeBRepDS_HDataStructure)& HDS) const;
92 Standard_EXPORT void ComputePCurves (const TopOpeBRepDS_Curve& C, TopoDS_Edge& E, TopOpeBRepDS_Curve& newC, const Standard_Boolean CompPC1, const Standard_Boolean CompPC2, const Standard_Boolean CompC3D) const;
94 Standard_EXPORT void PutPCurves (const TopOpeBRepDS_Curve& newC, TopoDS_Edge& E, const Standard_Boolean CompPC1, const Standard_Boolean CompPC2) const;
96 Standard_EXPORT void RecomputeCurves (const TopOpeBRepDS_Curve& C, const TopoDS_Edge& oldE, TopoDS_Edge& E, Standard_Integer& inewC, const Handle(TopOpeBRepDS_HDataStructure)& HDS) const;
98 //! Make a face <Fou> with the surface of the face <Fin>
99 Standard_EXPORT void CopyFace (const TopoDS_Shape& Fin, TopoDS_Shape& Fou) const;
101 Standard_EXPORT void AddEdgeVertex (const TopoDS_Shape& Ein, TopoDS_Shape& Eou, const TopoDS_Shape& V) const;
103 Standard_EXPORT void AddEdgeVertex (TopoDS_Shape& E, const TopoDS_Shape& V) const;
105 Standard_EXPORT void AddWireEdge (TopoDS_Shape& W, const TopoDS_Shape& E) const;
107 Standard_EXPORT void AddFaceWire (TopoDS_Shape& F, const TopoDS_Shape& W) const;
109 Standard_EXPORT void AddShellFace (TopoDS_Shape& Sh, const TopoDS_Shape& F) const;
111 Standard_EXPORT void AddSolidShell (TopoDS_Shape& S, const TopoDS_Shape& Sh) const;
113 //! Sets the parameter <P> for the vertex <V> on the
115 Standard_EXPORT void Parameter (const TopoDS_Shape& E, const TopoDS_Shape& V, const Standard_Real P) const;
117 //! Sets the range of edge <E>.
118 Standard_EXPORT void Range (const TopoDS_Shape& E, const Standard_Real first, const Standard_Real last) const;
120 //! Sets the range of edge <Eou> from <Ein>
121 //! only when <Ein> has a closed geometry.
122 Standard_EXPORT void UpdateEdge (const TopoDS_Shape& Ein, TopoDS_Shape& Eou) const;
124 //! Compute the parameter of the vertex <V>, supported
125 //! by the edge <E>, on the curve <C>.
126 Standard_EXPORT void Parameter (const TopOpeBRepDS_Curve& C, TopoDS_Shape& E, TopoDS_Shape& V) const;
128 //! Sets the curve <C> for the edge <E>
129 Standard_EXPORT void Curve3D (TopoDS_Shape& E, const Handle(Geom_Curve)& C, const Standard_Real Tol) const;
131 //! Sets the pcurve <C> for the edge <E> on the face
132 //! <F>. If OverWrite is True the old pcurve if there
133 //! is one is overwritten, else the two pcurves are
135 Standard_EXPORT void PCurve (TopoDS_Shape& F, TopoDS_Shape& E, const Handle(Geom2d_Curve)& C) const;
137 Standard_EXPORT void PCurve (TopoDS_Shape& F, TopoDS_Shape& E, const TopOpeBRepDS_Curve& CDS, const Handle(Geom2d_Curve)& C) const;
139 Standard_EXPORT void Orientation (TopoDS_Shape& S, const TopAbs_Orientation O) const;
141 Standard_EXPORT TopAbs_Orientation Orientation (const TopoDS_Shape& S) const;
143 Standard_EXPORT void Closed (TopoDS_Shape& S, const Standard_Boolean B) const;
145 Standard_EXPORT Standard_Boolean Approximation() const;
147 Standard_EXPORT void UpdateSurface (const TopoDS_Shape& F, const Handle(Geom_Surface)& SU) const;
149 Standard_EXPORT void UpdateSurface (const TopoDS_Shape& E, const TopoDS_Shape& oldF, const TopoDS_Shape& newF) const;
151 Standard_EXPORT Standard_Boolean OverWrite() const;
153 Standard_EXPORT void OverWrite (const Standard_Boolean O);
155 Standard_EXPORT Standard_Boolean Translate() const;
157 Standard_EXPORT void Translate (const Standard_Boolean T);
171 Standard_EXPORT void TranslateOnPeriodic (TopoDS_Shape& F, TopoDS_Shape& E, Handle(Geom2d_Curve)& C) const;
174 BRep_Builder myBuilder;
175 TopOpeBRepTool_CurveTool myCurveTool;
176 Standard_Boolean myOverWrite;
177 Standard_Boolean myTranslate;
188 #endif // _TopOpeBRepDS_BuildTool_HeaderFile