gcahandleofSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 4.2, Creation date: 2018-07-10, Last change: 2025-08-18

returns the handle to all patches of gca

Description

This function returns the handle to all patches in the current graphics axis. I tcan be used to change color, transparency, or to create a SG.

See Also: ispatch , SGofgca

Example Illustration

 missing image of gcahandleofSG

Syntax

h=gcahandleofSG

Output Parameter

h: handle of all patches in gca

Examples


SGfigure; view(-30,30); SGplot(SGbox([30,20,10]));
setplotlight(gcahandleofSG,'b',0.2), show




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, gcahandleofSG, is designed to return the handle to all patches in the current graphics axis (gca). It is part of the SolidGeometry library and is used for visualization purposes, such as changing color, transparency, or creating a solid geometry (SG).

Input Parameters

The function does not take any input parameters.

Output

The function returns a variable h, which is the handle of all patches in the current graphics axis.

Algorithm Steps

  1. Retrieve all children of the current graphics axis using get(gca, 'Children').
  2. Filter these children to only include those that are patches by using the ispatch function.
  3. Assign the filtered handles to the variable h.
  4. If there are no output arguments specified (i.e., nargout == 0), perform the following actions:
    • Call setplotlight with the handles h, color 'r', and transparency 0.90.
    • Call the show function to display the changes.

Example Usage

The function can be used in a script as follows:

SGfigure; 
view(-30,30); 
SGplot(SGbox([30,20,10]));
setplotlight(gcahandleofSG,'b',0.2), show;

This example creates a figure, sets the view, plots a box, and then sets the plot light with a blue color and 0.2 transparency.

Algorithm explaination created using ChatGPT on 2025-08-18 22:46. (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