by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 1.0, Creation date: 2012-11-10, Last change: 2025-08-18
See Also: appsavegcaSTL
, appuireadSTL
, apptogglelighttrans
, VLFLplotlight
, rotate3dlight
uitogglefigstyle
uitogglefigstyle % Switches between transparent with face edges and shaded surfaces.
The function uitogglefigstyle is designed to toggle the visual style of a MATLAB figure between two predefined styles: a "Matlab Style" and an "Ergosurg Style". This function is part of the SolidGeometry library and is used to switch between different visualization modes.
The function uitogglefigstyle does not take any input parameters. It operates on the current figure (gcf) in MATLAB.
The function uses a persistent variable mlstyle to keep track of the current style state. This variable is initialized to 0 or 1 to toggle between the two styles.
mlstyle.mlstyle is 0, set it to 1; otherwise, set it to 0. This toggles the state.mlstyle, execute one of the two styles:grid on.axis on.set(gcf, 'Color', [1 1 0.9]).VLFLplotlight(1,1) to set lighting.VLFLplotlight(0,0.9) to adjust lighting.VLFLcamlight to adjust camera lighting.grid off.axis off.set(gcf, 'Color', [1 1 0.9]).VLFLplotlight(1,1) to set lighting.The function makes use of the following custom functions:
VLFLplotlight: This function is called with different parameters to adjust the lighting of the figure.VLFLcamlight: This function is used to adjust the camera lighting in the "Matlab Style".The function does not return any output. It modifies the current figure's visual style directly.
Algorithm explaination created using ChatGPT on 2025-08-18 22:59. (Please note: No guarantee for the correctness of this explanation)