Page MenuHomec4science

JOINT_CONE_TOOL_main_file.m
No OneTemporary

File Metadata

Created
Wed, Sep 4, 21:16

JOINT_CONE_TOOL_main_file.m

%--------------------------------------------------------------------------
%
% EPFL - LA - LBO SHOULDER MODEL
% Created by : David Ingram (LA - EPFL)
%
% GUI FOR RUNNING THE JOINT SINUS CONE TOOL
%--------------------------------------------------------------------------
%
% File Description :
% This file creates a GUI which allows the used to modify the joint sinus
% cones of the model. These cones are not used for now but could be in the
% future to limit the joint angles.
%
%--------------------------------------------------------------------------
%
% File Structure :
% The GUI figure is created in MHandle. The pushbuttons are defined next,
% followed by the initialisation script. All the GUI control structures are
% contained in JGUIHandle. The axis is called JointVisualisationAxes.
% All the graphics are contained in a single strucure : JCPlotHandles.
%
%--------------------------------------------------------------------------
%
% Contents of the Interactive GUI structure :
% PushButton Section
% JGUIHandle.Close_Button
% JGUIHandle.Save_Visualisation_Button
% JGUIHandle.Reset_Button
%
% SC Cone Items
% JGUIHandle.SCCone.TextTitle
% JGUIHandle.SCCone.TextDimx
% JGUIHandle.SCCone.SliderDimx
% JGUIHandle.SCCone.EditDimx
% JGUIHandle.SCCone.TextDimy
% JGUIHandle.SCCone.SliderDimy
% JGUIHandle.SCCone.EditDimy
% JGUIHandle.SCCone.TextDimz
% JGUIHandle.SCCone.SliderDimz
% JGUIHandle.SCCone.EditDimz
% JGUIHandle.SCCone.TextAnglex
% JGUIHandle.SCCone.SliderAnglex
% JGUIHandle.SCCone.EditAnglex
% JGUIHandle.SCCone.TextAngley
% JGUIHandle.SCCone.SliderAngley
% JGUIHandle.SCCone.EditAngley
% JGUIHandle.SCCone.TextAnglez
% JGUIHandle.SCCone.SliderAnglez
% JGUIHandle.SCCone.EditAnglez
%
% All the previous list is comon to AC and GH.
%
%--------------------------------------------------------------------------
%
% The graphical hierarchy is :
% JHandle
% -> JointVisualisationAxes
% -> JPlotHandles
%
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% CREATE THE FIGURE
%--------------------------------------------------------------------------
JHandle = figure(...
'color', 'white',...
'units', 'normalized',...
'position', [0.1, 0.1, 0.4, 0.8],...
'toolbar', 'figure',...
'name', 'EPFL - LA - LBO SHOULDER MODEL: JOINT SINUS CONE TOOLBOX');
%--------------------------------------------------------------------------
% CREATE THE BUTTONS
%--------------------------------------------------------------------------
% Push Button for Closing the GUI
JGUIHandle.Close_Button = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.95, 0.3, 0.05],...
'style', 'pushbutton',...
'string', '<html><b>- CLOSE GUI -----------------------------------------</b><br><p style="font-size: 90%;"><i>Closes the joint tool GUI.</i></p>',...
'fontsize', 14,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Close Joint Tool'));
% Push Button for Visualising the Ellipsoid
JGUIHandle.Save_Visualisation_Button = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.9, 0.3, 0.05],...
'style', 'pushbutton',...
'string', '<html><b>- SAVE VISUALISATION ----------------------------</b><br><p style="font-size: 90%;"><i>Save''s the GUI''s current visualisation.</i></p>',...
'fontsize', 14,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Save Visualisation'));
% Push Button for Visualising the Ellipsoid
JGUIHandle.Reset_Button = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.85, 0.3, 0.05],...
'style', 'pushbutton',...
'string', '<html><b>- RESET CONE DATA -------------------------------</b><br><p style="font-size: 90%;"><i>Restes the data to original values.</i></p>',...
'fontsize', 14,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Reset Cone Data'));
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% CREATE USER INTERFACE OF SC CONE
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% Title
JGUIHandle.SCCone.TextTitle = uicontrol(...
'units', 'normalized',...
'position', [0, 0.4, 0.3, 0.02],...
'style', 'text',...
'string', 'SC JOINT SINUS CONES PARAMETERS',...
'backgroundcolor', 'white',...
'fontsize', 14,...
'fontweight', 'bold');
%--------------------------------------------------------------------------
% X AXIS PARAMETER
%--------------------------------------------------------------------------
% Base Axis 1: Title
JGUIHandle.SCCone.TextDimx = uicontrol(...
'units', 'normalized',...
'position', [0, 0.37, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Base Axes 1:',...
'fontsize', 12,...
'fontweight', 'bold');
% Base Axis 1: Slider
JGUIHandle.SCCone.SliderDimx = uicontrol(...
'units', 'normalized',...
'position', [0, 0.36, 0.3, 0.01],...
'style', 'slider',...
'value', 42,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 1, 1));
% Base Axis 1: Edit Box
JGUIHandle.SCCone.EditDimx = uicontrol(...
'units', 'normalized',...
'position', [0.15, 0.37, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '42',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 1, 1));
%--------------------------------------------------------------------------
% Y AXIS PARAMETER
%--------------------------------------------------------------------------
% Base Axis 2: Title
JGUIHandle.SCCone.TextDimy = uicontrol(...
'units', 'normalized',...
'position', [0, 0.31, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Base Axes 2:',...
'fontsize', 12,...
'fontweight', 'bold');
% Base Axis 2: Slider
JGUIHandle.SCCone.SliderDimy = uicontrol(...
'units', 'normalized',...
'position', [0, 0.3, 0.3, 0.01],...
'style', 'slider',...
'value', 25,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 1, 1));
% Base Axis 2: Edit Box
JGUIHandle.SCCone.EditDimy = uicontrol(...
'units', 'normalized',...
'position', [0.15, 0.31, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '25',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 2, 1));
%--------------------------------------------------------------------------
% Z AXIS PARAMETER
%--------------------------------------------------------------------------
% Cone Height: Title
JGUIHandle.SCCone.TextDimz = uicontrol(...
'units', 'normalized',...
'position', [0, 0.25, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Height:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Height: Slider
JGUIHandle.SCCone.SliderDimz = uicontrol(...
'units', 'normalized',...
'position', [0, 0.24, 0.3, 0.01],...
'style', 'slider',...
'value', 100,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 3, 1));
% Cone Height: Edit Box
JGUIHandle.SCCone.EditDimz = uicontrol(...
'units', 'normalized',...
'position', [0.15, 0.25, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '100',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 3, 1));
%--------------------------------------------------------------------------
% X ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle X: Title
JGUIHandle.SCCone.TextAnglex = uicontrol(...
'units', 'normalized',...
'position', [0, 0.19, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle X:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle X: Slider
JGUIHandle.SCCone.SliderAnglex = uicontrol(...
'units', 'normalized',...
'position', [0, 0.18, 0.3, 0.01],...
'style', 'slider',...
'value', -80.1568,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 4, 1));
% Cone Angle X: Edit Box
JGUIHandle.SCCone.EditAnglex = uicontrol(...
'units', 'normalized',...
'position', [0.15, 0.19, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '-80.1568',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 4, 1));
%--------------------------------------------------------------------------
% Y ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle Y: Title
JGUIHandle.SCCone.TextAngley = uicontrol(...
'units', 'normalized',...
'position', [0, 0.13, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle Y:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle Y: Slider
JGUIHandle.SCCone.SliderAngley = uicontrol(...
'units', 'normalized',...
'position', [0, 0.12, 0.3, 0.01],...
'style', 'slider',...
'value', -3.3805,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 5, 1));
% Cone Angle Y: Edit Box
JGUIHandle.SCCone.EditAngley = uicontrol(...
'units', 'normalized',...
'position', [0.15, 0.13, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '-3.3805',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 5, 1));
%--------------------------------------------------------------------------
% Z ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle Z: Title
JGUIHandle.SCCone.TextAnglez = uicontrol(...
'units', 'normalized',...
'position', [0, 0.07, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle Z:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle Z: Slider
JGUIHandle.SCCone.SliderAnglez = uicontrol(...
'units', 'normalized',...
'position', [0, 0.06, 0.3, 0.01],...
'style', 'slider',...
'value', -0.6303,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 6, 1));
% Cone Angle Z: Edit Box
JGUIHandle.SCCone.EditAnglez = uicontrol(...
'units', 'normalized',...
'position', [0.15, 0.07, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '-0.6202',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 6, 1));
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% CREATE USER INTERFACE OF AC CONE
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
JGUIHandle.ACCone.Text = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.4, 0.3, 0.02],...
'style', 'text',...
'string', 'AC JOINT SINUS CONES PARAMETERS',...
'backgroundcolor', 'white',...
'fontsize', 14,...
'fontweight', 'bold');
%--------------------------------------------------------------------------
% X AXIS PARAMETER
%--------------------------------------------------------------------------
% Base Axis 1: Title
JGUIHandle.ACCone.TextDimx = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.37, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Base Axes 1:',...
'fontsize', 12,...
'fontweight', 'bold');
% Base Axis 1: Slider
JGUIHandle.ACCone.SliderDimx = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.36, 0.3, 0.01],...
'style', 'slider',...
'value', 10.5,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 1, 2));
% Base Axis 1: Edit Box
JGUIHandle.ACCone.EditDimx = uicontrol(...
'units', 'normalized',...
'position', [0.5, 0.37, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '10.5',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 1, 2));
%--------------------------------------------------------------------------
% Y AXIS PARAMETER
%--------------------------------------------------------------------------
% Base Axis 2: Title
JGUIHandle.ACCone.TextDimy = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.31, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Base Axes 2:',...
'fontsize', 12,...
'fontweight', 'bold');
% Base Axis 2: Slider
JGUIHandle.ACCone.SliderDimy = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.3, 0.3, 0.01],...
'style', 'slider',...
'value', 8.1,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 2, 2));
% Base Axis 2: Edit Box
JGUIHandle.ACCone.EditDimy = uicontrol(...
'units', 'normalized',...
'position', [0.5, 0.31, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '8.1',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 2, 2));
%--------------------------------------------------------------------------
% Z AXIS PARAMETER
%--------------------------------------------------------------------------
% Cone Height: Title
JGUIHandle.ACCone.TextDimz = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.25, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Height:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Height: Slider
JGUIHandle.ACCone.SliderDimz = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.24, 0.3, 0.01],...
'style', 'slider',...
'value', 30,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 3, 2));
% Cone Height: Edit Box
JGUIHandle.ACCone.EditDimz = uicontrol(...
'units', 'normalized',...
'position', [0.5, 0.25, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '30',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 3, 2));
%--------------------------------------------------------------------------
% X ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle X: Title
JGUIHandle.ACCone.TextAnglex = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.19, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle X:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle X: Slider
JGUIHandle.ACCone.SliderAnglex = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.18, 0.3, 0.01],...
'style', 'slider',...
'value', 1.0886,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 4, 2));
% Cone Angle X: Edit Box
JGUIHandle.ACCone.EditAnglex = uicontrol(...
'units', 'normalized',...
'position', [0.5, 0.19, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '1.0886',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 4, 2));
%--------------------------------------------------------------------------
% Y ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle Y: Title
JGUIHandle.ACCone.TextAngley = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.13, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle Y:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle Y: Slider
JGUIHandle.ACCone.SliderAngley = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.12, 0.3, 0.01],...
'style', 'slider',...
'value', 5.1566,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 5, 2));
% Cone Angle Y: Edit Box
JGUIHandle.ACCone.EditAngley = uicontrol(...
'units', 'normalized',...
'position', [0.5, 0.13, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '5.1566',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 5, 2));
%--------------------------------------------------------------------------
% Z ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle Z: Title
JGUIHandle.ACCone.TextAnglez = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.07, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle Z:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle Z: Slider
JGUIHandle.ACCone.SliderAnglez = uicontrol(...
'units', 'normalized',...
'position', [0.35, 0.06, 0.3, 0.01],...
'style', 'slider',...
'value', 154.2975,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 6, 2));
% Cone Angle Z: Edit Box
JGUIHandle.ACCone.EditAnglez = uicontrol(...
'units', 'normalized',...
'position', [0.5, 0.07, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '154.2975',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 6, 2));
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% CREATE USER INTERFACE OF GH CONE
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
JGUIHandle.GHCone.Text = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.4, 0.3, 0.02],...
'style', 'text',...
'string', 'GH JOINT SINUS CONES PARAMETERS',...
'backgroundcolor', 'white',...
'fontsize', 14,...
'fontweight', 'bold');
%--------------------------------------------------------------------------
% X AXIS PARAMETER
%--------------------------------------------------------------------------
% Base Axis 1: Title
JGUIHandle.GHCone.TextDimx = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.37, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Base Axes 1:',...
'fontsize', 12,...
'fontweight', 'bold');
% Base Axis 1: Slider
JGUIHandle.GHCone.SliderDimx = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.36, 0.3, 0.01],...
'style', 'slider',...
'value', 96,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 1, 3));
% Base Axis 1: Edit Box
JGUIHandle.GHCone.EditDimx = uicontrol(...
'units', 'normalized',...
'position', [0.85, 0.37, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '96',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 1, 3));
%--------------------------------------------------------------------------
% Y AXIS PARAMETER
%--------------------------------------------------------------------------
% Base Axis 2: Title
JGUIHandle.GHCone.TextDimy = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.31, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Base Axes 2:',...
'fontsize', 12,...
'fontweight', 'bold');
% Base Axis 2: Slider
JGUIHandle.GHCone.SliderDimy = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.3, 0.3, 0.01],...
'style', 'slider',...
'value', 44,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 2, 3));
% Base Axis 2: Edit Box
JGUIHandle.GHCone.EditDimy = uicontrol(...
'units', 'normalized',...
'position', [0.85, 0.31, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '44',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 2, 3));
%--------------------------------------------------------------------------
% Z AXIS PARAMETER
%--------------------------------------------------------------------------
% Cone Height: Title
JGUIHandle.GHCone.TextDimz = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.25, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Height:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Height: Slider
JGUIHandle.GHCone.SliderDimz = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.24, 0.3, 0.01],...
'style', 'slider',...
'value', 40,...
'Max', 200,...
'Min', 0,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 3, 3));
% Cone Height: Edit Box
JGUIHandle.GHCone.EditDimz = uicontrol(...
'units', 'normalized',...
'position', [0.85, 0.25, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '40',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 3, 3));
%--------------------------------------------------------------------------
% X ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle X: Title
JGUIHandle.GHCone.TextAnglex = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.19, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle X:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle X: Slider
JGUIHandle.GHCone.SliderAnglex = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.18, 0.3, 0.01],...
'style', 'slider',...
'value', -40.1643,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 4, 3));
% Cone Angle X: Edit Box
JGUIHandle.GHCone.EditAnglex = uicontrol(...
'units', 'normalized',...
'position', [0.85, 0.19, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '-40.1643',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 4, 3));
%--------------------------------------------------------------------------
% Y ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle Y: Title
JGUIHandle.GHCone.TextAngley = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.13, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle Y:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle Y: Slider
JGUIHandle.GHCone.SliderAngley = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.12, 0.3, 0.01],...
'style', 'slider',...
'value', -37.8152,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 5, 3));
% Cone Angle Y: Edit Box
JGUIHandle.GHCone.EditAngley = uicontrol(...
'units', 'normalized',...
'position', [0.85, 0.13, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '-37.8152',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 5, 3));
%--------------------------------------------------------------------------
% Z ANGLE PARAMETER
%--------------------------------------------------------------------------
% Cone Angle Z: Title
JGUIHandle.GHCone.TextAnglez = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.07, 0.15, 0.02],...
'backgroundcolor', 'white',...
'style', 'text',...
'string', 'Cone Angle Z:',...
'fontsize', 12,...
'fontweight', 'bold');
% Cone Angle Z: Slider
JGUIHandle.GHCone.SliderAnglez = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.06, 0.3, 0.01],...
'style', 'slider',...
'value', 143.9270,...
'Max', 180,...
'Min', -180,...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Slider Modified', 6, 3));
% Cone Angle Z: Edit Box
JGUIHandle.GHCone.EditAnglez = uicontrol(...
'units', 'normalized',...
'position', [0.85, 0.07, 0.15, 0.04],...
'backgroundcolor', 'white',...
'style', 'edit',...
'string', '143.9270',...
'fontsize', 12,...
'fontweight', 'bold',...
'callback', JOINT_CONE_TOOL_script_generator('Cone Data Modified', 'Value Modified', 6, 3));
% Create a Help menu
JGUIHandle.Help(1,1) = uimenu(JHandle,...
'label', 'JOINT CONE GUI HELP');
JGUIHandle.Help(2,1) = uimenu(JGUIHandle.Help(1,1),...
'label', 'About?',...
'callback', JOINT_CONE_TOOL_script_generator('Help'));
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% INITIALISATION OF THE VISUALISATION
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% Create the Axis
JointVisualisationAxes = axes(...
'units', 'normalized',...
'position', [0.1, 0.43, 0.6, 0.57]);
% Set the Axis
set(JHandle, 'currentaxes', JointVisualisationAxes); hold on;
% Create the 3-D Meshing Visualisations
JPlotHandles.MeshHandle(1) = VISUALISATION_view_bone_meshing([], MEDATA, 0, BLDATA);
JPlotHandles.MeshHandle(2) = VISUALISATION_view_bone_meshing([], MEDATA, 1, BLDATA);
JPlotHandles.MeshHandle(3) = VISUALISATION_view_bone_meshing([], MEDATA, 2, BLDATA);
JPlotHandles.MeshHandle(4) = VISUALISATION_view_bone_meshing([], MEDATA, 3, BLDATA);
% Create the 3-D Wire Frame Visualisations
JPlotHandles.WireFrameHandle(1) = VISUALISATION_view_bone_wireframe([], 0, BLDATA);
JPlotHandles.WireFrameHandle(2) = VISUALISATION_view_bone_wireframe([], 1, BLDATA);
JPlotHandles.WireFrameHandle(3) = VISUALISATION_view_bone_wireframe([], 2, BLDATA);
JPlotHandles.WireFrameHandle(4) = VISUALISATION_view_bone_wireframe([], 3, BLDATA);
% Plot the Joint Sinus Cones
JPlotHandles.ConeHandle(1) = VISUALISATION_view_joint_sinus_cones([], JCDATA, BLDATA, 1);
JPlotHandles.ConeHandle(2) = VISUALISATION_view_joint_sinus_cones([], JCDATA, BLDATA, 2);
JPlotHandles.ConeHandle(3) = VISUALISATION_view_joint_sinus_cones([], JCDATA, BLDATA, 3);
%--------------------------------------------------------------------------
% SET THE APPEARANCE OF THE VISUALISATION
%--------------------------------------------------------------------------
% Set some lights to help visualise the model
light('Position',[ 1, 0, 0],'Style','infinite');
light('Position',[ 0, 0, -10],'Style','local');
light('Position',[10, -50, 0],'Style','infinite');
colormap copper; % Give the bone meshings a bone color.
box on; % Turn the axes box on. It makes is easier to keep track of the orientation.
material dull; % Define the bone meshing material. It removes the shiny effect.
axis equal; % Correct the apsect ratio.
zoom(1.4); % Zoom in on the visualisation. otherwise it looks very small.
view([135, 25]); % Setup the initial camera postion [0,0] is behind horizontally.

Event Timeline