コード例 #1
0
ファイル: ResliceToolGroup.cs プロジェクト: bangush/server-1
        protected override IEnumerable <MprViewerTool> CreateTools()
        {
            int index = 0;

            if (this.ImageViewer == null)
            {
                yield break;
            }

            // create one instance of the slave tool for each mutable slice set
            foreach (IMprVolume volume in this.ImageViewer.Volumes)
            {
                foreach (IMprSliceSet sliceSet in volume.SliceSets)
                {
                    IMprStandardSliceSet standardSliceSet = sliceSet as IMprStandardSliceSet;
                    if (standardSliceSet != null && !standardSliceSet.IsReadOnly)
                    {
                        ResliceTool tool = new ResliceTool(this);
                        tool.SliceSet    = standardSliceSet;
                        tool.HotColor    = _colors[index, 0];
                        tool.NormalColor = _colors[index, 1];
                        index            = (index + 1) % _colors.Length;            // advance to next color
                        yield return(tool);
                    }
                }
            }
        }
コード例 #2
0
            protected override void Dispose(bool disposing)
            {
                _owner               = null;
                _lineGraphic         = null;
                _sliceControlGraphic = null;
                _stateControlGraphic = null;

                base.Dispose(disposing);
            }
コード例 #3
0
ファイル: ResliceToolGraphic.cs プロジェクト: nhannd/Xian
			protected override void Dispose(bool disposing)
			{
				_owner = null;
				_lineGraphic = null;
				_sliceControlGraphic = null;
				_stateControlGraphic = null;

				base.Dispose(disposing);
			}
コード例 #4
0
ファイル: ResliceToolGroup.cs プロジェクト: bangush/server-1
        protected override void OnToolSelected(MprViewerTool tool)
        {
            base.OnToolSelected(tool);
            _lastSelectedTool = (ResliceTool)tool;

            if (_lastSelectedTool == null)
            {
                base.TooltipPrefix = SR.ToolbarReslice;
            }
            else
            {
                base.TooltipPrefix = _lastSelectedTool.Label;
            }
        }
コード例 #5
0
ファイル: ResliceToolGraphic.cs プロジェクト: nhannd/Xian
			public ResliceToolGraphic(ResliceTool owner)
			{
				LineGraphic lineGraphic = new LineGraphic();
				MprMoveControlGraphic moveControlGraphic = new MprMoveControlGraphic(lineGraphic);
				moveControlGraphic.UndoableOperationStart += OnControlGraphicUndoableOperationStart;
				moveControlGraphic.UndoableOperationStop += OnControlGraphicUndoableOperationStop;
				moveControlGraphic.UndoableOperationCancel += OnControlGraphicUndoableOperationCancel;
				MprLineStretchControlGraphic lineControlGraphic = new MprLineStretchControlGraphic(moveControlGraphic);
				lineControlGraphic.UndoableOperationStart += OnControlGraphicUndoableOperationStart;
				lineControlGraphic.UndoableOperationStop += OnControlGraphicUndoableOperationStop;
				lineControlGraphic.UndoableOperationCancel += OnControlGraphicUndoableOperationCancel;
				SliceControlGraphic sliceControlGraphic = new SliceControlGraphic(lineControlGraphic, this);
				StandardStatefulGraphic statefulGraphic = new StandardStatefulGraphic(sliceControlGraphic);
				statefulGraphic.State = statefulGraphic.CreateInactiveState();
				base.Graphics.Add(statefulGraphic);

				_stateControlGraphic = statefulGraphic;
				_sliceControlGraphic = sliceControlGraphic;
				_lineGraphic = lineGraphic;
				_owner = owner;
			}
コード例 #6
0
            public ResliceToolGraphic(ResliceTool owner)
            {
                LineGraphic           lineGraphic        = new LineGraphic();
                MprMoveControlGraphic moveControlGraphic = new MprMoveControlGraphic(lineGraphic);

                moveControlGraphic.UndoableOperationStart  += OnControlGraphicUndoableOperationStart;
                moveControlGraphic.UndoableOperationStop   += OnControlGraphicUndoableOperationStop;
                moveControlGraphic.UndoableOperationCancel += OnControlGraphicUndoableOperationCancel;
                MprLineStretchControlGraphic lineControlGraphic = new MprLineStretchControlGraphic(moveControlGraphic);

                lineControlGraphic.UndoableOperationStart  += OnControlGraphicUndoableOperationStart;
                lineControlGraphic.UndoableOperationStop   += OnControlGraphicUndoableOperationStop;
                lineControlGraphic.UndoableOperationCancel += OnControlGraphicUndoableOperationCancel;
                SliceControlGraphic     sliceControlGraphic = new SliceControlGraphic(lineControlGraphic, this);
                StandardStatefulGraphic statefulGraphic     = new StandardStatefulGraphic(sliceControlGraphic);

                statefulGraphic.State = statefulGraphic.CreateInactiveState();
                base.Graphics.Add(statefulGraphic);

                _stateControlGraphic = statefulGraphic;
                _sliceControlGraphic = sliceControlGraphic;
                _lineGraphic         = lineGraphic;
                _owner = owner;
            }