SGhelptext

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 4.3, Creation date: 2018-11-02, Last change: 2025-09-14

Writes a text annotation box on top of the current axis

Description

This function was already part of several interactive function and is now just a independent function

See Also: SGfigure , select3d

Example Illustration

 missing image of SGhelptext(helpstr,cname)

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

Output

Algorithm Steps

  1. Declare persistent variables callname and oldhandle to store the caller's name and the handle to the previous annotation, respectively.
  2. Retrieve the caller's name using getfuncparams with a default empty string if not provided.
  3. Retrieve the wait parameter using getfuncparams with a default value of false.
  4. Initialize the output handle h as an empty array.
  5. Delete any previous annotation using delete(oldhandle).
  6. If cname is not empty, update the persistent callname variable.
  7. If helpstr is not empty, create a yellow annotation box with the help text at the top of the figure.
  8. If callname is not empty, create a red annotation box with the caller's name above the help text.
  9. Adjust the outer position of the current axis (gca) based on whether annotations are present.
  10. Store the current annotation handle in oldhandle for future reference.
  11. 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