Multiple literals in 1 Ifc Text + aggregated text annotations

Added option to store multiple literals inside 1 Ifc text object.

If multiple literals share the same `BoxAlignment` then only the first one will be displayed in viewport
to prevent visual clutter (although added small asterisk symbol to indicate that there are still multiple literals).

Added option for aggregated text annotations. Example - "door-tag" symbol.
If you create text, specify "door-tag" symbol in EPset_Annotation.Symbol
\and add two literals to it then they'll automatically will fit to that door-tag in the svg drawing
(https://i.imgur.com/OXaIlWe.png).

The way it works - you define symbol in symbols.svg (or in your own symbols svg file)
and then add the `<text>` fields where text from literals will fit right in.
The imporant note: `<text>` tag must have attribute `data-type="text-template"` for it to work.
For example: `<text text-anchor="middle" dominant-baseline="middle" data-type="text-template"></text>`
This commit is contained in:
Andrej730
2023-03-20 15:38:09 +05:00
parent 2a0fdd214c
commit f7181aae8a
15 changed files with 480 additions and 259 deletions
+2 -4
View File
@@ -35,13 +35,11 @@ class TestDisableEditingText:
class TestEditText:
def test_run(self, ifc, drawing):
drawing.get_text_literal("obj").should_be_called().will_return("text")
drawing.export_text_literal_attributes("obj").should_be_called().will_return("attributes")
ifc.run("drawing.edit_text_literal", text_literal="text", attributes="attributes").should_be_called()
drawing.synchronise_ifc_and_text_attributes("obj").should_be_called()
drawing.update_text_value("obj").should_be_called()
drawing.update_text_size_pset("obj").should_be_called()
drawing.disable_editing_text("obj").should_be_called()
subject.edit_text(ifc, drawing, obj="obj")
subject.edit_text(drawing, obj="obj")
class TestEnableEditingAssignedProduct: