diff --git a/js/bloch-sphere/view/BlochSphereMeasurementArea.ts b/js/bloch-sphere/view/BlochSphereMeasurementArea.ts index 65b13fb..af9fa46 100644 --- a/js/bloch-sphere/view/BlochSphereMeasurementArea.ts +++ b/js/bloch-sphere/view/BlochSphereMeasurementArea.ts @@ -57,11 +57,31 @@ export default class BlochSphereMeasurementArea extends Node { drawTitle: false, drawKets: false, drawAngleIndicators: true, - centerX: magneticFieldNode.centerX, - centerY: magneticFieldNode.centerY + center: magneticFieldNode.center, + visibleProperty: model.isSingleMeasurementModeProperty } ); this.addChild( singleMeasurementBlochSphereNode ); + const multipleMeasurementBlochSpheresTandem = providedOptions.tandem.createTandem( 'multipleMeasurementBlochSpheres' ); + const multipleMeasurementBlochSpheresNode = new Node( { + visibleProperty: DerivedProperty.not( model.isSingleMeasurementModeProperty ) + } ); + const blochSpheresSpacing = 70; + model.multiMeasurementBlochSpheres.forEach( ( blochSphere, index ) => { + const blochSphereNode = new BlochSphereNode( blochSphere, { + tandem: multipleMeasurementBlochSpheresTandem.createTandem( `blochSphere${index}` ), + scale: 0.3, + drawTitle: false, + drawKets: false, + drawAngleIndicators: true, + centerX: index !== 9 ? ( ( index + 1 ) % 3 ) * blochSpheresSpacing : blochSpheresSpacing, + centerY: Math.floor( index / 3 ) * blochSpheresSpacing + } ); + multipleMeasurementBlochSpheresNode.addChild( blochSphereNode ); + } ); + multipleMeasurementBlochSpheresNode.center = magneticFieldNode.center.plusXY( 0, 30 ); + this.addChild( multipleMeasurementBlochSpheresNode ); + const spinUpLabelStringProperty = new DerivedStringProperty( [ model.measurementBasisProperty ], measurementBasis => measurementBasis.label.value + QuantumMeasurementConstants.SPIN_UP_ARROW_CHARACTER