|
bool | exportImplementation () override |
| Exports an OCD file. More...
|
|
template<class Encoding > |
QTextCodec * | determineEncoding () |
|
template<class Format > |
bool | exportImplementation () |
| Actual implementation of the export. More...
|
|
MapCoord | calculateAreaOffset () |
| Calculates an offset to be applied to the coordinates so that the map data is moved into the limited OCD drawing area. More...
|
|
template<class Format > |
void | exportSetup (OcdFile< Format > &file) |
|
void | exportSetup () |
|
void | exportGeoreferencing () |
|
template<class Format > |
void | exportSymbols (OcdFile< Format > &file) |
|
template<class OcdBaseSymbol > |
void | setupBaseSymbol (const Symbol *symbol, quint32 symbol_number, OcdBaseSymbol &ocd_base_symbol) |
|
template<class OcdBaseSymbol > |
void | setupIcon (const Symbol *symbol, OcdBaseSymbol &ocd_base_symbol) |
|
template<class OcdPointSymbol > |
QByteArray | exportPointSymbol (const PointSymbol *point_symbol) |
|
template<class Element > |
qint16 | exportPattern (const PointSymbol *point, QByteArray &byte_array) |
|
template<class Element > |
qint16 | exportSubPattern (const MapCoordVector &coords, const Symbol *symbol, QByteArray &byte_array) |
|
template<class OcdAreaSymbol > |
QByteArray | exportAreaSymbol (const AreaSymbol *area_symbol) |
|
template<class OcdAreaSymbol > |
QByteArray | exportAreaSymbol (const AreaSymbol *area_symbol, quint32 symbol_number) |
|
template<class OcdAreaSymbolCommon > |
quint8 | exportAreaSymbolCommon (const AreaSymbol *area_symbol, OcdAreaSymbolCommon &ocd_area_common, const PointSymbol *&pattern_symbol) |
|
template<class OcdAreaSymbol > |
void | exportAreaSymbolSpecial (const AreaSymbol *area_symbol, OcdAreaSymbol &ocd_area_symbol) |
|
template<class OcdLineSymbol > |
QByteArray | exportLineSymbol (const LineSymbol *line_symbol) |
|
template<class OcdLineSymbol > |
QByteArray | exportLineSymbol (const LineSymbol *line_symbol, quint32 symbol_number) |
|
template<class OcdLineSymbolCommon > |
quint32 | exportLineSymbolCommon (const LineSymbol *line_symbol, OcdLineSymbolCommon &ocd_line_common) |
|
template<class OcdLineSymbolCommon > |
void | exportLineSymbolDoubleLine (const LineSymbol *line_symbol, quint32 fill_color, OcdLineSymbolCommon &ocd_line_common) |
|
template<class Format , class OcdTextSymbol > |
void | exportTextSymbol (OcdFile< Format > &file, const TextSymbol *text_symbol) |
|
template<class OcdTextSymbol > |
QByteArray | exportTextSymbol (const TextSymbol *text_symbol, quint32 symbol_number, int alignment) |
|
template<class OcdTextSymbol > |
void | setupTextSymbolExtra (const TextSymbol *text_symbol, OcdTextSymbol &ocd_text_symbol) |
|
template<class OcdTextSymbolBasic > |
void | setupTextSymbolBasic (const TextSymbol *text_symbol, int alignment, OcdTextSymbolBasic &ocd_text_basic) |
|
template<class OcdTextSymbolSpecial > |
void | setupTextSymbolSpecial (const TextSymbol *text_symbol, OcdTextSymbolSpecial &ocd_text_special) |
|
template<class OcdTextSymbolFraming > |
void | setupTextSymbolFraming (const TextSymbol *text_symbol, OcdTextSymbolFraming &ocd_text_framing) |
|
template<class Format > |
void | exportCombinedSymbol (OcdFile< Format > &file, const CombinedSymbol *combined_symbol) |
|
template<class Format > |
void | exportGenericCombinedSymbol (OcdFile< Format > &file, const CombinedSymbol *combined_symbol) |
|
template<class OcdAreaSymbol > |
QByteArray | exportCombinedAreaSymbol (quint32 symbol_number, const CombinedSymbol *combined_symbol, const AreaSymbol *area_symbol, const LineSymbol *line_symbol) |
|
template<class OcdLineSymbol > |
QByteArray | exportCombinedLineSymbol (quint32 symbol_number, const CombinedSymbol *combined_symbol, const LineSymbol *main_line, const LineSymbol *framing, const LineSymbol *double_line) |
|
template<class Format > |
void | exportObjects (OcdFile< Format > &file) |
|
template<class OcdObject > |
void | handleObjectExtras (const Object *object, OcdObject &ocd_object, typename OcdObject::IndexEntryType &entry) |
| Object setup which depends on the type features, not on minor type variations of members. More...
|
|
template<class OcdObject > |
QByteArray | exportPointObject (const PointObject *point, typename OcdObject::IndexEntryType &entry) |
|
template<class Format > |
void | exportPathObject (OcdFile< Format > &file, const PathObject *path, bool lines_only=false) |
|
template<class OcdObject > |
QByteArray | exportTextObject (const TextObject *text, typename OcdObject::IndexEntryType &entry) |
|
template<class OcdObject > |
QByteArray | exportObjectCommon (const Object *object, OcdObject &ocd_object, typename OcdObject::IndexEntryType &entry) |
|
template<class Format > |
void | exportTemplates (OcdFile< Format > &file) |
|
void | exportTemplates () |
|
template<class Format > |
void | exportExtras (OcdFile< Format > &file) |
|
void | exportExtras () |
|
quint16 | convertColor (const MapColor *color) const |
|
quint16 | getPointSymbolExtent (const PointSymbol *symbol) const |
|
quint16 | exportCoordinates (const MapCoordVector &coords, const Symbol *symbol, QByteArray &byte_array) |
|
quint16 | exportCoordinates (const MapCoordVector &coords, const Symbol *symbol, QByteArray &byte_array, MapCoord &bottom_left, MapCoord &top_right) |
|
quint16 | exportTextCoordinatesSingle (const TextObject *object, QByteArray &byte_array, MapCoord &bottom_left, MapCoord &top_right) |
|
quint16 | exportTextCoordinatesBox (const TextObject *object, QByteArray &byte_array, MapCoord &bottom_left, MapCoord &top_right) |
|
QByteArray | exportTextData (const TextObject *object, int chunk_size, int max_chunks) |
|
void | addTextTruncationWarning (QString text, int pos) |
|
quint32 | makeUniqueSymbolNumber (quint32 initial_number) const |
|
An exporter for OCD files.
The functions in this class are designed around the following pattern:
From template<class Format> void OcdFileExport::exportImplementation()
we call into template functions so that we get a template function instantiation for the actual types of the format. This is what we can do:
- If a format is significantly different, so that it needs a different algorithm: We specialize the template function (as done in
template<> void OcdFileExport::exportSetup(OcdFile<Ocd::FormatV8>& file)
).
- If the same algorithm can be used for multiple formats:
- If the differences are completely represented by the the exporter's state (which captures version and parameter string handler), then we may just call into a non-template function (as done in
template<class Format> void OcdFileExport::exportSetup(OcdFile<Format>&)
. The template function is likely to get inlined, thus reducing/avoiding template bloat.
- Otherwise we still can use the same algorithm but need to specialize it for the actual types of the format. This specialization is solved by function template instantiation, i.e. the generic algorithm goes directly into the template function. This is the case for
exportSymbol()
where types and even the encoding of the symbol number vary over different versions of the format. This doesn't mean that there couldn't be room for reducing template bloat by factoring out universal parts. However, if the size gains are small, it might not be worth the increased complexity.