Skip to content

Commit 2d25290

Browse files
committed
OcdFileImport: Warn about unsupported virtual gaps
Line objects in .ocd files can contain virtual gaps, i.e., gaps that interrupt the line but keep the object as a single object. Mapper does not yet support virtual gaps and thus ignores them when importing .ocd files. Issue a warning that virtual gaps in line objects are not supported.
1 parent 8a5294e commit 2d25290

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/fileformats/ocd_file_import.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,11 @@ void OcdFileImport::fillPathCoords(OcdImportedPathObject *object, bool is_area,
21632163
{
21642164
object->coords[i] = convertOcdPoint(ocd_points[i]);
21652165
setPointFlags(object, i, is_area, ocd_points[i]);
2166+
if (ocd_points[i].x & Ocd::OcdPoint32::FlagGap)
2167+
{
2168+
// Virtual gaps are not supported
2169+
addWarningOnce(tr("Virtual gaps in line objects are not supported."));
2170+
}
21662171
}
21672172

21682173
// For path objects, create closed parts where the position of the last point is equal to that of the first point

src/fileformats/ocd_types.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013, 2015-2019 Kai Pastor
2+
* Copyright 2013, 2015-2019, 2024 Kai Pastor
33
*
44
* This file is part of OpenOrienteering.
55
*
@@ -231,7 +231,8 @@ namespace Ocd
231231
{
232232
FlagCtl1 = 0x01,
233233
FlagCtl2 = 0x02,
234-
FlagLeft = 0x04
234+
FlagLeft = 0x04,
235+
FlagGap = 0x08
235236
};
236237

237238
// Flags in Y coordinate

0 commit comments

Comments
 (0)