Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
e853895a
Unverified
Commit
e853895a
authored
1 year ago
by
xgui3783
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1396 from FZJ-INM1-BDA/feat_keyFrameNg
feat: auto rotate support for ng
parents
a7c0f124
d8ddbc21
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/releases/v2.12.5.md
+2
-0
2 additions, 0 deletions
docs/releases/v2.12.5.md
src/main.module.ts
+8
-2
8 additions, 2 deletions
src/main.module.ts
src/viewerModule/nehuba/nehubaViewer/nehubaViewer.component.ts
+51
-1
51 additions, 1 deletion
...iewerModule/nehuba/nehubaViewer/nehubaViewer.component.ts
with
61 additions
and
3 deletions
docs/releases/v2.12.5.md
+
2
−
0
View file @
e853895a
...
...
@@ -4,3 +4,5 @@
-
enable connectivity for Julich Brain v3
-
added version inspector in UI
-
(experimental) add keyframe support for NG viewer
-
allow experimental flag to be toggled via
`setExperimentalFlag`
global method
This diff is collapsed.
Click to expand it.
src/main.module.ts
+
8
−
2
View file @
e853895a
...
...
@@ -41,6 +41,7 @@ import {
atlasSelection
,
RootStoreModule
,
getStoreEffects
,
userPreference
,
}
from
"
./state
"
import
{
DARKTHEME
}
from
'
./util/injectionTokens
'
;
import
{
map
}
from
'
rxjs/operators
'
;
...
...
@@ -173,12 +174,17 @@ import { ViewerCommonEffects } from './viewerModule';
},
{
provide
:
APP_INITIALIZER
,
useFactory
:
(
authSvc
:
AuthService
)
=>
{
useFactory
:
(
authSvc
:
AuthService
,
store
:
Store
)
=>
{
window
[
'
setExperimentalFlag
'
]
=
(
flag
:
boolean
)
=>
{
store
.
dispatch
(
userPreference
.
actions
.
setShowExperimental
({
flag
}))
}
authSvc
.
authReloadState
()
return
()
=>
Promise
.
resolve
()
},
multi
:
true
,
deps
:
[
AuthService
]
deps
:
[
AuthService
,
Store
]
}
],
bootstrap
:
[
...
...
This diff is collapsed.
Click to expand it.
src/viewerModule/nehuba/nehubaViewer/nehubaViewer.component.ts
+
51
−
1
View file @
e853895a
...
...
@@ -2,7 +2,7 @@ import { Component, ElementRef, EventEmitter, OnDestroy, Output, Inject, Optiona
import
{
Subscription
,
BehaviorSubject
,
Observable
,
Subject
,
of
,
interval
,
combineLatest
}
from
'
rxjs
'
import
{
debounceTime
,
filter
,
scan
,
switchMap
,
take
,
distinctUntilChanged
,
debounce
,
map
}
from
"
rxjs/operators
"
;
import
{
LoggingService
}
from
"
src/logging
"
;
import
{
bufferUntil
,
getExportNehuba
,
switchMapWaitFor
}
from
"
src/util/fn
"
;
import
{
bufferUntil
,
getExportNehuba
,
getUuid
,
switchMapWaitFor
}
from
"
src/util/fn
"
;
import
{
deserializeSegment
,
NEHUBA_INSTANCE_INJTKN
}
from
"
../util
"
;
import
{
arrayOrderedEql
,
rgbToHex
}
from
'
common/util
'
import
{
IMeshesToLoad
,
SET_MESHES_TO_LOAD
,
PERSPECTIVE_ZOOM_FUDGE_FACTOR
}
from
"
../constants
"
;
...
...
@@ -14,6 +14,7 @@ import { IColorMap, SET_COLORMAP_OBS, SET_LAYER_VISIBILITY } from "../layerCtrl.
import
{
INgLayerCtrl
,
NG_LAYER_CONTROL
,
SET_SEGMENT_VISIBILITY
,
TNgLayerCtrl
,
Z_TRAVERSAL_MULTIPLIER
}
from
"
../layerCtrl.service/layerCtrl.util
"
;
import
{
NgCoordinateSpace
,
Unit
}
from
"
../types
"
;
import
{
PeriodicSvc
}
from
"
src/util/periodic.service
"
;
import
{
ViewerInternalStateSvc
,
AUTO_ROTATE
}
from
"
src/viewerModule/viewerInternalState.service
"
;
function
translateUnit
(
unit
:
Unit
)
{
if
(
unit
===
"
m
"
)
{
...
...
@@ -130,6 +131,7 @@ export class NehubaViewerUnit implements OnDestroy {
@
Optional
()
@
Inject
(
SET_SEGMENT_VISIBILITY
)
private
segVis$
:
Observable
<
string
[]
>
,
@
Optional
()
@
Inject
(
NG_LAYER_CONTROL
)
private
layerCtrl$
:
Observable
<
TNgLayerCtrl
<
keyof
INgLayerCtrl
>>
,
@
Optional
()
@
Inject
(
Z_TRAVERSAL_MULTIPLIER
)
multiplier$
:
Observable
<
number
>
,
@
Optional
()
intViewerStateSvc
:
ViewerInternalStateSvc
,
)
{
if
(
multiplier$
)
{
this
.
ondestroySubscriptions
.
push
(
...
...
@@ -139,6 +141,54 @@ export class NehubaViewerUnit implements OnDestroy {
this
.
multplier
[
0
]
=
1
}
if
(
intViewerStateSvc
)
{
let
raqRef
:
number
const
{
done
,
next
,
}
=
intViewerStateSvc
.
registerEmitter
({
"
@type
"
:
"
TViewerInternalStateEmitter
"
,
viewerType
:
"
nehuba
"
,
applyState
:
arg
=>
{
if
(
arg
.
viewerType
===
AUTO_ROTATE
)
{
if
(
raqRef
)
{
cancelAnimationFrame
(
raqRef
)
}
const
autoPlayFlag
=
(
arg
.
payload
as
any
).
play
const
reverseFlag
=
(
arg
.
payload
as
any
).
reverse
const
autoplaySpeed
=
(
arg
.
payload
as
any
).
speed
if
(
!
autoPlayFlag
)
{
return
}
const
deg
=
(
reverseFlag
?
1
:
-
1
)
*
autoplaySpeed
*
1
e
-
3
const
animate
=
()
=>
{
raqRef
=
requestAnimationFrame
(()
=>
{
animate
()
})
const
perspectivePose
=
this
.
nehubaViewer
?.
ngviewer
?.
perspectiveNavigationState
?.
pose
if
(
!
perspectivePose
)
{
return
}
perspectivePose
.
rotateAbsolute
([
0
,
0
,
1
],
deg
,
[
0
,
0
,
0
])
}
animate
()
return
}
}
})
this
.
onDestroyCb
.
push
(()
=>
done
())
next
({
"
@id
"
:
getUuid
(),
'
@type
'
:
"
TViewerInternalStateEmitterEvent
"
,
viewerType
:
"
nehuba
"
,
payload
:
{}
})
}
if
(
this
.
nehubaViewer$
)
{
this
.
nehubaViewer$
.
next
(
this
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment