Back to home page

EIC code displayed by LXR

 
 

    


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

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