Skip to content

Foundation Classes, gp - Mark geometry APIs noexcept/constexpr#798

Merged
dpasukhi merged 4 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:gp_geom_3d_constexpe_noexcept
Nov 3, 2025
Merged

Foundation Classes, gp - Mark geometry APIs noexcept/constexpr#798
dpasukhi merged 4 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:gp_geom_3d_constexpe_noexcept

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

@dpasukhi dpasukhi commented Nov 2, 2025

  • Add noexcept to many small mutating and non-throwing methods (Mirror, Mirrored, SetMirror, SetTranslationPart, etc.) across gp classes.
  • Annotate trivial getters, translators and small computations as constexpr where applicable (SetLocation/SetPosition, Area/Length/Radius/Volume, Axis/Location/Position accessors, Translate helpers).
  • Update headers and source files to improve noexcept/constexpr conformance for gp geometry and math types, enabling better optimization and stronger exception-safety guarantees.

- Add noexcept to many small mutating and non-throwing methods (Mirror, Mirrored, SetMirror, SetTranslationPart, etc.) across gp classes.
- Annotate trivial getters, translators and small computations as constexpr where applicable (SetLocation/SetPosition, Area/Length/Radius/Volume, Axis/Location/Position accessors, Translate helpers).
- Update headers and source files to improve noexcept/constexpr conformance for gp geometry and math types, enabling better optimization and stronger exception-safety guarantees.
@dpasukhi dpasukhi added this to the Release 8.0 milestone Nov 2, 2025
@dpasukhi dpasukhi requested a review from Copilot November 2, 2025 22:54
@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 exception-safety and compile-time optimization capabilities of the gp (geometry package) foundation classes by systematically adding noexcept and constexpr specifiers to appropriate methods.

Key Changes:

  • Added noexcept to non-throwing transformation methods (Mirror/Mirrored) across geometry classes
  • Added constexpr to trivial setters, getters, and computational methods where applicable
  • Marked simple translation and position-setting operations as constexpr for compile-time evaluation

Reviewed Changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.

Show a summary per file
File Description
gp_Vec.hxx/cxx Added noexcept to Mirror/Mirrored methods
gp_Trsf.hxx/cxx Added noexcept to SetMirror/SetTranslationPart, constexpr to SetTranslation
gp_Torus.hxx/cxx Added constexpr to setters/getters, noexcept to Mirror/Translate methods
gp_Sphere.hxx/cxx Added constexpr to setters/getters/Area/Volume, noexcept to Mirror/Translate
gp_Pnt.hxx/cxx Added noexcept to all Mirror/Mirrored methods
gp_Pln.hxx/cxx Added constexpr to setters/getters, noexcept to Mirror/Distance methods
gp_Parab.hxx/cxx Added constexpr to setters/getters, noexcept to Mirror/Translate methods
gp_Mat.hxx/cxx Added noexcept to SetDot method
gp_Lin.hxx/cxx Added constexpr to setters/getters, noexcept to Mirror/Distance methods
gp_Hypr.hxx/cxx Added constexpr to setters/getters, noexcept to Mirror/Translate methods
gp_Elips.hxx/cxx Added constexpr to setters/getters/Area, noexcept to Mirror/Translate
gp_Dir.hxx/cxx Added noexcept to all Mirror/Mirrored methods
gp_Cylinder.hxx/cxx Added constexpr to setters/getters, noexcept to Mirror/Translate methods
gp_Cone.hxx/cxx Added constexpr to setters/getters, noexcept to Mirror/Translate methods
gp_Circ.hxx/cxx Added constexpr to setters/getters/Area/Length, noexcept to Mirror/Translate
gp_Ax3.hxx/cxx Added noexcept to all Mirror/Mirrored methods
gp_Ax2.hxx/cxx Added noexcept to Mirror/Mirrored methods
gp_Ax1.hxx/cxx Added noexcept to all Mirror/Mirrored methods

…lax Direct()

Mark UReverse and VReverse as constexpr noexcept in gp_Cone, gp_Cylinder, gp_Pln, gp_Sphere and gp_Torus to allow compile-time evaluation and better optimization. Remove constexpr/noexcept from Direct() wrappers so their signature matches the underlying gp_Ax3::Direct() implementation.
@dpasukhi dpasukhi merged commit d98f74d into Open-Cascade-SAS:IR Nov 3, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Nov 3, 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