Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 09:16:32

0001 // Created on: 2000-01-25
0002 // Created by: Peter KURNEV
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _TopOpeBRepBuild_CorrectFace2d_HeaderFile
0017 #define _TopOpeBRepBuild_CorrectFace2d_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <TopoDS_Wire.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <NCollection_List.hxx>
0028 #include <NCollection_IndexedMap.hxx>
0029 #include <TopTools_ShapeMapHasher.hxx>
0030 #include <NCollection_IndexedDataMap.hxx>
0031 class TopoDS_Edge;
0032 class gp_Pnt2d;
0033 class TopoDS_Shape;
0034 class gp_Vec2d;
0035 class Geom2d_Curve;
0036 class Bnd_Box2d;
0037 
0038 class TopOpeBRepBuild_CorrectFace2d
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   Standard_EXPORT TopOpeBRepBuild_CorrectFace2d();
0044 
0045   Standard_EXPORT TopOpeBRepBuild_CorrectFace2d(
0046     const TopoDS_Face&                                                               aFace,
0047     const NCollection_IndexedMap<TopoDS_Shape>&                                      anAvoidMap,
0048     NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& aMap);
0049 
0050   Standard_EXPORT const TopoDS_Face& Face() const;
0051 
0052   Standard_EXPORT void Perform();
0053 
0054   Standard_EXPORT bool IsDone() const;
0055 
0056   Standard_EXPORT int ErrorStatus() const;
0057 
0058   Standard_EXPORT const TopoDS_Face& CorrectedFace() const;
0059 
0060   Standard_EXPORT void SetMapOfTrans2dInfo(
0061     NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& aMap);
0062 
0063   Standard_EXPORT NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>&
0064                   MapOfTrans2dInfo();
0065 
0066   Standard_EXPORT static void GetP2dFL(const TopoDS_Face& aFace,
0067                                        const TopoDS_Edge& anEdge,
0068                                        gp_Pnt2d&          P2dF,
0069                                        gp_Pnt2d&          P2dL);
0070 
0071   Standard_EXPORT static void CheckList(const TopoDS_Face&              aFace,
0072                                         NCollection_List<TopoDS_Shape>& aHeadList);
0073 
0074 private:
0075   Standard_EXPORT void CheckFace();
0076 
0077   Standard_EXPORT int MakeRightWire();
0078 
0079   Standard_EXPORT void MakeHeadList(const TopoDS_Shape&             aFirstEdge,
0080                                     NCollection_List<TopoDS_Shape>& aHeadList) const;
0081 
0082   Standard_EXPORT void TranslateCurve2d(const TopoDS_Edge&         anEdge,
0083                                         const TopoDS_Face&         aFace,
0084                                         const gp_Vec2d&            aTranslateVec,
0085                                         occ::handle<Geom2d_Curve>& aCurve2d);
0086 
0087   Standard_EXPORT int OuterWire(TopoDS_Wire& anOuterWire) const;
0088 
0089   Standard_EXPORT void BndBoxWire(const TopoDS_Wire& aWire, Bnd_Box2d& aB2d) const;
0090 
0091   Standard_EXPORT void MoveWire2d(TopoDS_Wire& aWire, const gp_Vec2d& aTrV);
0092 
0093   Standard_EXPORT void MoveWires2d(TopoDS_Wire& aWire);
0094 
0095   Standard_EXPORT void UpdateEdge(const TopoDS_Edge&               E,
0096                                   const occ::handle<Geom2d_Curve>& C,
0097                                   const TopoDS_Face&               F,
0098                                   const double                     Tol);
0099 
0100   Standard_EXPORT void UpdateEdge(const TopoDS_Edge&               E,
0101                                   const occ::handle<Geom2d_Curve>& C1,
0102                                   const occ::handle<Geom2d_Curve>& C2,
0103                                   const TopoDS_Face&               F,
0104                                   const double                     Tol);
0105 
0106   Standard_EXPORT void BuildCopyData(const TopoDS_Face&                          F,
0107                                      const NCollection_IndexedMap<TopoDS_Shape>& anAvoidMap,
0108                                      TopoDS_Face&                                aCopyFace,
0109                                      NCollection_IndexedMap<TopoDS_Shape>&       aCopyAvoidMap,
0110                                      const bool                                  aNeedToUsePMap);
0111 
0112   Standard_EXPORT int ConnectWire(TopoDS_Face&                                aCopyFace,
0113                                   const NCollection_IndexedMap<TopoDS_Shape>& aCopyAvoidMap,
0114                                   const bool                                  aTryToConnectFlag);
0115 
0116   TopoDS_Face                                                                     myFace;
0117   TopoDS_Face                                                                     myCorrectedFace;
0118   bool                                                                            myIsDone;
0119   int                                                                             myErrorStatus;
0120   double                                                                          myFaceTolerance;
0121   TopoDS_Wire                                                                     myCurrentWire;
0122   NCollection_List<TopoDS_Shape>                                                  myOrderedWireList;
0123   NCollection_IndexedMap<TopoDS_Shape>                                            myAvoidMap;
0124   void*                                                                           myMap;
0125   TopoDS_Face                                                                     myCopyFace;
0126   NCollection_IndexedMap<TopoDS_Shape>                                            myCopyAvoidMap;
0127   NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myEdMapInversed;
0128 };
0129 
0130 #endif // _TopOpeBRepBuild_CorrectFace2d_HeaderFile