-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Refactor responsibilities of backend and state
The backend should not hold on to the source. Instead, it should create it on demand. WIP because of weird compilation error.
- Loading branch information
1 parent
a6f5aa8
commit 7c5c5e9
Showing
18 changed files
with
312 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletion
10
src/main/kotlin/org/janelia/saalfeldlab/paintera/state/SourceStateBackend.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
package org.janelia.saalfeldlab.paintera.state | ||
|
||
import bdv.util.volatiles.SharedQueue | ||
import javafx.scene.Node | ||
import org.janelia.saalfeldlab.paintera.data.DataSource | ||
|
||
interface SourceStateBackend<D, T> { | ||
|
||
val source: DataSource<D, T> | ||
fun createSource( | ||
queue: SharedQueue, | ||
priority: Int, | ||
name: String, | ||
resolution: DoubleArray = doubleArrayOf(1.0, 1.0, 1.0), | ||
offset: DoubleArray = doubleArrayOf(1.0, 1.0, 1.0)): DataSource<D, T> | ||
|
||
fun createMetaDataNode(): Node | ||
|
||
val defaultSourceName: String | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
src/main/kotlin/org/janelia/saalfeldlab/paintera/state/channel/ConnectomicsChannelBackend.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
package org.janelia.saalfeldlab.paintera.state.channel | ||
|
||
import bdv.util.volatiles.SharedQueue | ||
import org.janelia.saalfeldlab.paintera.data.ChannelDataSource | ||
import org.janelia.saalfeldlab.paintera.state.SourceStateBackend | ||
|
||
interface ConnectomicsChannelBackend<D, T> : SourceStateBackend<D, T> { | ||
override val source: ChannelDataSource<D, T> | ||
|
||
val channelSelection: IntArray | ||
val channelIndex: Int | ||
val numChannels: Int | ||
get() = channelSelection.size | ||
|
||
override fun createSource( | ||
queue: SharedQueue, | ||
priority: Int, | ||
name: String, | ||
resolution: DoubleArray, | ||
offset: DoubleArray): ChannelDataSource<D, T> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7c5c5e9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The weird Kotlin compilation error is probably caused by any subset of
ConnectomicsLabelState
ConnectomicsChannelState
ConnectomcisRawState