|
bool | importImplementation () override |
| Actual implementation of the import. More...
|
|
Symbol * | importPointSymbol (const OCADPointSymbol *ocad_symbol) |
|
Symbol * | importLineSymbol (const OCADLineSymbol *ocad_symbol) |
|
Symbol * | importAreaSymbol (const OCADAreaSymbol *ocad_symbol) |
|
Symbol * | importTextSymbol (const OCADTextSymbol *ocad_symbol) |
|
RectangleInfo * | importRectSymbol (const OCADRectSymbol *ocad_symbol) |
|
Object * | importObject (const OCADObject *ocad_object, MapPart *part) |
|
bool | importRectangleObject (const OCADObject *ocad_object, MapPart *part, const RectangleInfo &rect) |
|
virtual void | importString (OCADStringEntry *entry) |
|
Template * | importTemplate (OCADCString *ocad_str) |
|
OCADBackground | importBackground (const QByteArray &data) |
|
Template * | importRasterTemplate (const OCADBackground &background) |
|
PointSymbol * | importPattern (s16 npts, OCADPoint *pts) |
|
void | fillCommonSymbolFields (Symbol *symbol, const OCADSymbol *ocad_symbol) |
|
void | setPathHolePoint (Object *object, int i) |
|
void | fillPathCoords (Object *object, bool is_area, u16 npts, const OCADPoint *pts) |
| Translates the OCAD path given in the last two arguments into an Object. More...
|
|
bool | fillTextPathCoords (TextObject *object, TextSymbol *symbol, u16 npts, OCADPoint *pts) |
| Translates an OCAD text object path into a Mapper text object specifier, if possible. More...
|
|
QString | convertPascalString (const char *p) |
| Converts a single-byte-per-character, length-payload string to a QString. More...
|
|
QString | convertCString (const char *p, std::size_t n, bool ignore_first_newline) |
| Converts a single-byte-per-character, zero-terminated string to a QString. More...
|
|
QString | convertWideCString (const char *p, std::size_t n, bool ignore_first_newline) |
| Converts a two-byte-per-character, zero-terminated string to a QString. More...
|
|
float | convertRotation (int angle) |
|
void | convertPoint (MapCoord &c, s32 ocad_x, s32 ocad_y) |
|
qint32 | convertSize (int ocad_size) |
|
const MapColor * | convertColor (int color) |
|
double | convertTemplateScale (double ocad_scale) |
|
virtual void | prepare () |
| Event handler called from doImport() to prepare the import process. More...
|
|
virtual void | validate () |
| Event handler called from doImport() to complete to postprocess imported data. More...
|
|
virtual void | importFailed () |
| Event handler called from doImport() to complete to cleanup a failed import attempt. More...
|
|
Importer for OCD version 8 files.
QString OpenOrienteering::OCAD8FileImport::convertPascalString |
( |
const char * |
p | ) |
|
|
protected |
Converts a single-byte-per-character, length-payload string to a QString.
The byte sequence will be: LEN C0 C1 C2 C3...
Obviously this will only hold up to 255 characters. By default, we interpret the bytes using Windows-1252, as that's the most likely candidate for OCAD files in the wild.
QString OpenOrienteering::OCAD8FileImport::convertWideCString |
( |
const char * |
p, |
|
|
std::size_t |
n, |
|
|
bool |
ignore_first_newline |
|
) |
| |
|
protected |
Converts a two-byte-per-character, zero-terminated string to a QString.
By default, we interpret the bytes using UTF-16LE, as that's the most likely candidate for OCAD files in the wild.
The byte sequence will be: L0 H0 L1 H1 L2 H2... 00 00. n describes the maximum length (in bytes) that will be scanned for a zero terminator; if none is found, the string will be truncated at that location.
bool OpenOrienteering::OCAD8FileImport::importImplementation |
( |
| ) |
|
|
overrideprotectedvirtual |
Actual implementation of the import.
This function shall read the input and populate the map and view from it. Importers which support input from QIODevice should use the device(). They must not open or close this device.
If information might be lost in the process, a message shall be recorded by calling addWarning() with a translated, useful description of the issue. If a fatal error is encountered, then this method may either throw an exception, or log an error message with addWarning() and return false. The line between errors and warnings is somewhat of a judgement call on the part of the author, but generally an Importer should not succeed unless the map is populated sufficiently to be useful.
Implements OpenOrienteering::Importer.