Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:06

0001 // Created on: 1995-11-10
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1995-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 _BRepAlgo_Loop_HeaderFile
0018 #define _BRepAlgo_Loop_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <TopTools_ListOfShape.hxx>
0025 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0026 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0027 #include <BRepAlgo_Image.hxx>
0028 class TopoDS_Edge;
0029 
0030 
0031 //! Builds the loops from a set of edges on a face.
0032 class BRepAlgo_Loop 
0033 {
0034 public:
0035 
0036   DEFINE_STANDARD_ALLOC
0037 
0038   
0039   Standard_EXPORT BRepAlgo_Loop();
0040   
0041   //! Init with <F> the set of edges must have
0042   //! pcurves on <F>.
0043   Standard_EXPORT void Init (const TopoDS_Face& F);
0044   
0045   //! Add E with <LV>. <E> will be copied and trim
0046   //! by vertices in <LV>.
0047   Standard_EXPORT void AddEdge (TopoDS_Edge& E, const TopTools_ListOfShape& LV);
0048   
0049   //! Add <E> as const edge, E can be in the result.
0050   Standard_EXPORT void AddConstEdge (const TopoDS_Edge& E);
0051   
0052   //! Add <LE> as a set of const edges.
0053   Standard_EXPORT void AddConstEdges (const TopTools_ListOfShape& LE);
0054   
0055   //! Sets the Image Vertex - Vertex
0056   Standard_EXPORT void SetImageVV (const BRepAlgo_Image& theImageVV);
0057   
0058   //! Make loops.
0059   Standard_EXPORT void Perform();
0060   
0061   //! Update VE map according to Image Vertex - Vertex
0062   Standard_EXPORT void UpdateVEmap (TopTools_IndexedDataMapOfShapeListOfShape& theVEmap);
0063   
0064   //! Cut the  edge <E>  in  several edges  <NE> on the
0065   //! vertices<VonE>.
0066   Standard_EXPORT void CutEdge (const TopoDS_Edge& E, const TopTools_ListOfShape& VonE, TopTools_ListOfShape& NE) const;
0067   
0068   //! Returns the list of wires performed.
0069   //! can be an empty list.
0070   Standard_EXPORT const TopTools_ListOfShape& NewWires() const;
0071   
0072   //! Build faces from the wires result.
0073   Standard_EXPORT void WiresToFaces();
0074   
0075   //! Returns the list of faces.
0076   //! Warning: The method <WiresToFaces> as to be called before.
0077   //! can be an empty list.
0078   Standard_EXPORT const TopTools_ListOfShape& NewFaces() const;
0079   
0080   //! Returns the list of new edges built from an edge <E>
0081   //! it can be an empty list.
0082   Standard_EXPORT const TopTools_ListOfShape& NewEdges (const TopoDS_Edge& E) const;
0083   
0084   //! Returns the datamap of vertices with their substitutes.
0085   Standard_EXPORT void GetVerticesForSubstitute (TopTools_DataMapOfShapeShape& VerVerMap) const;
0086   
0087   Standard_EXPORT void VerticesForSubstitute (TopTools_DataMapOfShapeShape& VerVerMap);
0088 
0089   //! Set maximal tolerance used for comparing distaces between vertices. 
0090   void SetTolConf(const Standard_Real theTolConf)
0091   {
0092     myTolConf = theTolConf;
0093   }
0094 
0095   //! Get maximal tolerance used for comparing distaces between vertices. 
0096   Standard_Real GetTolConf() const
0097   {
0098     return myTolConf;
0099   }
0100 
0101 protected:
0102 
0103 
0104 
0105 
0106 
0107 private:
0108 
0109 
0110 
0111   TopoDS_Face myFace;
0112   TopTools_ListOfShape myConstEdges;
0113   TopTools_ListOfShape myEdges;
0114   TopTools_DataMapOfShapeListOfShape myVerOnEdges;
0115   TopTools_ListOfShape myNewWires;
0116   TopTools_ListOfShape myNewFaces;
0117   TopTools_DataMapOfShapeListOfShape myCutEdges;
0118   TopTools_DataMapOfShapeShape myVerticesForSubstitute;
0119   BRepAlgo_Image myImageVV;
0120   Standard_Real myTolConf;
0121 
0122 
0123 };
0124 
0125 
0126 
0127 
0128 
0129 
0130 
0131 #endif // _BRepAlgo_Loop_HeaderFile