Skip to content

Commit

Permalink
fix(svg): Add symbol maker for Physical component
Browse files Browse the repository at this point in the history
  • Loading branch information
freshavocado7 committed Jan 2, 2024
1 parent f26665c commit 555e9b9
Showing 1 changed file with 39 additions and 58 deletions.
97 changes: 39 additions & 58 deletions capellambse/svg/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,36 @@ def _make_icon_frame(id_: str, color: str) -> container.Symbol:
return symb


def _make_physical_component_symbol(id_: str, color: str) -> container.Symbol:
symb = _make_icon_frame(id_=id_, color=color)
symb.add(
path.Path(
d=(
"m 57.589299,33.276194 c 0,1.410473 -0.249326,2.72122"
" -0.747979,3.93224 -0.484407,1.19676 -1.168275,2.236807"
" -2.051603,3.12014 -1.097038,1.097033 -2.393538,1.923373"
" -3.889499,2.47902 -1.495959,0.541393 -3.383718,0.81209"
" -5.663277,0.81209 h -4.231429 v 11.86083 h -4.23143 v"
" -31.82122 h 8.633826 c 1.909129,0 3.526191,0.163843"
" 4.851185,0.49153 1.324993,0.31344 2.500391,0.812097"
" 3.526192,1.49597 1.211016,0.812087 2.14421,1.82364"
" 2.799583,3.03466 0.669621,1.211013 1.004431,2.742593"
" 1.004431,4.59474 z m -4.402396,0.10687 c 0,-1.09704"
" -0.192339,-2.051607 -0.577016,-2.8637 -0.384675,-0.812093"
" -0.968811,-1.47459 -1.752408,-1.98749 -0.683868,-0.441667"
" -1.467467,-0.755107 -2.350798,-0.94032 -0.869079,-0.19946"
" -1.97324,-0.29919 -3.312483,-0.29919 h -4.188686 v 12.71566"
" h 3.568931 c 1.709669,0 3.098776,-0.149593 4.167321,-0.44878"
" 1.068543,-0.31344 1.937623,-0.80497 2.607242,-1.47459"
" 0.669621,-0.683867 1.139781,-1.403353 1.410478,-2.15846"
" 0.284946,-0.7551 0.427419,-1.60281 0.427419,-2.54313 z"
),
style="fill: #000;stroke-width: 0.1;",
)
)
return symb


@decorations.deco_factories
def entity_symbol(id_: str = "EntitySymbol") -> container.Symbol:
symb = _make_icon_frame(id_=id_, color="#a5b9c8")
Expand Down Expand Up @@ -1195,35 +1225,7 @@ def representation_link_symbol(
def physical_behavior_component_symbol(
id_: str = "PhysicalBehaviorComponentSymbol",
) -> container.Symbol:
symb = _make_icon_frame(id_=id_, color="#a5bde7")
letter = container.Group(transform="scale(0.7,0.7) translate(15, 18)")
letter.add(
path.Path(
d=(
"m 57.589299,33.276194 c 0,1.410473 -0.249326,2.72122"
" -0.747979,3.93224 -0.484407,1.19676 -1.168275,2.236807"
" -2.051603,3.12014 -1.097038,1.097033 -2.393538,1.923373"
" -3.889499,2.47902 -1.495959,0.541393 -3.383718,0.81209"
" -5.663277,0.81209 h -4.231429 v 11.86083 h -4.23143 v"
" -31.82122 h 8.633826 c 1.909129,0 3.526191,0.163843"
" 4.851185,0.49153 1.324993,0.31344 2.500391,0.812097"
" 3.526192,1.49597 1.211016,0.812087 2.14421,1.82364"
" 2.799583,3.03466 0.669621,1.211013 1.004431,2.742593"
" 1.004431,4.59474 z m -4.402396,0.10687 c 0,-1.09704"
" -0.192339,-2.051607 -0.577016,-2.8637 -0.384675,-0.812093"
" -0.968811,-1.47459 -1.752408,-1.98749 -0.683868,-0.441667"
" -1.467467,-0.755107 -2.350798,-0.94032 -0.869079,-0.19946"
" -1.97324,-0.29919 -3.312483,-0.29919 h -4.188686 v 12.71566"
" h 3.568931 c 1.709669,0 3.098776,-0.149593 4.167321,-0.44878"
" 1.068543,-0.31344 1.937623,-0.80497 2.607242,-1.47459"
" 0.669621,-0.683867 1.139781,-1.403353 1.410478,-2.15846"
" 0.284946,-0.7551 0.427419,-1.60281 0.427419,-2.54313 z"
),
style="white-space: pre;inline-size: 15.4494;stroke-width: 0.1;",
)
)
symb.add(letter)
return symb
return _make_physical_component_symbol(id_, color="#a5bde7")


@decorations.deco_factories
Expand Down Expand Up @@ -1284,35 +1286,14 @@ def physical_behavior_human_actor_symbol(
def physical_node_component_symbol(
id_: str = "PhysicalNodeComponentSymbol",
) -> container.Symbol:
symb = _make_icon_frame(id_=id_, color="#ffff00")
letter = container.Group(transform="scale(0.7,0.7) translate(15, 18)")
letter.add(
path.Path(
d=(
"m 57.589299,33.276194 c 0,1.410473 -0.249326,2.72122"
" -0.747979,3.93224 -0.484407,1.19676 -1.168275,2.236807"
" -2.051603,3.12014 -1.097038,1.097033 -2.393538,1.923373"
" -3.889499,2.47902 -1.495959,0.541393 -3.383718,0.81209"
" -5.663277,0.81209 h -4.231429 v 11.86083 h -4.23143 v"
" -31.82122 h 8.633826 c 1.909129,0 3.526191,0.163843"
" 4.851185,0.49153 1.324993,0.31344 2.500391,0.812097"
" 3.526192,1.49597 1.211016,0.812087 2.14421,1.82364"
" 2.799583,3.03466 0.669621,1.211013 1.004431,2.742593"
" 1.004431,4.59474 z m -4.402396,0.10687 c 0,-1.09704"
" -0.192339,-2.051607 -0.577016,-2.8637 -0.384675,-0.812093"
" -0.968811,-1.47459 -1.752408,-1.98749 -0.683868,-0.441667"
" -1.467467,-0.755107 -2.350798,-0.94032 -0.869079,-0.19946"
" -1.97324,-0.29919 -3.312483,-0.29919 h -4.188686 v 12.71566"
" h 3.568931 c 1.709669,0 3.098776,-0.149593 4.167321,-0.44878"
" 1.068543,-0.31344 1.937623,-0.80497 2.607242,-1.47459"
" 0.669621,-0.683867 1.139781,-1.403353 1.410478,-2.15846"
" 0.284946,-0.7551 0.427419,-1.60281 0.427419,-2.54313 z"
),
style="white-space: pre;inline-size: 15.4494;stroke-width: 0.1;",
)
)
symb.add(letter)
return symb
return _make_physical_component_symbol(id_, color="#ffff00")


@decorations.deco_factories
def physical_component_symbol(
id_: str = "PhysicalComponentSymbol",
) -> container.Symbol:
return _make_physical_component_symbol(id_, color="#dbe6f4")


@decorations.deco_factories
Expand Down

0 comments on commit 555e9b9

Please sign in to comment.