Skip to content

[Core] Merge Context into BaseContext - #6266

Open
damienmarchal wants to merge 11 commits into
sofa-framework:masterfrom
CRIStAL-PADR:pr-merge-context-basecontext
Open

[Core] Merge Context into BaseContext#6266
damienmarchal wants to merge 11 commits into
sofa-framework:masterfrom
CRIStAL-PADR:pr-merge-context-basecontext

Conversation

@damienmarchal

@damienmarchal damienmarchal commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The Context class is the only implementation of BaseContext.
This extra layer is probably over-engineered, so I merge the two.
Ideally BaseContext should have been merged down into Context.... but given that it would generate a huge amount of code change I prefer to merge Context up in BaseContext.

[ci-depends-on https://github.com/sofa-framework/SofaPython3/pull/636]

[with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

damienmarchal and others added 2 commits August 27, 2026 15:49
- BaseContext is now a concrete class with Data members (is_activated, worldGravity_,
  dt_, time_, animate_, d_isSleeping, d_canChangeSleepingState)
- All Context methods implemented in BaseContext
- Node now inherits directly from BaseNode and BaseContext (instead of Context)
- Context class kept as compatibility layer, inheriting from BaseContext
- Updated includes in Contact.h, UniformMass.inl, VisualStyle.cpp, Main.cpp
- Fixed casts in Node.cpp to use BaseContext instead of Context

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@damienmarchal damienmarchal added pr: status to review To notify reviewers to review this pull-request pr: refactoring Refactor code labels Aug 27, 2026
@damienmarchal damienmarchal added the pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI label Aug 27, 2026
@damienmarchal damienmarchal changed the title Merge Context into BaseContext [CORE] Merge Context into BaseContext Aug 27, 2026
@damienmarchal damienmarchal added the pr: breaking Change possibly inducing a compilation error label Aug 27, 2026
@damienmarchal damienmarchal changed the title [CORE] Merge Context into BaseContext [Core] Merge Context into BaseContext Aug 27, 2026
Comment thread Sofa/framework/Core/src/sofa/core/objectmodel/Context.h Outdated
@damienmarchal damienmarchal added pr: status to review To notify reviewers to review this pull-request and removed pr: status to review To notify reviewers to review this pull-request labels Sep 2, 2026
@damienmarchal damienmarchal reopened this Sep 2, 2026
@sofabot

sofabot commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #5.

To unlock the merge button, you must

@sofabot

sofabot commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #6.

To unlock the merge button, you must

@damienmarchal

Copy link
Copy Markdown
Contributor Author

Beware, sadly the PR does not compile on windows (on linux/clang it is ok), this is caused by a subtle problem related to a circular include dependency between BaseComponent and BaseContext.
BaseComponent need the full definition of BaseContext to provide the default implemetation of the create static metho
BaseContext needs BaseComponent's because the addObject method is going through a sptr which rely in intrusive_ptr, which imply intrusion in BaseComponent.

I'm not sure I will be able to fix that, any idea welcome.

@sofabot

sofabot commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #7.

To unlock the merge button, you must

@sofabot

sofabot commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #8.

To unlock the merge button, you must

Comment thread Sofa/framework/Core/src/sofa/core/objectmodel/Context.h Outdated
Comment thread Sofa/framework/Core/src/sofa/core/objectmodel/Context.h
@alxbilger

Copy link
Copy Markdown
Contributor

[ci-build][with-all-tests]

@sofabot

sofabot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #9.

To unlock the merge button, you must

Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
@sofabot

sofabot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #10.

To unlock the merge button, you must

@sofabot

sofabot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #11.

To unlock the merge button, you must

@fredroy

fredroy commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

[ci-build][with-all-tests]

@sofabot

sofabot commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #12.

To unlock the merge button, you must

Comment thread Sofa/framework/Core/src/sofa/core/objectmodel/Context.h Outdated
@sofabot

sofabot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #13.

To unlock the merge button, you must

Comment thread Sofa/framework/Core/src/sofa/core/objectmodel/Context.h
Co-authored-by: Frederick Roy <fredroy@users.noreply.github.com>
@sofabot

sofabot commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

[ci-depends-on] detected during build #14.

To unlock the merge button, you must

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: AI-aided Label notifying the reviewers that part or all of the PR has been generated with the help of an AI pr: breaking Change possibly inducing a compilation error pr: refactoring Refactor code pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants