IGLShape

Module: graphics

Renderable geometry wrapper that manages shaded and wireframe presentations. IGLShape wraps an underlying body object from the FEA/geometry backend and provides the logic required to build OpenGL render presentations, upload shader uniforms, and display the shape in different rendering modes.

__init__

method
__init__(self, body)
Initialize the shape wrapper for the provided geometry body.

Args

Name Type Description
body Backend geometry or finite element body instance that exposes node, face, edge, and identification APIs.

SetViewer

method
SetViewer(self, wglview)
Associate the shape with a viewer context.

Args

Name Type Description
wglview Viewer instance providing shader programs, camera state, and rendering context.

GetBoundingBox

method
GetBoundingBox(self)
Return the axis-aligned bounding box of the underlying body.

Returns

Bounding box object obtained from the body backend.

ComputePrs

method
ComputePrs(self)
Build OpenGL presentations for shaded and wireframe rendering. Extracts vertex, face, and edge topology from the underlying body and constructs IGLStdPrs objects for solid surfaces and line-based edges depending on the shape type.

GetGeoBody

method
GetGeoBody(self)
Return the underlying geometry or finite element body object.

Returns

The backend body object wrapped by this shape.

SetShaderAttribs

method
SetShaderAttribs(self)
Upload common material and lighting uniforms to the solid shader. Sets per-shape parameters such as highlight state, face color, transparency, and lighting coefficients on the viewer's solid shader.

Display

method
Display(self, theDisplayMode: int)
Render the shape in the specified display mode.

Args

Name Type Description
theDisplayMode Display mode enum value from IGLDisplayMode that controls shaded, shaded-with-edges, or wireframe rendering.

delete

method
delete(self)
Release OpenGL resources associated with this shape. Deletes GPU-backed presentations for shaded and wireframe meshes.

GetSelFaces

method
GetSelFaces(self)
Return the selected face IDs for shader-based face highlighting.

Returns

List of selected face indices, truncated to a maximum count to avoid exceeding shader uniform array limits.