@@ -30,20 +30,21 @@ package sc.iview.commands.edit
30
30
31
31
import graphics.scenery.*
32
32
import graphics.scenery.attribute.material.HasMaterial
33
- import net.imagej.lut.LUTService
34
33
import okio.withLock
35
34
import org.joml.Quaternionf
36
35
import org.joml.Vector3f
37
36
import org.scijava.command.Command
38
37
import org.scijava.plugin.Parameter
39
38
import org.scijava.plugin.Plugin
40
- import org.scijava.ui.UIService
41
39
import org.scijava.util.ColorRGB
42
40
import org.scijava.widget.ChoiceWidget
43
41
import org.scijava.widget.NumberWidget
44
42
import sc.iview.event.NodeChangedEvent
45
43
import java.util.*
46
44
45
+ const val GROUP_NAME_BASIC = " group:Basic Properties"
46
+ const val GROUP_NAME_ROTATION = " group:Rotation & Scaling"
47
+
47
48
/* *
48
49
* A command for interactively editing a node's properties.
49
50
*
@@ -54,52 +55,45 @@ import java.util.*
54
55
*/
55
56
@Plugin(type = Command ::class , initializer = " updateCommandFields" , visible = false )
56
57
class BasicProperties : InspectorInteractiveCommand () {
57
- @Parameter
58
- private lateinit var uiSrv: UIService
59
-
60
- @Parameter
61
- private lateinit var lutService: LUTService
62
-
63
58
/* Basic properties */
64
59
65
60
@Parameter(required = false , style = ChoiceWidget .LIST_BOX_STYLE , callback = " refreshSceneNodeInDialog" )
66
61
private val sceneNode: String? = null
67
62
68
- @Parameter(label = " Visible" , callback = " updateNodeProperties" , style = " group:Basic " )
63
+ @Parameter(label = " Visible" , callback = " updateNodeProperties" , style = GROUP_NAME_BASIC )
69
64
private var visible = false
70
65
71
- @Parameter(label = " Color" , required = false , callback = " updateNodeProperties" , style = " group:Basic " )
72
- private var colour : ColorRGB ? = null
66
+ @Parameter(label = " Color" , required = false , callback = " updateNodeProperties" , style = GROUP_NAME_BASIC )
67
+ private var color : ColorRGB ? = null
73
68
74
- @Parameter(label = " Name" , callback = " updateNodeProperties" , style = " group:Basic " )
69
+ @Parameter(label = " Name" , callback = " updateNodeProperties" , style = GROUP_NAME_BASIC )
75
70
private var name: String = " "
76
71
77
- @Parameter(label = " Position X" , style = NumberWidget .SPINNER_STYLE + " ,group:Basic " + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
72
+ @Parameter(label = " Position X" , style = NumberWidget .SPINNER_STYLE + " ," + GROUP_NAME_BASIC + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
78
73
private var positionX = 0f
79
74
80
- @Parameter(label = " Position Y" , style = NumberWidget .SPINNER_STYLE + " ,group:Basic " + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
75
+ @Parameter(label = " Position Y" , style = NumberWidget .SPINNER_STYLE + " ," + GROUP_NAME_BASIC + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
81
76
private var positionY = 0f
82
77
83
- @Parameter(label = " Position Z" , style = NumberWidget .SPINNER_STYLE + " ,group:Basic " + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
78
+ @Parameter(label = " Position Z" , style = NumberWidget .SPINNER_STYLE + " ," + GROUP_NAME_BASIC + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
84
79
private var positionZ = 0f
85
80
86
-
87
- @Parameter(label = " [Rotation & Scaling]Scale X" , style = NumberWidget .SPINNER_STYLE + " group:Rotation & Scaling" + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
81
+ @Parameter(label = " Scale X" , style = NumberWidget .SPINNER_STYLE + GROUP_NAME_ROTATION + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
88
82
private var scaleX = 1f
89
83
90
- @Parameter(label = " [Rotation & Scaling] Scale Y" , style = NumberWidget .SPINNER_STYLE + " group:Rotation & Scaling " + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
84
+ @Parameter(label = " Scale Y" , style = NumberWidget .SPINNER_STYLE + GROUP_NAME_ROTATION + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
91
85
private var scaleY = 1f
92
86
93
- @Parameter(label = " [Rotation & Scaling] Scale Z" , style = NumberWidget .SPINNER_STYLE + " group:Rotation & Scaling " + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
87
+ @Parameter(label = " Scale Z" , style = NumberWidget .SPINNER_STYLE + GROUP_NAME_ROTATION + " ,format:0.000" , stepSize = " 0.1" , callback = " updateNodeProperties" )
94
88
private var scaleZ = 1f
95
89
96
- @Parameter(label = " [ Rotation & Scaling]Rotation Phi" , style = NumberWidget .SPINNER_STYLE + " group:Rotation & Scaling " + " ,format:0.000" , min = PI_NEG , max = PI_POS , stepSize = " 0.01" , callback = " updateNodeProperties" )
90
+ @Parameter(label = " Rotation Phi" , style = NumberWidget .SPINNER_STYLE + GROUP_NAME_ROTATION + " ,format:0.000" , min = PI_NEG , max = PI_POS , stepSize = " 0.01" , callback = " updateNodeProperties" )
97
91
private var rotationPhi = 0f
98
92
99
- @Parameter(label = " [ Rotation & Scaling]Rotation Theta" , style = NumberWidget .SPINNER_STYLE + " group:Rotation & Scaling " + " ,format:0.000" , min = PI_NEG , max = PI_POS , stepSize = " 0.01" , callback = " updateNodeProperties" )
93
+ @Parameter(label = " Rotation Theta" , style = NumberWidget .SPINNER_STYLE + GROUP_NAME_ROTATION + " ,format:0.000" , min = PI_NEG , max = PI_POS , stepSize = " 0.01" , callback = " updateNodeProperties" )
100
94
private var rotationTheta = 0f
101
95
102
- @Parameter(label = " [ Rotation & Scaling]Rotation Psi" , style = NumberWidget .SPINNER_STYLE + " group:Rotation & Scaling " + " ,format:0.000" , min = PI_NEG , max = PI_POS , stepSize = " 0.01" , callback = " updateNodeProperties" )
96
+ @Parameter(label = " Rotation Psi" , style = NumberWidget .SPINNER_STYLE + GROUP_NAME_ROTATION + " ,format:0.000" , min = PI_NEG , max = PI_POS , stepSize = " 0.01" , callback = " updateNodeProperties" )
103
97
private var rotationPsi = 0f
104
98
105
99
@@ -168,7 +162,7 @@ class BasicProperties : InspectorInteractiveCommand() {
168
162
else -> Vector3f (0.5f )
169
163
}
170
164
171
- colour = ColorRGB (
165
+ color = ColorRGB (
172
166
(colourVector[0 ] * 255 ).toInt(), //
173
167
(colourVector[1 ] * 255 ).toInt(), //
174
168
(colourVector[2 ] * 255 ).toInt()
@@ -209,9 +203,9 @@ class BasicProperties : InspectorInteractiveCommand() {
209
203
210
204
// update colour
211
205
val cVector = Vector3f (
212
- colour !! .red / 255f ,
213
- colour !! .green / 255f ,
214
- colour !! .blue / 255f
206
+ color !! .red / 255f ,
207
+ color !! .green / 255f ,
208
+ color !! .blue / 255f
215
209
)
216
210
if (node is PointLight ) {
217
211
node.emissionColor = cVector
0 commit comments