class compolyx.Sensor(graph, obj, parent=None)
Sensor object for meassuring areas, prices, weights, and centers of gravity.Attributes
| Name | Description |
|---|---|
Sensor.active | Whether the sensor is computed on update or not |
Sensor.area | Area covered by all Entities of the Sensor |
Sensor.center_of_gravity | Center of Gravity over all Entities of the Sensor |
Sensor.enabled | Whether this object is currently enabled or not |
Sensor.entities | Entities of the Sensor |
Sensor.id | ID of object |
Sensor.is_dict_item | Specifies whether the object is an item of a dict |
Sensor.is_list_item | Specifies whether the object is an item of a list |
Sensor.link_path | Root path of the current node in the tree for links to this object |
Sensor.locked | Sensor cut was imported and cannot be changed. |
Sensor.modeling_ply_area | Cumulated area of all modeling-plies involved |
Sensor.name | Name of object |
Sensor.parent | Parent object in tree |
Sensor.price | Price over all Entities of the Sensor |
Sensor.production_ply_area | Cumulated area of all production-plies involved |
Sensor.root_path | Root path of the current node in the tree |
Sensor.sensor_type | Sensor type. |
Sensor.status | Status of the object |
Sensor.status_changed | Boolean flag which is set to true in C++ when up-to-date status of object changes |
Sensor.uid | UID of object |
Sensor.vertex | This will throw an error if the object has been removed from the graph |
Sensor.weight | Weight over all Entities of the Sensor |
Methods
| Name | Description |
|---|---|
Sensor.add_entity(entity) | Add entity to sensor |
Sensor.clear_entities() | Clear all entities of this sensor |
Sensor.find_parent(type) | Function steps up the tree and returns the first parent with given type |
Sensor.obj_exists() | Checks if __obj still references the c++ object (i.e. has not been reset to None by self._delete) AND exists in the graph |
Sensor.remove_entity(entity) | Remove entity from sensor. |
Sensor.serialize() | |
Sensor.serialize_name_and_id() | Helper function to serialize name and ID |
Sensor.update() | |
Sensor.visit(visitor) | Walk through the tree and let the visitor perform action on every descendant node |