Skip to content

[reve] Add ability to sync, save, and restore REveCamera settings#22553

Open
alja wants to merge 9 commits into
root-project:masterfrom
alja:rebasecam3a
Open

[reve] Add ability to sync, save, and restore REveCamera settings#22553
alja wants to merge 9 commits into
root-project:masterfrom
alja:rebasecam3a

Conversation

@alja

@alja alja commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Add ability to set camera type and position at startup time

Example for perspective camera type setting

std::vector<double> v ={0.4932384833540282,-0.8436429067566151,0.21209065141553668,0,0.8632825887052097,0.504720885280599,0,0,-0.10704658134218867,0.18309416659417868,0.977249996460544,0,464.4577842351097,-794.4159435682138,199.71506145179777,1};
eveMng->GetDefaultViewer()->GetCamera()->SetCamTransMtx(v);

Example of orthographic camera type setting

rhoZView->SetCameraType(REX::REveViewer::kCameraOrthoXOY);
std::vector<double> v = {1,0,0,0,0,1,0,0,0,0,1,0,847.215178743559,-309.4143138024666,-946.4074246985799,1};
rhoZView->GetCamera()->SetCamTransMtx(v);
rhoZView->GetCamera()->SetOrthoZoom(0.219);

Add automatic sync of camera position from client

By default, REveViewer syncs camera settings. The terminal printout is the client request to the server.
Below are examples of the client message

Info in <REveManager::ExecuteCommand>: MIR cmd SetCamTransMtxStr("1,0,0,0,0,1,0,0,0,0,1,0,1273.4223148638318,0,0,1,1")
Info in <REveManager::ExecuteCommand>: MIR cmd SetCamTransMtxStr("1,0,0,0,0,1,0,0,0,0,1,0,846.69242824589,0,0,1,1.190299739368571")
Info in <REveManager::ExecuteCommand>: MIR cmd SetCamTransMtxStr("1,0,0,0,0,1,0,0,0,0,1,0,846.69242824589,0,0,1,1.0889595743356195")

One can disable the sync with the call REveViewer::SyncCamera(kFALSE)

Add possibility to change camera type at runtime.

One can choose between camera types at runtime through REveViewer editor.
Screenshot of boxset.C demo:
Screenshot From 2026-06-09 12-43-00

Update RenderCore from 2.0 to 2.1

In RenderCore 2.1 there were minor changes in camera control event dispatch and rendering of REveDigitSet (ZShape material) with directional light.

yuxiaolab and others added 7 commits June 8, 2026 15:12
REveCamera implement

added REveCamera class

implement isEveCameraPerspective

set REveCamera free as an independent class

implement camera on the client side. Also, the hardcoded test matrix is here

hardcoded matrix test

change the paths & env variables

myslef as the author

Remove commented lines with V1, V2

fCamera declaration does not need a comment.

Restore align.

include the REveCamera.hxx header in REveManager.cxx

GetCameraId() replaced with REveCamera* GetCamera() {return fCamera; }

SetCamBaseMtx override with string input

SetCameraByElementId function implement; Set default camera to kCameraPerspXOZ

save camera matrix implemented
alias for backward compatibility

Correction to restore perspective camera

Save and restore camera on reload

Remove obsolete function

Move camera ownership to REveViewer

Hand over copy of trans matrix from REveCamera to REveCameraControl

Add callback from client to set camera type
…tSet and additional signal handling in REveCameraControl
Sync camera changes every 5 seconds
@alja alja requested review from bellenot, dpiparo and linev as code owners June 9, 2026 19:44
@alja

alja commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@linev Please check.

@alja

alja commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@yuxiaolab Please review.

@dpiparo dpiparo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for these changes. Besides the comments left on the code, I would also like to request to re-format the commit messages. If they need to be so many, at least they should respect the https://github.com/root-project/root/blob/master/CONTRIBUTING.md#your-commit

Comment thread graf3d/eve7/inc/ROOT/REveCamera.hxx Outdated
Comment thread graf3d/eve7/inc/ROOT/REveViewer.hxx Outdated
Comment thread graf3d/eve7/inc/ROOT/REveManager.hxx Outdated
Comment thread graf3d/eve7/src/REveCamera.cxx Outdated
return ret;
}

ClassImp(REveCamera); No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing newline

Comment thread graf3d/eve7/src/REveCamera.cxx Outdated
Comment thread graf3d/eve7/src/REveManager.cxx Outdated
Comment thread graf3d/eve7/src/REveViewer.cxx Outdated
return;
}
}
/// Set camera reference by ID, yuxiao

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please remove the username: the git history takes care of the ownership of the code.

Comment thread graf3d/eve7/src/REveViewer.cxx Outdated
@linev linev self-assigned this Jun 10, 2026
@github-actions

Copy link
Copy Markdown

Test Results

    15 files      15 suites   2d 7h 54m 13s ⏱️
 3 840 tests  3 840 ✅ 0 💤 0 ❌
51 528 runs  51 528 ✅ 0 💤 0 ❌

Results for commit 0812db9.

@alja

alja commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@dpiparo Thank you for the corrections.

@linev linev requested a review from dpiparo June 12, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants