IGLSelectableObj

Module: graphics

Renderable selectable object with mesh, edge, and face selection state. This class encapsulates geometry selection state, display style, and lighting parameters for an interactive OpenGL/mesh viewer.

__init__

method
__init__(self)
Initialize selection, display, and lighting defaults.

SetLightParams

method
SetLightParams(self, ambientStrength: Optional[float], diffuseMin: Optional[float], specularStrength: Optional[float], specularMin: Optional[float], shininess: Optional[float], diffuseStrength: Optional[float], rimStrength: Optional[float], rimPower: Optional[float], gamma: Optional[float])
Set per-object lighting parameters.

Args

Name Type Description
ambientStrength Ambient lighting intensity multiplier.
diffuseMin Minimum diffuse lighting contribution.
specularStrength Specular lighting intensity multiplier.
specularMin Minimum specular lighting contribution.
shininess Specular exponent controlling highlight size.
diffuseStrength Diffuse lighting strength.
rimStrength Rim lighting intensity for edge glow.
rimPower Rim lighting falloff exponent.
gamma Gamma correction factor.

GetLightParams

method
GetLightParams(self)
Get the current lighting parameters for this object.

Returns

A dictionary mapping lighting parameter names to their values.

Signature

method
Signature(self)
Return the shape type signature for this object.

Returns

The integer shape type defined by IGLShapeType.

is_selected

method
is_selected(self)
Return whether the entire body is selected.

Returns

True if the object body is selected, False otherwise.

is_visible

method
is_visible(self)
Return whether the object is visible in the scene.

Returns

True if the object is visible, False if hidden.

SetColor

method
SetColor(self, r: float, g: float, b: float)
Set the object face color.

Args

Name Type Description
r Red channel in [0.0, 1.0].
g Green channel in [0.0, 1.0].
b Blue channel in [0.0, 1.0].

SetTransparent

method
SetTransparent(self, factor: float)
Set the object transparency alpha.

Args

Name Type Description
factor Alpha blending factor, where 1.0 is opaque.

Hide

method
Hide(self)
Hide the object and disable its selectable state.

Show

method
Show(self)
Show the object and enable its selectable state.

SelectBody

method
SelectBody(self)
Select the entire body, clearing any face-level selection.

HilightBody

method
HilightBody(self, hilight: int)
Set the body highlight identifier for hover or preselection state.

Args

Name Type Description
hilight Highlight state or identifier value.

SelectFaces

method
SelectFaces(self, faces: Iterable[int])
Select faces.

Args

Name Type Description
faces Iterable of face indices to select.

SelectEdges

method
SelectEdges(self, edges: Iterable[int])
Select edges.

Args

Name Type Description
edges Iterable of edge indices to select.

ClearSelection

method
ClearSelection(self)
Clear face selection and deselect the body.

HilightFace

method
HilightFace(self, faceId: int)
Set a single face highlight index.

Args

Name Type Description
faceId Face index to highlight.

AddFaceSelection

method
AddFaceSelection(self, faceId: int)
Add a face index to the selection set.

Args

Name Type Description
faceId Face index to add to selection.

AddEdgeSelection

method
AddEdgeSelection(self, edgeId: int)
Add an edge index to the selection set.

Args

Name Type Description
edgeId Edge index to add to selection.

GetSelectedFaces

method
GetSelectedFaces(self)
Get the set of currently selected face indices.

Returns

Set of selected face indices.

GetSelectedEdges

method
GetSelectedEdges(self)
Get the set of currently selected edge indices.

Returns

Set of selected edge indices.