public static Types GetTypeOfControllerForFile(string[] filenames) { //Check if this is a full wrist and if we should load as such if (WristFilesystem.isRadius(filenames)) { string msg = "It looks like you are trying to open a radius.\n\nDo you wish to load the entire wrist?"; if (DialogResult.Yes == MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { return(Types.FullWrist); } } if (XrommFilesystem.IsXrommFile(filenames)) //then we are in XROMM mode { string msg = "It looks like you are trying to open an XROMM model.\n\nDo you wish to load the entire model?"; if (DialogResult.Yes == MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { return(Types.Xromm); } } if (PosViewController.IsPosViewFile(filenames)) { return(Types.PosView); } return(Types.Sceneviewer); }
private static int[] GetPositionIndexes(WristFilesystem wrist, string[] positionNames) { int[] indices = new int[positionNames.Length]; for (int i = 0; i < positionNames.Length; i++) { indices[i] = wrist.getSeriesIndexFromName(positionNames[i]); } return(indices); }
private void ReadInJobFromOption() { PreliminaryValidation(_options); _side = WristFilesystem.GetSideFromString(_options.SideString); _wrist = new WristFilesystem(WristFilesystem.findRadius(_options.Subject, _side)); _fullWrist = new FullWrist(_wrist); _refBoneIndex = _options.GetReferenceBoneIndex(); _testBoneIndex = _options.GetTestBoneIndex(); //int fixedBoneIndex = options.GetFixedBoneIndex(); _positionList = GetPositionIndexes(_wrist, _options.GetPositionNames()); _cDistances = _options.GetCoutourDistances(); _cAreas = _options.GetTargetContourAreas(); }
private void loadFullWrist(string radiusFilename) { //TODO: ShowFullWristControlBox //TODO: Block viewSource //First Try and load the wrist data _wrist = new WristFilesystem(); _wrist.setupWrist(radiusFilename); _fullWrist = new FullWrist(_wrist); _fullWrist.LoadFullJoint(); _root = _fullWrist.Root; populateSeriesList(); //TODO? //catch (ArgumentException ex) //{ // if (_showErrors) // { // string msg = "Error loading wrist kinematics.\n\n" + ex.Message; // //TODO: Change to abort,retry, and find way of cancelling load // libWrist.ExceptionHandling.HandledExceptionManager.ShowDialog(msg, "", "", ex); // } // for (int i = 0; i < Wrist.NumBones; i++) // _wristControl.disableFixingBone(i); //} //disable invalid bones! for (int i = 0; i < WristFilesystem.NumBones; i++) { if (!_fullWrist.Bones[i].IsValidBone) { _wristControl.disableBone(i); } } setupPositionGraphIfPossible(8); //hardcoded default reference bone to the Capitate }