capellambse.aird package¶
Functions for parsing and interacting with diagrams in a Capella model.
- class capellambse.aird.ActiveFilters¶
Bases:
MutableSet
[str
]A set of active filters on a Diagram.
Enable access to set, add and remove active filters on a
Diagram
.- __init__(model, diagram)¶
- Parameters:
model (MelodyModel)
diagram (Diagram)
- Return type:
None
- add(value)¶
Add an activated filter to the diagram.
Writes a new
<activatedFilters>
XML element to the<diagram:DSemanticDiagram>
XML element. If thevalue
is not apparent incapellambse.aird.GLOBAL_FILTERS
as a key it can not be applied when rendering. It should still be visible in the GUI.
- class capellambse.aird.DRepresentationDescriptor¶
A representation descriptor.
These are specific
_Element
s found in AIRD files, which contain metadata about diagrams.alias of
_Element
- capellambse.aird.enumerate_descriptors(model, *, viewpoint=None)¶
Enumerate the representation descriptors in the model.
- capellambse.aird.find_target(model, descriptor)¶
- Return type:
- Parameters:
model (MelodyLoader)
descriptor (DRepresentationDescriptor)
- capellambse.aird.get_styleclass(descriptor)¶
- Return type:
- Parameters:
descriptor (DRepresentationDescriptor)
- capellambse.aird.iter_visible(model, descriptor)¶
Iterate over all semantic elements that are visible in a diagram.
This is a much faster alternative to calling
parse_diagram()
and iterating over the diagram elements, if you only need to know which semantic elements are visible, but are not otherwise interested in the layout of the diagram.- Parameters:
model (
MelodyLoader
) – A loaded model.descriptor (
NewType
(DRepresentationDescriptor
,_Element
)) – A DiagramDescriptor as obtained fromenumerate_descriptors()
.
- Raises:
ValueError – If the corresponding data or style element can’t be found in the
*.aird
file.- Yields:
etree._Element – A semantic element from the
*.capella
file.- Return type:
- capellambse.aird.parse_diagram(model, descriptor, **params)¶
Parse a single diagram from the model.
- Parameters:
model (
MelodyLoader
) – A loaded model.descriptor (
NewType
(DRepresentationDescriptor
,_Element
)) – A DiagramDescriptor as obtained fromenumerate_descriptors()
.params (
Any
) – Additional render parameters.
- Return type:
- capellambse.aird.parse_diagrams(model, **params)¶
Parse all diagrams from the model.
- Return type:
- Parameters:
model (MelodyLoader)
params (Any)