1 // Created on: 1999-02-25 2 // Created by: Pavel DURANDIN 3 // Copyright (c) 1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 8 // This library is free software; you can redistribute it and/or modify it under 9 // the terms of the GNU Lesser General Public License version 2.1 as published 10 // by the Free Software Foundation, with special exception defined in the file 11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 12 // distribution for complete text of the license and disclaimer of any warranty. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _ShapeAnalysis_ShapeContents_HeaderFile 18 #define _ShapeAnalysis_ShapeContents_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_DefineAlloc.hxx> 22 #include <Standard_Handle.hxx> 23 24 #include <Standard_Integer.hxx> 25 #include <Standard_Boolean.hxx> 26 #include <TopTools_HSequenceOfShape.hxx> 27 class TopoDS_Shape; 28 29 30 //! Dumps shape contents 31 class ShapeAnalysis_ShapeContents 32 { 33 public: 34 35 DEFINE_STANDARD_ALLOC 36 37 38 //! Initialize fields and call ClearFlags() 39 Standard_EXPORT ShapeAnalysis_ShapeContents(); 40 41 //! Clears all accumulated statistics 42 Standard_EXPORT void Clear(); 43 44 //! Clears all flags 45 Standard_EXPORT void ClearFlags(); 46 47 //! Counts quantities of sun-shapes in shape and 48 //! stores sub-shapes according to flags 49 Standard_EXPORT void Perform (const TopoDS_Shape& shape); 50 51 //! Returns (modifiable) the flag which defines whether to store faces 52 //! with edges if its 3D curves has more than 8192 poles. ModifyBigSplineMode()53 Standard_Boolean& ModifyBigSplineMode() { return myBigSplineMode; } 54 55 //! Returns (modifiable) the flag which defines whether to store faces on indirect surfaces. ModifyIndirectMode()56 Standard_Boolean& ModifyIndirectMode() { return myIndirectMode; } 57 58 //! Returns (modifiable) the flag which defines whether to store faces on offset surfaces. ModifyOffsetSurfaceMode()59 Standard_Boolean& ModifyOffsetSurfaceMode() { return myOffsetSurfaceMode; } 60 61 //! Returns (modifiable) the flag which defines whether to store faces 62 //! with edges if its 3D curves are trimmed curves ModifyTrimmed3dMode()63 Standard_Boolean& ModifyTrimmed3dMode() { return myTrimmed3dMode; } 64 65 //! Returns (modifiable) the flag which defines whether to store faces 66 //! with edges if its 3D curves and pcurves are offset curves ModifyOffsetCurveMode()67 Standard_Boolean& ModifyOffsetCurveMode() { return myOffsetCurveMode; } 68 69 //! Returns (modifiable) the flag which defines whether to store faces 70 //! with edges if its pcurves are trimmed curves ModifyTrimmed2dMode()71 Standard_Boolean& ModifyTrimmed2dMode() { return myTrimmed2dMode; } 72 NbSolids() const73 Standard_Integer NbSolids() const { return myNbSolids; } 74 NbShells() const75 Standard_Integer NbShells() const { return myNbShells; } 76 NbFaces() const77 Standard_Integer NbFaces() const { return myNbFaces; } 78 NbWires() const79 Standard_Integer NbWires() const { return myNbWires; } 80 NbEdges() const81 Standard_Integer NbEdges() const { return myNbEdges; } 82 NbVertices() const83 Standard_Integer NbVertices() const { return myNbVertices; } 84 NbSolidsWithVoids() const85 Standard_Integer NbSolidsWithVoids() const { return myNbSolidsWithVoids; } 86 NbBigSplines() const87 Standard_Integer NbBigSplines() const { return myNbBigSplines; } 88 NbC0Surfaces() const89 Standard_Integer NbC0Surfaces() const { return myNbC0Surfaces; } 90 NbC0Curves() const91 Standard_Integer NbC0Curves() const { return myNbC0Curves; } 92 NbOffsetSurf() const93 Standard_Integer NbOffsetSurf() const { return myNbOffsetSurf; } 94 NbIndirectSurf() const95 Standard_Integer NbIndirectSurf() const { return myNbIndirectSurf; } 96 NbOffsetCurves() const97 Standard_Integer NbOffsetCurves() const { return myNbOffsetCurves; } 98 NbTrimmedCurve2d() const99 Standard_Integer NbTrimmedCurve2d() const { return myNbTrimmedCurve2d; } 100 NbTrimmedCurve3d() const101 Standard_Integer NbTrimmedCurve3d() const { return myNbTrimmedCurve3d; } 102 NbBSplibeSurf() const103 Standard_Integer NbBSplibeSurf() const { return myNbBSplibeSurf; } 104 NbBezierSurf() const105 Standard_Integer NbBezierSurf() const { return myNbBezierSurf; } 106 NbTrimSurf() const107 Standard_Integer NbTrimSurf() const { return myNbTrimSurf; } 108 NbWireWitnSeam() const109 Standard_Integer NbWireWitnSeam() const { return myNbWireWitnSeam; } 110 NbWireWithSevSeams() const111 Standard_Integer NbWireWithSevSeams() const { return myNbWireWithSevSeams; } 112 NbFaceWithSevWires() const113 Standard_Integer NbFaceWithSevWires() const { return myNbFaceWithSevWires; } 114 NbNoPCurve() const115 Standard_Integer NbNoPCurve() const { return myNbNoPCurve; } 116 NbFreeFaces() const117 Standard_Integer NbFreeFaces() const { return myNbFreeFaces; } 118 NbFreeWires() const119 Standard_Integer NbFreeWires() const { return myNbFreeWires; } 120 NbFreeEdges() const121 Standard_Integer NbFreeEdges() const { return myNbFreeEdges; } 122 NbSharedSolids() const123 Standard_Integer NbSharedSolids() const { return myNbSharedSolids; } 124 NbSharedShells() const125 Standard_Integer NbSharedShells() const { return myNbSharedShells; } 126 NbSharedFaces() const127 Standard_Integer NbSharedFaces() const { return myNbSharedFaces; } 128 NbSharedWires() const129 Standard_Integer NbSharedWires() const { return myNbSharedWires; } 130 NbSharedFreeWires() const131 Standard_Integer NbSharedFreeWires() const { return myNbSharedFreeWires; } 132 NbSharedFreeEdges() const133 Standard_Integer NbSharedFreeEdges() const { return myNbSharedFreeEdges; } 134 NbSharedEdges() const135 Standard_Integer NbSharedEdges() const { return myNbSharedEdges; } 136 NbSharedVertices() const137 Standard_Integer NbSharedVertices() const { return myNbSharedVertices; } 138 Handle(TopTools_HSequenceOfShape)139 const Handle(TopTools_HSequenceOfShape)& BigSplineSec() const { return myBigSplineSec; } 140 Handle(TopTools_HSequenceOfShape)141 const Handle(TopTools_HSequenceOfShape)& IndirectSec() const { return myIndirectSec; } 142 Handle(TopTools_HSequenceOfShape)143 const Handle(TopTools_HSequenceOfShape)& OffsetSurfaceSec() const { return myOffsetSurfaceSec; } 144 Handle(TopTools_HSequenceOfShape)145 const Handle(TopTools_HSequenceOfShape)& Trimmed3dSec() const { return myTrimmed3dSec; } 146 Handle(TopTools_HSequenceOfShape)147 const Handle(TopTools_HSequenceOfShape)& OffsetCurveSec() const { return myOffsetCurveSec; } 148 Handle(TopTools_HSequenceOfShape)149 const Handle(TopTools_HSequenceOfShape)& Trimmed2dSec() const { return myTrimmed2dSec; } 150 151 public: 152 153 Standard_DEPRECATED("ModifyOffsetSurfaceMode() should be used instead") ModifyOffestSurfaceMode()154 Standard_Boolean& ModifyOffestSurfaceMode() { return myOffsetSurfaceMode; } 155 156 private: 157 158 Standard_Integer myNbSolids; 159 Standard_Integer myNbShells; 160 Standard_Integer myNbFaces; 161 Standard_Integer myNbWires; 162 Standard_Integer myNbEdges; 163 Standard_Integer myNbVertices; 164 Standard_Integer myNbSolidsWithVoids; 165 Standard_Integer myNbBigSplines; 166 Standard_Integer myNbC0Surfaces; 167 Standard_Integer myNbC0Curves; 168 Standard_Integer myNbOffsetSurf; 169 Standard_Integer myNbIndirectSurf; 170 Standard_Integer myNbOffsetCurves; 171 Standard_Integer myNbTrimmedCurve2d; 172 Standard_Integer myNbTrimmedCurve3d; 173 Standard_Integer myNbBSplibeSurf; 174 Standard_Integer myNbBezierSurf; 175 Standard_Integer myNbTrimSurf; 176 Standard_Integer myNbWireWitnSeam; 177 Standard_Integer myNbWireWithSevSeams; 178 Standard_Integer myNbFaceWithSevWires; 179 Standard_Integer myNbNoPCurve; 180 Standard_Integer myNbFreeFaces; 181 Standard_Integer myNbFreeWires; 182 Standard_Integer myNbFreeEdges; 183 Standard_Integer myNbSharedSolids; 184 Standard_Integer myNbSharedShells; 185 Standard_Integer myNbSharedFaces; 186 Standard_Integer myNbSharedWires; 187 Standard_Integer myNbSharedFreeWires; 188 Standard_Integer myNbSharedFreeEdges; 189 Standard_Integer myNbSharedEdges; 190 Standard_Integer myNbSharedVertices; 191 Standard_Boolean myBigSplineMode; 192 Standard_Boolean myIndirectMode; 193 Standard_Boolean myOffsetSurfaceMode; 194 Standard_Boolean myTrimmed3dMode; 195 Standard_Boolean myOffsetCurveMode; 196 Standard_Boolean myTrimmed2dMode; 197 Handle(TopTools_HSequenceOfShape) myBigSplineSec; 198 Handle(TopTools_HSequenceOfShape) myIndirectSec; 199 Handle(TopTools_HSequenceOfShape) myOffsetSurfaceSec; 200 Handle(TopTools_HSequenceOfShape) myTrimmed3dSec; 201 Handle(TopTools_HSequenceOfShape) myOffsetCurveSec; 202 Handle(TopTools_HSequenceOfShape) myTrimmed2dSec; 203 204 }; 205 206 #endif // _ShapeAnalysis_ShapeContents_HeaderFile 207