mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-02 09:26:11 +08:00
Foundation, Modeling - NCollection modernization and BRepGraph overhaul (#1212)
- Migrate NCollection map/sequence/array size APIs from int to size_t; Size() returns size_t, Length() remains the int accessor; int overloads delegate through NbBucketsFromInt() with a negative-input guard. - Add NCollection_LinearVector: contiguous flat-buffer dynamic array with Standard::Reallocate-based growth for trivial types and move-construction for non-trivial types. - Rewrite NCollection_DynamicArray on top of LinearVector<T*>; switch to power-of-two block sizing with precomputed shift/mask. - Rework NCollection_BaseMap iterator with a forward findFirst() helper (no negative-bucket arithmetic); unify ReSize/BeginResize/EndResize on size_t. - Enable thread-safe fast path in NCollection_IncAllocator via std::shared_mutex + CAS bump allocation on atomic AvailableSize; exclusive lock is taken only for new-block allocation and list reordering. - Remove NCollection_BasePointerVector (superseded by NCollection_LinearVector). - Remove NCollection_BaseMap::Statistics (unused). - Add <cstddef> include in NCollection_Primes.hxx so size_t resolves on clean builds. - Document iterator invalidation contract on NCollection_LinearVector. - Unify BRepGraph programmatic mutation behind EditorView: delete BuilderView (2648+552 lines); EditorView (3186+930 lines) and EditorView_Mut.cxx own both structural creation (Add*/Remove*) and field-level RAII-scoped mutation (Mut*()) with automatic OwnGen and SubtreeGen propagation. - Add BRepGraph_MeshCache and BRepGraph_MeshView: two-tier mesh storage separating algorithm-derived caches from persistent (definition) triangulations; freshness is keyed on FaceDef.OwnGen; cache writes do not mutate the model. - Document the MeshCache invalidation contract in BRepGraph_MeshCache.hxx (which mutations bump Face.OwnGen and how markRepModified closes the loop for Surface/Triangulation reps). - Add BRepGraph_RefsIterator (generic flat ref scan with RefTraits dispatch) and BRepGraph_ReverseIterator (typed parent-traversal wrappers over reverse-index vectors). - Rework RefId entity model: replace inline refs with typed RefId vectors; add OccurrenceRef and Kind::Occurrence=7; BRepGraphInc_WireExplorer now requires a VertexRefLookup. - Rename layers for consistency: BRepGraph_ParamLayer to BRepGraph_LayerParam, BRepGraph_RegularityLayer to BRepGraph_LayerRegularity; rename BRepGraphInc_Usage to BRepGraphInc_Instance. - Replace RootNodeIds() with RootProductIds() returning product roots only. - Update BRepGraph and BRepGraphInc READMEs; fix stale RootNodeIds reference. - Sweep Size() to Length() renames across ~200 callers in TKG2d, TKG3d, TKMath, TKMesh, TKBO, TKOffset, TKShHealing, TKTopAlgo, TKBRep, TKService, TKV3d, TKOpenGl, TKMeshVS, TKDE*, TKXCAF, TKXSBase, TKLCAF, TKStd, and Draw harness. - Add GTest coverage for new containers and the BRepGraph overhaul: NCollection_DynamicArray_Test, NCollection_LinearVector_Test, BRepGraph_Fuzz_Test, BRepGraph_Iterator_Test, BRepGraph_LayerIterator_Test, BRepGraph_MeshCache_Test, BRepGraph_MutGuard_Test, BRepGraph_ReplaceVertex_Test, BRepGraph_ReverseIterator_Test, BRepGraph_ScenarioMatrix_Test, BRepGraph_TypedIdDispatch_Test, BRepGraph_WireExplorer_Test.
This commit is contained in:
@@ -114,7 +114,7 @@ void BRepFill_AdvancedEvolved::GetSpineAndProfile(const TopoDS_Wire& theSpine,
|
||||
gp_Vec aN2;
|
||||
gp_Pnt aLoc;
|
||||
|
||||
for (int i = 1; i <= aMVEP.Size(); i++)
|
||||
for (int i = 1; i <= aMVEP.Length(); i++)
|
||||
{
|
||||
const TopoDS_Vertex& aVC = TopoDS::Vertex(aMVEP.FindKey(i));
|
||||
|
||||
@@ -544,7 +544,7 @@ void BRepFill_AdvancedEvolved::GetLids()
|
||||
gp_Vec aTan;
|
||||
|
||||
double aDPMax = 0.;
|
||||
for (int i = 1; i <= aMapEF.Size(); i++)
|
||||
for (int i = 1; i <= aMapEF.Length(); i++)
|
||||
{
|
||||
NCollection_List<TopoDS_Shape>& aListF = aMapEF(i);
|
||||
|
||||
@@ -618,7 +618,7 @@ void BRepFill_AdvancedEvolved::GetLids()
|
||||
|
||||
bool isFound = false;
|
||||
|
||||
for (int i = 1; i <= aMapV.Size(); i++)
|
||||
for (int i = 1; i <= aMapV.Length(); i++)
|
||||
{
|
||||
const TopoDS_Vertex aV = TopoDS::Vertex(aMapV.FindKey(i));
|
||||
const gp_XYZ aP = BRep_Tool::Pnt(aV).XYZ();
|
||||
|
||||
@@ -1182,7 +1182,7 @@ void BRepFill_OffsetWire::PrepareSpine()
|
||||
TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
|
||||
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin
|
||||
occ::handle<BRep_TEdge> TEdge = occ::down_cast<BRep_TEdge>(E.TShape());
|
||||
const int aNumCurvesInEdge = TEdge->Curves().Size();
|
||||
const int aNumCurvesInEdge = TEdge->Curves().Length();
|
||||
if (nbEdges == 2 && nbResEdges == 0 && aNumCurvesInEdge > 1)
|
||||
ForcedCut = 1;
|
||||
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:33 2000 End
|
||||
|
||||
Reference in New Issue
Block a user