Mapper  0.9.0
API documentation
Classes | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Friends | List of all members
OpenOrienteering::Map Class Reference

Central class for an OpenOrienteering map. More...

#include <map.h>

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

Public Types

enum  ImportModeFlag {
  ObjectImport = 0x00, SymbolImport = 0x01, ColorImport = 0x02, GeorefImport = 0x10,
  MinimalImport = 0x20, MinimalSymbolImport = SymbolImport | MinimalImport, MinimalObjectImport = ObjectImport | MinimalImport, CompleteImport = ObjectImport | GeorefImport
}
 Different strategies for importing elements from another map. More...
 
enum  SelectionVisibility { FullVisibility, PartialVisibility, IgnoreVisibilty }
 Options for zooming to visibility of selection. More...
 
typedef std::set< Object * > ObjectSelection
 A set of selected objects represented by a std::set of object pointers. More...
 

Public Slots

void updateSymbolIconZoom ()
 Updates the symbol icon zoom from the current set of symbols. More...
 

Signals

void hasUnsavedChanged (bool is_clean)
 Emitted when a the map enters or leaves the state which is saved on map. More...
 
void colorAdded (int pos, const OpenOrienteering::MapColor *color)
 Emitted when a color is added to the map, gives the color's index and pointer. More...
 
void colorChanged (int pos, const OpenOrienteering::MapColor *color)
 Emitted when a map color is changed, gives the color's index and pointer. More...
 
void colorDeleted (int pos, const OpenOrienteering::MapColor *old_color)
 Emitted when a map color is deleted, gives the color's index and pointer. More...
 
void spotColorPresenceChanged (bool has_spot_colors) const
 Emitted when the presence of spot colors in the map changes. More...
 
void symbolAdded (int pos, const OpenOrienteering::Symbol *symbol)
 Emitted when a symbol is added to the map, gives the symbol's index and pointer. More...
 
void symbolChanged (int pos, const OpenOrienteering::Symbol *new_symbol, const OpenOrienteering::Symbol *old_symbol)
 Emitted when a symbol in the map is changed. More...
 
void symbolIconChanged (int pos)
 Emitted when the icon of the symbol with the given index changes. More...
 
void symbolDeleted (int pos, const OpenOrienteering::Symbol *old_symbol)
 Emitted when a symbol in the map is deleted. More...
 
void symbolIconZoomChanged ()
 Emitted when the symbol icon zoom changes. More...
 
void templateAdded (int pos, OpenOrienteering::Template *temp)
 Emitted when a template is added to the map, gives the template's index and pointer. More...
 
void templateChanged (int pos, OpenOrienteering::Template *temp)
 Emitted when a template in the map is changed, gives the template's index and pointer. More...
 
void templateDeleted (int pos, const OpenOrienteering::Template *old_temp)
 Emitted when a template in the map is deleted, gives the template's index and pointer. More...
 
void closedTemplateAvailabilityChanged ()
 Emitted when the number of closed templates changes between zero and one. More...
 
void objectSelectionChanged ()
 Emitted when the set of selected objects changes. More...
 
void selectedObjectEdited ()
 Emitted when at least one of the selected objects is edited in any way. More...
 
void currentMapPartChanged (const OpenOrienteering::MapPart *part)
 Emitted when the map part currently used for drawing changes. More...
 
void currentMapPartIndexChanged (std::size_t index)
 Emitted when the index of map part currently used for drawing changes. More...
 
void mapPartAdded (std::size_t index, const OpenOrienteering::MapPart *part)
 Emitted when a part is added to the map. More...
 
void mapPartChanged (std::size_t index, const OpenOrienteering::MapPart *part)
 Emitted when a part's properties are changed. More...
 
void mapPartDeleted (std::size_t index, const OpenOrienteering::MapPart *part)
 Emitted when a part is removed from the map. More...
 

Public Member Functions

 Map ()
 Creates a new, empty map. More...
 
 ~Map () override
 Destroys the map. More...
 
void clear ()
 Deletes all map data. More...
 
void init ()
 Initializes an empty map. More...
 
void reset ()
 Deletes all map data, and reinitializes the empty map. More...
 
bool loadFrom (const QString &path, MapView *view=nullptr)
 Attempts to load the map from the specified path. More...
 
QHash< const Symbol *, Symbol * > importMap (const Map &imported_map, ImportMode mode, std::vector< bool > *filter=nullptr, int symbol_insert_pos=-1, bool merge_duplicate_symbols=true)
 Imports another map into this map. More...
 
QHash< const Symbol *, Symbol * > importMap (const Map &imported_map, ImportMode mode, const QTransform &transform, std::vector< bool > *filter=nullptr, int symbol_insert_pos=-1, bool merge_duplicate_symbols=true)
 Imports another map into this map. More...
 
bool exportToIODevice (QIODevice &device) const
 Serializes the map directly to the given IO device, in a fixed format. More...
 
bool importFromIODevice (QIODevice &device)
 Loads the map directly from the given IO device. More...
 
void draw (QPainter *painter, const RenderConfig &config)
 Draws the part of the map which is visible in the bounding box. More...
 
void drawOverprintingSimulation (QPainter *painter, const RenderConfig &config)
 Draws a spot color overprinting simulation for the part of the map which is visible in the given bounding box. More...
 
void drawColorSeparation (QPainter *painter, const RenderConfig &config, const MapColor *spot_color, bool use_color=false)
 Draws the separation for a particular spot color for the part of the map which is visible in the given bounding box. More...
 
void drawGrid (QPainter *painter, const QRectF &bounding_box)
 Draws the map grid. More...
 
void drawTemplates (QPainter *painter, const QRectF &bounding_box, int first_template, int last_template, const MapView *view, bool on_screen) const
 Draws the templates with indices first_template until last_template which are visible in the given bounding box. More...
 
void updateObjects ()
 Updates the renderables and extent of all objects which have changed. More...
 
QRectF calculateExtent (bool include_helper_symbols=false, bool include_templates=false, const MapView *view=nullptr) const
 Calculates the extent of all map elements. More...
 
void addMapWidget (MapWidget *widget)
 Must be called to notify the map of new widgets displaying it. More...
 
void removeMapWidget (MapWidget *widget)
 Removes the map widget, see addMapWidget(). More...
 
void updateAllMapWidgets ()
 Redraws all map widgets completely - this can be slow! Try to avoid this and do partial redraws instead, if possible. More...
 
void ensureVisibilityOfSelectedObjects (SelectionVisibility visibility)
 Makes sure that the selected object(s) are visible in all map widgets by moving the views in the widgets to the selected objects. More...
 
void setDrawingBoundingBox (const QRectF &map_coords_rect, int pixel_border, bool do_update=true)
 Sets the rect (given in map coordinates) as "dirty rect" for every map widget showing this map, enlarged by the given pixel border. More...
 
void clearDrawingBoundingBox ()
 Removes the drawing bounding box and triggers a repaint. More...
 
void setActivityBoundingBox (const QRectF &map_coords_rect, int pixel_border, bool do_update=true)
 This is the analogon to setDrawingBoundingBox() for activities. More...
 
void clearActivityBoundingBox ()
 This is the analogon to clearDrawingBoundingBox() for activities. More...
 
void updateDrawing (const QRectF &map_coords_rect, int pixel_border)
 Updates all dynamic drawings at the given positions, i.e. More...
 
QString translate (const QString &symbol_text) const
 Returns a translated symbol text (name or description), or the original text. More...
 
QString raw_translation (const QString &symbol_text) const
 Returns a translated symbol text (name or description), or an empty string. More...
 
int getNumColors () const
 Returns the number of map colors defined in this map. More...
 
const MapColorgetMapColor (int i) const
 Returns a pointer to the MapColor identified by the non-negative priority i. More...
 
MapColorgetMapColor (int i)
 Returns a pointer to the MapColor identified by the non-negative priority i. More...
 
const MapColorgetColor (int i) const
 Returns a pointer to the const MapColor identified by the priority i. More...
 
void setColor (MapColor *color, int pos)
 Replaces the color at index pos with the given color, updates dependent colors and symbol icons. More...
 
void addColor (MapColor *color, int pos)
 Adds the given color as a new color at the given index. More...
 
void deleteColor (int pos)
 Deletes the color at the given index. More...
 
int findColorIndex (const MapColor *color) const
 Loops through the color list, looking for the given color pointer. More...
 
void setColorsDirty ()
 Marks the colors as "dirty", i.e. More...
 
void useColorsFrom (Map *map)
 Makes this map use the color set from the given map. More...
 
bool isColorUsedByASymbol (const MapColor *color) const
 Checks and returns if the given color is used by at least one symbol. More...
 
void determineColorsInUse (const std::vector< bool > &by_which_symbols, std::vector< bool > &out) const
 Checks which colors are in use by the symbols in this map. More...
 
bool hasSpotColors () const
 Returns true if the map contains spot colors. More...
 
bool hasAlpha () const
 Returns true if any visible object uses a non-opaque color. More...
 
QString symbolSetId () const
 Returns the symbol set ID. More...
 
void setSymbolSetId (const QString &id)
 Sets the symbol set ID. More...
 
int getNumSymbols () const
 Returns the number of symbols in this map. More...
 
const SymbolgetSymbol (int i) const
 Returns a pointer to the i-th symbol. More...
 
SymbolgetSymbol (int i)
 Returns a pointer to the i-th symbol. More...
 
void setSymbol (Symbol *symbol, int pos)
 Replaces the symbol at the given index with another symbol. More...
 
void addSymbol (Symbol *symbol, int pos)
 Adds the given symbol at the specified index. More...
 
void moveSymbol (int from, int to)
 Moves a symbol from one index to another in the symbol list. More...
 
template<typename T >
void sortSymbols (T compare)
 Sorts the symbol list using the given comparator. More...
 
void deleteSymbol (int pos)
 Deletes the symbol at the given index. More...
 
int findSymbolIndex (const Symbol *symbol) const
 Loops over all symbols, looking for the given symbol pointer. More...
 
void setSymbolsDirty ()
 Marks the symbols as "dirty", i.e. More...
 
void updateSymbolIcons (const MapColor *color)
 Updates the icons of all symbols with the given color. More...
 
void scaleAllSymbols (double factor)
 Scales all symbols by the given factor. More...
 
void determineSymbolsInUse (std::vector< bool > &out) const
 Checks which symbols are in use in this map. More...
 
void determineSymbolUseClosure (std::vector< bool > &symbol_bitfield) const
 Adds to the given symbol bitfield all other symbols which are needed to display the symbols indicated by the bitfield because of symbol dependencies. More...
 
qreal symbolIconZoom () const
 Returns the scale factor to be used for default symbol icons. More...
 
int getNumTemplates () const
 Returns the number of templates in this map. More...
 
const TemplategetTemplate (int i) const
 Returns the i-th template. More...
 
TemplategetTemplate (int i)
 Returns the i-th template. More...
 
void setFirstFrontTemplate (int pos)
 Sets the template index which is the first (lowest) to be drawn in front of the map. More...
 
int getFirstFrontTemplate () const
 Returns the template index which is the first (lowest) to be drawn in front of the map. More...
 
void setTemplate (Template *temp, int pos)
 Replaces the template at the given index with another. More...
 
void addTemplate (Template *temp, int pos)
 Adds a new template at the given index. More...
 
void removeTemplate (int pos)
 Removes the template with the given index from the template list, but does not delete it. More...
 
void deleteTemplate (int pos)
 Removes the template with the given position from the template list and deletes it. More...
 
void setTemplateAreaDirty (Template *temp, const QRectF &area, int pixel_border)
 Marks the area defined by the given QRectF (in map coordinates) and pixel border as "dirty", i.e. More...
 
void setTemplateAreaDirty (int i)
 Marks the whole area of the i-th template as "to be repainted". More...
 
int findTemplateIndex (const Template *temp) const
 Loops over all templates in the map and looks for the given template pointer. More...
 
void setTemplatesDirty ()
 Marks the template settings as "dirty", i.e. More...
 
void emitTemplateChanged (Template *temp)
 Emits templateChanged() for the given template. More...
 
int getNumClosedTemplates () const
 Returns the number of manually closed templates for which the settings are still stored. More...
 
const TemplategetClosedTemplate (int i) const
 Returns the i-th closed template. More...
 
TemplategetClosedTemplate (int i)
 Returns the i-th closed template. More...
 
void clearClosedTemplates ()
 Empties the list of closed templates. More...
 
void closeTemplate (int i)
 Removes the template with the given index from the normal template list, unloads the template file and adds the template to the closed template list. More...
 
bool reloadClosedTemplate (int i, int target_pos, QWidget *dialog_parent, const QString &map_path=QString())
 Removes the template with the given index from the closed template list, load the template file and adds the template to the normal template list again. More...
 
UndoManagerundoManager ()
 Returns the UndoManager instance for this map. More...
 
const UndoManagerundoManager () const
 Returns the UndoManager instance for this map. More...
 
void push (UndoStep *step)
 Pushes a new undo step to the map's undoManager. More...
 
int getNumParts () const
 Returns the number of map parts in this map. More...
 
MapPartgetPart (std::size_t i) const
 Returns the i-th map part. More...
 
void addPart (MapPart *part, std::size_t index)
 Adds the new part at the given index. More...
 
void removePart (std::size_t index)
 Removes the map part at position. More...
 
int findPartIndex (const MapPart *part) const
 Loops over all map parts, looking for the given part pointer. More...
 
MapPartgetCurrentPart () const
 Returns the current map part, i.e. More...
 
void setCurrentPart (MapPart *part)
 Changes the current map part. More...
 
std::size_t getCurrentPartIndex () const
 Returns the index of the current map part. More...
 
void setCurrentPartIndex (std::size_t index)
 Changes the current map part. More...
 
int reassignObjectsToMapPart (std::vector< int >::const_iterator first, std::vector< int >::const_iterator last, std::size_t source, std::size_t destination)
 Moves all specified objects from the source to the target map part. More...
 
int mergeParts (std::size_t source, std::size_t destination)
 Merges the source part with the destination part. More...
 
int getNumObjects () const
 Returns the total number of objects in this map (sum of all parts) More...
 
int addObject (Object *object, int part_index=-1)
 Adds the object as new object in the part with the given index, or in the current part if the default -1 is passed. More...
 
void deleteObject (Object *object, bool remove_only)
 Deletes the given object from the map. More...
 
void setObjectsDirty ()
 Marks the objects as "dirty", i.e. More...
 
void setObjectAreaDirty (const QRectF &map_coords_rect)
 Marks the area given by map_coords_rect as "dirty" in all map widgets, i.e. More...
 
void findObjectsAt (const MapCoordF &coord, float tolerance, bool treat_areas_as_paths, bool extended_selection, bool include_hidden_objects, bool include_protected_objects, SelectionInfoVector &out) const
 Finds and returns all objects at the given position in the current part. More...
 
void findAllObjectsAt (const MapCoordF &coord, float tolerance, bool treat_areas_as_paths, bool extended_selection, bool include_hidden_objects, bool include_protected_objects, SelectionInfoVector &out) const
 Finds and returns all objects at the given position in all parts. More...
 
void findObjectsAtBox (const MapCoordF &corner1, const MapCoordF &corner2, bool include_hidden_objects, bool include_protected_objects, std::vector< Object *> &out) const
 Finds and returns all objects intersecting the given box in the current part. More...
 
int countObjectsInRect (const QRectF &map_coord_rect, bool include_hidden_objects)
 Counts the objects whose bounding boxes intersect the given rect. More...
 
bool existsObject (const std::function< bool(const Object *)> &condition) const
 Applies a condition on all objects until the first match is found. More...
 
void applyOnMatchingObjects (const std::function< void(Object *)> &operation, const std::function< bool(const Object *)> &condition)
 Applies an operation on all objects which match a particular condition. More...
 
void applyOnMatchingObjects (const std::function< void(const Object *)> &operation, const std::function< bool(const Object *)> &condition) const
 Applies a function on all objects which match a particular condition. More...
 
void applyOnMatchingObjects (const std::function< void(Object *, MapPart *, int)> &operation, const std::function< bool(const Object *)> &condition)
 Applies an operation on all objects which match a particular condition. More...
 
void applyOnAllObjects (const std::function< void(Object *)> &operation)
 Applies an operation on all objects. More...
 
void applyOnAllObjects (const std::function< void(const Object *)> &operation) const
 Applies an operation on all objects. More...
 
void applyOnAllObjects (const std::function< void(Object *, MapPart *, int)> &operation)
 Applies an operation on all objects. More...
 
void scaleAllObjects (double factor, const MapCoord &scaling_center)
 Scales all objects by the given factor. More...
 
void rotateAllObjects (double rotation, const MapCoord &center)
 Rotates all objects by the given rotation angle (in radians). More...
 
void updateAllObjects ()
 Forces an update of all objects, i.e. More...
 
void updateAllObjectsWithSymbol (const Symbol *symbol)
 Forces an update of all objects with the given symbol. More...
 
void changeSymbolForAllObjects (const Symbol *old_symbol, const Symbol *new_symbol)
 For all symbols with old_symbol, replaces the symbol by new_symbol. More...
 
bool deleteAllObjectsWithSymbol (const Symbol *symbol)
 Deletes all objects with the given symbol. More...
 
bool existsObjectWithSymbol (const Symbol *symbol) const
 Returns if at least one object with the given symbol exists in the map. More...
 
void removeRenderablesOfObject (const Object *object, bool mark_area_as_dirty)
 Removes the renderables of the given object from display (does not delete them!). More...
 
void insertRenderablesOfObject (const Object *object)
 Inserts the renderables of the given object, so they will be displayed. More...
 
void markAsIrregular (Object *object)
 Marks an object as irregular. More...
 
const std::set< Object * > irregularObjects () const
 Returns the list of objects marked as irregular. More...
 
std::size_t deleteIrregularObjects ()
 Deletes the irregular objects. More...
 
const ObjectSelectionselectedObjects () const
 
int getNumSelectedObjects () const
 Returns the number of selected objects. More...
 
ObjectSelection::const_iterator selectedObjectsBegin () const
 Returns an iterator allowing to iterate over the selected objects. More...
 
ObjectSelection::const_iterator selectedObjectsEnd () const
 Returns an end iterator allowing to iterate over the selected objects. More...
 
const ObjectgetFirstSelectedObject () const
 Returns the object in the selection which was selected first by the user. More...
 
ObjectgetFirstSelectedObject ()
 Returns the object in the selection which was selected first by the user. More...
 
void getSelectionToSymbolCompatibility (const Symbol *symbol, bool &out_compatible, bool &out_different) const
 Checks the selected objects for compatibility with the given symbol. More...
 
void deleteSelectedObjects ()
 Deletes the selected objects and creates an undo step for this action. More...
 
void includeSelectionRect (QRectF &rect) const
 Enlarges the given rect to cover all selected objects. More...
 
void drawSelection (QPainter *painter, bool force_min_size, MapWidget *widget, MapRenderables *replacement_renderables=nullptr, bool draw_normal=false)
 Draws the selected objects. More...
 
void addObjectToSelection (Object *object, bool emit_selection_changed)
 Adds the given object to the selection. More...
 
void removeObjectFromSelection (Object *object, bool emit_selection_changed)
 Removes the given object from the selection. More...
 
bool removeSymbolFromSelection (const Symbol *symbol, bool emit_selection_changed)
 Removes from the selection all objects with the given symbol. More...
 
bool isObjectSelected (const Object *object) const
 Returns true if the given object is selected. More...
 
bool toggleObjectSelection (Object *object, bool emit_selection_changed)
 Toggles the selection of the given object. More...
 
void clearObjectSelection (bool emit_selection_changed)
 Empties the object selection. More...
 
void emitSelectionChanged ()
 Emits objectSelectionChanged(). More...
 
void emitSelectionEdited ()
 Emits selectedObjectEdited(). More...
 
void setScaleDenominator (unsigned int value)
 Sets the map's scale denominator. More...
 
unsigned int getScaleDenominator () const
 Returns the map's scale denominator. More...
 
void changeScale (unsigned int new_scale_denominator, const MapCoord &scaling_center, bool scale_symbols, bool scale_objects, bool scale_georeferencing, bool scale_templates)
 Changes the map's scale. More...
 
void rotateMap (double rotation, const MapCoord &center, bool adjust_georeferencing, bool adjust_declination, bool adjust_templates)
 Rotate the map around a point. More...
 
const QStringgetMapNotes () const
 Returns the map notes string. More...
 
void setMapNotes (const QString &text)
 Sets the map notes string. More...
 
const GeoreferencinggetGeoreferencing () const
 Returns the map's georeferencing object. More...
 
void setGeoreferencing (const Georeferencing &georeferencing)
 Assigns georeferencing settings for the map from the given object and sets the map to have unsaved changes. More...
 
const MapGridgetGrid () const
 Returns the map's grid settings. More...
 
void setGrid (const MapGrid &grid)
 Sets the map's grid settings from the given object and may set the map to have unsaved changes. More...
 
bool isAreaHatchingEnabled () const
 TODO: These two options should really be view options, but are not due to a limitation: the current architecture makes it impossible to have different renderables of the same objects in different views! More...
 
void setAreaHatchingEnabled (bool enabled)
 Sets if area hatching is enabled. More...
 
bool isBaselineViewEnabled () const
 Returns if the baseline view is enabled. More...
 
void setBaselineViewEnabled (bool enabled)
 Sets if the baseline view is enabled. More...
 
int renderableOptions () const
 Returns the rendering options as an int representing Symbol::RenderableOptions. More...
 
bool hasPrinterConfig () const noexcept
 Returns true if the map has a print configuration. More...
 
const MapPrinterConfigprinterConfig ()
 Returns a const reference to the current print configuration. More...
 
MapPrinterConfig printerConfig () const
 Returns a copy of the current print configuration. More...
 
void setPrinterConfig (const MapPrinterConfig &config)
 Sets the print configuration. More...
 
void resetPrinterConfig ()
 Clears the print configuration. More...
 
void getImageTemplateDefaults (bool &use_meters_per_pixel, double &meters_per_pixel, double &dpi, double &scale)
 Returns the default parameters for loading of image templates. More...
 
void setImageTemplateDefaults (bool use_meters_per_pixel, double meters_per_pixel, double dpi, double scale)
 Sets default parameters for loading of image templates. More...
 
bool hasUnsavedChanges () const
 Returns whether there are unsaved changes in the map. More...
 
void setHasUnsavedChanges (bool has_unsaved_changes)
 Do not use this in usual cases, see hasUnsavedChanged(). More...
 
bool areColorsDirty () const
 Returns if there are unsaved changes to the colors. More...
 
bool areSymbolsDirty () const
 Returns if there are unsaved changes to the symbols. More...
 
bool areTemplatesDirty () const
 Returns if there are unsaved changes to the templates. More...
 
bool areObjectsDirty () const
 Returns if there are unsaved changes to the objects. More...
 
bool isOtherDirty () const
 Returns if there are unsaved changes to anything else than the above. More...
 
void setOtherDirty ()
 Marks something unspecific in the map as "dirty", i.e. More...
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () const const
 
 QObject (QObject *parent)
 
virtual ~QObject ()
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
bool signalsBlocked () const const
 
bool blockSignals (bool block)
 
QThreadthread () const const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectListchildren () const const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const const
 
void dumpObjectInfo () const const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const const
 
QList< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 

Static Public Member Functions

static const MapColorgetCoveringRed ()
 Returns the special covering red color. More...
 
static const MapColorgetCoveringWhite ()
 Returns the special covering white color. More...
 
static const MapColorgetUndefinedColor ()
 Returns the special covering gray color for "undefined" objects. More...
 
static const MapColorgetRegistrationColor ()
 Returns the special registration color. More...
 
static LineSymbolgetCoveringWhiteLine ()
 Returns the special covering white line symbol. More...
 
static LineSymbolgetCoveringRedLine ()
 Returns the special covering red line symbol. More...
 
static CombinedSymbolgetCoveringCombinedLine ()
 Returns the special covering combined symbol (white + red). More...
 
static LineSymbolgetUndefinedLine ()
 Returns the special gray "undefined" line symbol. More...
 
static PointSymbolgetUndefinedPoint ()
 Returns the special gray "undefined" point symbol. More...
 
static TextSymbolgetUndefinedText ()
 Returns the special gray "undefined" text symbol. More...
 
- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 

Protected Slots

void checkSpotColorPresence ()
 
void undoCleanChanged (bool is_clean)
 

Friends

class MapTest
 
class MapRenderables
 
class OCAD8FileImport
 
class XMLFileImporter
 
class XMLFileExporter
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
QObjectsender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Central class for an OpenOrienteering map.

Member Typedef Documentation

◆ ObjectSelection

A set of selected objects represented by a std::set of object pointers.

Member Enumeration Documentation

◆ ImportModeFlag

Different strategies for importing elements from another map.

Enumerator
ObjectImport 

Import objects, symbols and colors.

SymbolImport 

Import symbols and colors.

ColorImport 

Import colors.

GeorefImport 

Use the georeferencing for object import.

MinimalImport 

Imports with minimal symbol and color dependencies.

MinimalSymbolImport 
MinimalObjectImport 
CompleteImport 

◆ SelectionVisibility

Options for zooming to visibility of selection.

Enumerator
FullVisibility 
PartialVisibility 
IgnoreVisibilty 

Constructor & Destructor Documentation

◆ Map()

OpenOrienteering::Map::Map ( )

Creates a new, empty map.

◆ ~Map()

OpenOrienteering::Map::~Map ( )
override

Destroys the map.

Member Function Documentation

◆ addColor()

void OpenOrienteering::Map::addColor ( MapColor color,
int  pos 
)

Adds the given color as a new color at the given index.

Emits colorAdded().

◆ addMapWidget()

void OpenOrienteering::Map::addMapWidget ( MapWidget widget)

Must be called to notify the map of new widgets displaying it.

Useful to notify the widgets about which parts of the map have changed and need to be redrawn.

◆ addObject()

int OpenOrienteering::Map::addObject ( Object object,
int  part_index = -1 
)

Adds the object as new object in the part with the given index, or in the current part if the default -1 is passed.

Returns the index of the added object in the part.

◆ addObjectToSelection()

void OpenOrienteering::Map::addObjectToSelection ( Object object,
bool  emit_selection_changed 
)

Adds the given object to the selection.

Parameters
objectThe object to add.
emit_selection_changedSet to true if objectSelectionChanged() should be emitted. Do this only for the last in a sequence of selection change oparations to prevent bad performance!

◆ addPart()

void OpenOrienteering::Map::addPart ( MapPart part,
std::size_t  index 
)

Adds the new part at the given index.

◆ addSymbol()

void OpenOrienteering::Map::addSymbol ( Symbol symbol,
int  pos 
)

Adds the given symbol at the specified index.

Emits symbolAdded().

◆ addTemplate()

void OpenOrienteering::Map::addTemplate ( Template temp,
int  pos 
)

Adds a new template at the given index.

To place a template immediately below the map, adjust first_front_template manually with setFirstFrontTemplate()!

◆ applyOnAllObjects() [1/3]

void OpenOrienteering::Map::applyOnAllObjects ( const std::function< void(Object *)> &  operation)

Applies an operation on all objects.

◆ applyOnAllObjects() [2/3]

void OpenOrienteering::Map::applyOnAllObjects ( const std::function< void(const Object *)> &  operation) const

Applies an operation on all objects.

◆ applyOnAllObjects() [3/3]

void OpenOrienteering::Map::applyOnAllObjects ( const std::function< void(Object *, MapPart *, int)> &  operation)

Applies an operation on all objects.

◆ applyOnMatchingObjects() [1/3]

void OpenOrienteering::Map::applyOnMatchingObjects ( const std::function< void(Object *)> &  operation,
const std::function< bool(const Object *)> &  condition 
)

Applies an operation on all objects which match a particular condition.

◆ applyOnMatchingObjects() [2/3]

void OpenOrienteering::Map::applyOnMatchingObjects ( const std::function< void(const Object *)> &  operation,
const std::function< bool(const Object *)> &  condition 
) const

Applies a function on all objects which match a particular condition.

◆ applyOnMatchingObjects() [3/3]

void OpenOrienteering::Map::applyOnMatchingObjects ( const std::function< void(Object *, MapPart *, int)> &  operation,
const std::function< bool(const Object *)> &  condition 
)

Applies an operation on all objects which match a particular condition.

◆ areColorsDirty()

bool OpenOrienteering::Map::areColorsDirty ( ) const
inline

Returns if there are unsaved changes to the colors.

◆ areObjectsDirty()

bool OpenOrienteering::Map::areObjectsDirty ( ) const
inline

Returns if there are unsaved changes to the objects.

◆ areSymbolsDirty()

bool OpenOrienteering::Map::areSymbolsDirty ( ) const
inline

Returns if there are unsaved changes to the symbols.

◆ areTemplatesDirty()

bool OpenOrienteering::Map::areTemplatesDirty ( ) const
inline

Returns if there are unsaved changes to the templates.

◆ calculateExtent()

QRectF OpenOrienteering::Map::calculateExtent ( bool  include_helper_symbols = false,
bool  include_templates = false,
const MapView view = nullptr 
) const

Calculates the extent of all map elements.

If templates shall be included, view may either be nullptr to include all templates, or specify a MapView to take the template visibilities from.

◆ changeScale()

void OpenOrienteering::Map::changeScale ( unsigned int  new_scale_denominator,
const MapCoord scaling_center,
bool  scale_symbols,
bool  scale_objects,
bool  scale_georeferencing,
bool  scale_templates 
)

Changes the map's scale.

Parameters
new_scale_denominatorThe new scale denominator.
scaling_centerThe coordinate to use as scaling center.
scale_symbolsWhether to scale the map symbols.
scale_objectsWhether to scale the map object coordinates.
scale_georeferencingWhether to adjust the map's georeferencing reference point.
scale_templatesWhether to scale non-georeferenced templates.

◆ changeSymbolForAllObjects()

void OpenOrienteering::Map::changeSymbolForAllObjects ( const Symbol old_symbol,
const Symbol new_symbol 
)

For all symbols with old_symbol, replaces the symbol by new_symbol.

◆ checkSpotColorPresence

void OpenOrienteering::Map::checkSpotColorPresence ( )
protectedslot

◆ clear()

void OpenOrienteering::Map::clear ( )

Deletes all map data.

The resulting map must not be modified before another init().

◆ clearActivityBoundingBox()

void OpenOrienteering::Map::clearActivityBoundingBox ( )

This is the analogon to clearDrawingBoundingBox() for activities.

See clearDrawingBoundingBox().

◆ clearClosedTemplates()

void OpenOrienteering::Map::clearClosedTemplates ( )

Empties the list of closed templates.

◆ clearDrawingBoundingBox()

void OpenOrienteering::Map::clearDrawingBoundingBox ( )

Removes the drawing bounding box and triggers a repaint.

Use this if the current drawing is hidden or erased.

◆ clearObjectSelection()

void OpenOrienteering::Map::clearObjectSelection ( bool  emit_selection_changed)

Empties the object selection.

Parameters
emit_selection_changedSee addObjectToSelection().

◆ closedTemplateAvailabilityChanged

void OpenOrienteering::Map::closedTemplateAvailabilityChanged ( )
signal

Emitted when the number of closed templates changes between zero and one.

◆ closeTemplate()

void OpenOrienteering::Map::closeTemplate ( int  i)

Removes the template with the given index from the normal template list, unloads the template file and adds the template to the closed template list.

NOTE: if required, adjust first_front_template manually with setFirstFrontTemplate()!

◆ colorAdded

void OpenOrienteering::Map::colorAdded ( int  pos,
const OpenOrienteering::MapColor color 
)
signal

Emitted when a color is added to the map, gives the color's index and pointer.

◆ colorChanged

void OpenOrienteering::Map::colorChanged ( int  pos,
const OpenOrienteering::MapColor color 
)
signal

Emitted when a map color is changed, gives the color's index and pointer.

◆ colorDeleted

void OpenOrienteering::Map::colorDeleted ( int  pos,
const OpenOrienteering::MapColor old_color 
)
signal

Emitted when a map color is deleted, gives the color's index and pointer.

◆ countObjectsInRect()

int OpenOrienteering::Map::countObjectsInRect ( const QRectF map_coord_rect,
bool  include_hidden_objects 
)

Counts the objects whose bounding boxes intersect the given rect.

This may be inaccurate because the true object shapes usually differ from the bounding boxes.

Parameters
map_coord_rectThe query rect.
include_hidden_objectsSet to true if you want to find hidden objects.

◆ currentMapPartChanged

void OpenOrienteering::Map::currentMapPartChanged ( const OpenOrienteering::MapPart part)
signal

Emitted when the map part currently used for drawing changes.

See also
currentMapPartIndexChanged()

◆ currentMapPartIndexChanged

void OpenOrienteering::Map::currentMapPartIndexChanged ( std::size_t  index)
signal

Emitted when the index of map part currently used for drawing changes.

This signal may be emitted even when the current MapPart object does not change. This happens when the index changes due to addition or removal of map parts.

◆ deleteAllObjectsWithSymbol()

bool OpenOrienteering::Map::deleteAllObjectsWithSymbol ( const Symbol symbol)

Deletes all objects with the given symbol.

Returns
True if at least one object was deleted, false otherwise

◆ deleteColor()

void OpenOrienteering::Map::deleteColor ( int  pos)

Deletes the color at the given index.

Emits colorDeleted().

◆ deleteIrregularObjects()

std::size_t OpenOrienteering::Map::deleteIrregularObjects ( )

Deletes the irregular objects.

This function deletes the objects which were previously marked as irregular. Only objects which are actually member of map parts are deleted. Objects in undo steps or similar are ignored.

Returns
The number of deleted objects.

◆ deleteObject()

void OpenOrienteering::Map::deleteObject ( Object object,
bool  remove_only 
)

Deletes the given object from the map.

remove_only will remove the object from the map, but not call "delete object"; be sure to call removeObjectFromSelection() if necessary.

TODO: make a separate method "removeObject()", remove_only is misleading!

◆ deleteSelectedObjects()

void OpenOrienteering::Map::deleteSelectedObjects ( )

Deletes the selected objects and creates an undo step for this action.

◆ deleteSymbol()

void OpenOrienteering::Map::deleteSymbol ( int  pos)

Deletes the symbol at the given index.

Emits symbolDeleted().

◆ deleteTemplate()

void OpenOrienteering::Map::deleteTemplate ( int  pos)

Removes the template with the given position from the template list and deletes it.

NOTE: if required, adjust first_front_template manually with setFirstFrontTemplate()!

◆ determineColorsInUse()

void OpenOrienteering::Map::determineColorsInUse ( const std::vector< bool > &  by_which_symbols,
std::vector< bool > &  out 
) const

Checks which colors are in use by the symbols in this map.

WARNING (FIXME): returns an empty list if the map does not contain symbols!

Parameters
by_which_symbolsMust be of the same size as the symbol set. If set to false for a symbol, it will be disregarded.
outOutput parameter: a vector of the same size as the color list, where each element is set to true if the color is used by at least one symbol.

◆ determineSymbolsInUse()

void OpenOrienteering::Map::determineSymbolsInUse ( std::vector< bool > &  out) const

Checks which symbols are in use in this map.

Returns a vector of the same size as the symbol list, where each element is set to true if there is at least one object which uses this symbol or a derived (combined) symbol.

◆ determineSymbolUseClosure()

void OpenOrienteering::Map::determineSymbolUseClosure ( std::vector< bool > &  symbol_bitfield) const

Adds to the given symbol bitfield all other symbols which are needed to display the symbols indicated by the bitfield because of symbol dependencies.

◆ draw()

void OpenOrienteering::Map::draw ( QPainter painter,
const RenderConfig config 
)

Draws the part of the map which is visible in the bounding box.

Parameters
painterThe QPainter used for drawing.
configThe rendering configuration

◆ drawColorSeparation()

void OpenOrienteering::Map::drawColorSeparation ( QPainter painter,
const RenderConfig config,
const MapColor spot_color,
bool  use_color = false 
)

Draws the separation for a particular spot color for the part of the map which is visible in the given bounding box.

Separations are normally drawn in levels of gray where black means full tone of the spot color. The parameter use_color can be used to draw in the actual spot color instead.

Parameters
painterThe QPainter used for drawing.
configThe rendering configuration
spot_colorThe spot color to draw the separation for.
use_colorIf true, forces the separation to be drawn in its actual color.

◆ drawGrid()

void OpenOrienteering::Map::drawGrid ( QPainter painter,
const QRectF bounding_box 
)

Draws the map grid.

Parameters
painterThe QPainter used for drawing.
bounding_boxBounding box of area to draw, given in map coordinates.

◆ drawOverprintingSimulation()

void OpenOrienteering::Map::drawOverprintingSimulation ( QPainter painter,
const RenderConfig config 
)

Draws a spot color overprinting simulation for the part of the map which is visible in the given bounding box.

Parameters
painterMust be a QPainter on a QImage of Format_ARGB32_Premultiplied.
configThe rendering configuration

◆ drawSelection()

void OpenOrienteering::Map::drawSelection ( QPainter painter,
bool  force_min_size,
MapWidget widget,
MapRenderables replacement_renderables = nullptr,
bool  draw_normal = false 
)

Draws the selected objects.

Parameters
painterThe QPainter used for drawing.
force_min_sizeSee draw().
widgetThe widget in which the drawing happens. Used to get view and viewport information.
replacement_renderablesIf given, draws these renderables instead Of the selection renderables. TODO: HACK
draw_normalIf set to true, draws the objects like normal objects, otherwise draws transparent highlights.

◆ drawTemplates()

void OpenOrienteering::Map::drawTemplates ( QPainter painter,
const QRectF bounding_box,
int  first_template,
int  last_template,
const MapView view,
bool  on_screen 
) const

Draws the templates with indices first_template until last_template which are visible in the given bounding box.

view determines template visibility and can be nullptr to show all templates. The initial transform of the given QPainter must be the map-to-paintdevice transformation. If on_screen is set to true, some optimizations will be applied, leading to a possibly lower display quality.

Parameters
painterThe QPainter used for drawing.
bounding_boxBounding box of area to draw, given in map coordinates.
first_templateLowest index of the template range to draw.
last_templateHighest index of the template range to draw.
viewOptional pointer to MapView object which is used to query template visibilities.
on_screenPotentially enables some drawing optimizations which decrease drawing quality. Should be enabled when drawing on-screen.

◆ emitSelectionChanged()

void OpenOrienteering::Map::emitSelectionChanged ( )

Emits objectSelectionChanged().

Use this if setting emit_selection_changed in a selection change method is unfeasible.

◆ emitSelectionEdited()

void OpenOrienteering::Map::emitSelectionEdited ( )

Emits selectedObjectEdited().

Use this after making changes to a selected object.

◆ emitTemplateChanged()

void OpenOrienteering::Map::emitTemplateChanged ( Template temp)

Emits templateChanged() for the given template.

◆ ensureVisibilityOfSelectedObjects()

void OpenOrienteering::Map::ensureVisibilityOfSelectedObjects ( SelectionVisibility  visibility)

Makes sure that the selected object(s) are visible in all map widgets by moving the views in the widgets to the selected objects.

◆ existsObject()

bool OpenOrienteering::Map::existsObject ( const std::function< bool(const Object *)> &  condition) const

Applies a condition on all objects until the first match is found.

Returns
True if there is an object matching the condition, false otherwise.

◆ existsObjectWithSymbol()

bool OpenOrienteering::Map::existsObjectWithSymbol ( const Symbol symbol) const

Returns if at least one object with the given symbol exists in the map.

WARNING: Even if no objects exist directly, the symbol could still be required by another (combined) symbol used by an object!

◆ exportToIODevice()

bool OpenOrienteering::Map::exportToIODevice ( QIODevice device) const

Serializes the map directly to the given IO device, in a fixed format.

This can be imported again using importFromIODevice(). Returns true if successful.

◆ findAllObjectsAt()

void OpenOrienteering::Map::findAllObjectsAt ( const MapCoordF coord,
float  tolerance,
bool  treat_areas_as_paths,
bool  extended_selection,
bool  include_hidden_objects,
bool  include_protected_objects,
SelectionInfoVector out 
) const

Finds and returns all objects at the given position in all parts.

See also
Map::findObjectsAt

◆ findColorIndex()

int OpenOrienteering::Map::findColorIndex ( const MapColor color) const

Loops through the color list, looking for the given color pointer.

Returns the index of the color, or -1 if it is not found.

◆ findObjectsAt()

void OpenOrienteering::Map::findObjectsAt ( const MapCoordF coord,
float  tolerance,
bool  treat_areas_as_paths,
bool  extended_selection,
bool  include_hidden_objects,
bool  include_protected_objects,
SelectionInfoVector out 
) const

Finds and returns all objects at the given position in the current part.

Parameters
coordCoordinate where to query objects.
toleranceAllowed distance from the query coordinate to the objects.
treat_areas_as_pathsIf set to true, areas will be treated as paths, i.e. they will be returned only if the query coordinate is close to their border, not in all cases where the query coordinate is inside the area.
extended_selectionIf set to true, more object than defined by the default behavior will be selected. For example, by default point objects will only be returned if the query coord is close to the point object coord. With extended_selection, they are also returned if the query coord is just inside the graphical extent of the point object. This can be used for a two-pass algorithm to find the most relevant objects first, and then query for all objects if no objects are found in the first pass.
include_hidden_objectsSet to true if you want to find hidden objects.
include_protected_objectsSet to true if you want to find protected objects.
outOutput parameter. Will be filled with pairs of symbol types and corresponding objects. The symbol type describes the way in which an object has been found and is taken from Symbol::Type. This is e.g. important for combined symbols, which can be found from a line or an area.

◆ findObjectsAtBox()

void OpenOrienteering::Map::findObjectsAtBox ( const MapCoordF corner1,
const MapCoordF corner2,
bool  include_hidden_objects,
bool  include_protected_objects,
std::vector< Object *> &  out 
) const

Finds and returns all objects intersecting the given box in the current part.

Parameters
corner1First corner of the query box.
corner2Second corner of the query box.
include_hidden_objectsSet to true if you want to find hidden objects.
include_protected_objectsSet to true if you want to find protected objects.
outOutput parameter. Will be filled with an object list.

◆ findPartIndex()

int OpenOrienteering::Map::findPartIndex ( const MapPart part) const

Loops over all map parts, looking for the given part pointer.

Returns the part's index in the list. The part must be contained in the map, otherwise an assert will be triggered!

◆ findSymbolIndex()

int OpenOrienteering::Map::findSymbolIndex ( const Symbol symbol) const

Loops over all symbols, looking for the given symbol pointer.

Returns the index of the symbol, or -1 if the symbol is not found. For the "undefined" symbols, returns special indices smaller than -1.

◆ findTemplateIndex()

int OpenOrienteering::Map::findTemplateIndex ( const Template temp) const

Loops over all templates in the map and looks for the given template pointer.

Returns the index of the template. The template must be contained in the map, otherwise an assert will be triggered!

◆ getClosedTemplate() [1/2]

const Template * OpenOrienteering::Map::getClosedTemplate ( int  i) const
inline

Returns the i-th closed template.

◆ getClosedTemplate() [2/2]

Template * OpenOrienteering::Map::getClosedTemplate ( int  i)
inline

Returns the i-th closed template.

◆ getColor()

const MapColor * OpenOrienteering::Map::getColor ( int  i) const
inline

Returns a pointer to the const MapColor identified by the priority i.

Parameter i may also be negative for specifying special reserved colors. This is different from getMapColor();

Returns nullptr if the color is not defined.

◆ getCoveringCombinedLine()

CombinedSymbol * OpenOrienteering::Map::getCoveringCombinedLine ( )
inlinestatic

Returns the special covering combined symbol (white + red).

◆ getCoveringRed()

const MapColor * OpenOrienteering::Map::getCoveringRed ( )
inlinestatic

Returns the special covering red color.

◆ getCoveringRedLine()

LineSymbol * OpenOrienteering::Map::getCoveringRedLine ( )
inlinestatic

Returns the special covering red line symbol.

◆ getCoveringWhite()

const MapColor * OpenOrienteering::Map::getCoveringWhite ( )
inlinestatic

Returns the special covering white color.

◆ getCoveringWhiteLine()

LineSymbol * OpenOrienteering::Map::getCoveringWhiteLine ( )
inlinestatic

Returns the special covering white line symbol.

◆ getCurrentPart()

MapPart * OpenOrienteering::Map::getCurrentPart ( ) const
inline

Returns the current map part, i.e.

the part where edit operations happen.

◆ getCurrentPartIndex()

std::size_t OpenOrienteering::Map::getCurrentPartIndex ( ) const
inline

Returns the index of the current map part.

See also
getCurrentPart().

◆ getFirstFrontTemplate()

int OpenOrienteering::Map::getFirstFrontTemplate ( ) const
inline

Returns the template index which is the first (lowest) to be drawn in front of the map.

◆ getFirstSelectedObject() [1/2]

const Object * OpenOrienteering::Map::getFirstSelectedObject ( ) const
inline

Returns the object in the selection which was selected first by the user.

If she later deselects it while other objects are still selected or if the selection is done as box selection, this "first" selected object is just a more or less random object from the selection.

◆ getFirstSelectedObject() [2/2]

Object * OpenOrienteering::Map::getFirstSelectedObject ( )
inline

Returns the object in the selection which was selected first by the user.

◆ getGeoreferencing()

const Georeferencing & OpenOrienteering::Map::getGeoreferencing ( ) const
inline

Returns the map's georeferencing object.

◆ getGrid()

const MapGrid & OpenOrienteering::Map::getGrid ( ) const
inline

Returns the map's grid settings.

◆ getImageTemplateDefaults()

void OpenOrienteering::Map::getImageTemplateDefaults ( bool use_meters_per_pixel,
double &  meters_per_pixel,
double &  dpi,
double &  scale 
)

Returns the default parameters for loading of image templates.

◆ getMapColor() [1/2]

const MapColor * OpenOrienteering::Map::getMapColor ( int  i) const
inline

Returns a pointer to the MapColor identified by the non-negative priority i.

Returns nullptr if the color is not defined, or if it is a special color (i.e i<0), i.e. only actual map colors are returned.

◆ getMapColor() [2/2]

MapColor * OpenOrienteering::Map::getMapColor ( int  i)
inline

Returns a pointer to the MapColor identified by the non-negative priority i.

Returns nullptr if the color is not defined, or if it is a special color (i.e i<0), i.e. only actual map colors are returned.

◆ getMapNotes()

const QString & OpenOrienteering::Map::getMapNotes ( ) const
inline

Returns the map notes string.

◆ getNumClosedTemplates()

int OpenOrienteering::Map::getNumClosedTemplates ( ) const
inline

Returns the number of manually closed templates for which the settings are still stored.

◆ getNumColors()

int OpenOrienteering::Map::getNumColors ( ) const
inline

Returns the number of map colors defined in this map.

◆ getNumObjects()

int OpenOrienteering::Map::getNumObjects ( ) const

Returns the total number of objects in this map (sum of all parts)

◆ getNumParts()

int OpenOrienteering::Map::getNumParts ( ) const
inline

Returns the number of map parts in this map.

◆ getNumSelectedObjects()

int OpenOrienteering::Map::getNumSelectedObjects ( ) const
inline

Returns the number of selected objects.

◆ getNumSymbols()

int OpenOrienteering::Map::getNumSymbols ( ) const
inline

Returns the number of symbols in this map.

◆ getNumTemplates()

int OpenOrienteering::Map::getNumTemplates ( ) const
inline

Returns the number of templates in this map.

◆ getPart()

MapPart * OpenOrienteering::Map::getPart ( std::size_t  i) const
inline

Returns the i-th map part.

◆ getRegistrationColor()

const MapColor * OpenOrienteering::Map::getRegistrationColor ( )
inlinestatic

Returns the special registration color.

◆ getScaleDenominator()

unsigned int OpenOrienteering::Map::getScaleDenominator ( ) const

Returns the map's scale denominator.

◆ getSelectionToSymbolCompatibility()

void OpenOrienteering::Map::getSelectionToSymbolCompatibility ( const Symbol symbol,
bool out_compatible,
bool out_different 
) const

Checks the selected objects for compatibility with the given symbol.

Parameters
symbolthe symbol to check compatibility for
out_compatiblereturns if all selected objects are compatible to the given symbol
out_differentreturns if at least one of the selected objects' symbols is different to the given symbol

◆ getSymbol() [1/2]

const Symbol * OpenOrienteering::Map::getSymbol ( int  i) const

Returns a pointer to the i-th symbol.

◆ getSymbol() [2/2]

Symbol * OpenOrienteering::Map::getSymbol ( int  i)

Returns a pointer to the i-th symbol.

◆ getTemplate() [1/2]

const Template * OpenOrienteering::Map::getTemplate ( int  i) const
inline

Returns the i-th template.

◆ getTemplate() [2/2]

Template * OpenOrienteering::Map::getTemplate ( int  i)
inline

Returns the i-th template.

◆ getUndefinedColor()

const MapColor * OpenOrienteering::Map::getUndefinedColor ( )
inlinestatic

Returns the special covering gray color for "undefined" objects.

◆ getUndefinedLine()

LineSymbol * OpenOrienteering::Map::getUndefinedLine ( )
inlinestatic

Returns the special gray "undefined" line symbol.

◆ getUndefinedPoint()

PointSymbol * OpenOrienteering::Map::getUndefinedPoint ( )
inlinestatic

Returns the special gray "undefined" point symbol.

◆ getUndefinedText()

TextSymbol * OpenOrienteering::Map::getUndefinedText ( )
inlinestatic

Returns the special gray "undefined" text symbol.

◆ hasAlpha()

bool OpenOrienteering::Map::hasAlpha ( ) const

Returns true if any visible object uses a non-opaque color.

◆ hasPrinterConfig()

bool OpenOrienteering::Map::hasPrinterConfig ( ) const
inlinenoexcept

Returns true if the map has a print configuration.

◆ hasSpotColors()

bool OpenOrienteering::Map::hasSpotColors ( ) const

Returns true if the map contains spot colors.

◆ hasUnsavedChanged

void OpenOrienteering::Map::hasUnsavedChanged ( bool  is_clean)
signal

Emitted when a the map enters or leaves the state which is saved on map.

◆ hasUnsavedChanges()

bool OpenOrienteering::Map::hasUnsavedChanges ( ) const
inline

Returns whether there are unsaved changes in the map.

To toggle this state, never use setHasUnsavedChanges() directly unless you know what you are doing, instead use setOtherDirty() or set one of the more specific 'dirty' flags. This is because a call to setHasUnsavedChanges() alone followed by a map change and an undo would result in no changed flag.

◆ importFromIODevice()

bool OpenOrienteering::Map::importFromIODevice ( QIODevice device)

Loads the map directly from the given IO device.

The data must have been written by exportToIODevice() (or at least use the same format.) Returns true if successful.

◆ importMap() [1/2]

QHash< const Symbol *, Symbol * > OpenOrienteering::Map::importMap ( const Map imported_map,
ImportMode  mode,
std::vector< bool > *  filter = nullptr,
int  symbol_insert_pos = -1,
bool  merge_duplicate_symbols = true 
)

Imports another map into this map.

If the Map::GeorefImport mode flag is set, this overload will attempt to calculate a transformation based on the maps' georeferencing. All further processing is delegated to the other overload.

Todo:
Test and review import of georeferenced and non-georeferenced maps, in all combinations.
Todo:
Handle rotation of patterns and text, cf. Object::transform.
Todo:
proper error message

◆ importMap() [2/2]

QHash< const Symbol *, Symbol * > OpenOrienteering::Map::importMap ( const Map imported_map,
ImportMode  mode,
const QTransform transform,
std::vector< bool > *  filter = nullptr,
int  symbol_insert_pos = -1,
bool  merge_duplicate_symbols = true 
)

Imports another map into this map.

The amount of imported elements is controlled by the mode argument which is a combination of an enumeration of basic modes (ColorImport, SymbolImport, ObjectImport) and the flags (MinimalImport).

  • ObjectImport: Import objects, symbols and colors. If the MinimalImport flag is set, symbols and colors not used by the imported objects are ignored. The filter argument is not used.
  • SymbolImport: Import symbols and colors. If the MinimalImport flag is set, the filter argument may be used to select a subset of the symbols, and colors not used by the imported symbols are ignored.
  • ColorImport: Import colors. If the MinimalImport flag is set, the filter argument may be used to select a subset of the colors.

This overload ignores the Map::GeorefImport mode flag. It only uses the given transformation. It is applied to all imported objects. No other adjustment of object positions and no scaling of symbol sizes (with respect to possible different map scales) is performed.

◆ includeSelectionRect()

void OpenOrienteering::Map::includeSelectionRect ( QRectF rect) const

Enlarges the given rect to cover all selected objects.

◆ init()

void OpenOrienteering::Map::init ( )

Initializes an empty map.

A map is empty when it is newly constructed or after clear().

◆ insertRenderablesOfObject()

void OpenOrienteering::Map::insertRenderablesOfObject ( const Object object)

Inserts the renderables of the given object, so they will be displayed.

◆ irregularObjects()

const std::set< Object * > OpenOrienteering::Map::irregularObjects ( ) const

Returns the list of objects marked as irregular.

◆ isAreaHatchingEnabled()

bool OpenOrienteering::Map::isAreaHatchingEnabled ( ) const

TODO: These two options should really be view options, but are not due to a limitation: the current architecture makes it impossible to have different renderables of the same objects in different views!

Returns if area hatching is enabled.

◆ isBaselineViewEnabled()

bool OpenOrienteering::Map::isBaselineViewEnabled ( ) const

Returns if the baseline view is enabled.

◆ isColorUsedByASymbol()

bool OpenOrienteering::Map::isColorUsedByASymbol ( const MapColor color) const

Checks and returns if the given color is used by at least one symbol.

◆ isObjectSelected()

bool OpenOrienteering::Map::isObjectSelected ( const Object object) const

Returns true if the given object is selected.

◆ isOtherDirty()

bool OpenOrienteering::Map::isOtherDirty ( ) const
inline

Returns if there are unsaved changes to anything else than the above.

◆ loadFrom()

bool OpenOrienteering::Map::loadFrom ( const QString path,
MapView view = nullptr 
)

Attempts to load the map from the specified path.

Returns true on success.

This is a convenience function used by tests. Normally, a importer should be used explicitly.

Parameters
pathThe file path to load the map from.
viewIf not nullptr, restores this map view.

◆ mapPartAdded

void OpenOrienteering::Map::mapPartAdded ( std::size_t  index,
const OpenOrienteering::MapPart part 
)
signal

Emitted when a part is added to the map.

◆ mapPartChanged

void OpenOrienteering::Map::mapPartChanged ( std::size_t  index,
const OpenOrienteering::MapPart part 
)
signal

Emitted when a part's properties are changed.

◆ mapPartDeleted

void OpenOrienteering::Map::mapPartDeleted ( std::size_t  index,
const OpenOrienteering::MapPart part 
)
signal

Emitted when a part is removed from the map.

◆ markAsIrregular()

void OpenOrienteering::Map::markAsIrregular ( Object object)

Marks an object as irregular.

◆ mergeParts()

int OpenOrienteering::Map::mergeParts ( std::size_t  source,
std::size_t  destination 
)

Merges the source part with the destination part.

Removes the source part unless it is identical with the destination part.

The objects will be continuously located at the end to the objects in the target part. Does not change the object selection.

Makes the destination part the current part when the source part is the current part.

Returns
The index of the first object which has been reassigned.

◆ moveSymbol()

void OpenOrienteering::Map::moveSymbol ( int  from,
int  to 
)

Moves a symbol from one index to another in the symbol list.

◆ objectSelectionChanged

void OpenOrienteering::Map::objectSelectionChanged ( )
signal

Emitted when the set of selected objects changes.

Also emitted when the symbol of a selected object changes (which is similar to selecting another object).

◆ printerConfig() [1/2]

const MapPrinterConfig & OpenOrienteering::Map::printerConfig ( )

Returns a const reference to the current print configuration.

If the map does not have a print configuration, a default configuration is created first.

◆ printerConfig() [2/2]

MapPrinterConfig OpenOrienteering::Map::printerConfig ( ) const

Returns a copy of the current print configuration.

If the map does not have a print configuration, the function will return a default configuration for this map.

◆ push()

void OpenOrienteering::Map::push ( UndoStep step)

Pushes a new undo step to the map's undoManager.

◆ raw_translation()

QString OpenOrienteering::Map::raw_translation ( const QString symbol_text) const

Returns a translated symbol text (name or description), or an empty string.

◆ reassignObjectsToMapPart()

int OpenOrienteering::Map::reassignObjectsToMapPart ( std::vector< int >::const_iterator  first,
std::vector< int >::const_iterator  last,
std::size_t  source,
std::size_t  destination 
)

Moves all specified objects from the source to the target map part.

Objects are processed one by one. This means that processing one object changes the index of following objects. Thus the given indices must normally be in descending order.

The objects will be continuously located at the end to the objects in the target part. Source object which were selected will be removed from the object selection.

Returns
The index of the first object which has been reassigned.

◆ reloadClosedTemplate()

bool OpenOrienteering::Map::reloadClosedTemplate ( int  i,
int  target_pos,
QWidget dialog_parent,
const QString map_path = QString() 
)

Removes the template with the given index from the closed template list, load the template file and adds the template to the normal template list again.

The template is made visible in the given view.

NOTE: if required, adjust first_front_template manually with setFirstFrontTemplate() before calling this method!

Parameters
iThe index of the closed template to reload.
target_posThe desired index in the normal template list after loading.
dialog_parentWidget as parent for possible dialogs.
map_pathPath where the map is saved currently. Used as possible search location to locate missing templates.

◆ removeMapWidget()

void OpenOrienteering::Map::removeMapWidget ( MapWidget widget)

Removes the map widget, see addMapWidget().

◆ removeObjectFromSelection()

void OpenOrienteering::Map::removeObjectFromSelection ( Object object,
bool  emit_selection_changed 
)

Removes the given object from the selection.

Parameters
objectThe object to remove.
emit_selection_changedSee addObjectToSelection().

◆ removePart()

void OpenOrienteering::Map::removePart ( std::size_t  index)

Removes the map part at position.

◆ removeRenderablesOfObject()

void OpenOrienteering::Map::removeRenderablesOfObject ( const Object object,
bool  mark_area_as_dirty 
)

Removes the renderables of the given object from display (does not delete them!).

◆ removeSymbolFromSelection()

bool OpenOrienteering::Map::removeSymbolFromSelection ( const Symbol symbol,
bool  emit_selection_changed 
)

Removes from the selection all objects with the given symbol.

Returns true if at least one object has been removed.

Parameters
symbolThe symbol of the objects to remove.
emit_selection_changedSee addObjectToSelection().

◆ removeTemplate()

void OpenOrienteering::Map::removeTemplate ( int  pos)

Removes the template with the given index from the template list, but does not delete it.

NOTE: if required, adjust first_front_template manually with setFirstFrontTemplate()!

◆ renderableOptions()

int OpenOrienteering::Map::renderableOptions ( ) const
inline

Returns the rendering options as an int representing Symbol::RenderableOptions.

◆ reset()

void OpenOrienteering::Map::reset ( )

Deletes all map data, and reinitializes the empty map.

This method combines a call to clear() followed by init().

◆ resetPrinterConfig()

void OpenOrienteering::Map::resetPrinterConfig ( )

Clears the print configuration.

After calling this method, hasPrinterConfig() returns false.

◆ rotateAllObjects()

void OpenOrienteering::Map::rotateAllObjects ( double  rotation,
const MapCoord center 
)

Rotates all objects by the given rotation angle (in radians).

◆ rotateMap()

void OpenOrienteering::Map::rotateMap ( double  rotation,
const MapCoord center,
bool  adjust_georeferencing,
bool  adjust_declination,
bool  adjust_templates 
)

Rotate the map around a point.

Parameters
rotationThe rotation angle (in radians).
centerThe rotation center point.
adjust_georeferencingWhether to adjust the georeferencing reference point.
adjust_declinationWhether to adjust the georeferencing declination.
adjust_templatesWhether to adjust non-georeferenced templates.

◆ scaleAllObjects()

void OpenOrienteering::Map::scaleAllObjects ( double  factor,
const MapCoord scaling_center 
)

Scales all objects by the given factor.

◆ scaleAllSymbols()

void OpenOrienteering::Map::scaleAllSymbols ( double  factor)

Scales all symbols by the given factor.

◆ selectedObjectEdited

void OpenOrienteering::Map::selectedObjectEdited ( )
signal

Emitted when at least one of the selected objects is edited in any way.

For example, this includes the case where a symbol of one of the selected objects is edited, too.

◆ selectedObjects()

const Map::ObjectSelection & OpenOrienteering::Map::selectedObjects ( ) const
inline

◆ selectedObjectsBegin()

Map::ObjectSelection::const_iterator OpenOrienteering::Map::selectedObjectsBegin ( ) const
inline

Returns an iterator allowing to iterate over the selected objects.

◆ selectedObjectsEnd()

Map::ObjectSelection::const_iterator OpenOrienteering::Map::selectedObjectsEnd ( ) const
inline

Returns an end iterator allowing to iterate over the selected objects.

◆ setActivityBoundingBox()

void OpenOrienteering::Map::setActivityBoundingBox ( const QRectF map_coords_rect,
int  pixel_border,
bool  do_update = true 
)

This is the analogon to setDrawingBoundingBox() for activities.

See setDrawingBoundingBox().

◆ setAreaHatchingEnabled()

void OpenOrienteering::Map::setAreaHatchingEnabled ( bool  enabled)

Sets if area hatching is enabled.

◆ setBaselineViewEnabled()

void OpenOrienteering::Map::setBaselineViewEnabled ( bool  enabled)

Sets if the baseline view is enabled.

◆ setColor()

void OpenOrienteering::Map::setColor ( MapColor color,
int  pos 
)

Replaces the color at index pos with the given color, updates dependent colors and symbol icons.

Emits colorChanged(). Does not delete the replaced color.

◆ setColorsDirty()

void OpenOrienteering::Map::setColorsDirty ( )

Marks the colors as "dirty", i.e.

as having unsaved changes. Emits hasUnsavedChanged(true) if the map did not have unsaved changed before.

◆ setCurrentPart()

void OpenOrienteering::Map::setCurrentPart ( MapPart part)
inline

Changes the current map part.

This is a convenience method which looks up the part's index and then calls setCurrentPartIndex.

◆ setCurrentPartIndex()

void OpenOrienteering::Map::setCurrentPartIndex ( std::size_t  index)

Changes the current map part.

◆ setDrawingBoundingBox()

void OpenOrienteering::Map::setDrawingBoundingBox ( const QRectF map_coords_rect,
int  pixel_border,
bool  do_update = true 
)

Sets the rect (given in map coordinates) as "dirty rect" for every map widget showing this map, enlarged by the given pixel border.

This means that the area covered by the rect will be redrawn by the active tool. Use this if the current tool's display has changed.

Parameters
map_coords_rectArea covered by the current tool's drawing in map coords.
pixel_borderBorder around the map coords rect which is also covered, given in pixels. Allows to enlarge the area given by the map coords by some pixels which are independent from the zoom level. For example if a tool displays markers with a radius of 3 pixels, it would set the bounding box of all markers as map_coords_rect and 3 for pixel_border.
do_updateWhether a repaint of the covered area should be triggered.

◆ setFirstFrontTemplate()

void OpenOrienteering::Map::setFirstFrontTemplate ( int  pos)
inline

Sets the template index which is the first (lowest) to be drawn in front of the map.

◆ setGeoreferencing()

void OpenOrienteering::Map::setGeoreferencing ( const Georeferencing georeferencing)

Assigns georeferencing settings for the map from the given object and sets the map to have unsaved changes.

◆ setGrid()

void OpenOrienteering::Map::setGrid ( const MapGrid grid)

Sets the map's grid settings from the given object and may set the map to have unsaved changes.

◆ setHasUnsavedChanges()

void OpenOrienteering::Map::setHasUnsavedChanges ( bool  has_unsaved_changes)

Do not use this in usual cases, see hasUnsavedChanged().

◆ setImageTemplateDefaults()

void OpenOrienteering::Map::setImageTemplateDefaults ( bool  use_meters_per_pixel,
double  meters_per_pixel,
double  dpi,
double  scale 
)

Sets default parameters for loading of image templates.

TODO: put these into a struct.

◆ setMapNotes()

void OpenOrienteering::Map::setMapNotes ( const QString text)

Sets the map notes string.

NOTE: Set the map to dirty manually!

◆ setObjectAreaDirty()

void OpenOrienteering::Map::setObjectAreaDirty ( const QRectF map_coords_rect)

Marks the area given by map_coords_rect as "dirty" in all map widgets, i.e.

as needing to be redrawn because some object(s) changed there.

◆ setObjectsDirty()

void OpenOrienteering::Map::setObjectsDirty ( )

Marks the objects as "dirty", i.e.

as having unsaved changes. Emits hasUnsavedChanged(true) if the map did not have unsaved changed before.

◆ setOtherDirty()

void OpenOrienteering::Map::setOtherDirty ( )

Marks something unspecific in the map as "dirty", i.e.

as having unsaved changes. Emits hasUnsavedChanged(true) if the map did not have unsaved changed before.

Use setColorsDirty(), setSymbolsDirty(), setTemplatesDirty() or setObjectsDirty() if you know more specifically what has changed.

◆ setPrinterConfig()

void OpenOrienteering::Map::setPrinterConfig ( const MapPrinterConfig config)

Sets the print configuration.

◆ setScaleDenominator()

void OpenOrienteering::Map::setScaleDenominator ( unsigned int  value)

Sets the map's scale denominator.

◆ setSymbol()

void OpenOrienteering::Map::setSymbol ( Symbol symbol,
int  pos 
)

Replaces the symbol at the given index with another symbol.

Emits symbolChanged() and possibly selectedObjectEdited().

◆ setSymbolsDirty()

void OpenOrienteering::Map::setSymbolsDirty ( )

Marks the symbols as "dirty", i.e.

as having unsaved changes. Emits hasUnsavedChanged(true) if the map did not have unsaved changed before.

◆ setSymbolSetId()

void OpenOrienteering::Map::setSymbolSetId ( const QString id)

Sets the symbol set ID.

◆ setTemplate()

void OpenOrienteering::Map::setTemplate ( Template temp,
int  pos 
)

Replaces the template at the given index with another.

Emits templateChanged().

◆ setTemplateAreaDirty() [1/2]

void OpenOrienteering::Map::setTemplateAreaDirty ( Template temp,
const QRectF area,
int  pixel_border 
)

Marks the area defined by the given QRectF (in map coordinates) and pixel border as "dirty", i.e.

as needing a repaint, for the given template in all map widgets.

For an explanation of the area and pixel border, see setDrawingBoundingBox().

Warning: does nothing if the template is not visible in a widget! So make sure to call this and showing/hiding a template in the correct order!

◆ setTemplateAreaDirty() [2/2]

void OpenOrienteering::Map::setTemplateAreaDirty ( int  i)

Marks the whole area of the i-th template as "to be repainted".

See setTemplateAreaDirty(). Does nothing for i == -1.

◆ setTemplatesDirty()

void OpenOrienteering::Map::setTemplatesDirty ( )

Marks the template settings as "dirty", i.e.

as having unsaved changes. Emits hasUnsavedChanged(true) if the map did not have unsaved changed before.

◆ sortSymbols()

template<typename T >
void OpenOrienteering::Map::sortSymbols ( compare)

Sorts the symbol list using the given comparator.

◆ spotColorPresenceChanged

void OpenOrienteering::Map::spotColorPresenceChanged ( bool  has_spot_colors) const
signal

Emitted when the presence of spot colors in the map changes.

◆ symbolAdded

void OpenOrienteering::Map::symbolAdded ( int  pos,
const OpenOrienteering::Symbol symbol 
)
signal

Emitted when a symbol is added to the map, gives the symbol's index and pointer.

◆ symbolChanged

void OpenOrienteering::Map::symbolChanged ( int  pos,
const OpenOrienteering::Symbol new_symbol,
const OpenOrienteering::Symbol old_symbol 
)
signal

Emitted when a symbol in the map is changed.

◆ symbolDeleted

void OpenOrienteering::Map::symbolDeleted ( int  pos,
const OpenOrienteering::Symbol old_symbol 
)
signal

Emitted when a symbol in the map is deleted.

◆ symbolIconChanged

void OpenOrienteering::Map::symbolIconChanged ( int  pos)
signal

Emitted when the icon of the symbol with the given index changes.

◆ symbolIconZoom()

qreal OpenOrienteering::Map::symbolIconZoom ( ) const

Returns the scale factor to be used for default symbol icons.

The full icon size (width, height) is represented by 1.0.

◆ symbolIconZoomChanged

void OpenOrienteering::Map::symbolIconZoomChanged ( )
signal

Emitted when the symbol icon zoom changes.

◆ symbolSetId()

QString OpenOrienteering::Map::symbolSetId ( ) const
inline

Returns the symbol set ID.

◆ templateAdded

void OpenOrienteering::Map::templateAdded ( int  pos,
OpenOrienteering::Template temp 
)
signal

Emitted when a template is added to the map, gives the template's index and pointer.

◆ templateChanged

void OpenOrienteering::Map::templateChanged ( int  pos,
OpenOrienteering::Template temp 
)
signal

Emitted when a template in the map is changed, gives the template's index and pointer.

◆ templateDeleted

void OpenOrienteering::Map::templateDeleted ( int  pos,
const OpenOrienteering::Template old_temp 
)
signal

Emitted when a template in the map is deleted, gives the template's index and pointer.

◆ toggleObjectSelection()

bool OpenOrienteering::Map::toggleObjectSelection ( Object object,
bool  emit_selection_changed 
)

Toggles the selection of the given object.

Returns true if the object was selected, false if deselected.

Parameters
objectThe object to select or deselect.
emit_selection_changedSee addObjectToSelection().

◆ translate()

QString OpenOrienteering::Map::translate ( const QString symbol_text) const

Returns a translated symbol text (name or description), or the original text.

◆ undoCleanChanged

void OpenOrienteering::Map::undoCleanChanged ( bool  is_clean)
protectedslot

◆ undoManager() [1/2]

UndoManager & OpenOrienteering::Map::undoManager ( )
inline

Returns the UndoManager instance for this map.

◆ undoManager() [2/2]

const UndoManager & OpenOrienteering::Map::undoManager ( ) const
inline

Returns the UndoManager instance for this map.

◆ updateAllMapWidgets()

void OpenOrienteering::Map::updateAllMapWidgets ( )

Redraws all map widgets completely - this can be slow! Try to avoid this and do partial redraws instead, if possible.

◆ updateAllObjects()

void OpenOrienteering::Map::updateAllObjects ( )

Forces an update of all objects, i.e.

calls update(true) on each map object.

◆ updateAllObjectsWithSymbol()

void OpenOrienteering::Map::updateAllObjectsWithSymbol ( const Symbol symbol)

Forces an update of all objects with the given symbol.

◆ updateDrawing()

void OpenOrienteering::Map::updateDrawing ( const QRectF map_coords_rect,
int  pixel_border 
)

Updates all dynamic drawings at the given positions, i.e.

tool & activity drawings.

See setDrawingBoundingBox() and setActivityBoundingBox().

◆ updateObjects()

void OpenOrienteering::Map::updateObjects ( )

Updates the renderables and extent of all objects which have changed.

This is automatically called by draw(), you normally do not need to call it directly.

◆ updateSymbolIcons()

void OpenOrienteering::Map::updateSymbolIcons ( const MapColor color)

Updates the icons of all symbols with the given color.

◆ updateSymbolIconZoom

void OpenOrienteering::Map::updateSymbolIconZoom ( )
slot

Updates the symbol icon zoom from the current set of symbols.

The symbol icon zoom is chosen so that most symbols fit into the full icon space, and the number of symbol below 10% size is kept low. For a map without symbols, this returns 1.0.

◆ useColorsFrom()

void OpenOrienteering::Map::useColorsFrom ( Map map)

Makes this map use the color set from the given map.

Used to create the maps containing preview objects in the symbol editor.

Friends And Related Function Documentation

◆ MapRenderables

friend class MapRenderables
friend

◆ MapTest

friend class MapTest
friend

◆ OCAD8FileImport

friend class OCAD8FileImport
friend

◆ XMLFileExporter

friend class XMLFileExporter
friend

◆ XMLFileImporter

friend class XMLFileImporter
friend

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