Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:36:54

0001 // Created on: 1998-09-16
0002 // Created by: Roman LYGIN <rln@nnov.matra-dtv.fr>
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 _ShapeFix_FreeBounds_HeaderFile
0018 #define _ShapeFix_FreeBounds_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopoDS_Compound.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 
0026 //! This class is intended to output free bounds of the shape
0027 //! (free bounds are the wires consisting of edges referenced by the
0028 //! only face).
0029 //! For building free bounds it uses ShapeAnalysis_FreeBounds class.
0030 //! This class complements it with the feature to reduce the number
0031 //! of open wires.
0032 //! This reduction is performed with help of connecting several
0033 //! adjacent open wires one to another what can lead to:
0034 //! 1. making an open wire with greater length out of several
0035 //! open wires
0036 //! 2. making closed wire out of several open wires
0037 //!
0038 //! The connecting open wires is performed with a user-given
0039 //! tolerance.
0040 //!
0041 //! When connecting several open wires into one wire their previous
0042 //! end vertices are replaced with new connecting vertices. After
0043 //! that all the edges in the shape sharing previous vertices inside
0044 //! the shape are updated with new vertices. Thus source shape can
0045 //! be modified.
0046 //!
0047 //! Since interface of this class is the same as one of
0048 //! ShapeAnalysis_FreeBounds refer to its CDL for details.
0049 class ShapeFix_FreeBounds
0050 {
0051 public:
0052   DEFINE_STANDARD_ALLOC
0053 
0054   //! Empty constructor
0055   Standard_EXPORT ShapeFix_FreeBounds();
0056 
0057   //! Builds forecasting free bounds of the <shape> and connects
0058   //! open wires with tolerance <closetoler>.
0059   //! <shape> should be a compound of faces.
0060   //! Tolerance <closetoler> should be greater than tolerance
0061   //! <sewtoler> used for initializing sewing analyzer, otherwise
0062   //! connection of open wires is not performed.
0063   Standard_EXPORT ShapeFix_FreeBounds(const TopoDS_Shape&    shape,
0064                                       const Standard_Real    sewtoler,
0065                                       const Standard_Real    closetoler,
0066                                       const Standard_Boolean splitclosed,
0067                                       const Standard_Boolean splitopen);
0068 
0069   //! Builds actual free bounds of the <shape> and connects
0070   //! open wires with tolerance <closetoler>.
0071   //! <shape> should be a compound of shells.
0072   Standard_EXPORT ShapeFix_FreeBounds(const TopoDS_Shape&    shape,
0073                                       const Standard_Real    closetoler,
0074                                       const Standard_Boolean splitclosed,
0075                                       const Standard_Boolean splitopen);
0076 
0077   //! Returns compound of closed wires out of free edges.
0078   const TopoDS_Compound& GetClosedWires() const;
0079 
0080   //! Returns compound of open wires out of free edges.
0081   const TopoDS_Compound& GetOpenWires() const;
0082 
0083   //! Returns modified source shape.
0084   const TopoDS_Shape& GetShape() const;
0085 
0086 protected:
0087 private:
0088   Standard_EXPORT Standard_Boolean Perform();
0089 
0090   TopoDS_Compound  myWires;
0091   TopoDS_Compound  myEdges;
0092   TopoDS_Shape     myShape;
0093   Standard_Boolean myShared;
0094   Standard_Real    mySewToler;
0095   Standard_Real    myCloseToler;
0096   Standard_Boolean mySplitClosed;
0097   Standard_Boolean mySplitOpen;
0098 };
0099 
0100 #include <ShapeFix_FreeBounds.lxx>
0101 
0102 #endif // _ShapeFix_FreeBounds_HeaderFile