Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:18:15

0001 // Created on: 1997-04-10
0002 // Created by: Prestataire Mary FABIEN
0003 // Copyright (c) 1997-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_Check_HeaderFile
0018 #define _TopOpeBRepDS_Check_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <TopOpeBRepDS_CheckStatus.hxx>
0025 #include <NCollection_DataMap.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <TopOpeBRepDS_Interference.hxx>
0028 #include <NCollection_List.hxx>
0029 #include <TopOpeBRepDS_Kind.hxx>
0030 #include <TopoDS_Shape.hxx>
0031 #include <Standard_OStream.hxx>
0032 #include <Standard_CString.hxx>
0033 #include <TopAbs_ShapeEnum.hxx>
0034 class TopOpeBRepDS_HDataStructure;
0035 
0036 //! a tool verifying integrity and structure of DS
0037 class TopOpeBRepDS_Check : public Standard_Transient
0038 {
0039 
0040 public:
0041   Standard_EXPORT TopOpeBRepDS_Check();
0042 
0043   Standard_EXPORT TopOpeBRepDS_Check(const occ::handle<TopOpeBRepDS_HDataStructure>& HDS);
0044 
0045   //! Check integrition of DS
0046   Standard_EXPORT bool ChkIntg();
0047 
0048   //! Check integrition of interferences
0049   //! (les supports et les geometries de LI)
0050   Standard_EXPORT bool ChkIntgInterf(
0051     const NCollection_List<occ::handle<TopOpeBRepDS_Interference>>& LI);
0052 
0053   //! Verifie que le ieme element de la DS existe, et
0054   //! pour un K de type topologique, verifie qu'il est du
0055   //! bon type (VERTEX, EDGE, WIRE, FACE, SHELL ou SOLID)
0056   Standard_EXPORT bool CheckDS(const int i, const TopOpeBRepDS_Kind K);
0057 
0058   //! Check integrition des champs SameDomain de la DS
0059   Standard_EXPORT bool ChkIntgSamDom();
0060 
0061   //! Verifie que les Shapes existent bien dans la DS
0062   //! Utile pour les Shapes SameDomain
0063   //! si la liste est vide, renvoie vrai
0064   Standard_EXPORT bool CheckShapes(const NCollection_List<TopoDS_Shape>& LS) const;
0065 
0066   //! Verifie que les Vertex non SameDomain sont bien
0067   //! nonSameDomain, que les vertex sameDomain sont bien
0068   //! SameDomain, que les Points sont non confondus
0069   //! ni entre eux, ni avec des Vertex.
0070   Standard_EXPORT bool OneVertexOnPnt();
0071 
0072   Standard_EXPORT const occ::handle<TopOpeBRepDS_HDataStructure>& HDS() const;
0073 
0074   Standard_EXPORT occ::handle<TopOpeBRepDS_HDataStructure>& ChangeHDS();
0075 
0076   Standard_EXPORT Standard_OStream& PrintIntg(Standard_OStream& S);
0077 
0078   //! Prints the name of CheckStatus <stat> as a String
0079   Standard_EXPORT Standard_OStream& Print(const TopOpeBRepDS_CheckStatus stat, Standard_OStream& S);
0080 
0081   //! Prints the name of CheckStatus <stat> as a String
0082   Standard_EXPORT Standard_OStream& PrintShape(const TopAbs_ShapeEnum SE, Standard_OStream& S);
0083 
0084   //! Prints the name of CheckStatus <stat> as a String
0085   Standard_EXPORT Standard_OStream& PrintShape(const int index, Standard_OStream& S);
0086 
0087   DEFINE_STANDARD_RTTIEXT(TopOpeBRepDS_Check, Standard_Transient)
0088 
0089 private:
0090   Standard_EXPORT Standard_OStream& PrintMap(
0091     NCollection_DataMap<int, TopOpeBRepDS_CheckStatus>& MapStat,
0092     const char* const                                   eltstr,
0093     Standard_OStream&                                   S);
0094 
0095   Standard_EXPORT Standard_OStream& PrintElts(
0096     NCollection_DataMap<int, TopOpeBRepDS_CheckStatus>& MapStat,
0097     const TopOpeBRepDS_CheckStatus                      Stat,
0098     bool&                                               b,
0099     Standard_OStream&                                   S);
0100 
0101   occ::handle<TopOpeBRepDS_HDataStructure>           myHDS;
0102   NCollection_DataMap<int, TopOpeBRepDS_CheckStatus> myMapSurfaceStatus;
0103   NCollection_DataMap<int, TopOpeBRepDS_CheckStatus> myMapCurveStatus;
0104   NCollection_DataMap<int, TopOpeBRepDS_CheckStatus> myMapPointStatus;
0105   NCollection_DataMap<int, TopOpeBRepDS_CheckStatus> myMapShapeStatus;
0106 };
0107 
0108 #endif // _TopOpeBRepDS_Check_HeaderFile