Skip to content

editorGlobalsModelElementGraphAnalyzer

Class: ModelElementGraphAnalyzer

Offers methods to uncover dependencies on a set of interlinked concepts for various use cases.

Hierarchy

  • ModelElementGraphAnalyzer

Index

Methods

Methods

Static getAllModelElementThisDependsOn

getAllModelElementThisDependsOn(modelElement: IModelElement): SetIModelElement

Defined in src/model/data/Concepts/Utilities/ModelElementGraphAnalyzer.ts:17

Determines all concepts the given modelElement depends on, also recursively. This is important to determine the order in which concepts are realized.

Parameters:

Name Type Description
modelElement IModelElement the modelElement to start searching with

Returns: SetIModelElement


Static getSourceOfTruthPositioningAnchors

getSourceOfTruthPositioningAnchors(modelElementSubgraph: Iterable‹IModelElement›): ArbitraryTransformsAnchor[]

Defined in src/model/data/Concepts/Utilities/ModelElementGraphAnalyzer.ts:151

Returns a list of IPositioningAnchor that together define all transforms in the given subgraph. "Source of truth" meaning that these anchors do not have a ModelElement as target and no transformTargets, thus defining their transforms all on their own.

All other ModelElements and anchors base their coordinate system on these anchors. So if you want to transform a whole subgraph of modelElements, you really only need to change these anchors.

see IPositionableElementTransformsDefiner.getTransformsTargets()

Parameters:

Name Type Description
modelElementSubgraph Iterable‹IModelElement the subgraph to analyze

Returns: ArbitraryTransformsAnchor[]


Static getSubgraphOf

getSubgraphOf(modelElement: IModelElement, allElements: SetIModelElement›): SetIModelElement

Defined in src/model/data/Concepts/Utilities/ModelElementGraphAnalyzer.ts:95

Returns all concepts that either depend on the provided modelElement or the provided modelElement depends on, also including concepts in-between those. Basically returns the subgraph containing the modelElement, where no modelElement depends on another modelElement outside of the subgraph.

Conceptually, an assembly should only contain one subgraph, as multiple subgraphs should be split up into their own assemblies. as they have no relation to each other.

Parameters:

Name Type Description
modelElement IModelElement the modelElement to analyze
allElements SetIModelElement other concepts that may possibly depend on the provided modelElement

Returns: SetIModelElement


Static sortByDependency

sortByDependency(modelElements: SetIModelElement›): IModelElement[]

Defined in src/model/data/Concepts/Utilities/ModelElementGraphAnalyzer.ts:48

Sorts all provided model elements by their dependency, moving independent objects to the front: if object A depends on object B, object B will have a lower index than object A. If object B and object C do not have any interdependencies, their position relative to each other is not defined. Cyclic dependencies will probably result in an arbitrary order.

Parameters:

Name Type Description
modelElements SetIModelElement a set of all model elements to sort. The set is expected to be a complete subgraph without any outside depenendcies

Returns: IModelElement[]