File indexing completed on 2026-09-28 09:19:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepGraph_Deduplicate_HeaderFile
0015 #define _BRepGraph_Deduplicate_HeaderFile
0016
0017 #include <BRepGraph.hxx>
0018 #include <BRepGraph_NodeId.hxx>
0019 #include <NCollection_LinearVector.hxx>
0020 #include <Precision.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022
0023
0024
0025
0026
0027
0028
0029
0030 class BRepGraph_Deduplicate
0031 {
0032 public:
0033 DEFINE_STANDARD_ALLOC
0034
0035
0036 struct Options
0037 {
0038 bool AnalyzeOnly = false;
0039 bool HistoryMode = true;
0040 bool MergeEntitiesWhenSafe = false;
0041 double CompTolerance = Precision::Angular();
0042 double HashTolerance = Precision::Confusion();
0043 };
0044
0045
0046 struct Result
0047 {
0048 uint32_t NbCanonicalSurfaces = 0;
0049 uint32_t NbCanonicalCurves = 0;
0050 uint32_t NbSurfaceRewrites = 0;
0051 uint32_t NbCurveRewrites = 0;
0052 uint32_t NbNullifiedSurfaces = 0;
0053 uint32_t NbNullifiedCurves = 0;
0054 uint32_t NbHistoryRecords = 0;
0055 bool IsEntityMergeApplied = false;
0056
0057
0058 uint32_t NbMergedVertices = 0;
0059 uint32_t NbMergedEdges = 0;
0060 uint32_t NbMergedWires = 0;
0061 uint32_t NbMergedFaces = 0;
0062 uint32_t NbReorderedWires = 0;
0063 uint32_t NbToleranceOrderedWires = 0;
0064 uint32_t NbPartialOrderedWires = 0;
0065
0066 NCollection_LinearVector<BRepGraph_FaceId> AffectedFaces;
0067 NCollection_LinearVector<BRepGraph_EdgeId> AffectedEdges;
0068 };
0069
0070
0071
0072
0073 [[nodiscard]] Standard_EXPORT static Result Perform(BRepGraph& theGraph);
0074
0075
0076
0077
0078
0079 [[nodiscard]] Standard_EXPORT static Result Perform(BRepGraph& theGraph,
0080 const Options& theOptions);
0081
0082 BRepGraph_Deduplicate() = delete;
0083
0084 private:
0085 static void CanonicalizeWireOrders(BRepGraph& theGraph, Result& theResult);
0086 };
0087
0088 #endif