Draft: clean up ViewProviderLabel class

Various improvements in style, PEP8, spacing, docstrings.

Improve the methods to update the text, the arrow, and the frame
of the label.

Options to handle `Justification` and `LineSpacing` are added.
These can be handled just like with the `ViewProviderText` object,
as the internal text node is the same, a `SoAsciiText`.

Nevertheless, currently the leader line and the frame that are
drawn for the label don't consider the correction in position
for the `Justification` or `Linespacing` so the graphics
may be overlapped in certain situations.
This commit is contained in:
vocx-fc
2020-06-20 14:19:18 -05:00
committed by Yorik van Havre
parent 22e9cf8921
commit 94b0fe1599
2 changed files with 293 additions and 130 deletions

View File

@@ -196,9 +196,18 @@ def dim_symbol(symbol=None, invert=False):
symbol = utils.get_param("dimsymbol", 0)
if symbol == 0:
return coin.SoSphere()
# marker = coin.SoMarkerSet()
# marker.markerIndex = 80
# Returning a sphere means that the bounding box will
# be 3-dimensional; a marker will always be planar seen from any
# orientation but it currently doesn't work correctly
marker = coin.SoSphere()
return marker
elif symbol == 1:
marker = coin.SoMarkerSet()
# Should be the same as
# marker.markerIndex = 10
marker.markerIndex = Gui.getMarkerIndex("circle", 9)
return marker
elif symbol == 2: