Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:19:02

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 _TopOpeBRepTool_HeaderFile
0018 #define _TopOpeBRepTool_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <TopoDS_Shape.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <TopTools_ShapeMapHasher.hxx>
0028 #include <NCollection_DataMap.hxx>
0029 #include <NCollection_IndexedMap.hxx>
0030 #include <NCollection_List.hxx>
0031 #include <Standard_OStream.hxx>
0032 #include <TopOpeBRepTool_OutCurveType.hxx>
0033 class TopoDS_Face;
0034 class TopoDS_Solid;
0035 
0036 //! This package provides services used by the TopOpeBRep
0037 //! package performing topological operations on the BRep
0038 //! data structure.
0039 class TopOpeBRepTool
0040 {
0041 public:
0042   DEFINE_STANDARD_ALLOC
0043 
0044   //! Fuse edges (in a wire) of a shape where we have
0045   //! useless vertex.
0046   //! In case face <FF> is built on UV-non-connexed wires
0047   //! (with the two closing edges FORWARD and REVERSED, in
0048   //! spite of one only), we find out the faulty edge, add
0049   //! the faulty shapes (edge,wire,face) to <MshNOK>.
0050   //! <FF> is a face descendant of <F>.
0051   //! <MWisOld>(wire) = 1 if wire is wire of <F>
0052   //! 0 wire results from <F>'s wire split.
0053   //! returns false if purge fails
0054   Standard_EXPORT static bool PurgeClosingEdges(
0055     const TopoDS_Face&                                                     F,
0056     const TopoDS_Face&                                                     FF,
0057     const NCollection_DataMap<TopoDS_Shape, int, TopTools_ShapeMapHasher>& MWisOld,
0058     NCollection_IndexedMap<TopoDS_Shape>&                                  MshNOK);
0059 
0060   Standard_EXPORT static bool PurgeClosingEdges(
0061     const TopoDS_Face&                                                     F,
0062     const NCollection_List<TopoDS_Shape>&                                  LOF,
0063     const NCollection_DataMap<TopoDS_Shape, int, TopTools_ShapeMapHasher>& MWisOld,
0064     NCollection_IndexedMap<TopoDS_Shape>&                                  MshNOK);
0065 
0066   Standard_EXPORT static bool CorrectONUVISO(const TopoDS_Face& F, TopoDS_Face& Fsp);
0067 
0068   //! Builds up the correct list of faces <LOFF> from <LOF>, using
0069   //! faulty shapes from map <MshNOK>.
0070   //! <LOF> is the list of <F>'s descendant faces.
0071   //! returns false if building fails
0072   Standard_EXPORT static bool MakeFaces(const TopoDS_Face&                          F,
0073                                         const NCollection_List<TopoDS_Shape>&       LOF,
0074                                         const NCollection_IndexedMap<TopoDS_Shape>& MshNOK,
0075                                         NCollection_List<TopoDS_Shape>&             LOFF);
0076 
0077   //! Returns <False> if the face is valid (the UV
0078   //! representation of the face is a set of pcurves
0079   //! connexed by points with connexity 2).
0080   //! Else, splits <aFace> in order to return a list of valid
0081   //! faces.
0082   Standard_EXPORT static bool Regularize(
0083     const TopoDS_Face&              aFace,
0084     NCollection_List<TopoDS_Shape>& aListOfFaces,
0085     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&
0086       ESplits);
0087 
0088   //! Returns <False> if the face is valid (the UV
0089   //! representation of the face is a set of pcurves
0090   //! connexed by points with connexity 2).
0091   //! Else, splits wires of the face, these are boundaries of the
0092   //! new faces to build up; <OldWiresNewWires> describes (wire,
0093   //! splits of wire); <ESplits> describes (edge, edge's splits)
0094   Standard_EXPORT static bool RegularizeWires(
0095     const TopoDS_Face& aFace,
0096     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&
0097       OldWiresNewWires,
0098     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&
0099       ESplits);
0100 
0101   //! Classify wire's splits of map <OldWiresnewWires> in order to
0102   //! compute <aListOfFaces>, the splits of <aFace>.
0103   Standard_EXPORT static bool RegularizeFace(
0104     const TopoDS_Face&                                  aFace,
0105     const NCollection_DataMap<TopoDS_Shape,
0106                               NCollection_List<TopoDS_Shape>,
0107                               TopTools_ShapeMapHasher>& OldWiresnewWires,
0108     NCollection_List<TopoDS_Shape>&                     aListOfFaces);
0109 
0110   //! Returns <False> if the shell is valid (the solid is a set
0111   //! of faces connexed by edges with connexity 2).
0112   //! Else, splits faces of the shell; <OldFacesnewFaces> describes
0113   //! (face, splits of face).
0114   Standard_EXPORT static bool RegularizeShells(
0115     const TopoDS_Solid& aSolid,
0116     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&
0117       OldSheNewShe,
0118     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&
0119       FSplits);
0120 
0121   //! Prints <OCT> as string on stream <S>; returns <S>.
0122   Standard_EXPORT static Standard_OStream& Print(const TopOpeBRepTool_OutCurveType OCT,
0123                                                  Standard_OStream&                 S);
0124 };
0125 
0126 #endif // _TopOpeBRepTool_HeaderFile