|
| OcdFileImport (const QString &path, Map *map, MapView *view) |
|
| ~OcdFileImport () override |
|
void | setCustom8BitEncoding (QTextCodec *encoding) |
|
template<unsigned char N> |
QString | convertOcdString (const Ocd::PascalString< N > &src) const |
|
template<unsigned char N> |
QString | convertOcdString (const Ocd::Utf8PascalString< N > &src) const |
|
template<std::size_t N> |
QString | convertOcdString (const Ocd::Utf16PascalString< N > &src) const |
|
template<class E > |
QString | convertOcdString (const char *src, uint len) const |
|
template<class E > |
QString | convertOcdString (const QByteArray &data) const |
|
QString | convertOcdString (const QChar *src, uint maxlen) const |
|
MapCoord | convertOcdPoint (const Ocd::OcdPoint32 &ocd_point) const |
|
qreal | convertAngle (int ocd_angle) const |
|
int | convertLength (qint16 ocd_length) const |
|
int | convertLength (quint16 ocd_length) const |
|
template<class T , class R = qint64> |
R | convertLength (T ocd_length) const |
|
const MapColor * | convertColor (int ocd_color) |
|
void | addSymbolWarning (const AreaSymbol *symbol, const QString &warning) |
|
void | addSymbolWarning (const LineSymbol *symbol, const QString &warning) |
|
void | addSymbolWarning (const TextSymbol *symbol, const QString &warning) |
|
template<> |
qint64 | convertLength (quint8 ocd_length) const |
|
template<> |
qint64 | convertLength (quint16 ocd_length) const |
|
template<> |
qint64 | convertLength (quint32 ocd_length) const |
|
| Importer (const QString &path, Map *map, MapView *view) |
| Creates a new Importer with the given input path, map, and view. More...
|
|
| ~Importer () override |
| Destroys this Importer. More...
|
|
bool | loadSymbolsOnly () const noexcept |
| Returns true if only symbols (and colors) are to be imported. More...
|
|
void | setLoadSymbolsOnly (bool value) |
| If set to true, importers shall import only symbols (and colors). More...
|
|
bool | doImport () |
| Imports the map and view. More...
|
|
| ImportExport (QIODevice *device=nullptr) |
| Creates a new importer or exporter with the given IO device. More...
|
|
| ImportExport (const ImportExport &)=delete |
|
| ImportExport (ImportExport &&)=delete |
|
virtual | ~ImportExport () |
| Destroys an importer or exporter. More...
|
|
virtual bool | supportsQIODevice () const noexcept |
| Returns true when the importer/exporter supports QIODevice. More...
|
|
QIODevice * | device () const noexcept |
| Returns the input device if it has been set or created. More...
|
|
void | setDevice (QIODevice *device) |
| Sets a custom input device to be used for import. More...
|
|
void | setOption (const QString &name, const QVariant &value) |
| Sets an option in this importer or exporter. More...
|
|
QVariant | option (const QString &name) const |
| Retrieves the value of an option in this instance. More...
|
|
void | addWarning (const QString &str) |
| Adds a string to the current list of warnings. More...
|
|
const std::vector< QString > & | warnings () const noexcept |
| Returns the current list of warnings collected by this object. More...
|
|
|
bool | importImplementation () override |
| Actual implementation of the import. More...
|
|
template<class F > |
void | importImplementation () |
| Actual implementation of the import. More...
|
|
template<class F > |
void | handleStrings (const OcdFile< F > &file, std::initializer_list< StringHandler > handlers) |
|
void | importGeoreferencing (const OcdFile< Ocd::FormatV8 > &file) |
|
template<class F > |
void | importGeoreferencing (const OcdFile< F > &file) |
|
void | importGeoreferencing (const QString ¶m_string) |
| Imports string 1039. More...
|
|
void | importColors (const OcdFile< struct Ocd::FormatV8 > &file) |
|
template<class F > |
void | importColors (const OcdFile< F > &file) |
|
void | importSpotColor (const QString ¶m_string) |
|
void | importColor (const QString ¶m_string) |
|
template<class F > |
void | importSymbols (const OcdFile< F > &file) |
|
void | resolveSubsymbols () |
|
void | importObjects (const OcdFile< Ocd::FormatV8 > &file) |
|
template<class F > |
void | importObjects (const OcdFile< F > &file) |
|
template<class F > |
void | importTemplates (const OcdFile< F > &file) |
|
void | importTemplate (const QString ¶m_string) |
|
void | importExtras (const OcdFile< Ocd::FormatV8 > &file) |
|
template<class F > |
void | importExtras (const OcdFile< F > &file) |
|
void | appendNotes (const QString ¶m_string) |
|
void | importView (const OcdFile< Ocd::FormatV8 > &file) |
|
template<class F > |
void | importView (const OcdFile< F > &file) |
|
void | importView (const QString ¶m_string) |
|
template<class S > |
PointSymbol * | importPointSymbol (const S &ocd_symbol) |
|
template<class S > |
Symbol * | importLineSymbol (const S &ocd_symbol) |
|
void | importLineSymbolBase (OcdImportedLineSymbol *symbol, const Ocd::LineSymbolCommonV8 &attributes) |
|
void | setupLineSymbolFraming (OcdImportedLineSymbol *framing_line, const Ocd::LineSymbolCommonV8 &attributes, const LineSymbol *main_line) |
|
void | setupLineSymbolDoubleBorder (OcdImportedLineSymbol *double_line, const Ocd::LineSymbolCommonV8 &attributes) |
|
void | setupLineSymbolForBorder (OcdImportedLineSymbol *line_for_borders, const Ocd::LineSymbolCommonV8 &attributes) |
|
void | setupLineSymbolPointSymbols (OcdImportedLineSymbol *line_symbol, const Ocd::LineSymbolCommonV8 &attributes, const Ocd::PointSymbolElementV8 *elements) |
|
void | mergeLineSymbol (CombinedSymbol *full_line, LineSymbol *main_line, LineSymbol *framing_line, LineSymbol *double_line) |
|
Symbol * | importAreaSymbol (const Ocd::AreaSymbolV8 &ocd_symbol) |
|
template<class S > |
Symbol * | importAreaSymbol (const S &ocd_symbol) |
|
void | setupAreaSymbolCommon (OcdImportedAreaSymbol *symbol, bool fill_on, const Ocd::AreaSymbolCommonV8 &ocd_symbol, std::size_t data_size, const Ocd::PointSymbolElementV8 *elements) |
|
template<class S > |
TextSymbol * | importTextSymbol (const S &ocd_symbol) |
|
template<class S > |
TextSymbol * | importLineTextSymbol (const S &ocd_symbol) |
|
template<class S > |
LineSymbol * | importRectangleSymbol (const S &ocd_symbol) |
|
template<class OcdBaseSymbol > |
void | setupBaseSymbol (Symbol *symbol, const OcdBaseSymbol &ocd_base_symbol) |
|
template<class OcdBaseSymbol > |
void | setupIcon (Symbol *symbol, const OcdBaseSymbol &ocd_base_symbol) |
|
template<class OcdBaseSymbol > |
void | dropRedundantIcon (Symbol *symbol, const OcdBaseSymbol &ocd_base_symbol) |
| Drop the symbol's custom icon if it can be reproduced by Mapper. More...
|
|
void | setupPointSymbolPattern (PointSymbol *symbol, std::size_t data_size, const Ocd::PointSymbolElementV8 *elements) |
|
template<class O > |
Object * | importObject (const O &ocd_object, MapPart *part) |
|
QString | getObjectText (const Ocd::ObjectV8 &ocd_object) const |
|
template<class O > |
QString | getObjectText (const O &ocd_object) const |
|
template<class O > |
Object * | importRectangleObject (const O &ocd_object, MapPart *part, const OcdFileImport::RectangleInfo &rect) |
|
Object * | importRectangleObject (const Ocd::OcdPoint32 *ocd_points, MapPart *part, const OcdFileImport::RectangleInfo &rect) |
|
void | setPointFlags (OcdImportedPathObject *object, quint32 pos, bool is_area, const Ocd::OcdPoint32 &ocd_point) |
|
void | setPathHolePoint (OcdFileImport::OcdImportedPathObject *object, quint32 pos) |
|
void | fillPathCoords (OcdFileImport::OcdImportedPathObject *object, bool is_area, quint32 num_points, const Ocd::OcdPoint32 *ocd_points) |
| Translates the OC*D path given in the last two arguments into an Object. More...
|
|
bool | fillTextPathCoords (TextObject *object, TextSymbol *symbol, quint32 npts, const Ocd::OcdPoint32 *ocd_points) |
| Translates an OCAD text object path into a Mapper text object specifier, if possible. More...
|
|
void | setBasicAttributes (OcdImportedTextSymbol *symbol, const QString &font_name, const Ocd::BasicTextAttributesV8 &attributes) |
|
void | setSpecialAttributes (OcdImportedTextSymbol *symbol, const Ocd::SpecialTextAttributesV8 &attributes) |
|
void | setFraming (OcdImportedTextSymbol *symbol, const Ocd::FramingAttributesV8 &framing) |
|
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...
|
|
An map file importer for OC*D files.
bool OpenOrienteering::OcdFileImport::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.
template<class F >
void OpenOrienteering::OcdFileImport::importImplementation |
( |
| ) |
|
|
protectedvirtual |
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.