Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:25

0001 // Created on: 1993-06-16
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1993-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 _TopOpeBRepBuild_ShapeSet_HeaderFile
0018 #define _TopOpeBRepBuild_ShapeSet_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopAbs_ShapeEnum.hxx>
0024 #include <TopOpeBRepTool_ShapeExplorer.hxx>
0025 #include <TopTools_ListOfShape.hxx>
0026 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0027 #include <TopoDS_Shape.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <TCollection_AsciiString.hxx>
0030 #include <TopTools_IndexedMapOfOrientedShape.hxx>
0031 #include <Standard_OStream.hxx>
0032 
0033 
0034 
0035 //! Auxiliary class providing an exploration of a set
0036 //! of shapes to build faces or solids.
0037 //! To build faces  : shapes are wires, elements are edges.
0038 //! To build solids : shapes are shells, elements are faces.
0039 //! The ShapeSet stores a list of shapes, a list of elements
0040 //! to start reconstructions, and a map to search neighbours.
0041 //! The map stores the connection  between elements through
0042 //! subshapes of type <SubShapeType> given in constructor.
0043 //! <SubShapeType> is :
0044 //! - TopAbs_VERTEX to connect edges
0045 //! - TopAbs_EDGE to connect faces
0046 //!
0047 //! Signature needed by the BlockBuilder :
0048 //! InitStartElements(me : in out)
0049 //! MoreStartElements(me) returns Boolean;
0050 //! NextStartElement(me : in out);
0051 //! StartElement(me) returns Shape; ---C++: return const &
0052 //! InitNeighbours(me : in out; S : Shape);
0053 //! MoreNeighbours(me) returns Boolean;
0054 //! NextNeighbour(me : in out);
0055 //! Neighbour(me) returns Shape; ---C++: return const &
0056 class TopOpeBRepBuild_ShapeSet 
0057 {
0058 public:
0059 
0060   DEFINE_STANDARD_ALLOC
0061 
0062   
0063   //! Creates a ShapeSet  in order to build shapes connected
0064   //! by <SubShapeType>  shapes.
0065   //! <checkshape>:check (or not) the shapes, startelements, elements added.
0066   Standard_EXPORT TopOpeBRepBuild_ShapeSet(const TopAbs_ShapeEnum SubShapeType, const Standard_Boolean checkshape = Standard_True);
0067   
0068   Standard_EXPORT virtual ~TopOpeBRepBuild_ShapeSet();
0069   
0070   //! Adds <S> to the list of shapes. (wires or shells).
0071   Standard_EXPORT virtual void AddShape (const TopoDS_Shape& S);
0072   
0073   //! (S is a face or edge)
0074   //! Add S to the list of starting shapes used for reconstructions.
0075   //! apply AddElement(S).
0076   Standard_EXPORT virtual void AddStartElement (const TopoDS_Shape& S);
0077   
0078   //! for each subshape SE of S of type mySubShapeType
0079   //! - Add subshapes of S to the map of subshapes (mySubShapeMap)
0080   //! - Add S to the list of shape incident to subshapes of S.
0081   Standard_EXPORT virtual void AddElement (const TopoDS_Shape& S);
0082   
0083   //! return a reference on myStartShapes
0084   Standard_EXPORT const TopTools_ListOfShape& StartElements() const;
0085   
0086   Standard_EXPORT void InitShapes();
0087   
0088   Standard_EXPORT Standard_Boolean MoreShapes() const;
0089   
0090   Standard_EXPORT void NextShape();
0091   
0092   Standard_EXPORT const TopoDS_Shape& Shape() const;
0093   
0094   Standard_EXPORT void InitStartElements();
0095   
0096   Standard_EXPORT Standard_Boolean MoreStartElements() const;
0097   
0098   Standard_EXPORT void NextStartElement();
0099   
0100   Standard_EXPORT const TopoDS_Shape& StartElement() const;
0101   
0102   Standard_EXPORT virtual void InitNeighbours (const TopoDS_Shape& S);
0103   
0104   Standard_EXPORT Standard_Boolean MoreNeighbours();
0105   
0106   Standard_EXPORT void NextNeighbour();
0107   
0108   Standard_EXPORT const TopoDS_Shape& Neighbour() const;
0109   
0110   Standard_EXPORT TopTools_ListOfShape& ChangeStartShapes();
0111   
0112   //! Build the list of neighbour shapes of myCurrentShape
0113   //! (neighbour shapes and myCurrentShapes are of type t)
0114   //! Initialize myIncidentShapesIter on neighbour shapes.
0115   Standard_EXPORT virtual void FindNeighbours();
0116   
0117   Standard_EXPORT virtual const TopTools_ListOfShape& MakeNeighboursList (const TopoDS_Shape& E, const TopoDS_Shape& V);
0118   
0119   Standard_EXPORT Standard_Integer MaxNumberSubShape (const TopoDS_Shape& Shape);
0120   
0121   Standard_EXPORT void CheckShape (const Standard_Boolean checkshape);
0122   
0123   Standard_EXPORT Standard_Boolean CheckShape() const;
0124   
0125   Standard_EXPORT Standard_Boolean CheckShape (const TopoDS_Shape& S, const Standard_Boolean checkgeom = Standard_False);
0126   
0127   Standard_EXPORT void DumpName (Standard_OStream& OS, const TCollection_AsciiString& str) const;
0128   
0129   Standard_EXPORT void DumpCheck (Standard_OStream& OS, const TCollection_AsciiString& str, const TopoDS_Shape& S, const Standard_Boolean chk) const;
0130   
0131   Standard_EXPORT virtual void DumpSS();
0132   
0133   Standard_EXPORT virtual void DumpBB();
0134   
0135   Standard_EXPORT void DEBName (const TCollection_AsciiString& N);
0136   
0137   Standard_EXPORT const TCollection_AsciiString& DEBName() const;
0138   
0139   Standard_EXPORT void DEBNumber (const Standard_Integer I);
0140   
0141   Standard_EXPORT Standard_Integer DEBNumber() const;
0142   
0143   Standard_EXPORT virtual TCollection_AsciiString SName (const TopoDS_Shape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const;
0144   
0145   Standard_EXPORT virtual TCollection_AsciiString SNameori (const TopoDS_Shape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const;
0146   
0147   Standard_EXPORT virtual TCollection_AsciiString SName (const TopTools_ListOfShape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const;
0148   
0149   Standard_EXPORT virtual TCollection_AsciiString SNameori (const TopTools_ListOfShape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const;
0150 
0151 
0152 
0153 
0154 protected:
0155 
0156   
0157   Standard_EXPORT void ProcessAddShape (const TopoDS_Shape& S);
0158   
0159   Standard_EXPORT void ProcessAddStartElement (const TopoDS_Shape& S);
0160   
0161   Standard_EXPORT void ProcessAddElement (const TopoDS_Shape& S);
0162 
0163 
0164   TopAbs_ShapeEnum myShapeType;
0165   TopAbs_ShapeEnum mySubShapeType;
0166   TopOpeBRepTool_ShapeExplorer mySubShapeExplorer;
0167   TopTools_ListOfShape myStartShapes;
0168   TopTools_ListIteratorOfListOfShape myStartShapesIter;
0169   TopTools_IndexedDataMapOfShapeListOfShape mySubShapeMap;
0170   TopTools_ListIteratorOfListOfShape myIncidentShapesIter;
0171   TopTools_ListOfShape myShapes;
0172   TopTools_ListIteratorOfListOfShape myShapesIter;
0173   TopoDS_Shape myCurrentShape;
0174   TopTools_ListOfShape myCurrentShapeNeighbours;
0175   Standard_Integer myDEBNumber;
0176   TCollection_AsciiString myDEBName;
0177   TopTools_IndexedMapOfOrientedShape myOMSS;
0178   TopTools_IndexedMapOfOrientedShape myOMES;
0179   TopTools_IndexedMapOfOrientedShape myOMSH;
0180   Standard_Boolean myCheckShape;
0181 
0182 
0183 private:
0184 
0185 
0186 
0187 
0188 
0189 };
0190 
0191 
0192 
0193 
0194 
0195 
0196 
0197 #endif // _TopOpeBRepBuild_ShapeSet_HeaderFile