Mapper  0.9.0
API documentation
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
OpenOrienteering::OCAD8FileExport Class Reference

Exporter for OCD version 8 files. More...

#include <ocad8_file_format_p.h>

Inheritance diagram for OpenOrienteering::OCAD8FileExport:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::OCAD8FileExport:
Collaboration graph
[legend]

Public Member Functions

 OCAD8FileExport (const QString &path, const Map *map, const MapView *view)
 
 ~OCAD8FileExport () override
 
- Public Member Functions inherited from OpenOrienteering::Exporter
 Exporter (const QString &path, const Map *map, const MapView *view)
 Creates a new Exporter with the given path, map, and view. More...
 
 ~Exporter () override
 Destroys the current Exporter. More...
 
bool doExport ()
 Exports the map and view. More...
 
- Public Member Functions inherited from OpenOrienteering::ImportExport
 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...
 
QIODevicedevice () 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...
 

Protected Member Functions

bool exportImplementation () override
 Actual implementation of the export. More...
 
MapCoord calculateAreaOffset ()
 
void exportCommonSymbolFields (const Symbol *symbol, OCADSymbol *ocad_symbol, int size)
 
void exportSymbolIcon (const Symbol *symbol, u8 ocad_icon[])
 
int getPatternSize (const PointSymbol *point)
 
s16 exportPattern (const PointSymbol *point, OCADPoint **buffer)
 
s16 exportSubPattern (const Object *object, const Symbol *symbol, OCADPoint **buffer)
 
s16 exportPointSymbol (const PointSymbol *point)
 
s16 exportLineSymbol (const LineSymbol *line)
 
s16 exportAreaSymbol (const AreaSymbol *area)
 
s16 exportTextSymbol (const TextSymbol *text)
 
void setTextSymbolFormatting (OCADTextSymbol *ocad_symbol, TextObject *formatting)
 
std::set< s16exportCombinedSymbol (const CombinedSymbol *combination)
 
u16 exportCoordinates (const MapCoordVector &coords, OCADPoint **buffer, const Symbol *symbol)
 Returns the number of exported coordinates. If not nullptr, the given symbol is used to determine the meaning of dash points. More...
 
u16 exportTextCoordinates (TextObject *object, OCADPoint **buffer)
 
s16 getPointSymbolExtent (const PointSymbol *symbol)
 
void convertPascalString (const QString &text, char *buffer, int buffer_size)
 
void convertCString (const QString &text, unsigned char *buffer, int buffer_size)
 
int convertWideCString (const QString &text, unsigned char *buffer, int buffer_size)
 Returns the number of bytes written into buffer. More...
 
int convertRotation (float angle)
 
OCADPoint convertPoint (qint32 x, qint32 y)
 
OCADPoint convertPoint (const MapCoord &coord)
 Attention: this ignores the coordinate flags! More...
 
s32 convertSize (qint32 size)
 
s16 convertColor (const MapColor *color) const
 
double convertTemplateScale (double mapper_scale)
 

Static Protected Member Functions

static int getOcadColor (QRgb rgb)
 

Additional Inherited Members

- Protected Attributes inherited from OpenOrienteering::Exporter
const QString path
 The output path. More...
 
const Map *const map
 The Map to import or export. More...
 
const MapView *const view
 The MapView to import or export. More...
 

Detailed Description

Exporter for OCD version 8 files.

Constructor & Destructor Documentation

◆ OCAD8FileExport()

OpenOrienteering::OCAD8FileExport::OCAD8FileExport ( const QString path,
const Map map,
const MapView view 
)

◆ ~OCAD8FileExport()

OpenOrienteering::OCAD8FileExport::~OCAD8FileExport ( )
override

Member Function Documentation

◆ calculateAreaOffset()

MapCoord OpenOrienteering::OCAD8FileExport::calculateAreaOffset ( )
protected

◆ convertColor()

s16 OpenOrienteering::OCAD8FileExport::convertColor ( const MapColor color) const
protected

◆ convertCString()

void OpenOrienteering::OCAD8FileExport::convertCString ( const QString text,
unsigned char *  buffer,
int  buffer_size 
)
protected

◆ convertPascalString()

void OpenOrienteering::OCAD8FileExport::convertPascalString ( const QString text,
char *  buffer,
int  buffer_size 
)
protected

◆ convertPoint() [1/2]

OCADPoint OpenOrienteering::OCAD8FileExport::convertPoint ( qint32  x,
qint32  y 
)
protected

◆ convertPoint() [2/2]

OCADPoint OpenOrienteering::OCAD8FileExport::convertPoint ( const MapCoord coord)
protected

Attention: this ignores the coordinate flags!

◆ convertRotation()

int OpenOrienteering::OCAD8FileExport::convertRotation ( float  angle)
protected

◆ convertSize()

s32 OpenOrienteering::OCAD8FileExport::convertSize ( qint32  size)
protected

◆ convertTemplateScale()

double OpenOrienteering::OCAD8FileExport::convertTemplateScale ( double  mapper_scale)
protected

◆ convertWideCString()

int OpenOrienteering::OCAD8FileExport::convertWideCString ( const QString text,
unsigned char *  buffer,
int  buffer_size 
)
protected

Returns the number of bytes written into buffer.

◆ exportAreaSymbol()

s16 OpenOrienteering::OCAD8FileExport::exportAreaSymbol ( const AreaSymbol area)
protected

◆ exportCombinedSymbol()

std::set< s16 > OpenOrienteering::OCAD8FileExport::exportCombinedSymbol ( const CombinedSymbol combination)
protected

◆ exportCommonSymbolFields()

void OpenOrienteering::OCAD8FileExport::exportCommonSymbolFields ( const Symbol symbol,
OCADSymbol *  ocad_symbol,
int  size 
)
protected

◆ exportCoordinates()

u16 OpenOrienteering::OCAD8FileExport::exportCoordinates ( const MapCoordVector coords,
OCADPoint **  buffer,
const Symbol symbol 
)
protected

Returns the number of exported coordinates. If not nullptr, the given symbol is used to determine the meaning of dash points.

◆ exportImplementation()

bool OpenOrienteering::OCAD8FileExport::exportImplementation ( )
overrideprotectedvirtual

Actual implementation of the export.

Exporters which support input from QIODevice shall use the device(). They must not open or close the device.

If information might be lost in the export, 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.

There is no default implementation.

Implements OpenOrienteering::Exporter.

◆ exportLineSymbol()

s16 OpenOrienteering::OCAD8FileExport::exportLineSymbol ( const LineSymbol line)
protected

◆ exportPattern()

s16 OpenOrienteering::OCAD8FileExport::exportPattern ( const PointSymbol point,
OCADPoint **  buffer 
)
protected

◆ exportPointSymbol()

s16 OpenOrienteering::OCAD8FileExport::exportPointSymbol ( const PointSymbol point)
protected

◆ exportSubPattern()

s16 OpenOrienteering::OCAD8FileExport::exportSubPattern ( const Object object,
const Symbol symbol,
OCADPoint **  buffer 
)
protected

◆ exportSymbolIcon()

void OpenOrienteering::OCAD8FileExport::exportSymbolIcon ( const Symbol symbol,
u8  ocad_icon[] 
)
protected

◆ exportTextCoordinates()

u16 OpenOrienteering::OCAD8FileExport::exportTextCoordinates ( TextObject object,
OCADPoint **  buffer 
)
protected

◆ exportTextSymbol()

s16 OpenOrienteering::OCAD8FileExport::exportTextSymbol ( const TextSymbol text)
protected

◆ getOcadColor()

int OpenOrienteering::OCAD8FileExport::getOcadColor ( QRgb  rgb)
staticprotected

◆ getPatternSize()

int OpenOrienteering::OCAD8FileExport::getPatternSize ( const PointSymbol point)
protected

◆ getPointSymbolExtent()

s16 OpenOrienteering::OCAD8FileExport::getPointSymbolExtent ( const PointSymbol symbol)
protected

◆ setTextSymbolFormatting()

void OpenOrienteering::OCAD8FileExport::setTextSymbolFormatting ( OCADTextSymbol *  ocad_symbol,
TextObject formatting 
)
protected

The documentation for this class was generated from the following files: