Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:20:46

0001 // Created on: 1993-06-17
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _TopOpeBRepDS_BuildTool_HeaderFile
0018 #define _TopOpeBRepDS_BuildTool_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRep_Builder.hxx>
0025 #include <TopOpeBRepTool_CurveTool.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <TopOpeBRepTool_OutCurveType.hxx>
0028 #include <Standard_Real.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <TopAbs_Orientation.hxx>
0031 class TopOpeBRepTool_GeomTool;
0032 class TopoDS_Shape;
0033 class TopOpeBRepDS_Point;
0034 class TopOpeBRepDS_Curve;
0035 class TopOpeBRepDS_DataStructure;
0036 class Geom_Curve;
0037 class TopOpeBRepDS_Surface;
0038 class TopoDS_Edge;
0039 class TopoDS_Vertex;
0040 class TopoDS_Face;
0041 class TopOpeBRepDS_HDataStructure;
0042 class Geom2d_Curve;
0043 class Geom_Surface;
0044 
0045 //! Provides a Tool to build topologies. Used to
0046 //! instantiate the Builder algorithm.
0047 class TopOpeBRepDS_BuildTool
0048 {
0049 public:
0050   DEFINE_STANDARD_ALLOC
0051 
0052   Standard_EXPORT TopOpeBRepDS_BuildTool();
0053 
0054   Standard_EXPORT TopOpeBRepDS_BuildTool(const TopOpeBRepTool_OutCurveType OutCurveType);
0055 
0056   Standard_EXPORT TopOpeBRepDS_BuildTool(const TopOpeBRepTool_GeomTool& GT);
0057 
0058   Standard_EXPORT const TopOpeBRepTool_GeomTool& GetGeomTool() const;
0059 
0060   Standard_EXPORT TopOpeBRepTool_GeomTool& ChangeGeomTool();
0061 
0062   Standard_EXPORT void MakeVertex(TopoDS_Shape& V, const TopOpeBRepDS_Point& P) const;
0063 
0064   Standard_EXPORT void MakeEdge(TopoDS_Shape& E, const TopOpeBRepDS_Curve& C) const;
0065 
0066   Standard_EXPORT void MakeEdge(TopoDS_Shape&                     E,
0067                                 const TopOpeBRepDS_Curve&         C,
0068                                 const TopOpeBRepDS_DataStructure& DS) const;
0069 
0070   Standard_EXPORT void MakeEdge(TopoDS_Shape&                  E,
0071                                 const occ::handle<Geom_Curve>& C,
0072                                 const double                   Tol) const;
0073 
0074   Standard_EXPORT void MakeEdge(TopoDS_Shape& E) const;
0075 
0076   Standard_EXPORT void MakeWire(TopoDS_Shape& W) const;
0077 
0078   Standard_EXPORT void MakeFace(TopoDS_Shape& F, const TopOpeBRepDS_Surface& S) const;
0079 
0080   Standard_EXPORT void MakeShell(TopoDS_Shape& Sh) const;
0081 
0082   Standard_EXPORT void MakeSolid(TopoDS_Shape& S) const;
0083 
0084   //! Make an edge <Eou> with the curve of the edge <Ein>
0085   Standard_EXPORT void CopyEdge(const TopoDS_Shape& Ein, TopoDS_Shape& Eou) const;
0086 
0087   Standard_EXPORT void GetOrientedEdgeVertices(TopoDS_Edge&   E,
0088                                                TopoDS_Vertex& Vmin,
0089                                                TopoDS_Vertex& Vmax,
0090                                                double&        Parmin,
0091                                                double&        Parmax) const;
0092 
0093   Standard_EXPORT void UpdateEdgeCurveTol(const TopoDS_Face&             F1,
0094                                           const TopoDS_Face&             F2,
0095                                           TopoDS_Edge&                   E,
0096                                           const occ::handle<Geom_Curve>& C3Dnew,
0097                                           const double                   tol3d,
0098                                           const double                   tol2d1,
0099                                           const double                   tol2d2,
0100                                           double&                        newtol,
0101                                           double&                        newparmin,
0102                                           double&                        newparmax) const;
0103 
0104   Standard_EXPORT void ApproxCurves(const TopOpeBRepDS_Curve&                       C,
0105                                     TopoDS_Edge&                                    E,
0106                                     int&                                            inewC,
0107                                     const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0108 
0109   Standard_EXPORT void ComputePCurves(const TopOpeBRepDS_Curve& C,
0110                                       TopoDS_Edge&              E,
0111                                       TopOpeBRepDS_Curve&       newC,
0112                                       const bool                CompPC1,
0113                                       const bool                CompPC2,
0114                                       const bool                CompC3D) const;
0115 
0116   Standard_EXPORT void PutPCurves(const TopOpeBRepDS_Curve& newC,
0117                                   TopoDS_Edge&              E,
0118                                   const bool                CompPC1,
0119                                   const bool                CompPC2) const;
0120 
0121   Standard_EXPORT void RecomputeCurves(const TopOpeBRepDS_Curve&                       C,
0122                                        const TopoDS_Edge&                              oldE,
0123                                        TopoDS_Edge&                                    E,
0124                                        int&                                            inewC,
0125                                        const occ::handle<TopOpeBRepDS_HDataStructure>& HDS) const;
0126 
0127   //! Make a face <Fou> with the surface of the face <Fin>
0128   Standard_EXPORT void CopyFace(const TopoDS_Shape& Fin, TopoDS_Shape& Fou) const;
0129 
0130   Standard_EXPORT void AddEdgeVertex(const TopoDS_Shape& Ein,
0131                                      TopoDS_Shape&       Eou,
0132                                      const TopoDS_Shape& V) const;
0133 
0134   Standard_EXPORT void AddEdgeVertex(TopoDS_Shape& E, const TopoDS_Shape& V) const;
0135 
0136   Standard_EXPORT void AddWireEdge(TopoDS_Shape& W, const TopoDS_Shape& E) const;
0137 
0138   Standard_EXPORT void AddFaceWire(TopoDS_Shape& F, const TopoDS_Shape& W) const;
0139 
0140   Standard_EXPORT void AddShellFace(TopoDS_Shape& Sh, const TopoDS_Shape& F) const;
0141 
0142   Standard_EXPORT void AddSolidShell(TopoDS_Shape& S, const TopoDS_Shape& Sh) const;
0143 
0144   //! Sets the parameter <P> for the vertex <V> on the
0145   //! edge <E>.
0146   Standard_EXPORT void Parameter(const TopoDS_Shape& E,
0147                                  const TopoDS_Shape& V,
0148                                  const double        P) const;
0149 
0150   //! Sets the range of edge <E>.
0151   Standard_EXPORT void Range(const TopoDS_Shape& E, const double first, const double last) const;
0152 
0153   //! Sets the range of edge <Eou> from <Ein>
0154   //! only when <Ein> has a closed geometry.
0155   Standard_EXPORT void UpdateEdge(const TopoDS_Shape& Ein, TopoDS_Shape& Eou) const;
0156 
0157   //! Compute the parameter of the vertex <V>, supported
0158   //! by the edge <E>, on the curve <C>.
0159   Standard_EXPORT void Parameter(const TopOpeBRepDS_Curve& C,
0160                                  TopoDS_Shape&             E,
0161                                  TopoDS_Shape&             V) const;
0162 
0163   //! Sets the curve <C> for the edge <E>
0164   Standard_EXPORT void Curve3D(TopoDS_Shape&                  E,
0165                                const occ::handle<Geom_Curve>& C,
0166                                const double                   Tol) const;
0167 
0168   //! Sets the pcurve <C> for the edge <E> on the face
0169   //! <F>. If OverWrite is True the old pcurve if there
0170   //! is one is overwritten, else the two pcurves are
0171   //! set.
0172   Standard_EXPORT void PCurve(TopoDS_Shape&                    F,
0173                               TopoDS_Shape&                    E,
0174                               const occ::handle<Geom2d_Curve>& C) const;
0175 
0176   Standard_EXPORT void PCurve(TopoDS_Shape&                    F,
0177                               TopoDS_Shape&                    E,
0178                               const TopOpeBRepDS_Curve&        CDS,
0179                               const occ::handle<Geom2d_Curve>& C) const;
0180 
0181   Standard_EXPORT void Orientation(TopoDS_Shape& S, const TopAbs_Orientation O) const;
0182 
0183   Standard_EXPORT TopAbs_Orientation Orientation(const TopoDS_Shape& S) const;
0184 
0185   Standard_EXPORT void Closed(TopoDS_Shape& S, const bool B) const;
0186 
0187   Standard_EXPORT bool Approximation() const;
0188 
0189   Standard_EXPORT void UpdateSurface(const TopoDS_Shape&              F,
0190                                      const occ::handle<Geom_Surface>& SU) const;
0191 
0192   Standard_EXPORT void UpdateSurface(const TopoDS_Shape& E,
0193                                      const TopoDS_Shape& oldF,
0194                                      const TopoDS_Shape& newF) const;
0195 
0196   Standard_EXPORT bool OverWrite() const;
0197 
0198   Standard_EXPORT void OverWrite(const bool O);
0199 
0200   Standard_EXPORT bool Translate() const;
0201 
0202   Standard_EXPORT void Translate(const bool T);
0203 
0204 private:
0205   Standard_EXPORT void TranslateOnPeriodic(TopoDS_Shape&              F,
0206                                            TopoDS_Shape&              E,
0207                                            occ::handle<Geom2d_Curve>& C) const;
0208 
0209   BRep_Builder             myBuilder;
0210   TopOpeBRepTool_CurveTool myCurveTool;
0211   bool                     myOverWrite;
0212   bool                     myTranslate;
0213 };
0214 
0215 #endif // _TopOpeBRepDS_BuildTool_HeaderFile