Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:19:56

0001 // Created on: 1994-12-22
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1994-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 _BRepTools_Quilt_HeaderFile
0018 #define _BRepTools_Quilt_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Shape.hxx>
0024 #include <TopTools_ShapeMapHasher.hxx>
0025 #include <NCollection_IndexedDataMap.hxx>
0026 class TopoDS_Edge;
0027 class TopoDS_Vertex;
0028 class TopoDS_Shape;
0029 
0030 //! A Tool to glue faces at common edges and reconstruct shells.
0031 //!
0032 //! The user designate pairs of common edges using the method Bind.
0033 //! One edge is designated as the edge to use in place of the other one
0034 //! (they are supposed to be geometrically confused, but this not checked).
0035 //! They can be of opposite directions, this is specified by the orientations.
0036 //!
0037 //! The user can add shapes with the Add method, all the faces are registered and copies of faces
0038 //! and edges are made to glue at the bound edges.
0039 //!
0040 //! The user can call the Shells methods to compute a compound of shells from the current set of
0041 //! faces.
0042 //!
0043 //! If no binding is made this class can be used to make shell from faces already sharing their
0044 //! edges.
0045 class BRepTools_Quilt
0046 {
0047 public:
0048   DEFINE_STANDARD_ALLOC
0049 
0050   Standard_EXPORT BRepTools_Quilt();
0051 
0052   //! Binds <Enew> to be the new edge instead of <Eold>.
0053   //!
0054   //! The faces of the added shape containing <Eold>
0055   //! will be copied to substitute <Eold> by <Enew>.
0056   //!
0057   //! The vertices of <Eold> will be bound to the
0058   //! vertices of <Enew> with the same orientation.
0059   //!
0060   //! If <Eold> and <Enew> have different orientations
0061   //! the curves are considered to be opposite and the
0062   //! pcurves of <Eold> will be copied and reversed in
0063   //! the new faces.
0064   //!
0065   //! <Eold> must belong to the next added shape, <Enew> must belong
0066   //! to a Shape added before.
0067   Standard_EXPORT void Bind(const TopoDS_Edge& Eold, const TopoDS_Edge& Enew);
0068 
0069   //! Binds <VNew> to be a new vertex instead of <Vold>.
0070   //!
0071   //! The faces of the added shape containing <Vold>
0072   //! will be copied to substitute <Vold> by <Vnew>.
0073   Standard_EXPORT void Bind(const TopoDS_Vertex& Vold, const TopoDS_Vertex& Vnew);
0074 
0075   //! Add the faces of <S> to the Quilt, the faces
0076   //! containing bounded edges are copied.
0077   Standard_EXPORT void Add(const TopoDS_Shape& S);
0078 
0079   //! Returns True if <S> has been copied (<S> is a
0080   //! vertex, an edge or a face)
0081   Standard_EXPORT bool IsCopied(const TopoDS_Shape& S) const;
0082 
0083   //! Returns the shape substituted to <S> in the Quilt.
0084   Standard_EXPORT const TopoDS_Shape& Copy(const TopoDS_Shape& S) const;
0085 
0086   //! Returns a Compound of shells made from the current
0087   //! set of faces. The shells will be flagged as closed
0088   //! or not closed.
0089   Standard_EXPORT TopoDS_Shape Shells() const;
0090 
0091 private:
0092   NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> myBounds;
0093   bool                                                                            hasCopy;
0094 };
0095 
0096 #endif // _BRepTools_Quilt_HeaderFile