Shape¶
Declaration¶
- class declaracad.occ.shape.Shape(parent=None, **kwargs)[source]¶
Bases:
ToolkitObject
Abstract shape component that can be displayed on the screen and represented by the framework.
- Attributes:
- activated
- axis
- bbox
- children
- color
- constructed
- description
- destroyed
- direction
- display
- initialized
- is_destroyed
- is_initialized
- line_color
- material
- name
- parent
- position
- proxy
- proxy_is_active
- rotation
- texture
- tolerance
- topology
- transparency
- wireframe_line_color
- x
- y
- z
Methods
activate_bottom_up
()Initialize the proxy on the bottom-up activation pass.
Activate the proxy object tree.
activate_top_down
()Initialize the proxy on the top-down activation pass.
child_added
(child)A reimplemented child added event handler.
child_moved
(child)A method invoked when a child is moved in the object.
child_removed
(child)A reimplemented child removed event handler.
destroy
()A reimplemented destructor.
find
(name[, regex])Find the first object in the subtree with the given name.
find_all
(name[, regex])Find all objects in the subtree with the given name.
freeze
Freeze the atom to prevent further modifications to its attributes.
get_member
Get the named member for the atom.
has_observer
Get whether the atom has the given observer for a given topic.
has_observers
Get whether the atom has observers for a given topic.
initialize
()A reimplemented initializer.
insert_children
(before, insert)Insert children into this object at the given location.
members
()Get the members dictionary for the type.
notifications_enabled
Get whether notification is enabled for the atom.
notify
Call the registered observers for a given topic with positional and keyword arguments.
observe
Register an observer callback to observe changes on the given topic(s).
parent_changed
(old, new)A method invoked when the parent of the object changes.
render
()Generates and returns the actual shape from the declaration.
root_object
()Get the root object for this hierarchy.
set_notifications_enabled
Enable or disable notifications for the atom.
set_parent
(parent)Set the parent for this object.
suppress_notifications
()Disable member notifications within in a context.
traverse
([depth_first])Yield all of the objects in the tree, from this object down.
traverse_ancestors
([root])Yield all of the objects in the tree, from this object up.
unobserve
Unregister an observer callback for the given topic(s).
Notes
This shape’s proxy holds an internal reference to the underlying shape which can be accessed using self.proxy.shape if needed. The topology of the shape can be accessed using the self.proxy.topology attribute.
- activate_proxy()[source]¶
Activate the proxy object tree.
This method should be called by a node to activate the proxy tree by making two initialization passes over the tree, from this node downward. This method is automatically at the proper times and should not normally need to be invoked by user code.
- axis¶
A tuple or list of the (u, v, w) axis of this shape. This is coerced into a Vector that defines the x, y, and z orientation of this shape.
- bbox¶
Bounding box of this shape
- color¶
A string representing the color of the shape.
- constructed¶
Triggered when the shape is constructed
- description¶
Description to display in the tooltip when clicked
- direction¶
A tuple or list of the (u, v, w) normal vector of this shape. This is coerced into a Vector setting the orentation of the shape. This is effectively the working plane.
- display¶
Whether the shape should be displayed and exported when in a part If set to false this shape will be excluded from the rendered part
- line_color¶
A string representing the line color of the shape in HLR mode.
- material¶
Material
- position¶
A tuple or list of the (x, y, z) position of this shape. This is coerced into a Point.
- proxy¶
Reference to the implementation control
- render() → TopoDS_Shape[source]¶
Generates and returns the actual shape from the declaration. Enaml does this automatically when it’s included in the viewer so this is only neede when working with shapes manually.
- Returns:
- shape: TopoDS_Shape
The shape generated by this declaration.
- rotation¶
Rotation about the normal vector in radians
- texture¶
Texture to apply to the shape
- tolerance¶
The tolerance to use for operations that may require it.
- topology¶
A read only property that accesses the topology of the shape such as edges, faces, shells, solids, etc….
- transparency¶
The opacity of the shape used for display.
- wireframe_line_color¶
A string representing the hidden line color of the shape in wireframe mode.
No implementation found