ViewerSceneObject
- class ViewerSceneObject[source]
Bases:
SceneObject
Base class for all Viewer scene objects which also includes the GL buffer creation and drawing methods.
- Parameters:
- viewer
compas_viewer.viewer.Viewer
The viewer object.
- is_selectedbool
Whether the object is selected.
- is_lockedbool
Whether the object is locked.
- is_visiblebool
Whether to show object.
- show_pointsbool, optional
Whether to show points/vertices of the object. It will override the value in the config file.
- show_linesbool, optional
Whether to show lines/edges of the object. It will override the value in the config file.
- show_facesbool, optional
Whether to show faces of the object. It will override the value in the config file.
- pointscolorUnion[
compas.colors.Color
, dict[Any,compas.colors.Color
]], optional The color or the dict of colors of the points. It will override the value in the config file.
- linescolorUnion[
compas.colors.Color
, dict[Any,compas.colors.Color
]], optional The color or the dict of colors of the lines. It will override the value in the config file.
- facescolorUnion[
compas.colors.Color
, dict[Any,compas.colors.Color
]], optional The color or the dict of colors the faces. It will override the value in the config file.
- lineswidthfloat, optional
The line width to be drawn on screen. It will override the value in the config file.
- pointssizefloat, optional
The point size to be drawn on screen. It will override the value in the config file.
- opacityfloat, optional
The opacity of the object. It will override the value in the config file.
- config: :class:`compas_viewer.configurations.scene_config.SceneConfig`.
The configuration of the scene object. Defaults to None. It should be assigned though the
compas_viewer.viewer.Viewer.add
method. Otherwise a exception will be raised.- **kwargsdict, optional
Additional visualization options for specific objects.
- viewer
See also
- Attributes:
- is_selectedbool
Whether the object is selected.
- is_lockedbool
Whether the object is locked (selectable). The global grid is a typical object that is not selectable.
- is_visiblebool
Whether to show object.
- show_pointsbool
Whether to show points/vertices of the object.
- show_linesbool
Whether to show lines/edges of the object.
- show_facesbool
Whether to show faces of the object.
- pointscolordict[Any,
compas.colors.Color
] The color of the points.
- linescolordict[Any,
compas.colors.Color
] The color of the lines.
- facescolordict[Any,
compas.colors.Color
] The color of the faces.
- lineswidthfloat
The line width to be drawn on screen
- pointssizefloat
The point size to be drawn on screen.
- opacityfloat
The opacity of the object.
- backgroundbool
Whether the object is drawn on the background with depth test disabled.
- bounding_boxlist[float], read-only
The min and max corners of object bounding box, as a numpy array of shape (2, 3).
- bounding_box_center
compas.geometry.Point
, read-only The center of object bounding box, as a point.
Methods
Clear the object
Draw the object from its buffers
Draw the object instance for picking
Initialize the object
Create buffers from point/line/face data.
Create all buffers from object's data
Update the object
Update existing buffers from point/line/face data.
Update all buffers from object's data
Inherited Methods
Add a child item to the scene object.