Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of graphic, layout and image objects #2124

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Commits on Nov 19, 2024

  1. OcdFileImport: Handle graphic objects

    OCD format recognizes symbol-less map objects that, however, render in
    map colors. They are called "graphic objects". We create synthetic
    symbols for graphic objects on import. All the Mapper symbols have the
    same name and number reflecting the anonymous nature of the source
    graphic objects.
    
    Closes OpenOrienteeringGH-959.
    lpechacek authored and dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    519f53e View commit details
    Browse the repository at this point in the history
  2. OcdFileImport: Hide imported graphics objects

    There is a flag in the .ocd file to hide all graphics objects which
    was not yet evaluated.
    The status of the flag is now read and applied to all imported
    graphic objects.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    6201bf7 View commit details
    Browse the repository at this point in the history
  3. OcdFileImport: Import layout vector objects

    Layout objects (line, area, text) can now be imported.
    Significant code parts were taken over from Libor's commits.
    Layout objects' symbols are hidden depending on the 'l' flag in
    si_ViewPar. The 'l' flag in si_DisplayPar is apparently not used
    for hiding layouts objects, but both flags are evaluated in parallel.
    Todo: for text objects the import of the format (font, size,
    alignment, bold, italic) needs to be added.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    2bf0335 View commit details
    Browse the repository at this point in the history
  4. OcdFileImport: Apply OcdParameterStreamReader

    Refactor importDisplayPar() by using OcdParameterStreamReader.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    7f8c24d View commit details
    Browse the repository at this point in the history
  5. OcdFileImport: Remove caching of imported graphic and layout symbols

    There is no need to cache the dynamically created graphic and layout
    symbols. Instead create a temporary symbol and then scan the list of
    symbols whether an equal symbol is already present and thus can be
    used instead.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    3a596f0 View commit details
    Browse the repository at this point in the history
  6. OcdFileImport: Complete import of text layout objects

    Text layout objects contain a limited set of formatting options, e.g.,
    font type, font size, horizontal alignment, italic and bold type.
    These options are stored after the text string in the same format as
    for Parameter Strings.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    fd92635 View commit details
    Browse the repository at this point in the history
  7. ImportExport: Avoid duplicate warnings

    In addition to 'addWarning()' 'addWarningOnce()' only adds a warning to
    the list of warnings if the warning is not yet in the list.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    ad935ae View commit details
    Browse the repository at this point in the history
  8. OcdFileImport: Import of image objects

    Image objects (as well as layout objects) define their color directly
    in the object definition.
    With this commit the import of layout, image and graphic objects is
    now done within a single function.
    A single warning is issued that these kind of objects are imported by
    means of auxiliary symbols and can't be exported in their original
    format.
    Closes OpenOrienteering#1231
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    ecf63a1 View commit details
    Browse the repository at this point in the history
  9. OcdFileImport: Hide layout objects individually

    Layout objects can be hidden individually. This property is set within
    a parameter string (type 27).
    If the parameter string defines an image layout object, a warning is
    issue that this object type cannot be imported.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    d8db904 View commit details
    Browse the repository at this point in the history
  10. OcdFileImport: Set cap and join styles in separate function

    Setting of cap and join styles was done in the importLineSymbolBase()
    function and was replicated by this PR for importing special objects.
    In addition setupLineSymbolFraming() was setting the cap and join
    styles for framing lines (although only checking for a subset of cap
    and join styles).
    This commit moves the setting to a separate function.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    7a5f947 View commit details
    Browse the repository at this point in the history
  11. OcdFileImport: Import of image layout objects

    Image layout objects are stored in parameter strings very similar to
    background images (i.e., templates), whereas the image file itself is
    stored outside the .ocd file.
    This commit imports image layout objects as templates (and informs the
    user about it) after the original templates have been imported and
    thus adds them to the end of the list of templates.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    8fd5a2b View commit details
    Browse the repository at this point in the history
  12. OcdFileImport: Import embedded images

    Layout raster image objects can also be stored as embedded images
    directly in the .ocd file.
    This commit allows to save the embedded image locally in order to be
    added as a template to the map.
    dl3sdo committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    e363653 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    2d1add8 View commit details
    Browse the repository at this point in the history