Commit Graph

44 Commits

Author SHA1 Message Date
Pasukhin Dmitry
e5888e6d19 Modeing - BSpline Cache Optimised calls for Local (#906)
- Added `D0Local`, `D1Local`, `D2Local`, `D3Local` methods to `BSplCLib_Cache` and `BSplSLib_Cache` classes
- Added accessor methods to `Geom_BSplineCurve` and `Geom_BSplineSurface` for direct handle access to internal arrays
- Comprehensive test coverage for both curve and surface cache implementations
2025-12-12 20:11:29 +00:00
Pasukhin Dmitry
8662adfe46 Modeling - Refactor Extrema package (#869)
- Replacing preprocessor-based generic programming with C++ templates
- Converting inline implementation files (`.lxx`) to inline definitions within header files
- Removing legacy instantiation files (`_0.cxx`)
- Updating type aliases to use modern `using` declarations instead of macro-based instantiation
2025-12-06 17:08:32 +00:00
Pasukhin Dmitry
c770a1a7f7 Coding - Fixing analyzer reports (#885)
- Replaced manual absolute value logic (conditional negation) with `std::abs` for clarity
- Added `const` qualifiers to variables that are not modified after initialization
- Moved variable declarations closer to their first use and removed unused variable assignments
2025-12-05 21:20:08 +00:00
Pasukhin Dmitry
d349cd4a67 Configuration - Update compiler flags and includes for macOS (#884)
- Added flags to suppress elaborated-enum-base warnings for newer Clang versions on macOS
- Updated includes in TDF_AttributeMap.hxx to include Standard_Handle.hxx
- Modified hash functions in GeomHash and Geom2dHash classes to use Standard_CStringHasher instead of Standard_HashUtils
2025-12-05 16:05:07 +00:00
Dmitrii Kulikov
244c54af3d Modeling - BRepBuilderAPI_GTransform face stretch crash (#875)
- Modified parameter validation to allow curves where `theUFirst > theULast` within `Precision::Confusion()` tolerance
- Updated documentation to reflect the new tolerance-based validation
- Added comprehensive test suites for both 2D and 3D curve adaptors
2025-12-04 19:02:29 +00:00
Pasukhin Dmitry
c04f5e0b4c Modeling - Optimize BndLib and add GTests (#856)
- Fix negative modulo in torus bounding box computation
- Fix hyperbola extrema loop early break condition
- Fix OpenMin/OpenMax direction sign for infinite bounds
- Remove dead code in cone bounding computation
- Replace sqrt/log with more efficient computations in hyperbola bounds
- General code cleanup and modernization
2025-11-27 09:22:44 +00:00
Pasukhin Dmitry
052c37669b Modeling Data - Add GeomHash and Geom2dHash packages (#845)
- Implementation of hashers for analytic curves (Line, Circle, Ellipse, Hyperbola, Parabola) and freeform curves (Bezier, BSpline, Trimmed, Offset) in both 2D and 3D
- Implementation of hashers for surfaces including elementary surfaces (Plane, Cylinder, Cone, Sphere, Torus) and derived surfaces (Revolution, LinearExtrusion, RectangularTrimmed, Offset)
- Comprehensive test coverage for all hasher implementations
2025-11-22 11:16:25 +00:00
Dmitrii Kulikov
c479f6e000 Coding - Rework of Math global functions to stl (#833)
Majority of functions now simply call same functions from std namespace.
Functions that duplicate std namespace functionality are declared
deprecated.
Calls of deprecated functions are replaced with std functions calls.
2025-11-17 14:20:24 +00:00
Pasukhin Dmitry
e03b266234 Foundation Classes - Performance improvements for TopExp package (#831)
- Replaced raw pointer-based stack (`TopExp_Stack`) with `NCollection_Vector<TopoDS_Iterator>`
- Mark some methods noexcept
- Removed `myTop` field
2025-11-14 18:00:19 +00:00
luzpaz
79289339d8 Documentation - Fix whitespaces and typos (#824)
- Fixed excessive whitespace in multi-line comments
- Corrected spelling errors (e.g., "selectionnable" → "selectable", "begenning" → "beginning")
- Improved comment formatting and readability
2025-11-13 20:31:57 +00:00
Pasukhin Dmitry
570b34b666 Coding - Removing simple gxx files (#827)
- Converted generic template files to direct implementations for three packages (Extrema, MAT, TopBas/HLRAlgo)
- Removed preprocessor macro-based includes and replaced with concrete type definitions
- Updated CMake FILES lists to remove deprecated `.gxx` and `.lxx` files
2025-11-13 19:28:14 +00:00
luzpaz
df59c53e79 Documentation - Fix whitespaces and typos (#821)
- Removed excessive whitespace between words in comments
- Removed <br> syntax
- Fixed spelling errors ("hilight" → "highlights", "texte" → "text")
- Improved comment formatting and structure
2025-11-13 09:30:53 +00:00
Pasukhin Dmitry
396b677095 Testing - Migrate QA DRAW tests to GTest (#823)
- Deletion of 20 legacy DRAW test files (.tcl format) from tests/bugs/ directories
- Addition of 15 new GTest C++ test files across multiple modules
- Removal of corresponding QA command implementations from TKQADraw
2025-11-13 09:28:07 +00:00
luzpaz
ed1d0c88cc Documentation - Fix whitespaces and typos (#819)
- Fixed inconsistent whitespace and line breaks in comments
- Corrected spelling errors ("witch" → "which", "sprcified" → "specified", "nul" → "null", etc.)
- Improved formatting consistency in documentation comments
2025-11-12 18:06:11 +00:00
Pasukhin Dmitry
d166ff70e7 Testing - Migrate QA DRAW tests to GTest (#818)
- Removed 37 DRAW test scripts from `tests/bugs/` directories
- Added 31 new GTest C++ test files in appropriate `GTests/` directories
- Removed corresponding QAcommands implementations from QABugs source files
- Updated CMake FILES.cmake files to include new test files
2025-11-10 21:17:50 +00:00
luzpaz
f9f94b6e36 Documentation - Fix whitespaces (#816)
- Standardized spacing in comment formatting (removing extra spaces after colons, between words)
- Fixed one typo in a parameter name within a comment
- Translated one French comment to English
2025-11-10 17:42:08 +00:00
luzpaz
a47cffd0eb Documentation - Fix whitespace and typos (#815) 2025-11-09 21:38:29 +00:00
Pasukhin Dmitry
27e61c089c Foundation Classes - ElSLib, ElCLib Angle normalization refactor (#813)
- Introduced a centralized `normalizeAngle()` function in both ElSLib.cxx and ElCLib.cxx with special handling for values near zero and the 2π seam
- Replaced multiple instances of inline angle normalization code with calls to the new function
- Migrated the OCC24945 bug test from Draw Harness to GTest framework
- Updated expected test values to reflect the improved normalization behavior
2025-11-09 14:13:24 +00:00
Pasukhin Dmitry
2cc2bfdd27 Foundation Classes, gp - Add constexpr/noexcept constructors and standard direction enums (#803)
- Addition of `gp_Dir::D` and `gp_Dir2d::D` enums for standard directions (X, Y, Z, NX, NY, NZ)
- Constexpr/noexcept constructors for geometric primitives (circles, cones, cylinders, etc.)
- Enhanced axis placement classes with enum-based constructors
- Replacement of hardcoded direction values throughout the codebase
2025-11-04 16:21:59 +00:00
Pasukhin Dmitry
787bee375c Coding - Replace Standard_Mutex with std::mutex and migrate to RAII locks (#766)
- Replace legacy Standard_Mutex usage across many modules with std::mutex.
- Include <mutex> where needed and remove <Standard_Mutex.hxx> includes.
- Replace Standard_Mutex::Sentry / explicit Lock/Unlock with std::lock_guard or std::unique_lock.
- Convert optional/heap mutex holders to std::unique_ptr<std::mutex> and adapt locking accordingly.
- Simplify several singleton initializations (remove manual double-checked locking where safe).
- Use thread_local for per-thread flags instead of ad-hoc mutex protection.
- Fix BVH_BuildQueue Fetch logic to preserve thread counters and wasBusy handling.
- Remove obsolete TopTools_MutexForShapeProvider sources and update FILES.cmake.

This modernizes mutex usage, reduces dependency on custom mutex types and improves clarity of locking patterns.
2025-11-03 16:44:08 +00:00
Pasukhin Dmitry
6c32db17c1 Foundation Classes - remove PLib_Base and migrate to concrete polynomial types (#795)
- Delete PLib_Base.hxx / PLib_Base.cxx and remove from PLib/FILES.cmake.
- Convert PLib_JacobiPolynomial and PLib_HermitJacobi from polymorphic Handle-based types to direct value types:
  - Remove inheritance from PLib_Base and RTTI macros.
  - Replace DEFINE_STANDARD_HANDLE / Handle usage with plain objects/members.
  - Make internal PLib_JacobiPolynomial member const where appropriate.
- Make basis evaluation methods const (D0/D1/D2/D3 and internal D0123) and mark trivial accessors noexcept:
  - WorkDegree() and NivConstr() now noexcept.
  - Update signatures (const correctness) across implementation and headers.
- Update all call sites to new API and value semantics:
  - Tests: PLib_HermitJacobi_Test.cxx, PLib_JacobiPolynomial_Test.cxx updated to construct objects by value and call methods without '->'.
  - Modeling/approximation & FEM code: AdvApprox_ApproxAFunction, AdvApprox_SimpleApprox, AppDef_LinearCriteria, AppDef_Variational, FEmTool_Curve, FEmTool_ElementsOfRefMatrix, FEmTool_LinearFlexion/Jerk/Tension and related headers updated to accept/use PLib_HermitJacobi by reference/value and call new methods.
  - Replace Handle(...) constructions with stack/local objects and adapt calls (ToCoefficients, ReduceDegree, MaxError, AverageError, Points, Weights, etc.).
- Miscellaneous API adjustments to match new declarations (removed Standard_OVERRIDE annotations where not applicable).
- Keep behavior unchanged; this is an API/implementation refactor to remove legacy polymorphic base and improve const-correctness and performance.
2025-11-02 15:53:23 +00:00
Pasukhin Dmitry
962a456f9b Foundation Classes, Strings - add EmptyString() for Ascii/Extended and use it everywhere (#788)
Introduce TCollection_AsciiString::EmptyString() and TCollection_ExtendedString::EmptyString()
  and update headers.
Replace many local/static empty string instances and default-constructed
  temporaries with the shared EmptyString() reference across ApplicationFramework, DataExchange,
  Visualization and other modules.
Remove several unused local empty-key/static variables and
  adjust default parameters and return paths to use the centralized empty-string accessors.
Add missing #include <TCollection_AsciiString.hxx> to several headers that use/forward TCollection_AsciiString.
2025-11-01 22:39:12 +00:00
Pasukhin Dmitry
c88c05399f Coding - Introduce compile-time sqrt constants and use them consistently (#789)
- Add M_SQRT2 macro in multiple sources and replace runtime sqrt/Sqrt(2) calls with the macro
- Add SQRT_3 constexpr in IGESGraph_Color and Bnd_OBB and replace Sqrt(3) usages
- Make BSplSLib_zero a constexpr array
- Replace a few computed sqrt literals with compile-time constants for clarity and consistency
2025-11-01 13:57:11 +00:00
luzpaz
ae33c4ef42 Documentation - Fix whitespace and typos (#772)
- Corrected spelling errors (e.g., "aera" → "area", "nithing" → "nothing")
- Normalized excessive whitespace in comments for better readability
- Standardized comment formatting while preserving technical content
2025-10-29 17:57:19 +00:00
luzpaz
719ed090cb Documentation - Fix whitespace uniformity (#770)
- Standardized spacing in documentation comments by removing extra spaces between words
- Fixed inconsistent line breaks in multi-line comment blocks  
- Corrected minor spelling/grammar issues (e.g., "follow" → "follows", "form" → "from")
2025-10-28 08:26:46 +00:00
luzpaz
859d1d6f6c Documentation - Fix various typos and comment uniformity (#767)
Fixes user-facing and non-user-facing typos.  
Also removes code comment justification and optimizes whitespace.
2025-10-27 10:42:17 +00:00
Pasukhin Dmitry
f4741d647f Coding - Checking for copyright notice (#749)
Created a new CI step to validate the presence of a copyright notice in each source file.
Updated existed files to include the copyright notice.
2025-10-16 18:39:56 +01:00
Pasukhin Dmitry
775454b75a Coding - Remove duplicate and self-referencing include directives (#739)
- Removal of self-referencing includes where files include themselves
- Elimination of duplicate include statements within the same file
- Cleanup of redundant includes in conditional compilation blocks
- Adding CI validation for validation PRs
2025-10-08 20:31:35 +01:00
Pasukhin Dmitry
47bc102e28 Coding - Method guard iterative update (#732)
Used regex in src folder:
^//[\s\n\r\t]*[-=]{2,}[=]*[\n\r]*//[\s\n\r\t]*[a-z]+[\s\n\r\t]*:[\s\n\r\t]*[a-z0-9_:\t\s]*[\s\n\r\t]*//[\s\n\r\t]*[a-z]+[\s\n\r\t]*:[\s\n\r\t]*[a-z0-9_\s\t./-><]{0,22}//[\s\n\r\t]*[-=]{3,}[=]*
2025-09-21 11:50:56 +01:00
Pasukhin Dmitry
08c8482271 Coding - Applying formatting to gxx files (#730)
- Updated GitHub Action for ASCII Check and Clang-Format
- Formatted all gxx files in the src directory
2025-09-21 09:53:01 +01:00
Pasukhin Dmitry
80ce783ca2 Modeling - Fix array indexing bug in IntAna_IntQuadQuad::NextCurve method (#703)
Fixed a critical indexing bug in IntAna_IntQuadQuad::NextCurve where the
  method incorrectly used nextcurve[I] instead of nextcurve[I-1] for
  determining the theOpposite parameter.
This mismatch between 1-indexed API
  parameters and 0-indexed array access could lead to out-of-bounds memory
  access and incorrect curve connectivity determination.

Changes:
  - Fix IntAna_IntQuadQuad::NextCurve to use consistent I-1 indexing for both
   condition check and return value
  - Add comprehensive GTests covering NextCurve functionality, edge cases,
  and performance
  - Ensure proper error handling for invalid curve indices
2025-09-06 13:36:48 +01:00
Pasukhin Dmitry
5ae60b51d3 Coding - Moving to Sprintf call (#675)
- Updates function calls from `sprintf` to `Sprintf` across the entire codebase
- Updates comments and documentation references to reflect the new function name
- Adds format attribute annotations to the `Sprintf` function declaration for better compiler validation
2025-08-17 12:45:30 +01:00
Pasukhin Dmitry
314527f5c0 Coding - Update Clang-format with more macroses (#677)
- Updates `.clang-format` to include `OCC_CATCH_SIGNALS`, `DEFINE_STANDARD_RTTIEXT`, and `Draw_Drawable3D_FACTORY` as statement macros
- Adds a GitHub action step to automatically remove empty lines after `Standard_DEPRECATED` macro declarations
- Reformats numerous files by removing blank lines after deprecated method declarations and improving macro formatting
2025-08-16 20:50:50 +01:00
Pasukhin Dmitry
ae4de70f98 Coding - Method guard iterative update (#674)
- Standardizes comment formatting by replacing detailed comment blocks with a uniform "//=================================================================================================" separator
- Removes redundant "function:" and "purpose:" fields that often contained minimal or no useful information
- Maintains code functionality while improving visual consistency across the codebase
2025-08-15 17:14:53 +01:00
Pasukhin Dmitry
0eb86fb05a Coding - Geom package Copy optimisation (#645)
- Adds copy constructors for 9 geometry classes (Bezier/BSpline curves and surfaces, offset curves and surfaces in both 2D and 3D)
- Updates Copy() methods to use the new copy constructors instead of recreating objects through standard constructors
- Includes comprehensive test coverage for all new copy constructors
2025-07-26 17:38:46 +01:00
Pasukhin Dmitry
0947067ed5 Coding - Function guard update (#610)
- Removed verbose function header comments (name, purpose) across multiple C++ source files.
- Introduced a single-line separator comment before each function for consistent formatting.
- Applied the change in visualization, modeling, algorithms, foundation, and application framework modules.
2025-07-13 13:16:51 +01:00
Pasukhin Dmitry
4629ee0ca3 Coding - Refactor switch-case statements and improve memory management #569
- Added missing break statements in switch-case blocks in LDOMBasicString, LDOM_BasicElement, PCDM_ReadWriter, and IntCurve_IntConicConic_1 to prevent fall-through behavior.
- Enhanced Standard_Macro.hxx to support fallthrough attributes across different compilers.
- Corrected the use of std::forward in Standard_MemoryUtils.hxx for better type deduction.
- Replaced raw arrays with NCollection_Array1 in AdvApp2Var_SysBase for improved memory safety.
- Updated Extrema_ExtCC2d to utilize smart pointers for better memory management and avoid potential leaks.
- Refactored Units_UnitsDictionary to use NCollection_Array2 for matrix representation, improving readability and maintainability.
- Initialized TranFirst and TranLast in TopTrans_CurveTransition constructor for better default state management.
- Set myStatus in ShapeConstruct_ProjectCurveOnSurface constructor to ensure proper initialization.
- Changed matrix access in Units_UnitsDictionary to use NCollection_Array2 syntax for consistency.
2025-05-30 14:31:26 +01:00
Dmitrii Kulikov
7b016e5c28 Modeling - General Fuse (BOPAlgo_PaveFiller) optimization #514
Adding a null check for the triangulation in BRep_Tool::IsClosed.
Simplifying index lookup logic in BOPDS_DS.
Introducing helper functions (IsPlaneFF and IsClosedFF) and updating iteration loops in BOPAlgo_PaveFiller_6 for improved clarity and robustness.
2025-05-16 00:03:44 +01:00
Dmitrii Kulikov
a56d85bf15 Modeling - BRepFilletAPI_MakeFillet Segfault with two curves and rim #532
Added null checks for TopoDS_Face in ChFi3d_Builder_2 and BRepAdaptor_Surface.
Added tests to check for crash.
2025-05-15 19:35:52 +01:00
Pasukhin Dmitry
469da02ca6 Configuration - Fixed pathes to 3rd-party in cmake configuration (#523)
Update target_link_libraries to use PUBLIC and PRIVATE visibility for dependencies.
Now all 3rd-party is hidden for the external linking, no more issues to invalid path to 3rd-party
2025-05-15 13:04:14 +01:00
Pasukhin Dmitry
15ec314a87 Modeling - Periodic BSpline curve bounding #493
Enhance periodic curve handling in BndLib_Add3dCurve::Add method.
Checks the periodic BSpline on 3 directions of period for tolerance upgrade.
2025-04-11 22:08:02 +01:00
Pasukhin Dmitry
ea34d5b2b7 Modeling - Bounding BSpline periodic tolerance issue #468
Update BndLib_Add3dCurve to check the periodic case u1-u2 matching with period
2025-03-31 11:29:38 +01:00
Pasukhin Dmitry
876ccbe977 Configuration - Add support for Google Test framework in CMake #443
Enhance Google Test integration and add support for test projects.
Each Toolkit have GTests folder with place for new tests.
For adding new tests needs to extend FILES.cmake files in each GTests folder.
The single executable is created for each toolkit with all tests.
The tests grouped by module and toolkit with :: as separator.
Added option to download GTest by Cmake if not found.
Add GTest for PLib_JacobiPolynomial with comprehensive test cases
Add GTest for TCollection_AsciiString and TCollection_ExtendedString
Set C++ standard to C++14 for GTest compatibility if required
2025-03-24 08:58:02 +00:00
Pasukhin Dmitry
5647b46a34 Configuration - Reorganize repository structure #450
Reorganizing structure to have Module/TK/Package/FILES structure.
New structure reflect the structure inside IDE.
Migrate FILES, PACKAGES, EXTRLIB to CMake version to handle changes on updates.
No changes were done to installation layout, all installation result keep as before.
The migration was done using python script, see PR, which refactor automatically the structure.
Updated doc generation to have valid path to modules, toolkits and packages.
In case of PR into new version, IR-790 can be used as a target for the previous version.
2025-03-20 00:39:26 +00:00