Skip to content

Coding - Geom package Copy optimisation#645

Merged
dpasukhi merged 7 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:geom_deep_copy
Jul 26, 2025
Merged

Coding - Geom package Copy optimisation#645
dpasukhi merged 7 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:geom_deep_copy

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

@dpasukhi dpasukhi commented Jul 26, 2025

  • 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

dpasukhi added 3 commits July 26, 2025 12:31
Implement copy constructors for Geom_BSplineCurve, Geom_BSplineSurface, Geom_BezierCurve, Geom_OffsetCurve, and Geom_OffsetSurface for optimized copying without validation.
…d Geom2d_OffsetCurve; update Copy methods for optimized copying
@dpasukhi dpasukhi added this to the Release 8.0 milestone Jul 26, 2025
@dpasukhi dpasukhi requested a review from Copilot July 26, 2025 11:57
@dpasukhi dpasukhi self-assigned this Jul 26, 2025
@dpasukhi dpasukhi added the 1. Coding Coding rules, trivial changes and misprints label Jul 26, 2025
@dpasukhi dpasukhi changed the base branch from master to IR July 26, 2025 11:58

This comment was marked as outdated.

@dpasukhi dpasukhi requested a review from Copilot July 26, 2025 12:00

This comment was marked as outdated.

…e, Geom_BSplineCurve, and Geom_BSplineSurface by eliminating unnecessary null checks for flatknots, weights, ufknots, and vfknots.
@dpasukhi dpasukhi requested a review from Copilot July 26, 2025 12:05

This comment was marked as outdated.

@dpasukhi dpasukhi requested a review from Copilot July 26, 2025 12:07

This comment was marked as outdated.

…ce, Geom_BezierCurve, and Geom_BezierSurface by removing unnecessary null checks for weights.
@dpasukhi dpasukhi requested a review from Copilot July 26, 2025 12:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces optimized copy constructors for geometry classes in the Geom package to improve copying performance without validation overhead. The optimization eliminates redundant validation when copying already-validated geometric objects by implementing dedicated copy constructors that perform deep copying of internal data structures.

  • 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

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
Geom_OffsetSurface.hxx/cxx Adds copy constructor for 3D offset surfaces
Geom_OffsetCurve.hxx/cxx Adds copy constructor for 3D offset curves
Geom_BezierSurface.hxx/cxx Adds copy constructor for Bezier surfaces
Geom_BezierCurve.hxx/cxx Adds copy constructor for Bezier curves
Geom_BSplineSurface.hxx/cxx Adds copy constructor for B-spline surfaces
Geom_BSplineCurve.hxx/cxx Adds copy constructor for B-spline curves
Geom2d_OffsetCurve.hxx/cxx Adds copy constructor for 2D offset curves
Geom2d_BezierCurve.hxx/cxx Adds copy constructor for 2D Bezier curves
Geom2d_BSplineCurve.hxx/cxx Adds copy constructor for 2D B-spline curves
Test files Comprehensive unit tests for all new copy constructors

Comment thread src/ModelingData/TKG3d/Geom/Geom_OffsetSurface.hxx
Comment thread src/ModelingData/TKG3d/Geom/Geom_BezierSurface.cxx
Comment thread src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.cxx
Comment thread src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.cxx
Comment thread src/ModelingData/TKG3d/Geom/Geom_BezierCurve.cxx
Comment thread src/ModelingData/TKG2d/Geom2d/Geom2d_OffsetCurve.cxx
Comment thread src/ModelingData/TKG2d/Geom2d/Geom2d_BezierCurve.cxx
Comment thread src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.cxx
…SplineCurve, Geom2d_BezierCurve, Geom_BSplineCurve, Geom_BSplineSurface, and Geom_BezierSurface
@dpasukhi dpasukhi merged commit 0eb86fb into Open-Cascade-SAS:IR Jul 26, 2025
23 checks passed
@dpasukhi dpasukhi deleted the geom_deep_copy branch July 26, 2025 16:38
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Coding Coding rules, trivial changes and misprints

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants