Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:05:10

0001 // Created on: 1993-06-17
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 _TopOpeBRepDS_HDataStructure_HeaderFile
0018 #define _TopOpeBRepDS_HDataStructure_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopOpeBRepDS_DataStructure.hxx>
0024 #include <TCollection_AsciiString.hxx>
0025 #include <Standard_Transient.hxx>
0026 #include <TopAbs_ShapeEnum.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <TopOpeBRepDS_Config.hxx>
0029 #include <TopOpeBRepDS_Kind.hxx>
0030 #include <TopOpeBRepDS_Interference.hxx>
0031 #include <NCollection_List.hxx>
0032 class TopoDS_Shape;
0033 class TopOpeBRepDS_Surface;
0034 class TopOpeBRepDS_CurveIterator;
0035 class TopOpeBRepDS_Curve;
0036 class TopOpeBRepDS_PointIterator;
0037 class TopOpeBRepDS_Point;
0038 class TopOpeBRepDS_SurfaceIterator;
0039 class TopOpeBRepDS_Interference;
0040 
0041 class TopOpeBRepDS_HDataStructure : public Standard_Transient
0042 {
0043 
0044 public:
0045   Standard_EXPORT TopOpeBRepDS_HDataStructure();
0046 
0047   Standard_EXPORT void AddAncestors(const TopoDS_Shape& S);
0048 
0049   //! Update the data structure with shapes of type T1
0050   //! containing a subshape of type T2 which is stored
0051   //! in the DS.
0052   //! Used by the previous one.
0053   Standard_EXPORT void AddAncestors(const TopoDS_Shape&    S,
0054                                     const TopAbs_ShapeEnum T1,
0055                                     const TopAbs_ShapeEnum T2);
0056 
0057   //! Check the integrity of the DS
0058   Standard_EXPORT void ChkIntg();
0059 
0060   Standard_EXPORT const TopOpeBRepDS_DataStructure& DS() const;
0061 
0062   Standard_EXPORT TopOpeBRepDS_DataStructure& ChangeDS();
0063 
0064   Standard_EXPORT int NbSurfaces() const;
0065 
0066   Standard_EXPORT int NbCurves() const;
0067 
0068   Standard_EXPORT int NbPoints() const;
0069 
0070   //! Returns the surface of index <I>.
0071   Standard_EXPORT const TopOpeBRepDS_Surface& Surface(const int I) const;
0072 
0073   //! Returns an iterator on the curves on the surface
0074   //! <I>.
0075   Standard_EXPORT TopOpeBRepDS_CurveIterator SurfaceCurves(const int I) const;
0076 
0077   //! Returns the Curve of index <I>.
0078   Standard_EXPORT const TopOpeBRepDS_Curve& Curve(const int I) const;
0079 
0080   //! Returns the Curve of index <I>.
0081   Standard_EXPORT TopOpeBRepDS_Curve& ChangeCurve(const int I);
0082 
0083   //! Returns an iterator on the points on the curve
0084   //! <I>.
0085   Standard_EXPORT TopOpeBRepDS_PointIterator CurvePoints(const int I) const;
0086 
0087   //! Returns the point of index <I>.
0088   Standard_EXPORT const TopOpeBRepDS_Point& Point(const int I) const;
0089 
0090   Standard_EXPORT int NbShapes() const;
0091 
0092   //! Returns the shape of index <I> in the DS
0093   Standard_EXPORT const TopoDS_Shape& Shape(const int I, const bool FindKeep = true) const;
0094 
0095   //! Returns the index of shape <S> in the DS
0096   //! returns 0 if <S> is not in the DS
0097   Standard_EXPORT int Shape(const TopoDS_Shape& S, const bool FindKeep = true) const;
0098 
0099   //! Returns True if <S> has new geometries.
0100   Standard_EXPORT bool HasGeometry(const TopoDS_Shape& S) const;
0101 
0102   //! Returns True if <S> has new geometries (SOLID,FACE,EDGE)
0103   //! or if <S> (SHELL,WIRE) has sub-shape (FACE,EDGE)
0104   //! with new geometries
0105   Standard_EXPORT bool HasShape(const TopoDS_Shape& S, const bool FindKeep = true) const;
0106 
0107   //! Returns True if <S> share a geometrical domain with
0108   //! some other shapes.
0109   Standard_EXPORT bool HasSameDomain(const TopoDS_Shape& S, const bool FindKeep = true) const;
0110 
0111   //! Returns an iterator on the SameDomain shapes attached
0112   //! to the shape <S>.
0113   Standard_EXPORT NCollection_List<TopoDS_Shape>::Iterator SameDomain(const TopoDS_Shape& S) const;
0114 
0115   //! Returns orientation of shape <S> compared with its
0116   //! reference shape
0117   Standard_EXPORT TopOpeBRepDS_Config SameDomainOrientation(const TopoDS_Shape& S) const;
0118 
0119   //! Returns orientation of shape <S> compared with its
0120   //! reference shape
0121   Standard_EXPORT int SameDomainReference(const TopoDS_Shape& S) const;
0122 
0123   //! Returns an iterator on the surfaces attached to the
0124   //! solid <S>.
0125   Standard_EXPORT TopOpeBRepDS_SurfaceIterator SolidSurfaces(const TopoDS_Shape& S) const;
0126 
0127   //! Returns an iterator on the surfaces attached to the
0128   //! solid <I>.
0129   Standard_EXPORT TopOpeBRepDS_SurfaceIterator SolidSurfaces(const int I) const;
0130 
0131   //! Returns an iterator on the curves attached to the
0132   //! face <F>.
0133   Standard_EXPORT TopOpeBRepDS_CurveIterator FaceCurves(const TopoDS_Shape& F) const;
0134 
0135   //! Returns an iterator on the curves attached to the
0136   //! face <I>.
0137   Standard_EXPORT TopOpeBRepDS_CurveIterator FaceCurves(const int I) const;
0138 
0139   //! Returns an iterator on the points attached to the
0140   //! edge <E>.
0141   Standard_EXPORT TopOpeBRepDS_PointIterator EdgePoints(const TopoDS_Shape& E) const;
0142 
0143   Standard_EXPORT int MakeCurve(const TopOpeBRepDS_Curve& C1, TopOpeBRepDS_Curve& C2);
0144 
0145   Standard_EXPORT void RemoveCurve(const int iC);
0146 
0147   Standard_EXPORT int NbGeometry(const TopOpeBRepDS_Kind K) const;
0148 
0149   Standard_EXPORT int NbTopology(const TopOpeBRepDS_Kind K) const;
0150 
0151   Standard_EXPORT int NbTopology() const;
0152 
0153   //! returns True if all the edges stored as shapes in the DS
0154   //! are SameParameter, otherwise False.
0155   Standard_EXPORT bool EdgesSameParameter() const;
0156 
0157   Standard_EXPORT void SortOnParameter(
0158     const NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& L1,
0159     NCollection_List<occ::handle<TopOpeBRepDS_Interference>>&       L2) const;
0160 
0161   Standard_EXPORT void SortOnParameter(
0162     NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& L) const;
0163 
0164   Standard_EXPORT void MinMaxOnParameter(
0165     const NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& L,
0166     double&                                                         Min,
0167     double&                                                         Max) const;
0168 
0169   //! Search, among a list of interferences accessed by the iterator
0170   //! <IT>, a geometry <G> whose 3D point is identical to the 3D point
0171   //! of the TheDSPoint <PDS>.
0172   //! returns True if such an interference has been found, False else.
0173   //! if True, iterator It points (by the Value() method) on the first
0174   //! interference accessing an identical 3D point.
0175   Standard_EXPORT bool ScanInterfList(
0176     NCollection_List<occ::handle<TopOpeBRepDS_Interference>>::Iterator& IT,
0177     const TopOpeBRepDS_Point&                                           PDS) const;
0178 
0179   //! Get the geometry of a DS point <PDS>.
0180   //! Search for it with ScanInterfList (previous method).
0181   //! if found, set <G,K> to the geometry,kind of the interference found.
0182   //! returns the value of ScanInterfList().
0183   Standard_EXPORT bool GetGeometry(
0184     NCollection_List<occ::handle<TopOpeBRepDS_Interference>>::Iterator& IT,
0185     const TopOpeBRepDS_Point&                                           PDS,
0186     int&                                                                G,
0187     TopOpeBRepDS_Kind&                                                  K) const;
0188 
0189   //! Add interference <I> to list <LI>.
0190   Standard_EXPORT void StoreInterference(
0191     const occ::handle<TopOpeBRepDS_Interference>&             I,
0192     NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& LI,
0193     const TCollection_AsciiString&                            str = "");
0194 
0195   //! Add interference <I> to list of interference of shape <S>.
0196   Standard_EXPORT void StoreInterference(const occ::handle<TopOpeBRepDS_Interference>& I,
0197                                          const TopoDS_Shape&                           S,
0198                                          const TCollection_AsciiString&                str = "");
0199 
0200   //! Add interference <I> to list of interference of shape <IS>.
0201   Standard_EXPORT void StoreInterference(const occ::handle<TopOpeBRepDS_Interference>& I,
0202                                          const int                                     IS,
0203                                          const TCollection_AsciiString&                str = "");
0204 
0205   Standard_EXPORT void StoreInterferences(
0206     const NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& LI,
0207     const TopoDS_Shape&                                             S,
0208     const TCollection_AsciiString&                                  str = "");
0209 
0210   Standard_EXPORT void StoreInterferences(
0211     const NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& LI,
0212     const int                                                       IS,
0213     const TCollection_AsciiString&                                  str = "");
0214 
0215   Standard_EXPORT void ClearStoreInterferences(
0216     const NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& LI,
0217     const TopoDS_Shape&                                             S,
0218     const TCollection_AsciiString&                                  str = "");
0219 
0220   Standard_EXPORT void ClearStoreInterferences(
0221     const NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& LI,
0222     const int                                                       IS,
0223     const TCollection_AsciiString&                                  str = "");
0224 
0225   DEFINE_STANDARD_RTTIEXT(TopOpeBRepDS_HDataStructure, Standard_Transient)
0226 
0227 private:
0228   TopOpeBRepDS_DataStructure myDS;
0229 };
0230 
0231 #endif // _TopOpeBRepDS_HDataStructure_HeaderFile