Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-01 09:02:43

0001 // Created on: 1998-10-06
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1998-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 _TopOpeBRepTool_TOPOLOGY_HeaderFile
0018 #define _TopOpeBRepTool_TOPOLOGY_HeaderFile
0019 
0020 #include <GeomAbs_CurveType.hxx>
0021 #include <Geom2d_Curve.hxx>
0022 #include <Geom_Curve.hxx>
0023 #include <gp_Pnt.hxx>
0024 #include <gp_Dir.hxx>
0025 #include <gp_Vec.hxx>
0026 #include <TopoDS_Wire.hxx>
0027 // #include <BRepAdaptor_Curve2d.hxx>
0028 
0029 Standard_EXPORT void FUN_tool_tolUV(const TopoDS_Face& F, double& tolu, double& tolv);
0030 Standard_EXPORT bool FUN_tool_direct(const TopoDS_Face& F, bool& direct);
0031 // Standard_EXPORT bool FUN_tool_IsUViso(const TopoDS_Shape& E,const TopoDS_Shape&
0032 // F,bool& isoU,bool& isoV,gp_Dir2d& d2d,gp_Pnt2d& o2d);
0033 Standard_EXPORT bool FUN_tool_bounds(const TopoDS_Shape& F,
0034                                      double&             u1,
0035                                      double&             u2,
0036                                      double&             v1,
0037                                      double&             v2);
0038 Standard_EXPORT bool FUN_tool_geombounds(const TopoDS_Face& F,
0039                                          double&            u1,
0040                                          double&            u2,
0041                                          double&            v1,
0042                                          double&            v2);
0043 Standard_EXPORT bool FUN_tool_isobounds(const TopoDS_Shape& F,
0044                                         double&             u1,
0045                                         double&             u2,
0046                                         double&             v1,
0047                                         double&             v2);
0048 Standard_EXPORT bool FUN_tool_outbounds(const TopoDS_Shape& Sh,
0049                                         double&             u1,
0050                                         double&             u2,
0051                                         double&             v1,
0052                                         double&             v2,
0053                                         bool&               outbounds);
0054 
0055 // ----------------------------------------------------------------------
0056 //  project point <P> on geometries (curve <C>,surface <S>)
0057 // ----------------------------------------------------------------------
0058 Standard_EXPORT bool FUN_tool_PinC(const gp_Pnt&            P,
0059                                    const BRepAdaptor_Curve& BAC,
0060                                    const double             pmin,
0061                                    const double             pmax,
0062                                    const double             tol);
0063 Standard_EXPORT bool FUN_tool_PinC(const gp_Pnt& P, const BRepAdaptor_Curve& BAC, const double tol);
0064 
0065 // ----------------------------------------------------------------------
0066 Standard_EXPORT bool         FUN_tool_value(const double par, const TopoDS_Edge& E, gp_Pnt& P);
0067 Standard_EXPORT bool         FUN_tool_value(const gp_Pnt2d& UV, const TopoDS_Face& F, gp_Pnt& P);
0068 Standard_EXPORT TopAbs_State FUN_tool_staPinE(const gp_Pnt&      P,
0069                                               const TopoDS_Edge& E,
0070                                               const double       tol);
0071 Standard_EXPORT TopAbs_State FUN_tool_staPinE(const gp_Pnt& P, const TopoDS_Edge& E);
0072 
0073 // ----------------------------------------------------------------------
0074 //  subshape's orientation :
0075 //  - orientVinE : vertex orientation in edge
0076 //  - orientEinF : edge's orientation in face
0077 //  - tool_orientEinFFORWARD : edge's orientation in face oriented FORWARD
0078 //  - EboundF : true if vertex is oriented (FORWARD,REVERSED) in an edge
0079 // ----------------------------------------------------------------------
0080 Standard_EXPORT int  FUN_tool_orientVinE(const TopoDS_Vertex& v, const TopoDS_Edge& e);
0081 Standard_EXPORT bool FUN_tool_orientEinF(const TopoDS_Edge&  E,
0082                                          const TopoDS_Face&  F,
0083                                          TopAbs_Orientation& oriEinF);
0084 Standard_EXPORT bool FUN_tool_orientEinFFORWARD(const TopoDS_Edge&  E,
0085                                                 const TopoDS_Face&  F,
0086                                                 TopAbs_Orientation& oriEinF);
0087 Standard_EXPORT bool FUN_tool_EboundF(const TopoDS_Edge& E, const TopoDS_Face& F);
0088 
0089 // ----------------------------------------------------------------------
0090 //  derivatives :
0091 // ----------------------------------------------------------------------
0092 Standard_EXPORT gp_Vec FUN_tool_nggeomF(const gp_Pnt2d& p2d, const TopoDS_Face& F);
0093 Standard_EXPORT bool   FUN_tool_nggeomF(const double&      paronE,
0094                                         const TopoDS_Edge& E,
0095                                         const TopoDS_Face& F,
0096                                         gp_Vec&            nggeomF);
0097 Standard_EXPORT bool   FUN_tool_nggeomF(const double&      paronE,
0098                                         const TopoDS_Edge& E,
0099                                         const TopoDS_Face& F,
0100                                         gp_Vec&            nggeomF,
0101                                         const double       tol);
0102 Standard_EXPORT bool   FUN_tool_EtgF(const double&      paronE,
0103                                      const TopoDS_Edge& E,
0104                                      const gp_Pnt2d&    p2d,
0105                                      const TopoDS_Face& F,
0106                                      const double       tola);
0107 Standard_EXPORT bool   FUN_tool_EtgOOE(const double&      paronE,
0108                                        const TopoDS_Edge& E,
0109                                        const double&      paronOOE,
0110                                        const TopoDS_Edge& OOE,
0111                                        const double       tola);
0112 
0113 // ----------------------------------------------------------------------
0114 // oriented vectors :
0115 // ----------------------------------------------------------------------
0116 Standard_EXPORT gp_Vec FUN_tool_getgeomxx(const TopoDS_Face& Fi,
0117                                           const TopoDS_Edge& Ei,
0118                                           const double       parOnEi,
0119                                           const gp_Dir&      ngFi);
0120 Standard_EXPORT gp_Vec FUN_tool_getgeomxx(const TopoDS_Face& Fi,
0121                                           const TopoDS_Edge& Ei,
0122                                           const double       parOnEi);
0123 Standard_EXPORT bool   FUN_nearestISO(const TopoDS_Face& F,
0124                                       const double       xpar,
0125                                       const bool         isoU,
0126                                       double&            xinf,
0127                                       double&            xsup);
0128 Standard_EXPORT bool   FUN_tool_getxx(const TopoDS_Face& Fi,
0129                                       const TopoDS_Edge& Ei,
0130                                       const double       parOnEi,
0131                                       const gp_Dir&      ngFi,
0132                                       gp_Dir&            XX);
0133 Standard_EXPORT bool   FUN_tool_getxx(const TopoDS_Face& Fi,
0134                                       const TopoDS_Edge& Ei,
0135                                       const double       parOnEi,
0136                                       gp_Dir&            XX);
0137 Standard_EXPORT bool   FUN_tool_getdxx(const TopoDS_Face& F,
0138                                        const TopoDS_Edge& E,
0139                                        const double       parE,
0140                                        gp_Vec2d&          XX);
0141 Standard_EXPORT bool   FUN_tool_EitangenttoFe(const gp_Dir&      ngFe,
0142                                               const TopoDS_Edge& Ei,
0143                                               const double       parOnEi);
0144 
0145 // ----------------------------------------------------------------------
0146 // curve type,surface type :
0147 // ----------------------------------------------------------------------
0148 Standard_EXPORT GeomAbs_CurveType FUN_tool_typ(const TopoDS_Edge& E);
0149 Standard_EXPORT bool              FUN_tool_line(const TopoDS_Edge& E);
0150 Standard_EXPORT bool              FUN_tool_plane(const TopoDS_Shape& F);
0151 Standard_EXPORT bool              FUN_tool_cylinder(const TopoDS_Shape& F);
0152 Standard_EXPORT bool              FUN_tool_closedS(const TopoDS_Shape& F,
0153                                                    bool&               uclosed,
0154                                                    double&             uperiod,
0155                                                    bool&               vclosed,
0156                                                    double&             vperiod);
0157 Standard_EXPORT bool              FUN_tool_closedS(const TopoDS_Shape& F);
0158 Standard_EXPORT bool FUN_tool_closedS(const TopoDS_Shape& F, bool& inU, double& xmin, double& xper);
0159 Standard_EXPORT void FUN_tool_mkBnd2d(const TopoDS_Shape& W,
0160                                       const TopoDS_Shape& FF,
0161                                       Bnd_Box2d&          B2d);
0162 
0163 // ----------------------------------------------------------------------
0164 //  closing topologies :
0165 // ----------------------------------------------------------------------
0166 Standard_EXPORT bool FUN_tool_IsClosingE(const TopoDS_Edge&  E,
0167                                          const TopoDS_Shape& S,
0168                                          const TopoDS_Face&  F);
0169 Standard_EXPORT bool FUN_tool_ClosingE(const TopoDS_Edge& E,
0170                                        const TopoDS_Wire& W,
0171                                        const TopoDS_Face& F);
0172 
0173 // ----------------------------------------------------------------------
0174 //  shared topologies :
0175 // ----------------------------------------------------------------------
0176 Standard_EXPORT bool FUN_tool_inS(const TopoDS_Shape& subshape, const TopoDS_Shape& shape);
0177 Standard_EXPORT bool FUN_tool_Eshared(const TopoDS_Shape& v,
0178                                       const TopoDS_Shape& F1,
0179                                       const TopoDS_Shape& F2,
0180                                       TopoDS_Shape&       Eshared);
0181 
0182 Standard_EXPORT bool   FUN_tool_parVonE(const TopoDS_Vertex& v, const TopoDS_Edge& E, double& par);
0183 Standard_EXPORT bool   FUN_tool_parE(const TopoDS_Edge& E0,
0184                                      const double&      par0,
0185                                      const TopoDS_Edge& E,
0186                                      double&            par,
0187                                      const double       tol);
0188 Standard_EXPORT bool   FUN_tool_parE(const TopoDS_Edge& E0,
0189                                      const double&      par0,
0190                                      const TopoDS_Edge& E,
0191                                      double&            par);
0192 Standard_EXPORT bool   FUN_tool_paronEF(const TopoDS_Edge& E,
0193                                         const double&      par,
0194                                         const TopoDS_Face& F,
0195                                         gp_Pnt2d&          UV,
0196                                         const double       tol);
0197 Standard_EXPORT bool   FUN_tool_paronEF(const TopoDS_Edge& E,
0198                                         const double&      par,
0199                                         const TopoDS_Face& F,
0200                                         gp_Pnt2d&          UV);
0201 Standard_EXPORT bool   FUN_tool_parF(const TopoDS_Edge& E,
0202                                      const double&      par,
0203                                      const TopoDS_Face& F,
0204                                      gp_Pnt2d&          UV,
0205                                      const double       tol);
0206 Standard_EXPORT bool   FUN_tool_parF(const TopoDS_Edge& E,
0207                                      const double&      par,
0208                                      const TopoDS_Face& F,
0209                                      gp_Pnt2d&          UV);
0210 Standard_EXPORT gp_Dir FUN_tool_dirC(const double par, const BRepAdaptor_Curve& BAC);
0211 Standard_EXPORT gp_Vec FUN_tool_tggeomE(const double paronE, const TopoDS_Edge& E);
0212 Standard_EXPORT bool   FUN_tool_line(const BRepAdaptor_Curve& BAC);
0213 Standard_EXPORT bool   FUN_tool_quad(const TopoDS_Edge& E);
0214 Standard_EXPORT bool   FUN_tool_quad(const BRepAdaptor_Curve& BAC);
0215 Standard_EXPORT bool   FUN_tool_quad(const TopoDS_Face& F);
0216 Standard_EXPORT bool   FUN_tool_findPinBAC(const BRepAdaptor_Curve& BAC, gp_Pnt& P, double& par);
0217 Standard_EXPORT bool   FUN_tool_findparinBAC(const BRepAdaptor_Curve& BAC, double& par);
0218 Standard_EXPORT bool   FUN_tool_findparinE(const TopoDS_Shape& E, double& par);
0219 Standard_EXPORT bool   FUN_tool_findPinE(const TopoDS_Shape& E, gp_Pnt& P, double& par);
0220 Standard_EXPORT bool   FUN_tool_maxtol(const TopoDS_Shape&     S,
0221                                        const TopAbs_ShapeEnum& typ,
0222                                        double&                 tol);
0223 Standard_EXPORT double FUN_tool_maxtol(const TopoDS_Shape& S);
0224 Standard_EXPORT int    FUN_tool_nbshapes(const TopoDS_Shape& S, const TopAbs_ShapeEnum& typ);
0225 Standard_EXPORT void   FUN_tool_shapes(const TopoDS_Shape&             S,
0226                                        const TopAbs_ShapeEnum&         typ,
0227                                        NCollection_List<TopoDS_Shape>& ltyp);
0228 Standard_EXPORT int    FUN_tool_comparebndkole(const TopoDS_Shape& sh1, const TopoDS_Shape& sh2);
0229 Standard_EXPORT bool   FUN_tool_SameOri(const TopoDS_Edge& E1, const TopoDS_Edge& E2);
0230 Standard_EXPORT bool   FUN_tool_haspc(const TopoDS_Edge& E, const TopoDS_Face& F);
0231 Standard_EXPORT bool   FUN_tool_pcurveonF(const TopoDS_Face& F, TopoDS_Edge& E);
0232 Standard_EXPORT bool   FUN_tool_pcurveonF(const TopoDS_Face&               fF,
0233                                           TopoDS_Edge&                     faultyE,
0234                                           const occ::handle<Geom2d_Curve>& C2d,
0235                                           TopoDS_Face&                     newf);
0236 
0237 // ----------------------------------------------------------------------
0238 //  shared geometry :
0239 // ----------------------------------------------------------------------
0240 Standard_EXPORT bool FUN_tool_curvesSO(const TopoDS_Edge& E1,
0241                                        const double       p1,
0242                                        const TopoDS_Edge& E2,
0243                                        const double       p2,
0244                                        bool&              so);
0245 Standard_EXPORT bool FUN_tool_curvesSO(const TopoDS_Edge& E1,
0246                                        const double       p1,
0247                                        const TopoDS_Edge& E2,
0248                                        bool&              so);
0249 Standard_EXPORT bool FUN_tool_curvesSO(const TopoDS_Edge& E1, const TopoDS_Edge& E2, bool& so);
0250 Standard_EXPORT bool FUN_tool_findAncestor(const NCollection_List<TopoDS_Shape>& lF,
0251                                            const TopoDS_Edge&                    E,
0252                                            TopoDS_Face&                          Fanc);
0253 
0254 // ----------------------------------------------------------------------
0255 //  new topologies :
0256 // ----------------------------------------------------------------------
0257 Standard_EXPORT void FUN_ds_CopyEdge(const TopoDS_Shape& Ein, TopoDS_Shape& Eou);
0258 Standard_EXPORT void FUN_ds_Parameter(const TopoDS_Shape& E, const TopoDS_Shape& V, const double P);
0259 Standard_EXPORT bool FUN_tool_MakeWire(const NCollection_List<TopoDS_Shape>& loE,
0260                                        TopoDS_Wire&                          newW);
0261 
0262 #endif