Skip to content

Foundation Classes, gp - Mark 2D geometry APIs noexcept/constexpr#796

Merged
dpasukhi merged 4 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:gp_geom_2d_constexpr_noexcept
Nov 2, 2025
Merged

Foundation Classes, gp - Mark 2D geometry APIs noexcept/constexpr#796
dpasukhi merged 4 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:gp_geom_2d_constexpr_noexcept

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

@dpasukhi dpasukhi commented Nov 2, 2025

Annotate numerous gp 2D classes (gp_Pnt2d, gp_Vec2d, gp_Dir2d, gp_Ax2d, gp_Ax22d,
gp_Lin2d, gp_Circ2d, gp_Elips2d, gp_Hypr2d, gp_Parab2d, gp_Trsf2d) with
noexcept and add constexpr to trivial/constexpr-friendly accessors and
constructors. Update corresponding inline/implementation functions to match.
This documents no-throw guarantees and enables more compile-time evaluation.

Annotate numerous gp 2D classes (gp_Pnt2d, gp_Vec2d, gp_Dir2d, gp_Ax2d, gp_Ax22d,
gp_Lin2d, gp_Circ2d, gp_Elips2d, gp_Hypr2d, gp_Parab2d, gp_Trsf2d) with
noexcept and add constexpr to trivial/constexpr-friendly accessors and
constructors. Update corresponding inline/implementation functions to match.
This documents no-throw guarantees and enables more compile-time evaluation.
…2D gp headers and remove unused variable

Reflow long parameter lists and expand single-line inline function bodies (IsDirect, Rotate, Translate, etc.) across gp_Circ2d, gp_Elips2d, gp_Hypr2d, gp_Lin2d and gp_Parab2d headers for consistent style and readability. Remove an unused local gp_Lin2d from GeomInt_IntSS_1.cxx.
… methods

Remove noexcept from Rotate/Rotated, Scale/Scaled, Transform/Transformed in gp_Circ2d,
gp_Elips2d, gp_Hypr2d and gp_Parab2d to align declarations with definitions and allow
proper error propagation from transformation operations.
@dpasukhi dpasukhi added this to the Release 8.0 milestone Nov 2, 2025
@dpasukhi dpasukhi requested a review from Copilot November 2, 2025 18:25
@dpasukhi dpasukhi self-assigned this Nov 2, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code 1. Coding Coding rules, trivial changes and misprints labels Nov 2, 2025
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 enhances the 2D geometry classes in the gp package by adding noexcept specifications to document no-throw guarantees and constexpr qualifiers to enable compile-time evaluation of trivial accessors and constructors. The changes systematically apply these modern C++ annotations across multiple 2D geometry types (gp_Pnt2d, gp_Vec2d, gp_Dir2d, gp_Ax2d, gp_Ax22d, gp_Lin2d, gp_Circ2d, gp_Elips2d, gp_Hypr2d, gp_Parab2d, gp_Trsf2d).

Key Changes

  • Added noexcept to transformation and mirroring methods across all 2D geometry classes
  • Added constexpr to trivial getters, setters, and simple computational methods where applicable
  • Removed an unused variable declaration in GeomInt_IntSS_1.cxx

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx Removed unused gp_Lin2d aL variable declaration
src/FoundationClasses/TKMath/gp/gp_Vec2d.hxx Added noexcept to Transform method
src/FoundationClasses/TKMath/gp/gp_Vec2d.cxx Added noexcept to Transform method implementation
src/FoundationClasses/TKMath/gp/gp_Trsf2d.hxx Added noexcept to SetMirror methods
src/FoundationClasses/TKMath/gp/gp_Trsf2d.cxx Added noexcept to SetMirror method implementation
src/FoundationClasses/TKMath/gp/gp_Pnt2d.hxx Added noexcept to Mirror, Mirrored, and Transform methods
src/FoundationClasses/TKMath/gp/gp_Pnt2d.cxx Added noexcept to Mirror, Mirrored, and Transform implementations
src/FoundationClasses/TKMath/gp/gp_Parab2d.hxx Added noexcept/constexpr to constructors, accessors, and transformation methods
src/FoundationClasses/TKMath/gp/gp_Parab2d.cxx Added noexcept to Mirror and Mirrored implementations
src/FoundationClasses/TKMath/gp/gp_Lin2d.hxx Added noexcept/constexpr to constructors, accessors, and transformation methods
src/FoundationClasses/TKMath/gp/gp_Lin2d.cxx Added noexcept to Mirror and Mirrored implementations
src/FoundationClasses/TKMath/gp/gp_Hypr2d.hxx Added noexcept/constexpr to constructors, accessors, and transformation methods
src/FoundationClasses/TKMath/gp/gp_Hypr2d.cxx Added noexcept to Mirror and Mirrored implementations
src/FoundationClasses/TKMath/gp/gp_Elips2d.hxx Added noexcept/constexpr to constructors, accessors, and transformation methods
src/FoundationClasses/TKMath/gp/gp_Elips2d.cxx Added noexcept to Mirror and Mirrored implementations
src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx Added noexcept to Mirror, Mirrored, and Transform methods
src/FoundationClasses/TKMath/gp/gp_Dir2d.cxx Added noexcept to Mirror, Mirrored, and Transform implementations
src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx Added noexcept/constexpr to constructors, accessors, and transformation methods
src/FoundationClasses/TKMath/gp/gp_Circ2d.cxx Added noexcept to Mirror and Mirrored implementations
src/FoundationClasses/TKMath/gp/gp_Ax2d.hxx Added noexcept to Mirror and Mirrored methods
src/FoundationClasses/TKMath/gp/gp_Ax2d.cxx Added noexcept to Mirror and Mirrored implementations
src/FoundationClasses/TKMath/gp/gp_Ax22d.hxx Added noexcept to Mirror, Mirrored, and Transform methods
src/FoundationClasses/TKMath/gp/gp_Ax22d.cxx Added noexcept to Mirror and Mirrored implementations

Comment thread src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx
@dpasukhi dpasukhi merged commit ddffad0 into Open-Cascade-SAS:IR Nov 2, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Nov 2, 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 1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants