Syntax
h=SGhelptext(helpstr,[cname])
Input Parameter
helpstr : | | help string (yellow) |
cname : | | caller string (red) |
Output Parameter
h : | | handle to text annotation |
Examples
SGhelptext('Rotate and Press Enter','Solid Geometry Modeler'); a=ans
SGhelptext('','');
Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, SGhelptext
, is designed to display a text annotation box on top of the current axis in a MATLAB figure. It is part of the SolidGeometry library and was developed by Tim Lueth.
Input Parameters
- helpstr: A string that represents the help text to be displayed in a yellow annotation box.
- cname (optional): A string representing the caller's name, displayed in a red annotation box.
Output
- h: A handle to the text annotation(s) created.
Algorithm Steps
- Declare persistent variables
callname
and oldhandle
to store the caller's name and the handle to the previous annotation, respectively.
- Retrieve the caller's name using
getfuncparams
with a default empty string if not provided.
- Retrieve the wait parameter using
getfuncparams
with a default value of false
.
- Initialize the output handle
h
as an empty array.
- Delete any previous annotation using
delete(oldhandle)
.
- If
cname
is not empty, update the persistent callname
variable.
- If
helpstr
is not empty, create a yellow annotation box with the help text at the top of the figure.
- If
callname
is not empty, create a red annotation box with the caller's name above the help text.
- Adjust the outer position of the current axis (
gca
) based on whether annotations are present.
- Store the current annotation handle in
oldhandle
for future reference.
- If the wait parameter is true, enable 3D rotation and pause execution until the user resumes.
Algorithm explaination created using ChatGPT on 2025-08-19 08:26. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21