Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Feb 17, 2025
1 parent e7a9bc3 commit 394a43a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ApplicationLibCode/ProjectDataModel/Rim3dView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,8 @@ void Rim3dView::setupBeforeSave()
{
if ( m_viewer )
{
// The update of these fields is also done in cameraPosition() and cameraPointOfInterest(). When the
// project is saved to file, these functions are not used, so we need to update the fields here.
m_cameraPosition = m_viewer->mainCamera()->viewMatrix();
m_cameraPointOfInterest = m_viewer->pointOfInterest();
}
Expand Down
4 changes: 3 additions & 1 deletion ApplicationLibCode/ProjectDataModel/Rim3dView.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ class Rim3dView : public RimViewWindow, public RiuViewerToViewInterface, public
caf::PdmField<bool> m_showZScaleLabel;
caf::PdmPtrField<Rim3dView*> m_comparisonView;

// Camera
// Camera position and point of interest. The member variables are mutable to allow for setting them from const methods.
// The camera position and point of interest can change rapidly as the user interacts with the 3D view. Only update the Pdm field values
// when the application requests the camera position or point of interest.
mutable caf::PdmField<cvf::Mat4d> m_cameraPosition;
mutable caf::PdmField<cvf::Vec3d> m_cameraPointOfInterest;
caf::PdmProxyValueField<cvf::Vec3d> m_cameraPointOfInterestProxy;
Expand Down

0 comments on commit 394a43a

Please sign in to comment.