feat(4D): Add 4D dynamic volume rendering and new pre-clinical 4d pt/ct mode (#3664)
Co-authored-by: Alireza <ar.sedghi@gmail.com> Co-authored-by: Neil <neil.a.macphee@gmail.com>
This commit is contained in:
200 files changed
+9589
-2178
No files matched your search
@@ -21,13 +21,30 @@ export default function CineProvider({ children, service }) {
|
||||
const { id, frameRate, isPlaying = undefined } = action.payload;
|
||||
const cines = state.cines;
|
||||
|
||||
if (!cines[id]) {
|
||||
cines[id] = { id, ...DEFAULT_CINE };
|
||||
}
|
||||
cines[id].frameRate = frameRate || cines[id].frameRate;
|
||||
cines[id].isPlaying = isPlaying !== undefined ? isPlaying : cines[id].isPlaying;
|
||||
const syncedCineIds = service.getSyncedViewports(id).map(({ viewportId }) => viewportId);
|
||||
const cineIdsToUpdate = [id, ...syncedCineIds].filter(curId => {
|
||||
const currentCine = cines[curId] ?? {};
|
||||
const shouldUpdateFrameRate =
|
||||
currentCine.frameRate !== (frameRate ?? currentCine.frameRate);
|
||||
const shouldUpdateIsPlaying =
|
||||
currentCine.isPlaying !== (isPlaying ?? currentCine.isPlaying);
|
||||
|
||||
return { ...state, ...{ cines } };
|
||||
return shouldUpdateFrameRate || shouldUpdateIsPlaying;
|
||||
});
|
||||
|
||||
cineIdsToUpdate.forEach(currId => {
|
||||
let cine = cines[currId];
|
||||
|
||||
if (!cine) {
|
||||
cine = { id, ...DEFAULT_CINE };
|
||||
cines[currId] = cine;
|
||||
}
|
||||
|
||||
cine.frameRate = frameRate ?? cine.frameRate;
|
||||
cine.isPlaying = isPlaying ?? cine.isPlaying;
|
||||
});
|
||||
|
||||
return { ...state, ...cines };
|
||||
}
|
||||
case 'SET_IS_CINE_ENABLED': {
|
||||
return { ...state, ...{ isCineEnabled: action.payload } };
|
||||
|
||||
Reference in new issue
Block a user