Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-26 08:29:25

0001 // Created on: 1998-06-03
0002 // Created by: data exchange team
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 _ShapeAnalysis_Shell_HeaderFile
0018 #define _ShapeAnalysis_Shell_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopTools_IndexedMapOfShape.hxx>
0024 #include <Standard_Integer.hxx>
0025 class TopoDS_Shape;
0026 class TopoDS_Compound;
0027 
0028 //! This class provides operators to analyze edges orientation
0029 //! in the shell.
0030 class ShapeAnalysis_Shell
0031 {
0032 public:
0033   DEFINE_STANDARD_ALLOC
0034 
0035   //! Empty constructor
0036   Standard_EXPORT ShapeAnalysis_Shell();
0037 
0038   //! Clears data about loaded shells and performed checks
0039   Standard_EXPORT void Clear();
0040 
0041   //! Adds shells contained in the <shape> to the list of loaded shells
0042   Standard_EXPORT void LoadShells(const TopoDS_Shape& shape);
0043 
0044   //! Checks if shells fulfill orientation condition, i.e. if each
0045   //! edge is, either present once (free edge) or twice (connected
0046   //! edge) but with different orientations (FORWARD/REVERSED)
0047   //! Edges which do not fulfill these conditions are bad
0048   //!
0049   //! If <alsofree> is True free edges are considered.
0050   //! Free edges can be queried but are not bad
0051   Standard_EXPORT Standard_Boolean
0052     CheckOrientedShells(const TopoDS_Shape&    shape,
0053                         const Standard_Boolean alsofree           = Standard_False,
0054                         const Standard_Boolean checkinternaledges = Standard_False);
0055 
0056   //! Tells if a shape is loaded (only shells are checked)
0057   Standard_EXPORT Standard_Boolean IsLoaded(const TopoDS_Shape& shape) const;
0058 
0059   //! Returns the actual number of loaded shapes (i.e. shells)
0060   Standard_EXPORT Standard_Integer NbLoaded() const;
0061 
0062   //! Returns a loaded shape specified by its rank number.
0063   //! Returns null shape if <num> is out of range
0064   Standard_EXPORT TopoDS_Shape Loaded(const Standard_Integer num) const;
0065 
0066   //! Tells if at least one edge is recorded as bad
0067   Standard_EXPORT Standard_Boolean HasBadEdges() const;
0068 
0069   //! Returns the list of bad edges as a Compound
0070   //! It is empty (not null) if no edge are recorded as bad
0071   Standard_EXPORT TopoDS_Compound BadEdges() const;
0072 
0073   //! Tells if at least one edge is recorded as free (not connected)
0074   Standard_EXPORT Standard_Boolean HasFreeEdges() const;
0075 
0076   //! Returns the list of free (not connected) edges as a Compound
0077   //! It is empty (not null) if no edge are recorded as free
0078   Standard_EXPORT TopoDS_Compound FreeEdges() const;
0079 
0080   //! Tells if at least one edge is connected (shared twice or more)
0081   Standard_EXPORT Standard_Boolean HasConnectedEdges() const;
0082 
0083 protected:
0084 private:
0085   TopTools_IndexedMapOfShape myShells;
0086   TopTools_IndexedMapOfShape myBad;
0087   TopTools_IndexedMapOfShape myFree;
0088   Standard_Boolean           myConex;
0089 };
0090 
0091 #endif // _ShapeAnalysis_Shell_HeaderFile