Beispiel #1
0
        private void setupControl()
        {
            _wristControl = new FullWristControl();
            _wristControl.setupControl(WristFilesystem.LongBoneNames, false);
            //disable long bones
            for (int i = 10; i < WristFilesystem.NumBones; i++)
            {
                _wristControl.disableBone(i);
            }

            WristPanelLayoutControl p = new WristPanelLayoutControl();

            p.addControl(_wristControl);

            _animationControl = new AnimationControl();
            _animationControl.setupController(_numPositions);
            _animationControl.FPS = DEFAULT_FPS;
            _animationControl.StopButtonEnabled = false;

            p.addControl(_animationControl);

            //save control
            _control = p;

            setupEventListeners();
        }
Beispiel #2
0
        public override void EndFullAnimation()
        {
            //return GUI
            _layoutControl.removeControl(_animationControl);
            if (_positionGraph != null)
            {
                _layoutControl.addControl(_positionGraph);
            }
            _wristControl.changeBackToNormalMode();

            _wristControl.FixedBoneChanged += new FixedBoneChangedHandler(_control_FixedBoneChanged);
            _wristControl.setFixedBone(_fixedBoneIndex); //set back to where we were
            _wristControl.FixedBoneChanged -= new FixedBoneChangedHandler(_control_Animation_FixedBoneChanged);
            _wristControl.ShowHamChanged   -= new ShowHamChangedHandler(_wristControl_ShowHamChanged);

            _animationControl.TrackbarScroll -= new AnimationControl.TrackbarScrollHandler(_animationControl_TrackbarScroll);
            _animationControl.StopClicked    -= new AnimationControl.StopClickedHandler(_animationControl_StopClicked);
            _animationControl.PlayClicked    -= new AnimationControl.PlayClickedHandler(_animationControl_PlayClicked);
            _animationControl.FPSChanged     -= new AnimationControl.FPSChangedHandler(_animationControl_FPSChanged);

            _animationTimer.Tick -= new EventHandler(_animationTimer_Tick);
            _animationTimer.Stop();
            _animationTimer   = null;
            _animationControl = null;

            //reset wrist
            _fullWrist.EndAnimation();
        }
Beispiel #3
0
        private void SetupXrommControl()
        {
            string[] seriesNames = createSeriesListWithNiceNames();
            _layoutControl = new WristPanelLayoutControl();
            _wristControl  = new FullWristControl();
            _wristControl.setupControl(_xrommFileSys.ShortBoneNames, true, seriesNames.Length);
            _layoutControl.addControl(_wristControl);

            _animationControl = new AnimationControl();
            _animationControl.EnableInternalTimer();
            _animationControl.FPS = 10; //default
            _layoutControl.addControl(_animationControl);

            _wristControl.clearSeriesList();
            _wristControl.addToSeriesList(seriesNames);
            _wristControl.selectedSeriesIndex = 0;
        }
Beispiel #4
0
        public FullWristController(ExaminerViewer viewer, string radiusFilename)
        {
            _viewer = viewer;
            setupControl();
            setupControlEventListeners();
            _root       = new Separator();
            _calculator = new BulkCalculator();


            //defaults
            _animationControl = null;
            _FPS             = 15;
            _animateDuration = 0.5;

            //now lets load
            loadFullWrist(radiusFilename);
        }
Beispiel #5
0
        private void startFullAnimation(AnimationCreatorForm acf)
        {
            _acf = acf;
            int[] animationOrder = acf.getAnimationOrder();
            int   numFrames      = acf.NumberStepsPerPositionChange;

            _animationControl = new AnimationControl();
            _layoutControl.addControl(_animationControl);

            int totalNumFrames = numFrames * (animationOrder.Length - 1) + 1;

            _animationControl.setupController(totalNumFrames);
            _animationControl.FPS = 10;

            //little bit of gui stuff
            if (_layoutControl.Contains(_positionGraph))
            {
                _layoutControl.removeControl(_positionGraph);
            }
            _wristControl.changeToAnimationMode();

            int startingFixedBone = (int)WristFilesystem.BIndex.RAD; //default to fixing to the radius...

            //now, lets go and add the switches into place
            SetupWristDistancesForAnimation(startingFixedBone, animationOrder, numFrames, (double)acf.DistanceMapMaximumValue, acf.GetContourDistancesToCalculate(), acf.GetContourColorsToCalculate());
            _fullWrist.SetupWristForAnimation(startingFixedBone, animationOrder, numFrames); //default to radius fixed...
            _fullWrist.SetToAnimationFrame(0);                                               //set us to the first frame

            //redirect change in fixed bone....
            _wristControl.FixedBoneChanged -= new FixedBoneChangedHandler(_control_FixedBoneChanged);
            _wristControl.setFixedBone(startingFixedBone); //do this while no one is listening
            _wristControl.FixedBoneChanged += new FixedBoneChangedHandler(_control_Animation_FixedBoneChanged);
            _wristControl.ShowHamChanged   += new ShowHamChangedHandler(_wristControl_ShowHamChanged);

            _animationControl.TrackbarScroll += new AnimationControl.TrackbarScrollHandler(_animationControl_TrackbarScroll);
            _animationControl.StopClicked    += new AnimationControl.StopClickedHandler(_animationControl_StopClicked);
            _animationControl.PlayClicked    += new AnimationControl.PlayClickedHandler(_animationControl_PlayClicked);
            _animationControl.FPSChanged     += new AnimationControl.FPSChangedHandler(_animationControl_FPSChanged);

            _animationTimer          = new Timer();
            _animationTimer.Tick    += new EventHandler(_animationTimer_Tick);
            _animationTimer.Interval = (int)(1000 / (double)_animationControl.FPS);
        }