ViewerSceneObject
- class ViewerSceneObject[source]
Bases:
SceneObject
,Base
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, optional
Whether the object is selected. Default is False.
- showbool, optional
Whether to show object. Default is True.
- show_pointsbool, optional
Whether to show points/vertices of the object. Default is the value of show_points in viewer.config.
- show_linesbool, optional
Whether to show lines/edges of the object. Default is the value of show_lines in viewer.config.
- show_facesbool, optional
Whether to show faces of the object. Default is the value of show_faces in viewer.config.
- linewidthfloat, optional
The line width to be drawn on screen. Default is the value of linewidth in viewer.config.
- pointsizefloat, optional
The point size to be drawn on screen. Default is the value of pointsize in viewer.config.
- opacityfloat, optional
The opacity of the object. Default is the value of opacity in viewer.config.
- **kwargsdict, optional
Additional visualization options for
compas.scene.SceneObject
.
- viewer
- Attributes:
- is_selectedbool
Whether the object is selected.
- showbool
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.
- linewidthfloat
The line width to be drawn on screen
- pointsizefloat
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.
See also
Methods
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.
Inherited Methods
Converts the instance to a string.
Add a child item to the scene object.
The main clearing method.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Remove a child node from this node.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Traverse the tree from this node.
Validate the data against the object's data schema.