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

MainWindowController for editing a map. More...

#include <map_editor.h>

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

Public Types

enum  OperatingMode { MapEditor = 0, SymbolEditor = 1 }
 See MapEditorController constructor. More...
 

Public Slots

void exportVector ()
 Lets the user export the map as geospatial vector data. More...
 
void printClicked (int task)
 Makes the print/export dock widget visible, and configures it for the given task (which is of type PrintWidget::TaskFlags). More...
 
void undo ()
 Undoes the last object edit step. More...
 
void redo ()
 Redoes the last object edit step. More...
 
void cut ()
 Cuts the selected object(s). More...
 
void copy ()
 Copies the selected object(s). More...
 
void paste ()
 Pastes the object(s) from the clipboard. More...
 
void clearUndoRedoHistory ()
 Empties the undo / redo history to save space. More...
 
void showGrid ()
 Toggles visivbility of the map grid. More...
 
void configureGrid ()
 Shows the map grid configuration dialog. More...
 
void pan ()
 Activates the pan tool. More...
 
void moveToGpsPos ()
 Moves view to GPS position. More...
 
void zoomIn ()
 Zooms in in the current map widget. More...
 
void zoomOut ()
 Zooms out in the current map widget. More...
 
void setCustomZoomFactorClicked ()
 Shows the dialog to set a custom zoom factor in the current map widget. More...
 
void hatchAreas (bool checked)
 Sets the hatch areas view option. More...
 
void baselineView (bool checked)
 Sets the baseline view option. More...
 
void hideAllTemplates (bool checked)
 Sets the "hide all templates" view option. More...
 
void overprintingSimulation (bool checked)
 Sets the overprinting simulation view option. More...
 
void coordsDisplayChanged ()
 Adjusts the coordinates display of the map widget to the selected option. More...
 
void copyDisplayedCoords ()
 Copies the displayed coordinates to the clipboard. More...
 
void showSymbolWindow (bool show)
 Shows or hides the symbol pane. More...
 
void showColorWindow (bool show)
 Shows or hides the color dock widget. More...
 
void symbolSetIdClicked ()
 Shows a dialog for changing the symbol set ID. More...
 
void loadSymbolsFromClicked ()
 Shows the "load symbols from" dialog. More...
 
void loadCrtClicked ()
 Loads a CRT file and shows the symbol replacement dialog. More...
 
void loadColorsFromClicked ()
 TODO: not implemented yet. More...
 
void scaleAllSymbolsClicked ()
 Shows the "scale all symbols" dialog. More...
 
void scaleMapClicked ()
 Shows the ScaleMapDialog. More...
 
void rotateMapClicked ()
 Shows the RotateMapDialog. More...
 
void mapNotesClicked ()
 Shows the dialog to enter map notes. More...
 
void showTemplateWindow (bool show)
 Shows or hides the template setup dock widget. More...
 
void openTemplateClicked ()
 Shows a file selector to open a template. More...
 
void reopenTemplateClicked ()
 Shows the ReopenTemplateDialog. More...
 
void templateAvailabilityChanged ()
 Adjusts action availability based on the presence of templates. More...
 
void closedTemplateAvailabilityChanged ()
 Adjusts action availability based on the presence of closed templates. More...
 
void showTagsWindow (bool show)
 Shows or hides the tags editor dock widget. More...
 
void editGeoreferencing ()
 Shows the GeoreferencingDialog. More...
 
void selectedSymbolsChanged ()
 Makes the editor aware of a change of the selected symbols. More...
 
void objectSelectionChanged ()
 Makes the editor aware of a change of the selected object. More...
 
void undoStepAvailabilityChanged ()
 Adjusts the enabled state of the undo / redo actions. More...
 
void clipboardChanged (QClipboard::Mode mode)
 Adjusts the enabled state of the paste action (specific signature required). More...
 
void updatePasteAvailability ()
 Adjusts the enabled state of the paste action. More...
 
void spotColorPresenceChanged (bool has_spot_colors)
 Checks the presence of spot colors, and to disables overprinting simulation if there are no spot colors. More...
 
void showWholeMap ()
 Adjusts the view in the current map widget to show the whole map. More...
 
void editToolClicked ()
 Activates the point edit tool. More...
 
void editLineToolClicked ()
 Activates the line edit tool. More...
 
void drawPointClicked ()
 Activates the draw point tool. More...
 
void drawPathClicked ()
 Activates the draw path tool. More...
 
void drawCircleClicked ()
 Activates the draw circle tool. More...
 
void drawRectangleClicked ()
 Activates the draw rectangle tool. More...
 
void drawFreehandClicked ()
 Activates the draw freehand tool. More...
 
void drawFillClicked ()
 Activates the draw fill tool. More...
 
void drawTextClicked ()
 Activates the draw text tool. More...
 
void deleteClicked ()
 Deletes the selected object(s) More...
 
void duplicateClicked ()
 Duplicates the selected object(s) More...
 
void switchSymbolClicked ()
 Switches the symbol of the selected object(s) to the selected symbol. More...
 
void fillBorderClicked ()
 Creates duplicates of the selected object(s) and assigns them the selected symbol. More...
 
void selectObjectsClicked (bool select_exclusively)
 Selects all objects with the selected symbol(s) More...
 
void deselectObjectsClicked ()
 Deselects all objects with the selected symbol(s) More...
 
void selectAll ()
 Selects all objects in the current map part. More...
 
void selectNothing ()
 Clears the object selection. More...
 
void invertSelection ()
 Inverts in the object selection in the current map part. More...
 
void selectByCurrentSymbols ()
 Selects all objects having the current selected symbols. More...
 
void switchDashesClicked ()
 Reverses the selected object(s) direcction(s), thus switching dash directions for lines. More...
 
void connectPathsClicked ()
 Connects close endpoints of selected lines. More...
 
void cutClicked ()
 Activates the cut tool. More...
 
void cutHoleClicked ()
 Activates the cut hole tool. More...
 
void cutHoleCircleClicked ()
 Activates the cut circular hole tool. More...
 
void cutHoleRectangleClicked ()
 Activates the cut rectangular hole tool. More...
 
void rotateClicked ()
 Activates the rotate tool. More...
 
void rotatePatternClicked ()
 Activates the rotate pattern tool. More...
 
void scaleClicked ()
 Activates the scale tool. More...
 
void measureClicked (bool checked)
 Shows or hides the MeasureWidget. More...
 
void booleanUnionClicked ()
 Calculates the union of selected same-symbol area objects. More...
 
void booleanIntersectionClicked ()
 Calculates the intersection of selected same-symbol area objects. More...
 
void booleanDifferenceClicked ()
 Calculates the difference of selected area objects from the first selected area object. More...
 
void booleanXOrClicked ()
 Calculates the boolean XOr of selected same-symbol area objects. More...
 
void booleanMergeHolesClicked ()
 Merges holes of the (single) selected area object. More...
 
void convertToCurvesClicked ()
 Converts selected polygonal paths to curves. More...
 
void simplifyPathClicked ()
 Tries to remove points of selected paths while retaining their shape. More...
 
void cutoutPhysicalClicked ()
 Activates the physical cutout tool. More...
 
void cutawayPhysicalClicked ()
 Activates the physical cutout tool (inversed) More...
 
void distributePointsClicked ()
 Executes the "distribute points along path" action. More...
 
void paintOnTemplateClicked (bool checked)
 Shows or hides the paint-on-template widget. More...
 
void paintOnTemplateSelectClicked ()
 Shows the template selection dialog for for the paint-on-template functionality. More...
 
void enableGPSDisplay (bool enable)
 Enables or disables GPS display. More...
 
void enableGPSDistanceRings (bool enable)
 Enables or disables showing distance rings when GPS display is active. More...
 
void updateDrawPointGPSAvailability ()
 Updates availability of the GPS point drawing tool. More...
 
void drawPointGPSClicked ()
 Switches to the GPS point drawing tool. More...
 
void gpsTemporaryPointClicked ()
 Sets a temporary marker at the GPS position. More...
 
void gpsTemporaryPathClicked (bool enable)
 Draws a temporary path at the GPS position. More...
 
void gpsTemporaryClearClicked ()
 Clears temporary GPS markers. More...
 
void enableCompassDisplay (bool enable)
 Enables or disables digital compass display. More...
 
void alignMapWithNorth (bool enable)
 Enables or disables map auto-rotation according to compass. More...
 
void alignMapWithNorthUpdate ()
 Called regularly after enabled with alignMapWithNorth() to update the map rotation. More...
 
void hideTopActionBar ()
 For mobile UI: hides the top action bar. More...
 
void showTopActionBar ()
 For mobile UI: shows the top action bar again after hiding it. More...
 
void mobileSymbolSelectorClicked ()
 For mobile UI: shows the symbol selection screen. More...
 
void mobileSymbolSelectorFinished ()
 Counterpart to mobileSymbolSelectorClicked(). More...
 
void addMapPart ()
 Creates and adds a new map part. More...
 
void removeMapPart ()
 Removes the current map part. More...
 
void renameMapPart ()
 Renames the current map part. More...
 
void reassignObjectsToMapPart (int target)
 Moves all selected objects to a different map part. More...
 
void mergeCurrentMapPartTo (int target)
 Merges the current map part with another one. More...
 
void mergeAllMapParts ()
 Merges all map parts into the current one. More...
 
void templateAdded (int pos, const OpenOrienteering::Template *temp)
 Updates action enabled states after a template has been added. More...
 
void templateDeleted (int pos, const OpenOrienteering::Template *temp)
 Updates action enabled states after a template has been deleted. More...
 
void importClicked ()
 Shows the import file selector and imports the selected file, if any. More...
 
void setViewOptionsEnabled (bool enabled=true)
 Sets the enabled state of actions which change how the map is rendered, such as with grid, with templates, with overprinting simulation. More...
 
void setWindowStateChanged ()
 Indicates a change of the current toolbar and dock widget positions, and schedules saving. More...
 

Signals

void activeSymbolChanged (const OpenOrienteering::Symbol *symbol)
 Indicates a change of the active symbol. More...
 
void templatePositionDockWidgetClosed (OpenOrienteering::Template *temp)
 

Public Member Functions

 MapEditorController (OperatingMode mode, Map *map=nullptr, MapView *map_view=nullptr)
 Constructs a new MapEditorController for a map. More...
 
 ~MapEditorController () override
 Destroys the MapEditorController. More...
 
bool menuBarVisible () override
 In SymbolEditor mode, this controller doesn't want a menu bar. More...
 
bool isInMobileMode () const
 Returns if the editor is in mobile mode. More...
 
void setTool (MapEditorTool *new_tool)
 Changes to new_tool as the new active tool. More...
 
void setEditTool ()
 Shortcut to change to the point edit tool as new active tool. More...
 
void setOverrideTool (MapEditorTool *new_override_tool)
 Sets new_override_tool as the new active override tool. More...
 
MapEditorToolgetTool () const
 Returns the current tool. More...
 
MapEditorToolgetDefaultDrawToolForSymbol (const Symbol *symbol)
 Returns the default drawing tool for a given symbol. More...
 
SymbolactiveSymbol () const
 Returns the active symbol, or nullptr. More...
 
void setEditingInProgress (bool value)
 If this is set to true (usually by the current tool), undo/redo and saving the map is deactivated. More...
 
bool isEditingInProgress () const override
 Returns true when editing is in progress. More...
 
void addFloatingDockWidget (QDockWidget *dock_widget)
 Adds a a floating dock widget to the main window. More...
 
void setEditorActivity (MapEditorActivity *new_activity)
 Sets the current editor activity. More...
 
MapEditorActivitygetEditorActivity () const
 Returns the current editor activity. More...
 
MapgetMap () const
 Returns the map on which this controller operates. More...
 
MapWidgetgetMainWidget () const
 Returns the main map widget (which is currently the only map widget). More...
 
SymbolWidgetgetSymbolWidget () const
 Returns this controller's symbol widget, where the symbol selection happens. More...
 
bool existsTemplatePositionDockWidget (Template *temp) const
 Returns if a template position dock widget exists for a template. More...
 
TemplatePositionDockWidgetgetTemplatePositionDockWidget (Template *temp) const
 Returns the template position dock widget for a template. More...
 
void addTemplatePositionDockWidget (Template *temp)
 Adds a template position dock widget for the given template. More...
 
void removeTemplatePositionDockWidget (Template *temp)
 Removes the template position dock widget for the template. More...
 
void showPopupWidget (QWidget *child_widget, const QString &title)
 Shows the given widget in a popup window with specified title. More...
 
void deletePopupWidget (QWidget *child_widget)
 Deletes the given popup widget, which was previously shown with showPopupWidget(). More...
 
QActiongetAction (const char *id)
 Returns the action identified by id if it exists, or nullptr. More...
 
bool saveTo (const QString &path, const FileFormat &format) override
 Override from MainWindowController. More...
 
bool exportTo (const QString &path, const FileFormat &format) override
 Override from MainWindowController. More...
 
bool loadFrom (const QString &path, const FileFormat &format, QWidget *dialog_parent=nullptr) override
 Override from MainWindowController. More...
 
void attach (MainWindow *window) override
 Override from MainWindowController. More...
 
void detach () override
 Override from MainWindowController. More...
 
bool keyPressEventFilter (QKeyEvent *event) override
 Receives key press events from the main window. This implementation passes the event to MapWidget::keyPressEventFilter. More...
 
bool keyReleaseEventFilter (QKeyEvent *event) override
 Receives key release events from the main window. This implementation passes the event to MapWidget::keyReleaseEventFilter. More...
 
QHash< const Symbol *, Symbol * > importMap (Map &other, Map::ImportMode mode, QWidget *dialog_parent, std::vector< bool > *filter=nullptr, int symbol_insert_pos=-1, bool merge_duplicate_symbols=true)
 Imports another map into this map. More...
 
bool importGpxFile (const QString &filename)
 Imports a track file (GPX) into the map. More...
 
bool importMapFile (const QString &filename, bool show_errors)
 Imports a map file into the loaded map. More...
 
- Public Member Functions inherited from OpenOrienteering::MainWindowController
 ~MainWindowController () override
 
virtual bool statusBarVisible ()
 Returns true when the controller wants a status bar to be shown. More...
 
bool exportTo (const QString &path)
 Export to a file, but don't change modified state with regard to the original file. More...
 
MainWindowgetWindow () const
 Get the main window this controller is attached to. 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
 

Protected Slots

void projectionChanged ()
 
void georeferencingDialogFinished ()
 
void changeMapPart (int index)
 Sets the map's current part. More...
 
void updateMapPartsUI ()
 Updates all UI components related to map parts. More...
 

Protected Member Functions

void updateSymbolDependentActions ()
 Adjusts the enabled state of various actions after the selected symbol(s) have changed. More...
 
void updateObjectDependentActions ()
 Adjusts the enabled state of various actions after the selected object(s) have changed. More...
 
void updateSymbolAndObjectDependentActions ()
 Adjusts the enabled state of various actions after the selected symbol(s) or object(s) have changed. More...
 
- 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)
 

Friends

class Map
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenOrienteering::MainWindowController
static MainWindowControllercontrollerForFile (const QString &filename)
 Get a controller suitable for a particular file. 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)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Attributes inherited from OpenOrienteering::MainWindowController
MainWindowwindow
 
- Properties inherited from QObject
 objectName
 

Detailed Description

MainWindowController for editing a map.

Creates menus and toolbars, manages editing tools, dock widgets, and much more.

Member Enumeration Documentation

◆ OperatingMode

See MapEditorController constructor.

Enumerator
MapEditor 
SymbolEditor 

Constructor & Destructor Documentation

◆ MapEditorController()

OpenOrienteering::MapEditorController::MapEditorController ( OperatingMode  mode,
Map map = nullptr,
MapView map_view = nullptr 
)

Constructs a new MapEditorController for a map.

Parameters
modeNormally, MapEditor should be used. However, as a HACK the MapEditorController is also used in the symbol editor for the preview. In this case, SymbolEditor is passed to disable showing the menus, toolbars, etc.
mapA Map which is to be edited by the controller.
map_viewA MapView for the given map.
Todo:

Review/remove mode hack.

Document and fix ownership of map and map_view. Double deletes waiting...

◆ ~MapEditorController()

OpenOrienteering::MapEditorController::~MapEditorController ( )
override

Destroys the MapEditorController.

Member Function Documentation

◆ activeSymbol()

Symbol * OpenOrienteering::MapEditorController::activeSymbol ( ) const
inline

Returns the active symbol, or nullptr.

The active symbol is the single symbol which is to be used by drawing tools and actions.

It there is no active symbol, this function returns nullptr.

◆ activeSymbolChanged

void OpenOrienteering::MapEditorController::activeSymbolChanged ( const OpenOrienteering::Symbol symbol)
signal

Indicates a change of the active symbol.

Parameters
symbolThe new active symbol, or nullptr.

◆ addFloatingDockWidget()

void OpenOrienteering::MapEditorController::addFloatingDockWidget ( QDockWidget dock_widget)

Adds a a floating dock widget to the main window.

Adjusts some geometric properties.

◆ addMapPart

void OpenOrienteering::MapEditorController::addMapPart ( )
slot

Creates and adds a new map part.

◆ addTemplatePositionDockWidget()

void OpenOrienteering::MapEditorController::addTemplatePositionDockWidget ( Template temp)

Adds a template position dock widget for the given template.

◆ alignMapWithNorth

void OpenOrienteering::MapEditorController::alignMapWithNorth ( bool  enable)
slot

Enables or disables map auto-rotation according to compass.

◆ alignMapWithNorthUpdate

void OpenOrienteering::MapEditorController::alignMapWithNorthUpdate ( )
slot

Called regularly after enabled with alignMapWithNorth() to update the map rotation.

◆ attach()

void OpenOrienteering::MapEditorController::attach ( MainWindow window)
overridevirtual

◆ baselineView

void OpenOrienteering::MapEditorController::baselineView ( bool  checked)
slot

Sets the baseline view option.

◆ booleanDifferenceClicked

void OpenOrienteering::MapEditorController::booleanDifferenceClicked ( )
slot

Calculates the difference of selected area objects from the first selected area object.

◆ booleanIntersectionClicked

void OpenOrienteering::MapEditorController::booleanIntersectionClicked ( )
slot

Calculates the intersection of selected same-symbol area objects.

◆ booleanMergeHolesClicked

void OpenOrienteering::MapEditorController::booleanMergeHolesClicked ( )
slot

Merges holes of the (single) selected area object.

◆ booleanUnionClicked

void OpenOrienteering::MapEditorController::booleanUnionClicked ( )
slot

Calculates the union of selected same-symbol area objects.

◆ booleanXOrClicked

void OpenOrienteering::MapEditorController::booleanXOrClicked ( )
slot

Calculates the boolean XOr of selected same-symbol area objects.

◆ changeMapPart

void OpenOrienteering::MapEditorController::changeMapPart ( int  index)
protectedslot

Sets the map's current part.

◆ clearUndoRedoHistory

void OpenOrienteering::MapEditorController::clearUndoRedoHistory ( )
slot

Empties the undo / redo history to save space.

◆ clipboardChanged

void OpenOrienteering::MapEditorController::clipboardChanged ( QClipboard::Mode  mode)
slot

Adjusts the enabled state of the paste action (specific signature required).

◆ closedTemplateAvailabilityChanged

void OpenOrienteering::MapEditorController::closedTemplateAvailabilityChanged ( )
slot

Adjusts action availability based on the presence of closed templates.

◆ configureGrid

void OpenOrienteering::MapEditorController::configureGrid ( )
slot

Shows the map grid configuration dialog.

◆ connectPathsClicked

void OpenOrienteering::MapEditorController::connectPathsClicked ( )
slot

Connects close endpoints of selected lines.

Todo:
Fix connectPathsClicked()
Todo:
get rid of force if possible

◆ convertToCurvesClicked

void OpenOrienteering::MapEditorController::convertToCurvesClicked ( )
slot

Converts selected polygonal paths to curves.

◆ coordsDisplayChanged

void OpenOrienteering::MapEditorController::coordsDisplayChanged ( )
slot

Adjusts the coordinates display of the map widget to the selected option.

◆ copy

void OpenOrienteering::MapEditorController::copy ( )
slot

Copies the selected object(s).

◆ copyDisplayedCoords

void OpenOrienteering::MapEditorController::copyDisplayedCoords ( )
slot

Copies the displayed coordinates to the clipboard.

◆ cut

void OpenOrienteering::MapEditorController::cut ( )
slot

Cuts the selected object(s).

◆ cutawayPhysicalClicked

void OpenOrienteering::MapEditorController::cutawayPhysicalClicked ( )
slot

Activates the physical cutout tool (inversed)

◆ cutClicked

void OpenOrienteering::MapEditorController::cutClicked ( )
slot

Activates the cut tool.

◆ cutHoleCircleClicked

void OpenOrienteering::MapEditorController::cutHoleCircleClicked ( )
slot

Activates the cut circular hole tool.

◆ cutHoleClicked

void OpenOrienteering::MapEditorController::cutHoleClicked ( )
slot

Activates the cut hole tool.

◆ cutHoleRectangleClicked

void OpenOrienteering::MapEditorController::cutHoleRectangleClicked ( )
slot

Activates the cut rectangular hole tool.

◆ cutoutPhysicalClicked

void OpenOrienteering::MapEditorController::cutoutPhysicalClicked ( )
slot

Activates the physical cutout tool.

◆ deleteClicked

void OpenOrienteering::MapEditorController::deleteClicked ( )
slot

Deletes the selected object(s)

◆ deletePopupWidget()

void OpenOrienteering::MapEditorController::deletePopupWidget ( QWidget child_widget)

Deletes the given popup widget, which was previously shown with showPopupWidget().

◆ deselectObjectsClicked

void OpenOrienteering::MapEditorController::deselectObjectsClicked ( )
slot

Deselects all objects with the selected symbol(s)

◆ detach()

void OpenOrienteering::MapEditorController::detach ( )
overridevirtual

◆ distributePointsClicked

void OpenOrienteering::MapEditorController::distributePointsClicked ( )
slot

Executes the "distribute points along path" action.

The prerequisites for using the tool must be given.

◆ drawCircleClicked

void OpenOrienteering::MapEditorController::drawCircleClicked ( )
slot

Activates the draw circle tool.

◆ drawFillClicked

void OpenOrienteering::MapEditorController::drawFillClicked ( )
slot

Activates the draw fill tool.

◆ drawFreehandClicked

void OpenOrienteering::MapEditorController::drawFreehandClicked ( )
slot

Activates the draw freehand tool.

◆ drawPathClicked

void OpenOrienteering::MapEditorController::drawPathClicked ( )
slot

Activates the draw path tool.

◆ drawPointClicked

void OpenOrienteering::MapEditorController::drawPointClicked ( )
slot

Activates the draw point tool.

◆ drawPointGPSClicked

void OpenOrienteering::MapEditorController::drawPointGPSClicked ( )
slot

Switches to the GPS point drawing tool.

◆ drawRectangleClicked

void OpenOrienteering::MapEditorController::drawRectangleClicked ( )
slot

Activates the draw rectangle tool.

◆ drawTextClicked

void OpenOrienteering::MapEditorController::drawTextClicked ( )
slot

Activates the draw text tool.

◆ duplicateClicked

void OpenOrienteering::MapEditorController::duplicateClicked ( )
slot

Duplicates the selected object(s)

◆ editGeoreferencing

void OpenOrienteering::MapEditorController::editGeoreferencing ( )
slot

◆ editLineToolClicked

void OpenOrienteering::MapEditorController::editLineToolClicked ( )
slot

Activates the line edit tool.

◆ editToolClicked

void OpenOrienteering::MapEditorController::editToolClicked ( )
slot

Activates the point edit tool.

◆ enableCompassDisplay

void OpenOrienteering::MapEditorController::enableCompassDisplay ( bool  enable)
slot

Enables or disables digital compass display.

◆ enableGPSDisplay

void OpenOrienteering::MapEditorController::enableGPSDisplay ( bool  enable)
slot

Enables or disables GPS display.

◆ enableGPSDistanceRings

void OpenOrienteering::MapEditorController::enableGPSDistanceRings ( bool  enable)
slot

Enables or disables showing distance rings when GPS display is active.

◆ existsTemplatePositionDockWidget()

bool OpenOrienteering::MapEditorController::existsTemplatePositionDockWidget ( Template temp) const
inline

Returns if a template position dock widget exists for a template.

◆ exportTo()

bool OpenOrienteering::MapEditorController::exportTo ( const QString path,
const FileFormat format 
)
overridevirtual

◆ exportVector

void OpenOrienteering::MapEditorController::exportVector ( )
slot

Lets the user export the map as geospatial vector data.

Todo:
Error message?

◆ fillBorderClicked

void OpenOrienteering::MapEditorController::fillBorderClicked ( )
slot

Creates duplicates of the selected object(s) and assigns them the selected symbol.

◆ georeferencingDialogFinished

void OpenOrienteering::MapEditorController::georeferencingDialogFinished ( )
protectedslot

◆ getAction()

QAction * OpenOrienteering::MapEditorController::getAction ( const char *  id)

Returns the action identified by id if it exists, or nullptr.

This allows the reuse of the controller's actions in dock widgets etc.

◆ getDefaultDrawToolForSymbol()

MapEditorTool * OpenOrienteering::MapEditorController::getDefaultDrawToolForSymbol ( const Symbol symbol)

Returns the default drawing tool for a given symbol.

◆ getEditorActivity()

MapEditorActivity* OpenOrienteering::MapEditorController::getEditorActivity ( ) const
inline

Returns the current editor activity.

◆ getMainWidget()

MapWidget* OpenOrienteering::MapEditorController::getMainWidget ( ) const
inline

Returns the main map widget (which is currently the only map widget).

◆ getMap()

Map* OpenOrienteering::MapEditorController::getMap ( ) const
inline

Returns the map on which this controller operates.

◆ getSymbolWidget()

SymbolWidget* OpenOrienteering::MapEditorController::getSymbolWidget ( ) const
inline

Returns this controller's symbol widget, where the symbol selection happens.

◆ getTemplatePositionDockWidget()

TemplatePositionDockWidget* OpenOrienteering::MapEditorController::getTemplatePositionDockWidget ( Template temp) const
inline

Returns the template position dock widget for a template.

◆ getTool()

MapEditorTool* OpenOrienteering::MapEditorController::getTool ( ) const
inline

Returns the current tool.

◆ gpsTemporaryClearClicked

void OpenOrienteering::MapEditorController::gpsTemporaryClearClicked ( )
slot

Clears temporary GPS markers.

◆ gpsTemporaryPathClicked

void OpenOrienteering::MapEditorController::gpsTemporaryPathClicked ( bool  enable)
slot

Draws a temporary path at the GPS position.

◆ gpsTemporaryPointClicked

void OpenOrienteering::MapEditorController::gpsTemporaryPointClicked ( )
slot

Sets a temporary marker at the GPS position.

◆ hatchAreas

void OpenOrienteering::MapEditorController::hatchAreas ( bool  checked)
slot

Sets the hatch areas view option.

◆ hideAllTemplates

void OpenOrienteering::MapEditorController::hideAllTemplates ( bool  checked)
slot

Sets the "hide all templates" view option.

◆ hideTopActionBar

void OpenOrienteering::MapEditorController::hideTopActionBar ( )
slot

For mobile UI: hides the top action bar.

◆ importClicked

void OpenOrienteering::MapEditorController::importClicked ( )
slot

Shows the import file selector and imports the selected file, if any.

Todo:
Reword message (not a map file here). Requires new translations

◆ importGpxFile()

bool OpenOrienteering::MapEditorController::importGpxFile ( const QString filename)

Imports a track file (GPX) into the map.

◆ importMap()

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

Imports another map into this map.

This method changes the given 'other' map if the maps' scales differ. This is an optimization for the use cases where temporary maps are created just for this kind of import.

See also
Map::importMap
Todo:
Move message to this context.

◆ importMapFile()

bool OpenOrienteering::MapEditorController::importMapFile ( const QString filename,
bool  show_errors 
)

Imports a map file into the loaded map.

Todo:
error message

◆ invertSelection

void OpenOrienteering::MapEditorController::invertSelection ( )
slot

Inverts in the object selection in the current map part.

◆ isEditingInProgress()

bool OpenOrienteering::MapEditorController::isEditingInProgress ( ) const
overridevirtual

Returns true when editing is in progress.

See also
setEditingInProgress

Reimplemented from OpenOrienteering::MainWindowController.

◆ isInMobileMode()

bool OpenOrienteering::MapEditorController::isInMobileMode ( ) const

Returns if the editor is in mobile mode.

◆ keyPressEventFilter()

bool OpenOrienteering::MapEditorController::keyPressEventFilter ( QKeyEvent event)
overridevirtual

Receives key press events from the main window. This implementation passes the event to MapWidget::keyPressEventFilter.

Reimplemented from OpenOrienteering::MainWindowController.

◆ keyReleaseEventFilter()

bool OpenOrienteering::MapEditorController::keyReleaseEventFilter ( QKeyEvent event)
overridevirtual

Receives key release events from the main window. This implementation passes the event to MapWidget::keyReleaseEventFilter.

Reimplemented from OpenOrienteering::MainWindowController.

◆ loadColorsFromClicked

void OpenOrienteering::MapEditorController::loadColorsFromClicked ( )
slot

TODO: not implemented yet.

◆ loadCrtClicked

void OpenOrienteering::MapEditorController::loadCrtClicked ( )
slot

Loads a CRT file and shows the symbol replacement dialog.

◆ loadFrom()

bool OpenOrienteering::MapEditorController::loadFrom ( const QString path,
const FileFormat format,
QWidget dialog_parent = nullptr 
)
overridevirtual

◆ loadSymbolsFromClicked

void OpenOrienteering::MapEditorController::loadSymbolsFromClicked ( )
slot

Shows the "load symbols from" dialog.

◆ mapNotesClicked

void OpenOrienteering::MapEditorController::mapNotesClicked ( )
slot

Shows the dialog to enter map notes.

◆ measureClicked

void OpenOrienteering::MapEditorController::measureClicked ( bool  checked)
slot

Shows or hides the MeasureWidget.

◆ menuBarVisible()

bool OpenOrienteering::MapEditorController::menuBarVisible ( )
overridevirtual

In SymbolEditor mode, this controller doesn't want a menu bar.

Reimplemented from OpenOrienteering::MainWindowController.

◆ mergeAllMapParts

void OpenOrienteering::MapEditorController::mergeAllMapParts ( )
slot

Merges all map parts into the current one.

◆ mergeCurrentMapPartTo

void OpenOrienteering::MapEditorController::mergeCurrentMapPartTo ( int  target)
slot

Merges the current map part with another one.

◆ mobileSymbolSelectorClicked

void OpenOrienteering::MapEditorController::mobileSymbolSelectorClicked ( )
slot

For mobile UI: shows the symbol selection screen.

◆ mobileSymbolSelectorFinished

void OpenOrienteering::MapEditorController::mobileSymbolSelectorFinished ( )
slot

◆ moveToGpsPos

void OpenOrienteering::MapEditorController::moveToGpsPos ( )
slot

Moves view to GPS position.

◆ objectSelectionChanged

void OpenOrienteering::MapEditorController::objectSelectionChanged ( )
slot

Makes the editor aware of a change of the selected object.

◆ openTemplateClicked

void OpenOrienteering::MapEditorController::openTemplateClicked ( )
slot

Shows a file selector to open a template.

◆ overprintingSimulation

void OpenOrienteering::MapEditorController::overprintingSimulation ( bool  checked)
slot

Sets the overprinting simulation view option.

◆ paintOnTemplateClicked

void OpenOrienteering::MapEditorController::paintOnTemplateClicked ( bool  checked)
slot

Shows or hides the paint-on-template widget.

◆ paintOnTemplateSelectClicked

void OpenOrienteering::MapEditorController::paintOnTemplateSelectClicked ( )
slot

Shows the template selection dialog for for the paint-on-template functionality.

◆ pan

void OpenOrienteering::MapEditorController::pan ( )
slot

Activates the pan tool.

◆ paste

void OpenOrienteering::MapEditorController::paste ( )
slot

Pastes the object(s) from the clipboard.

◆ printClicked

void OpenOrienteering::MapEditorController::printClicked ( int  task)
slot

Makes the print/export dock widget visible, and configures it for the given task (which is of type PrintWidget::TaskFlags).

◆ projectionChanged

void OpenOrienteering::MapEditorController::projectionChanged ( )
protectedslot

◆ reassignObjectsToMapPart

void OpenOrienteering::MapEditorController::reassignObjectsToMapPart ( int  target)
slot

Moves all selected objects to a different map part.

◆ redo

void OpenOrienteering::MapEditorController::redo ( )
slot

Redoes the last object edit step.

◆ removeMapPart

void OpenOrienteering::MapEditorController::removeMapPart ( )
slot

Removes the current map part.

◆ removeTemplatePositionDockWidget()

void OpenOrienteering::MapEditorController::removeTemplatePositionDockWidget ( Template temp)

Removes the template position dock widget for the template.

Should be called by the dock widget if it is closed or the template deleted; deletes the dock widget.

◆ renameMapPart

void OpenOrienteering::MapEditorController::renameMapPart ( )
slot

Renames the current map part.

◆ reopenTemplateClicked

void OpenOrienteering::MapEditorController::reopenTemplateClicked ( )
slot

◆ rotateClicked

void OpenOrienteering::MapEditorController::rotateClicked ( )
slot

Activates the rotate tool.

◆ rotateMapClicked

void OpenOrienteering::MapEditorController::rotateMapClicked ( )
slot

Shows the RotateMapDialog.

◆ rotatePatternClicked

void OpenOrienteering::MapEditorController::rotatePatternClicked ( )
slot

Activates the rotate pattern tool.

◆ saveTo()

bool OpenOrienteering::MapEditorController::saveTo ( const QString path,
const FileFormat format 
)
overridevirtual

◆ scaleAllSymbolsClicked

void OpenOrienteering::MapEditorController::scaleAllSymbolsClicked ( )
slot

Shows the "scale all symbols" dialog.

◆ scaleClicked

void OpenOrienteering::MapEditorController::scaleClicked ( )
slot

Activates the scale tool.

◆ scaleMapClicked

void OpenOrienteering::MapEditorController::scaleMapClicked ( )
slot

Shows the ScaleMapDialog.

◆ selectAll

void OpenOrienteering::MapEditorController::selectAll ( )
slot

Selects all objects in the current map part.

◆ selectByCurrentSymbols

void OpenOrienteering::MapEditorController::selectByCurrentSymbols ( )
slot

Selects all objects having the current selected symbols.

◆ selectedSymbolsChanged

void OpenOrienteering::MapEditorController::selectedSymbolsChanged ( )
slot

Makes the editor aware of a change of the selected symbols.

◆ selectNothing

void OpenOrienteering::MapEditorController::selectNothing ( )
slot

Clears the object selection.

◆ selectObjectsClicked

void OpenOrienteering::MapEditorController::selectObjectsClicked ( bool  select_exclusively)
slot

Selects all objects with the selected symbol(s)

◆ setCustomZoomFactorClicked

void OpenOrienteering::MapEditorController::setCustomZoomFactorClicked ( )
slot

Shows the dialog to set a custom zoom factor in the current map widget.

◆ setEditingInProgress()

void OpenOrienteering::MapEditorController::setEditingInProgress ( bool  value)

If this is set to true (usually by the current tool), undo/redo and saving the map is deactivated.

This is important if the map is in an "unstable" state temporarily.

◆ setEditorActivity()

void OpenOrienteering::MapEditorController::setEditorActivity ( MapEditorActivity new_activity)

Sets the current editor activity.

new_activity may be nullptr to disable the current editor activity.

◆ setEditTool()

void OpenOrienteering::MapEditorController::setEditTool ( )

Shortcut to change to the point edit tool as new active tool.

See setTool().

◆ setOverrideTool()

void OpenOrienteering::MapEditorController::setOverrideTool ( MapEditorTool new_override_tool)

Sets new_override_tool as the new active override tool.

This takes precedence over all tools set via setTool(). new_override_tool may be nullptr, which disables using an override tool and re-enables the normal tool set via setTool().

◆ setTool()

void OpenOrienteering::MapEditorController::setTool ( MapEditorTool new_tool)

Changes to new_tool as the new active tool.

If there is a current tool before, calls deleteLater() on it. new_tool may be nullptr, but it is unusual to have no active tool, so consider setEditTool() instead.

◆ setViewOptionsEnabled

void OpenOrienteering::MapEditorController::setViewOptionsEnabled ( bool  enabled = true)
slot

Sets the enabled state of actions which change how the map is rendered, such as with grid, with templates, with overprinting simulation.

◆ setWindowStateChanged

void OpenOrienteering::MapEditorController::setWindowStateChanged ( )
slot

Indicates a change of the current toolbar and dock widget positions, and schedules saving.

◆ showColorWindow

void OpenOrienteering::MapEditorController::showColorWindow ( bool  show)
slot

Shows or hides the color dock widget.

◆ showGrid

void OpenOrienteering::MapEditorController::showGrid ( )
slot

Toggles visivbility of the map grid.

◆ showPopupWidget()

void OpenOrienteering::MapEditorController::showPopupWidget ( QWidget child_widget,
const QString title 
)

Shows the given widget in a popup window with specified title.

In the desktop version, the widget is shown inside a dock widget. In the mobile version, the widget is shown as a popup over the map, ignoring the title.

Make sure that the child widget has a reasonable size hint.

◆ showSymbolWindow

void OpenOrienteering::MapEditorController::showSymbolWindow ( bool  show)
slot

Shows or hides the symbol pane.

◆ showTagsWindow

void OpenOrienteering::MapEditorController::showTagsWindow ( bool  show)
slot

Shows or hides the tags editor dock widget.

◆ showTemplateWindow

void OpenOrienteering::MapEditorController::showTemplateWindow ( bool  show)
slot

Shows or hides the template setup dock widget.

◆ showTopActionBar

void OpenOrienteering::MapEditorController::showTopActionBar ( )
slot

For mobile UI: shows the top action bar again after hiding it.

◆ showWholeMap

void OpenOrienteering::MapEditorController::showWholeMap ( )
slot

Adjusts the view in the current map widget to show the whole map.

◆ simplifyPathClicked

void OpenOrienteering::MapEditorController::simplifyPathClicked ( )
slot

Tries to remove points of selected paths while retaining their shape.

◆ spotColorPresenceChanged

void OpenOrienteering::MapEditorController::spotColorPresenceChanged ( bool  has_spot_colors)
slot

Checks the presence of spot colors, and to disables overprinting simulation if there are no spot colors.

◆ switchDashesClicked

void OpenOrienteering::MapEditorController::switchDashesClicked ( )
slot

Reverses the selected object(s) direcction(s), thus switching dash directions for lines.

◆ switchSymbolClicked

void OpenOrienteering::MapEditorController::switchSymbolClicked ( )
slot

Switches the symbol of the selected object(s) to the selected symbol.

◆ symbolSetIdClicked

void OpenOrienteering::MapEditorController::symbolSetIdClicked ( )
slot

Shows a dialog for changing the symbol set ID.

◆ templateAdded

void OpenOrienteering::MapEditorController::templateAdded ( int  pos,
const OpenOrienteering::Template temp 
)
slot

Updates action enabled states after a template has been added.

◆ templateAvailabilityChanged

void OpenOrienteering::MapEditorController::templateAvailabilityChanged ( )
slot

Adjusts action availability based on the presence of templates.

◆ templateDeleted

void OpenOrienteering::MapEditorController::templateDeleted ( int  pos,
const OpenOrienteering::Template temp 
)
slot

Updates action enabled states after a template has been deleted.

◆ templatePositionDockWidgetClosed

void OpenOrienteering::MapEditorController::templatePositionDockWidgetClosed ( OpenOrienteering::Template temp)
signal

◆ undo

void OpenOrienteering::MapEditorController::undo ( )
slot

Undoes the last object edit step.

◆ undoStepAvailabilityChanged

void OpenOrienteering::MapEditorController::undoStepAvailabilityChanged ( )
slot

Adjusts the enabled state of the undo / redo actions.

◆ updateDrawPointGPSAvailability

void OpenOrienteering::MapEditorController::updateDrawPointGPSAvailability ( )
slot

Updates availability of the GPS point drawing tool.

◆ updateMapPartsUI

void OpenOrienteering::MapEditorController::updateMapPartsUI ( )
protectedslot

Updates all UI components related to map parts.

◆ updateObjectDependentActions()

void OpenOrienteering::MapEditorController::updateObjectDependentActions ( )
protected

Adjusts the enabled state of various actions after the selected object(s) have changed.

In addition, it disables actions as long as some editing is in progress.

The caller shall also call updateSymbolAndObjectDependentActions().

◆ updatePasteAvailability

void OpenOrienteering::MapEditorController::updatePasteAvailability ( )
slot

Adjusts the enabled state of the paste action.

◆ updateSymbolAndObjectDependentActions()

void OpenOrienteering::MapEditorController::updateSymbolAndObjectDependentActions ( )
protected

Adjusts the enabled state of various actions after the selected symbol(s) or object(s) have changed.

In addition, it disables actions as long as some editing is in progress.

◆ updateSymbolDependentActions()

void OpenOrienteering::MapEditorController::updateSymbolDependentActions ( )
protected

Adjusts the enabled state of various actions after the selected symbol(s) have changed.

In addition, it disables actions as long as some editing is in progress.

The caller shall also call updateSymbolAndObjectDependentActions().

◆ zoomIn

void OpenOrienteering::MapEditorController::zoomIn ( )
slot

Zooms in in the current map widget.

◆ zoomOut

void OpenOrienteering::MapEditorController::zoomOut ( )
slot

Zooms out in the current map widget.

Friends And Related Function Documentation

◆ Map

friend class Map
friend

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