Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-05-02
0002 // Created by: Jing Cheng MEI
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 _BRepOffsetAPI_FindContigousEdges_HeaderFile
0018 #define _BRepOffsetAPI_FindContigousEdges_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <TopTools_ListOfShape.hxx>
0026 class BRepBuilderAPI_Sewing;
0027 class TopoDS_Shape;
0028 class TopoDS_Edge;
0029 
0030 
0031 //! Provides methods to identify contiguous boundaries for continuity control (C0, C1, ...)
0032 //!
0033 //! Use this function as following:
0034 //! - create an object
0035 //! - default tolerance 1.E-06
0036 //! - with analysis of degenerated faces on
0037 //! - define if necessary a new tolerance
0038 //! - set if necessary analysis of degenerated shapes off
0039 //! - add shapes to be controlled -> Add
0040 //! - compute -> Perfom
0041 //! - output couples of connected edges for control
0042 //! - output the problems if any
0043 class BRepOffsetAPI_FindContigousEdges 
0044 {
0045 public:
0046 
0047   DEFINE_STANDARD_ALLOC
0048 
0049   
0050   //! Initializes an algorithm for identifying contiguous edges
0051   //! on shapes with tolerance as the tolerance of contiguity
0052   //! (defaulted to 1.0e-6). This tolerance value is used to
0053   //! determine whether two edges or sections of edges are coincident.
0054   //! Use the function Add to define the shapes to be checked.
0055   //! Set option to false. This argument (defaulted to true) will
0056   //! serve in subsequent software releases for performing an
0057   //! analysis of degenerated shapes.
0058   Standard_EXPORT BRepOffsetAPI_FindContigousEdges(const Standard_Real tolerance = 1.0e-06, const Standard_Boolean option = Standard_True);
0059   
0060   //! Initializes this algorithm for identifying contiguous edges
0061   //! on shapes using the tolerance of contiguity tolerance.
0062   //! This tolerance value is used to determine whether two
0063   //! edges or sections of edges are coincident.
0064   //! Use the function Add to define the shapes to be checked.
0065   //! Sets <option> to false.
0066   Standard_EXPORT void Init (const Standard_Real tolerance, const Standard_Boolean option);
0067   
0068   //! Adds the shape shape to the list of shapes to be
0069   //! checked by this algorithm.
0070   //! Once all the shapes to be checked have been added,
0071   //! use the function Perform to find the contiguous edges
0072   //! and the function ContigousEdge to return these edges.
0073   Standard_EXPORT void Add (const TopoDS_Shape& shape);
0074   
0075   //! Finds coincident parts of edges of two or more shapes
0076   //! added to this algorithm and breaks down these edges
0077   //! into contiguous and non-contiguous sections on copies
0078   //! of the initial shapes.
0079   //! The function ContigousEdge returns contiguous
0080   //! edges. The function Modified can be used to return
0081   //! modified copies of the initial shapes where one or more
0082   //! edges were broken down into contiguous and non-contiguous sections.
0083   //! Warning
0084   //! This function must be used once all the shapes to be
0085   //! checked have been added. It is not possible to add
0086   //! further shapes subsequently and then to repeat the call to Perform.
0087   Standard_EXPORT void Perform();
0088   
0089   //! Gives the number of edges (free edges + contiguous edges + multiple edge)
0090   Standard_EXPORT Standard_Integer NbEdges() const;
0091   
0092   //! Returns the number of contiguous edges found by the
0093   //! function Perform on the shapes added to this algorithm.
0094   Standard_EXPORT Standard_Integer NbContigousEdges() const;
0095   
0096   //! Returns the contiguous edge of index index found by
0097   //! the function Perform on the shapes added to this algorithm.
0098   //! Exceptions
0099   //! Standard_OutOfRange if:
0100   //! - index is less than 1, or
0101   //! - index is greater than the number of contiguous
0102   //! edges found by the function Perform on the shapes added to this algorithm.
0103   Standard_EXPORT const TopoDS_Edge& ContigousEdge (const Standard_Integer index) const;
0104   
0105   //! Returns a list of edges coincident with the contiguous
0106   //! edge of index index found by the function Perform.
0107   //! There are as many edges in the list as there are faces
0108   //! adjacent to this contiguous edge.
0109   //! Exceptions
0110   //! Standard_OutOfRange if:
0111   //! - index is less than 1, or
0112   //! - index is greater than the number of contiguous edges
0113   //! found by the function Perform on the shapes added to this algorithm.
0114   Standard_EXPORT const TopTools_ListOfShape& ContigousEdgeCouple (const Standard_Integer index) const;
0115   
0116   //! Returns the edge on the initial shape, of which the
0117   //! modified copy contains the edge section.
0118   //! section is coincident with a contiguous edge found by
0119   //! the function Perform. Use the function
0120   //! ContigousEdgeCouple to obtain a valid section.
0121   //! This information is useful for verification purposes, since
0122   //! it provides a means of determining the surface to which
0123   //! the contiguous edge belongs.
0124   //! Exceptions
0125   //! Standard_NoSuchObject if section is not coincident
0126   //! with a contiguous edge. Use the function
0127   //! ContigousEdgeCouple to obtain a valid section.
0128   Standard_EXPORT const TopoDS_Edge& SectionToBoundary (const TopoDS_Edge& section) const;
0129   
0130   //! Gives the number of degenerated shapes
0131   Standard_EXPORT Standard_Integer NbDegeneratedShapes() const;
0132   
0133   //! Gives a degenerated shape
0134   Standard_EXPORT const TopoDS_Shape& DegeneratedShape (const Standard_Integer index) const;
0135   
0136   //! Indicates if a input shape is degenerated
0137   Standard_EXPORT Standard_Boolean IsDegenerated (const TopoDS_Shape& shape) const;
0138   
0139   //! Returns true if the copy of the initial shape shape was
0140   //! modified by the function Perform (i.e. if one or more of
0141   //! its edges was broken down into contiguous and non-contiguous sections).
0142   //! Warning
0143   //! Returns false if shape is not one of the initial shapes
0144   //! added to this algorithm.
0145   Standard_EXPORT Standard_Boolean IsModified (const TopoDS_Shape& shape) const;
0146   
0147   //! Gives a modifieded shape
0148   //! Raises   NoSuchObject if shape has not been modified
0149   Standard_EXPORT const TopoDS_Shape& Modified (const TopoDS_Shape& shape) const;
0150   
0151   //! Dump properties of resulting shape.
0152   Standard_EXPORT void Dump() const;
0153 
0154 
0155 
0156 
0157 protected:
0158 
0159 
0160 
0161 
0162 
0163 private:
0164 
0165 
0166 
0167   Handle(BRepBuilderAPI_Sewing) mySewing;
0168 
0169 
0170 };
0171 
0172 
0173 
0174 
0175 
0176 
0177 
0178 #endif // _BRepOffsetAPI_FindContigousEdges_HeaderFile