Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:56

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