Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:19:01

0001 // Created on: 1999-02-25
0002 // Created by: Pavel DURANDIN
0003 // Copyright (c) 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_ShapeContents_HeaderFile
0018 #define _ShapeAnalysis_ShapeContents_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <TopoDS_Shape.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <NCollection_HSequence.hxx>
0028 class TopoDS_Shape;
0029 
0030 //! Dumps shape contents
0031 class ShapeAnalysis_ShapeContents
0032 {
0033 public:
0034   DEFINE_STANDARD_ALLOC
0035 
0036   //! Initialize fields and call ClearFlags()
0037   Standard_EXPORT ShapeAnalysis_ShapeContents();
0038 
0039   //! Clears all accumulated statistics
0040   Standard_EXPORT void Clear();
0041 
0042   //! Clears all flags
0043   Standard_EXPORT void ClearFlags();
0044 
0045   //! Counts quantities of sun-shapes in shape and
0046   //! stores sub-shapes according to flags
0047   Standard_EXPORT void Perform(const TopoDS_Shape& shape);
0048 
0049   //! Returns (modifiable) the flag which defines whether to store faces
0050   //! with edges if its 3D curves has more than 8192 poles.
0051   bool& ModifyBigSplineMode() { return myBigSplineMode; }
0052 
0053   //! Returns (modifiable) the flag which defines whether to store faces on indirect surfaces.
0054   bool& ModifyIndirectMode() { return myIndirectMode; }
0055 
0056   //! Returns (modifiable) the flag which defines whether to store faces on offset surfaces.
0057   bool& ModifyOffsetSurfaceMode() { return myOffsetSurfaceMode; }
0058 
0059   //! Returns (modifiable) the flag which defines whether to store faces
0060   //! with edges if its 3D curves are trimmed curves
0061   bool& ModifyTrimmed3dMode() { return myTrimmed3dMode; }
0062 
0063   //! Returns (modifiable) the flag which defines whether to store faces
0064   //! with edges if its 3D curves and pcurves are offset curves
0065   bool& ModifyOffsetCurveMode() { return myOffsetCurveMode; }
0066 
0067   //! Returns (modifiable) the flag which defines whether to store faces
0068   //! with edges if its pcurves are trimmed curves
0069   bool& ModifyTrimmed2dMode() { return myTrimmed2dMode; }
0070 
0071   int NbSolids() const { return myNbSolids; }
0072 
0073   int NbShells() const { return myNbShells; }
0074 
0075   int NbFaces() const { return myNbFaces; }
0076 
0077   int NbWires() const { return myNbWires; }
0078 
0079   int NbEdges() const { return myNbEdges; }
0080 
0081   int NbVertices() const { return myNbVertices; }
0082 
0083   int NbSolidsWithVoids() const { return myNbSolidsWithVoids; }
0084 
0085   int NbBigSplines() const { return myNbBigSplines; }
0086 
0087   int NbC0Surfaces() const { return myNbC0Surfaces; }
0088 
0089   int NbC0Curves() const { return myNbC0Curves; }
0090 
0091   int NbOffsetSurf() const { return myNbOffsetSurf; }
0092 
0093   int NbIndirectSurf() const { return myNbIndirectSurf; }
0094 
0095   int NbOffsetCurves() const { return myNbOffsetCurves; }
0096 
0097   int NbTrimmedCurve2d() const { return myNbTrimmedCurve2d; }
0098 
0099   int NbTrimmedCurve3d() const { return myNbTrimmedCurve3d; }
0100 
0101   int NbBSplibeSurf() const { return myNbBSplibeSurf; }
0102 
0103   int NbBezierSurf() const { return myNbBezierSurf; }
0104 
0105   int NbTrimSurf() const { return myNbTrimSurf; }
0106 
0107   int NbWireWitnSeam() const { return myNbWireWitnSeam; }
0108 
0109   int NbWireWithSevSeams() const { return myNbWireWithSevSeams; }
0110 
0111   int NbFaceWithSevWires() const { return myNbFaceWithSevWires; }
0112 
0113   int NbNoPCurve() const { return myNbNoPCurve; }
0114 
0115   int NbFreeFaces() const { return myNbFreeFaces; }
0116 
0117   int NbFreeWires() const { return myNbFreeWires; }
0118 
0119   int NbFreeEdges() const { return myNbFreeEdges; }
0120 
0121   int NbSharedSolids() const { return myNbSharedSolids; }
0122 
0123   int NbSharedShells() const { return myNbSharedShells; }
0124 
0125   int NbSharedFaces() const { return myNbSharedFaces; }
0126 
0127   int NbSharedWires() const { return myNbSharedWires; }
0128 
0129   int NbSharedFreeWires() const { return myNbSharedFreeWires; }
0130 
0131   int NbSharedFreeEdges() const { return myNbSharedFreeEdges; }
0132 
0133   int NbSharedEdges() const { return myNbSharedEdges; }
0134 
0135   int NbSharedVertices() const { return myNbSharedVertices; }
0136 
0137   const occ::handle<NCollection_HSequence<TopoDS_Shape>>& BigSplineSec() const
0138   {
0139     return myBigSplineSec;
0140   }
0141 
0142   const occ::handle<NCollection_HSequence<TopoDS_Shape>>& IndirectSec() const
0143   {
0144     return myIndirectSec;
0145   }
0146 
0147   const occ::handle<NCollection_HSequence<TopoDS_Shape>>& OffsetSurfaceSec() const
0148   {
0149     return myOffsetSurfaceSec;
0150   }
0151 
0152   const occ::handle<NCollection_HSequence<TopoDS_Shape>>& Trimmed3dSec() const
0153   {
0154     return myTrimmed3dSec;
0155   }
0156 
0157   const occ::handle<NCollection_HSequence<TopoDS_Shape>>& OffsetCurveSec() const
0158   {
0159     return myOffsetCurveSec;
0160   }
0161 
0162   const occ::handle<NCollection_HSequence<TopoDS_Shape>>& Trimmed2dSec() const
0163   {
0164     return myTrimmed2dSec;
0165   }
0166 
0167 public:
0168   Standard_DEPRECATED("ModifyOffsetSurfaceMode() should be used instead")
0169   bool& ModifyOffestSurfaceMode() { return myOffsetSurfaceMode; }
0170 
0171 private:
0172   int                                              myNbSolids;
0173   int                                              myNbShells;
0174   int                                              myNbFaces;
0175   int                                              myNbWires;
0176   int                                              myNbEdges;
0177   int                                              myNbVertices;
0178   int                                              myNbSolidsWithVoids;
0179   int                                              myNbBigSplines;
0180   int                                              myNbC0Surfaces;
0181   int                                              myNbC0Curves;
0182   int                                              myNbOffsetSurf;
0183   int                                              myNbIndirectSurf;
0184   int                                              myNbOffsetCurves;
0185   int                                              myNbTrimmedCurve2d;
0186   int                                              myNbTrimmedCurve3d;
0187   int                                              myNbBSplibeSurf;
0188   int                                              myNbBezierSurf;
0189   int                                              myNbTrimSurf;
0190   int                                              myNbWireWitnSeam;
0191   int                                              myNbWireWithSevSeams;
0192   int                                              myNbFaceWithSevWires;
0193   int                                              myNbNoPCurve;
0194   int                                              myNbFreeFaces;
0195   int                                              myNbFreeWires;
0196   int                                              myNbFreeEdges;
0197   int                                              myNbSharedSolids;
0198   int                                              myNbSharedShells;
0199   int                                              myNbSharedFaces;
0200   int                                              myNbSharedWires;
0201   int                                              myNbSharedFreeWires;
0202   int                                              myNbSharedFreeEdges;
0203   int                                              myNbSharedEdges;
0204   int                                              myNbSharedVertices;
0205   bool                                             myBigSplineMode;
0206   bool                                             myIndirectMode;
0207   bool                                             myOffsetSurfaceMode;
0208   bool                                             myTrimmed3dMode;
0209   bool                                             myOffsetCurveMode;
0210   bool                                             myTrimmed2dMode;
0211   occ::handle<NCollection_HSequence<TopoDS_Shape>> myBigSplineSec;
0212   occ::handle<NCollection_HSequence<TopoDS_Shape>> myIndirectSec;
0213   occ::handle<NCollection_HSequence<TopoDS_Shape>> myOffsetSurfaceSec;
0214   occ::handle<NCollection_HSequence<TopoDS_Shape>> myTrimmed3dSec;
0215   occ::handle<NCollection_HSequence<TopoDS_Shape>> myOffsetCurveSec;
0216   occ::handle<NCollection_HSequence<TopoDS_Shape>> myTrimmed2dSec;
0217 };
0218 
0219 #endif // _ShapeAnalysis_ShapeContents_HeaderFile