Open CASCADE Technology Version 8.0.0 Release Candidate 4
Open Cascade is delighted to announce the release of Open CASCADE Technology version 8.0.0 Release Candidate 4 to the public.
Overview
Version 8.0.0-rc4 is a candidate release incorporating 111 improvements and bug fixes compared to version 8.0.0-rc3, bringing the total improvements since version 7.9.0 to over 400 changes.
This release focuses on:
- Redesigned geometry evaluation architecture: New
EvalD*API with POD result structs replaces old virtualD0/D1/D2/D3methods, elementary geometry evaluation devirtualized viastd::variantdispatch, new EvalRep descriptor system decouples geometry identity from evaluation strategy, all 29 leaf Geom/Geom2d classes markedfinal - Elimination of heap indirection in core geometry classes: BSpline/Bezier classes use direct value-member arrays instead of handle-wrapped heap storage, always-populated weights via static unit-weights buffer eliminates pervasive null-check patterns across ~100 call sites
- Topological data structure overhaul:
TopoDS_TShapehierarchy replaces linked-list child storage with contiguous arrays, bit-packs shape state intouint16_t, devirtualizesShapeType(), and introduces index-based iteration - Modern C++ foundation layer:
Standard_Failureinherits fromstd::exception, error handlers usethread_localstorage eliminating global mutex contention, reference counting uses optimized memory ordering, mesh plugin system replaced with registry-based factory - New high-performance collections: Robin Hood hash maps (
NCollection_FlatDataMap/FlatMap), insertion-order-preserving maps (NCollection_OrderedMap/OrderedDataMap), header-only KD-Tree for spatial queries, C++17 structured binding support viaItems()views, unified map API withContained/TryEmplace/TryBind - Numerical solver improvements: Laguerre polynomial root-finder, coordinate-wise Brent polishing for PSO/DE improving precision by 4+ orders of magnitude, batch 2D curve evaluation, BSplCLib interpolation hot-path optimizations
- Comprehensive automated migration toolkit: 12-phase Python script suite in
adm/scripts/migration_800/for migrating external projects to 8.0.0 APIs
What is a Release Candidate
A Release Candidate is a tag on the master branch that has completed all test rounds and is stable to use. Release candidates progress in parallel with maintenance releases, with the difference that maintenance releases remain binary compatible with minor releases and cannot include most improvements. The cycle for a release candidate is planned to be 5-10 weeks, while maintenance releases occur once per quarter.
What's New in OCCT 8.0.0-rc4
Foundation Classes
High-Performance Collections
-
New
NCollection_FlatDataMapandNCollection_FlatMap#1015: Cache-friendly open-addressing hash containers with Robin Hood hashing:- All key-value pairs stored inline in contiguous array (eliminates per-element heap allocations)
- Robin Hood hashing reduces probe sequence variance for more predictable performance
- Power-of-2 sizing for fast modulo operations via bitwise AND
- Cached hash codes for faster collision handling and rehashing
- Also in this PR: optimized
Standard_Transientreference counting with explicit memory ordering (followingstd::shared_ptrpattern), deprecatedStandard_Mutexin favor ofstd::mutex
-
New
NCollection_KDTree#1073: Header-only static balanced KD-Tree for efficient spatial point queries:- Nearest-neighbor search in O(log N), k-nearest, range (sphere), box (AABB), and sphere containment queries
- Works with
gp_Pnt,gp_Pnt2d,gp_XYZ,gp_XYout-of-the-box - Optional per-point radii via compile-time template parameter
- Weighted nearest queries support
-
New
NCollection_OrderedMapandNCollection_OrderedDataMap#1072: Insertion-order-preserving hash containers using intrusive doubly-linked list:- O(1) hash lookup, O(1) append/remove
- Deterministic iteration in insertion order
- O(1) removal (unlike
NCollection_IndexedMapwhich requires O(n) swap-and-shrink)
-
Try and Emplace methods for NCollection maps* #1022: Non-throwing lookup operations and in-place construction:
if (auto* pValue = aMap.TryBind(key, defaultValue)) { /* use pValue */ } aMap.Emplace(key, constructorArgs...); // No copy/move!
-
Emplace methods for NCollection containers #1035: In-place construction support for
NCollection_List(EmplaceAppend,EmplacePrepend,EmplaceBefore,EmplaceAfter),NCollection_Sequence,NCollection_DynamicArray,NCollection_Array1, andNCollection_Array2 -
Items() views with C++17 structured bindings #1038: Key-value pair iteration for NCollection map classes:
for (auto [aKey, aValue] : aMap.Items()) { ... }
Added
Items()for DataMap, FlatDataMap, IndexedDataMap andIndexedItems()for IndexedMap and IndexedDataMap -
NCollection_List optimization #1040:
std::initializer_listconstructor, improved const-correctness, optimized move constructor,Exchange()method -
Unified map API and collection performance optimizations #1065: API unification and performance improvements across NCollection:
- Unified map API:
Contained()added to all map types returningstd::optional<std::reference_wrapper<T>>,TryEmplace/TryBindparity across all map types - NCollection_UBTree/EBTree: iterative stack-based traversal replacing recursion (prevents stack overflow on deep trees), move semantics
- NCollection_LocalArray: move semantics,
Reallocate()for use as growable stack - NCollection_CellFilter: proper move semantics replacing destructive-copy hack
- Removed dead Sun WorkShop/Borland compiler workarounds
- Unified map API:
-
TColStd_PackedMapOfInteger refactoring #1023: Improved implementation of specialized integer set
-
Keep deprecated NCollection aliases #1026: Deprecated package type aliases (
TColStd_*,TopTools_*) kept for backward compatibility with deprecation warnings
Exception Handling Revolution
-
Standard_Failure inherits from std::exception #984: Bridges OCCT's exception system with standard C++:
- OCCT exceptions now caught by standard
catch (const std::exception&)blocks - Internal storage switched from
occ::handletostd::shared_ptr - New
what()method implements std::exception interface - New
ExceptionType()virtual method for exception class identification - Exception classes simplified to pure data containers
- Removed
Raise(),Instance(),Throw()static methods - usethrowinstead
- OCCT exceptions now caught by standard
-
Thread-local error handler stack #980: Replaced global mutex-protected stack with
thread_localstorage:- Zero lock overhead - no mutex acquisition for error handler operations
- Perfect scalability - threads never contend on error handler state
- Especially beneficial in TBB/OpenMP parallelized algorithms
- Removed:
Catches(),LastCaughtError()methods - Updated
OCC_CATCH_SIGNALSmacro with newRaise()re-throw method
-
Use throw instead of legacy Standard_Failure::Raise #983: Migrated codebase to modern C++ exception throwing
Math and Solver Enhancements
-
Cache-friendly matrix multiplication #1015: Changed
math_Matrix::Multiply()from i-j-k to i-k-j loop order for row-major storage with significant speedup for large matrices -
SIMD-friendly vector norm #1015: 4-way loop unrolling for
math_VectorBase::Norm()/Norm2()with pairwise partial sum combination -
Optimized atomic reference counting #1015:
Standard_Transientuses explicit memory ordering (memory_order_relaxedfor increment,memory_order_releasefor decrement with acquire fence only at zero) -
Laguerre polynomial solver and Newton API refactoring #1086: New
MathPoly_Laguerrefor general polynomial root finding with Laguerre + deflation, including Quintic/Sextic/Octic helpers. Refactored specialized Newton solvers (2D/3D/4D) to unified fixed-size API -
Coordinate-wise polishing for PSO and DE solvers #1088: Brent-based coordinate-wise polishing phase improving component-level precision from ~1e-4 to 1e-8+ for separable functions. New
BrentAlongCoordinateinMathUtils_LineSearch, newMathUtils_Randomutility -
PLib polynomial evaluation optimization #953
-
MathRoot and MathSys enhancements #954: New mathematical utilities
-
math_DirectPolynomialRoots refactoring #937
-
TKMath modernization with new packages #944
-
math_Vector Resize functionality #957
Bnd Package Improvements
-
Bnd package improvements #1051: Multiple bug fixes (
Bnd_Box::Add,IsOut,Distance;Bnd_Range::Common;Bnd_Sphere::SquareDistances;Bnd_OBBdegenerate cases), performance optimizations (early return fast paths forIsOut), and API improvements (Contains()/Intersects()wrappers,Center()/Min()/Max()/Get()returningstd::optional,IntersectStatusenum). Added[[nodiscard]]andnoexceptannotations -
BVH Box and Rays improvements #882
String Enhancements
- std::u16string_view support for TCollection_ExtendedString #1009: Modern Unicode string handling
- TCollection_AsciiString UTF-8 fix #1070: Fixed multibyte UTF-8 handling in
UsefullLength()which was treating individual UTF-8 continuation bytes as non-graphic, causing premature truncation of strings ending with non-ASCII characters
Convert Package Refactoring
- Replace handle-based APIs with direct array access #1057: Replaced heap-allocated handle-based storage with direct
NCollection_Arraymembers throughout the Convert package. Deprecated single-element accessors in favor of batch const-reference accessors
Other Foundation Improvements
- TopLoc_Location::HashCode optimization #1006: Faster hash computation for location objects
- gp_Pln refactoring #1003: Improved plane geometry class
- Extend precompiled headers #1029: Faster compilation times
Modeling Data
BSpline/Bezier Memory Optimization
-
BSpline/Bezier classes refactored to direct array members #1056: Replaced handle-based
NCollection_HArray1/HArray2members with directNCollection_Array1/Array2value members in all Geom BSpline and Bezier classes (curves and surfaces). Eliminates heap indirection and reference counting overhead. Bug fixes forGeom_BSplineCurve::IsEqualskipping knot comparison,Geom_BSplineSurface::SetUNotPeriodic/SetVNotPeriodicwrong constructor,Geom_BezierSurface::Increaseself-referencingInit -
Always-populated weights and direct array access #1058: BSpline/Bezier weights arrays are now always populated (non-rational geometry uses non-owning view over static unit-weights buffer, zero allocation). New
WeightsArray()accessor always returns valid reference. Bug fix inHermit.cxx: fixed long-standing typoPole0 < 3that should bePole0 < Pole3 -
Optimize BSplCLib interpolation and blend evaluation #1082: Four categories of hot-path optimization: (1) static initialization for GeomFill convertor matrices that were recomputed on every call, (2) stack allocation for small matrices/arrays to avoid heap allocation, (3) raw pointer access in hot loops replacing multi-layer accessor chains with bounds checks, (4) eliminated redundant recomputation with cached solver instances and
NbPoles()results. Also fixes undefined behavior inBSplCLib::NbPoles
Geometry Evaluation Overhaul
-
EvalRep descriptors and dispatch for Geom/Geom2d #1089: New extensible evaluation dispatch architecture that decouples geometry identity from evaluation strategy. Per-object
Set/Get/ClearEvalRep API with support for full, derivative-bounded, and parameter-mapped descriptors. Enables alternate evaluation paths -- e.g., an offset surface can carry its equivalent non-offset surface as an EvalRep, bypassing the expensive offset evaluation path. MigratedGeom_OffsetSurfaceequivalent-surface path as proof-of-concept -
Redesigned evaluation hierarchy with EvalD0/D1/D2/D3 API #1064, #1094: Fundamental redesign of the geometry evaluation dispatch hierarchy across all 32 Geom/Geom2d curve and surface classes. New
EvalD0/EvalD1/EvalD2/EvalD3/EvalDNvirtual methods serve as the primary dispatch points, returning new POD result structs (Geom_CurveD1/D2/D3,Geom_SurfD1/D2/D3,Geom2d_CurveD1/D2/D3). OldD0/D1/D2/D3/DNmethods retained as non-virtual inline backward-compatible wrappers. The final API uses direct struct returns with exception-based error handling (chosen overstd::optionalwrapping for evaluation hot-path performance) -
Devirtualize adaptor dispatch, mark leaf Geom classes final #1063: Eliminates virtual method dispatch on the geometry evaluation hot path by storing
gp_*primitives directly instd::variantinside adaptor classes and dispatching via switch/enum toElCLib/ElSLibstatic methods. Marks all 29 concrete leaf classes asfinalinGeom_*andGeom2d_*hierarchies, enabling compiler devirtualization. Bug fix:ShallowCopyinGeomAdaptor_Curve/Surfacenow correctly copies elementary types in the variant -
Geom2dGridEval package for batch 2D curve evaluation #1079: New package mirroring
GeomGridEvalfor 3D, providing batch evaluation of 2D curves with specialized evaluators for conics (analytical) and BSpline/Bezier (cache-based) -
Optimize adaptor Bezier cache and grid eval threshold #1084: Removed redundant
IsCacheValid()checks for Bezier curves/surfaces (single span, always valid), lowered cache threshold for more aggressive cache-based evaluation
TShape Hierarchy Optimization
- TShape hierarchy redesign for performance and memory efficiency #1027: Fundamental redesign of OCCT's most critical topological data structure:
- Child storage changed from
NCollection_List(linked list) toNCollection_DynamicArray(contiguous memory) with type-specific default bucket sizes (e.g., TEdge=2 for vertices, TWire=8 for edges) ShapeType()now non-virtual - embedded in compactuint16_t myStatebit-packed field (4 bits for type, 8 bits for flags)- New
TopoDS_TShapeDispatchforstd::visit-style devirtualized type dispatch TopAbs::Compose(),Reverse(),Complement()moved inline to headerTopoDS_Iteratorrefactored from list-based to index-based iteration- Result: Smaller TShape objects, cache-friendly child traversal, faster shape exploration
- Child storage changed from
Other Modeling Data Improvements
- Simplify EmplaceValue in Array1 and Array2 #1087
Modeling Algorithms
Geometry Evaluation Optimization
- GeomGridEval optimization and simplification #908, #951, #952, #1031: Improved surface grid evaluation with sequential processing
- Bnd_BoundSortBox optimization #958
- Optimized point-to-plane projection helper #959: Batch processing support
- Optimize properties computation for complex compounds #1091: Reduced
TopLoc_Locationcomposition overhead in edge pcurve lookup, added fast-path exits inTopLoc_Location::Predivided()for identity and equal-location cases, cached face surface/location inBRepGProp_Face
Algorithm Refactoring
- IntCurveSurface and HLRBRep intersection refactoring #912, #936: Complete code sharing for Polyhedron classes
- Offset curve and surface evaluators refactoring #930
- Extrusion and revolution Utils refactoring #948: Accept pre-computed curve values
- Evaluator classes refactoring #935: Inline Utils and variant-based Adaptors
- HLRAlgo_PolyData::Box replacement with Bnd_Box #923
- Extrema_ExtPS refactoring #978
- BOPDS refactoring #1007
- IntTools Box calculation optimization #990
- Update tolerance settings in BRepBlend_AppFuncRoot #1083: Regression fix after BSplCLib interpolation optimization
Bug Fixes
- Fixed solid-level caching bugs in BRepGProp volume properties #1092: Fixed SkipShared semantics broken for same-placement duplicates causing double-counting, and free faces/shells dropped when shared solids exist
- Fixed crash in ComputePolesIndexes() #1049: Fixed bounds checking where
theOutMinIdxcould exceed upper bound andtheOutMaxIdxcould be less than lower bound - Fixed partial torus creation with inverted V range #928
- Fixed 0-based index in BRep_Tool::CurveOnSurface call #949
- Fixed curve concatenation to use actual endpoints #926
- Fixed unnecessary loop iteration in BRepLib::BuildCurve3d #921
Shape Healing
- GlueEdgesWithPCurves validation fix #981
- Unstable PCurve Processing fix #967
- Remove edges from map during face unification in ShapeUpgrade_UnifySameDomain #941
Mesh
-
Registry-based factory pattern replacing plugin system #1033: Major architecture change:
- Replaced legacy DISCRETPLUGIN/DISCRETALGO symbol-based plugin system
- New
BRepMesh_DiscretAlgoFactoryabstract base with static registry BRepMesh_IncrementalMeshFactoryfor "FastDiscret" algorithmXBRepMesh_Factoryfor "XBRepMesh" extended meshing- Eliminated symbol collisions when TKMesh and TKXMesh both loaded
- Cleaner C++ design without dynamic symbol lookup
- Removed:
BRepMesh_PluginMacro.hxx,BRepMesh_PluginEntryType.hxx,BRepMesh_FactoryError.hxx - Removed Draw commands:
mpsetfunctionname,mpgetfunctionname,mperror
-
Fixed point-in-polygon check for CCW polygons in BRepMesh_Delaun #920
Visualization
-
Remove obsolete UNLIT shading optimization #1069: Removed implicit optimization in
OpenGl_Aspectsthat forced UNLIT shading when material had no reflection properties. This was breaking PBR materials, interior color handling, and texture modulation. Legacy code now explicitly setsSetShadingModel(Unlit) -
Avoid redundant shape copies in AIS_ColoredShape::dispatchColors #1068: Deferred
EmptyCopied()andBRep_Builder::Add()to avoid redundant shape construction; compound built only when required
Data Exchange
- STEP: Refactor pnindex handling in CreatePolyTriangulation #1067: Separated direct node indexing and pnindex remapping into distinct code paths
Build and Configuration
- Accept empty FILES content #1017
- Clean up the FILES #1002
- Disable usage of VTK by default #939
- Fix CMake static linking warnings #1075: Fixed missing spaces in warning messages
Testing
- Update CI workflow to build and test on Ubuntu with GCC #1028
- Use current run ID to download test results for platforms #1025
- Update font installation process for Windows to use Noto Sans CJK #999
- Remove long-running DRAW test cases with low diagnostic value #1093: Removed 5 test cases consuming ~590s total CI time
- Cleanup GTests layout and move TKXCAF test #1080: Removed empty GTests stubs, moved
XCAFDoc_Test.cxxto correct location
Coding Quality
Global Refactoring
- Global Refactoring OCCT as part of 8.0.0 #955: Comprehensive codebase modernization
- Clang-Tidy application with refactoring #965, #977
- Fix GCC warnings #975
- Fixed MSVC warnings #1004, #1060
- Suppress macOS system header warnings #997
- Fix critical CodeQL static analysis warnings #1074: Fixed use-after-free in
Interface_ParamSet::Append(), upcast pointer arithmetic bug indelabella.cpp, signed integer overflow inAdvApp2Var_MathBase. Also fixed pure virtual call during destruction inNCollection_SparseArrayBaseby replacing virtual dispatch with function pointers, eliminating the vtable entirely - Fix clang warning suppression for function pointer casts #1059
- Fix compilation warnings #1034
Code Cleanup
- HArray and HSequence Definitions refactoring #962
- HLRBRep algorithms: Replace Standard_Address with typed pointers #947, #961
- Remove unused typedefs and includes #971
- Remove unused code and comments #968
- Remove redundant null checks before deallocation #1077: Cleaned up 39 files
- BSplineCurve and BSplineSurface parameter preparation refactoring #972
- Add constexpr compatibility to more gp classes #933
- Translate French comments and modernize constants #932
- Move semantics and default constructor for CSLib_Class2d #919
- Optimize memory management in BOPAlgo classes #915
- Prevent copy and move operations in BRepAlgoAPI_BuilderAlgo #913
- Remove unused Bnd_Box and related code from BRepClass3d_SolidExplorer #931
- Revert type definitions for Standard_CString replacements #1021
- Include Standard_ErrorHandler header in OSD_signal #996
- Remove redundant pragma lib comment in OSD_Host.cxx #902
Temporary Changes
- Temporarily remove samples from the repository #960
Documentation
- Improve code examples in modeling algorithms #1016
- Refactor documentation with new coding rules #1013
- Update AI Assistant guidelines #1005
- Fix issue with documentation build #992
Migration Guide
OCCT 8.0.0 includes a comprehensive set of automated migration scripts in adm/scripts/migration_800/ to help external projects adapt to the new API. These scripts require Python 3.6+ with no external dependencies.
Automated Migration Toolkit
The migration scripts can be run all at once or individually. Each script supports --dry-run to preview changes before applying.
Full Automated Migration (Recommended)
# Linux/macOS - full migration with preview
./adm/scripts/migration_800/run_migration.sh /path/to/your/src --dry-run
# Linux/macOS - apply changes
./adm/scripts/migration_800/run_migration.sh /path/to/your/src
# Windows
adm\scripts\migration_800\run_migration.bat /path/to/your/src --dry-runThe full migration runs 12 phases in order:
| Phase | Script | What It Does | Approximate Scope |
|---|---|---|---|
| 1-2 | migrate_handles.py
| Handle(Class) to occ::handle<Class>, Handle(T)::DownCast() to occ::down_cast<T>()
| ~90,600 replacements |
| 3 | migrate_standard_types.py
| Standard_Boolean/Integer/Real to bool/int/double, Standard_True/False to true/false
| ~198,000 replacements |
| 4 | migrate_macros.py
| Standard_OVERRIDE to override, Standard_NODISCARD to [[nodiscard]], etc.
| ~7,730 replacements |
| 5 | cleanup_define_handle.py
| Remove redundant DEFINE_STANDARD_HANDLE macros
| ~1,970 removals |
| 6 | cleanup_deprecated_typedefs.py
| Remove deprecated typedef/using declarations, replace usages | ~1,800 cleanups |
| 7 | collect_typedefs.py
| Collect NCollection typedef mappings to JSON | Analysis phase |
| 8 | replace_typedefs.py
| Replace TColStd_*/TopTools_* with NCollection_*<T>
| ~31,000 replacements |
| 9 | remove_typedef_headers.py
| Remove typedef-only headers, update FILES.cmake | Header cleanup |
| 10 | cleanup_forwarding_headers.py
| Clean up forwarding/include-only headers | Header cleanup |
| 11 | cleanup_unused_typedefs.py
| Remove unused typedef declarations | Final cleanup |
| 12 | cleanup_access_specifiers.py
| Remove redundant access specifiers | Code cleanup |
After all phases, verify_migration.py runs automatically to report any remaining legacy patterns.
Individual Scripts for Targeted Migration
Each script can be run independently for granular control:
Handle Migration
python3 adm/scripts/migration_800/migrate_handles.py --dry-run /path/to/your/src// Before // After
Handle(Geom_Circle) aCircle; occ::handle<Geom_Circle> aCircle;
Handle(Geom_Circle)::DownCast(aCurve); occ::down_cast<Geom_Circle>(aCurve);Standard_* Type Migration
python3 adm/scripts/migration_800/migrate_standard_types.py --dry-run /path/to/your/src// Before // After
Standard_Boolean isOk = Standard_True; bool isOk = true;
Standard_Integer aCount = 0; int aCount = 0;
Standard_Real aTol = 0.001; double aTol = 0.001;
Standard_CString aName = "test"; const char* aName = "test";Full type mapping:
| Deprecated | Replacement | Deprecated | Replacement | |
|---|---|---|---|---|
Standard_Boolean
| bool
| Standard_Byte
| uint8_t
| |
Standard_Integer
| int
| Standard_Size
| size_t
| |
Standard_Real
| double
| Standard_Address
| void*
| |
Standard_ShortReal
| float
| Standard_CString
| const char*
| |
Standard_Character
| char
| Standard_ExtCharacter
| char16_t
| |
Standard_True/False
| true/false
| Standard_Time
| std::time_t
|
Standard_* Macro Migration
python3 adm/scripts/migration_800/migrate_macros.py --dry-run /path/to/your/src| Deprecated Macro | Replacement |
|---|---|
Standard_OVERRIDE
| override
|
Standard_NODISCARD
| [[nodiscard]]
|
Standard_FALLTHROUGH
| [[fallthrough]];
|
Standard_Noexcept
| noexcept
|
Standard_DELETE
| = delete
|
Standard_THREADLOCAL
| thread_local
|
Standard_ATOMIC(T)
| std::atomic<T>
|
Note:
Standard_UNUSEDrequires manual migration to[[maybe_unused]]due to stricter placement rules.
NCollection Typedef Migration
# Step 1: Use pre-generated JSON from OCCT (or collect from source)
python3 adm/scripts/migration_800/replace_typedefs.py --dry-run \
--input adm/scripts/migration_800/collected_typedefs.json /path/to/your/src// Before // After
TColStd_ListOfInteger aList; NCollection_List<int> aList;
TopTools_MapOfShape aMap; NCollection_Map<TopoDS_Shape> aMap;
TColStd_Array1OfReal anArr; NCollection_Array1<double> anArr;
TColgp_SequenceOfPnt aSeq; NCollection_Sequence<gp_Pnt> aSeq;Pre-generated JSON files are included in adm/scripts/migration_800/ so external projects do not need to re-scan the OCCT source:
collected_typedefs.json- NCollection typedef mappingscollected_deprecated_typedefs.json- Deprecated typedef patterns and replacements
Exception Raise Migration
python3 adm/scripts/migration_800/migrate_raise_to_throw.py --dry-run// Before (removed) // After (required)
Standard_Failure::Raise("error"); throw Standard_Failure("error");
Standard_OutOfRange::Raise("index"); throw Standard_OutOfRange("index");H-Collection Macro Migration
python3 adm/scripts/migration_800/migrate_hcollections.py --dry-runConverts DEFINE_HARRAY1, DEFINE_HARRAY2, and DEFINE_HSEQUENCE macros to the new NCollection_HArray1/HArray2/HSequence template classes.
Verification
After migration, verify completeness:
python3 adm/scripts/migration_800/verify_migration.py --verbose /path/to/your/srcManual Migration Notes
The following API changes require manual attention beyond what the automated scripts handle.
Exception Handling
OCCT exceptions now inherit from std::exception and can be caught using standard C++ exception handling:
// Now works! (OCCT exceptions inherit from std::exception)
try {
// OCCT operations
} catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
}
// Or catch specific OCCT exception types
try {
// OCCT operations
} catch (const Standard_Failure& e) {
std::cerr << e.ExceptionType() << ": " << e.what() << std::endl;
}The GetMessageString() method is deprecated; use what() instead.
NCollection_Map API Changes
Seek()/ChangeSeek() have been removed from NCollection_Map. Use Contained() instead:
// Before (removed)
const KeyType* pKey = aMap.Seek(aKey);
// After
auto anOpt = aMap.Contained(aKey);
if (anOpt.has_value()) { const KeyType& aFoundKey = anOpt->get(); }BSpline/Bezier Weights Migration
The nullable Weights() pattern has been replaced with always-valid WeightsArray():
// Before (nullable)
const NCollection_Array1<double>* pWeights = aCurve->Weights();
if (pWeights != nullptr) { /* use weights */ }
// After (always valid)
const NCollection_Array1<double>& aWeights = aCurve->WeightsArray();
// Non-rational curves return a view over static unit-weights buffer (no allocation)Copy-out accessor overloads are deprecated in favor of const-reference returning versions:
// Before (deprecated, copies data)
NCollection_Array1<gp_Pnt> aPoles;
aCurve->Poles(aPoles);
// After (zero-copy)
const NCollection_Array1<gp_Pnt>& aPoles = aCurve->Poles();Convert Package Migration
Single-element accessors are deprecated in favor of batch const-reference accessors:
// Before (deprecated)
gp_Pnt aPole = aConverter.Pole(i);
// After
const NCollection_Array1<gp_Pnt>& aPoles = aConverter.Poles();Visualization: UNLIT Shading
The implicit optimization that forced UNLIT shading when material had no reflection properties has been removed. If relying on zero-material properties for UNLIT shading, explicitly set the shading model:
// Before (implicit, now removed)
// Setting material with no reflection would auto-switch to UNLIT
// After (explicit)
anAspect->SetShadingModel(Graphic3d_TypeOfShadingModel_Unlit);Mesh Plugin System Migration
The legacy DISCRETPLUGIN/DISCRETALGO symbol-based plugin system has been replaced with a registry-based factory:
// Before (removed)
BRepMesh_PluginEntryType aFunc = BRepMesh::PluginEntry("DISCRETPLUGIN");
// After
occ::handle<BRepMesh_DiscretAlgoFactory> aFactory = BRepMesh_DiscretAlgoFactory::FindFactory("FastDiscret");
if (!aFactory.IsNull()) {
occ::handle<BRepMesh_DiscretAlgo> anAlgo = aFactory->Create();
}Bnd Package API Changes
Bnd_Range::IsIntersected magic int returns replaced with IntersectStatus enum:
// Before
int aResult = aRange.IsIntersected(...);
// After
Bnd_Range::IntersectStatus aResult = aRange.IsIntersected(...);Geom Classes Marked Final
All 29 concrete leaf classes in Geom_* and Geom2d_* hierarchies are now marked final. If your code inherits from these concrete classes (e.g., Geom_BSplineCurve, Geom_Plane), this will cause a compilation error. Inherit from the abstract base classes instead (e.g., Geom_BoundedCurve, Geom_ElementarySurface).
Removed Functionality
| Item | Commit | Replacement |
|---|---|---|
Standard_Failure::Raise() static method
| #984 | throw Standard_Failure()
|
Standard_ErrorHandler::Catches()
| #980 | Implicit from execution flow |
Standard_ErrorHandler::LastCaughtError()
| #980 | Accessed via variant in handler |
NCollection_Map::Seek()/ChangeSeek()
| #1065 | Contained() returning std::optional
|
BRepMesh_PluginMacro.hxx
| #1033 | BRepMesh_DiscretAlgoFactory
|
BRepMesh_PluginEntryType.hxx
| #1033 | Factory registration |
BRepMesh_FactoryError.hxx
| #1033 | Standard exceptions |
Draw commands: mpsetfunctionname, mpgetfunctionname, mperror
| #1033 | Not needed with factory pattern |
Draw command: BUC60720
| #1069 | Not needed |
QABugs_PresentableObject
| #1069 | Not needed |
NCollection_SparseArrayBase vtable
| #1074 | Function pointers |
| Samples directory | #960 | Temporary removal |
Deprecated Functionality
| Item | Commit | Replacement |
|---|---|---|
Package type aliases (TColStd_*, TopTools_*, etc.)
| #1026 | NCollection_*<T> templates
|
Standard_Failure::GetMessageString()
| #984 | what() (std::exception interface)
|
| BSpline/Bezier copy-out accessor overloads | #1056 | Const-reference returning versions |
| Convert package single-element accessors | #1057 | Batch const-reference accessors |
Nullable Weights() pattern
| #1058 | WeightsArray() (always valid)
|
Performance Improvements Summary
- Devirtualized adaptor dispatch #1063: Eliminates virtual calls for elementary geometry evaluation via std::variant
- BSpline/Bezier direct array members #1056: Eliminates heap indirection and reference counting
- Always-populated weights with zero-alloc views #1058: Eliminates null checks and copies for non-rational geometry
- BSplCLib interpolation optimization #1082: Static init, stack allocation, raw pointer hot loops
- Properties computation for complex compounds #1091: TopLoc_Location fast paths, cached face surface/location
- Thread-local error handling #980: Zero lock overhead for exception handling in parallel code
- TShape hierarchy optimization #1027: Non-virtual ShapeType(), compact state storage, better cache locality
- NCollection_FlatDataMap/FlatMap #1015: Robin Hood hashing with open addressing for cache-friendly hash maps
- Matrix multiplication optimization #1015: Cache-friendly i-k-j loop order
- Vector norm with SIMD unrolling #1015: 4-way loop unrolling
- Optimized atomic reference counting #1015: Explicit memory ordering
- NCollection_List optimization #1040: Optimized move constructor, improved const-correctness
- Tree and collection optimizations #1065: Iterative traversal, move semantics across containers
- AIS_ColoredShape::dispatchColors #1068: Avoids redundant shape copies
- TopLoc_Location::HashCode optimization #1006
- Adaptor Bezier cache optimization #1084: Removed redundant validity checks
- Bnd package optimizations #1051: Early return fast paths
- PLib polynomial evaluation optimization #953
- GeomGridEval optimization #908, #951, #952, #1031
- Bnd_BoundSortBox optimization #958
- IntTools Box calculation optimization #990
- Coordinate-wise polishing for PSO/DE #1088: Precision improvement to 1e-8+
- Extended precompiled headers #1029: Faster compilation
Acknowledgments
We thank all contributors who helped make this release possible through their code contributions, bug reports, and testing.
New Contributors
- @Andrej730 made their first contribution in #902
Full Changelog: V8_0_0_rc3...V8_0_0_rc4