Skip to content

Commit

Permalink
Change prefix priority order in the order of the classes they inherit
Browse files Browse the repository at this point in the history
  • Loading branch information
kwkwan committed Jan 27, 2025
1 parent 1128012 commit 9f9a449
Showing 1 changed file with 92 additions and 64 deletions.
156 changes: 92 additions & 64 deletions sources/liquid_templates/_klass_table.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -70,78 +70,106 @@ h| 属性名 h| 属性の型及び多重度 h| 定義 {% if klass.has_guidance?
{% if root.sorted_inherited_assoc_props.size > 0 %}
{{ cols_number }}+h| 継承する関連役割
h| 関連役割名 h| 関連役割の型及び多重度 h| 定義 {% if klass.has_guidance? %} h| 補足{%- endif %}
{% endif %}
{% assign all_gen_names = '' %}
{% for attr in root.sorted_inherited_assoc_props %}
{% if citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% assign all_gen_names = all_gen_names | append: ',' | append: attr.gen_name %}
{% endfor %}
{% assign all_gens = all_gen_names | split: ',' | uniq %}
{% endif %}
{% endfor %}
{% for attr in root.sorted_inherited_assoc_props %}
{% unless citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% endunless %}
{% for cur_gen in all_gens %}
{% assign performed = false %}
{% for attr in root.sorted_inherited_assoc_props %}
{% assign props_with_same_gen = root.sorted_inherited_assoc_props | where: 'gen_name', cur_gen %}
{% unless performed %}
{% for attr in props_with_same_gen %}
{% if citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% endif %}
{% endfor %}
{% for attr in props_with_same_gen %}
{% unless citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% endunless %}
{% endfor %}
{% assign performed = true %}
{% endunless %}
{% endfor %}
{% endfor %}

{% if root.sorted_assoc_props.size > 0 %}
{{ cols_number }}+h| 自身に定義された関連役割
h| 関連役割名 h| 関連役割の型及び多重度 h| 定義 {% if klass.has_guidance? %} h| 補足{%- endif %}
{% endif %}
{% assign all_gen_names = '' %}
{% for attr in root.sorted_assoc_props %}
{% if citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% assign all_gen_names = all_gen_names | append: ',' | append: attr.gen_name %}
{% endfor %}
{% assign all_gens = all_gen_names | split: ',' | uniq %}
{% endif %}
{% endfor %}
{% for attr in root.sorted_assoc_props %}
{% unless citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% endunless %}
{% for cur_gen in all_gens %}
{% assign performed = false %}
{% for attr in root.sorted_assoc_props %}
{% assign props_with_same_gen = root.sorted_assoc_props | where: 'gen_name', cur_gen %}
{% unless performed %}
{% for attr in props_with_same_gen %}
{% if citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% endif %}
{% endfor %}
{% for attr in props_with_same_gen %}
{% unless citygml_ns contains attr.name_ns %}
{%- capture name_col -%}
{%- if attr.used? == false -%}
({{ attr.name_ns }}:{{ attr.name }})
[ {{ attr.gen_name }} ]
{%- else -%}
{{ attr.name_ns }}:{{ attr.name }}
[ {{ attr.gen_name }} ]
{%- endif -%}
{%- endcapture -%}
| {{ name_col | newline_to_br }}
| {{ attr.type_ns }}:{{ attr.type }} [{{ attr.cardinality.min }}..{{ attr.cardinality.max }}]
| {{ attr.definition }}
{% if klass.has_guidance? -%} | {{ attr.guidance }}{%- endif %}
{% endunless %}
{% endfor %}
{% assign performed = true %}
{% endunless %}
{% endfor %}
{% endfor %}
|===

0 comments on commit 9f9a449

Please sign in to comment.