• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

Digikam::MarkerClusterHolder

Digikam::MarkerClusterHolder Class Reference

#include <markerclusterholder.h>

Inheritance diagram for Digikam::MarkerClusterHolder:
Inheritance graph
[legend]

List of all members.

Classes

class  ClusterInfo
 Information about a cluster. More...
class  MarkerInfo
 Information about a marker. More...

Public Types

typedef QList< ClusterInfo > ClusterInfoList
typedef PixmapOperations(* ClusterPixmapFunction )(const int clusterIndex, MarkerClusterHolder *const mch, const QSize &maxSize, void *const yourdata, QPixmap *const clusterPixmap)
typedef void(* CustomPaintFunction )(Marble::GeoPainter *const geoPainter, const bool isBefore, void *const yourdata)
typedef bool(* MarkerDataEqualFunction )(const QVariant &one, const QVariant &two, void *const yourdata)
typedef QList< MarkerInfo > MarkerInfoList
enum  MouseMode { MouseModePan = 1, MouseModeFilter = 2, MouseModeSelect = 3, MouseModeZoomCluster = 4 }
enum  PixmapOperations {
  PixmapInvalid = 0, PixmapValid = 1, PixmapNoAddNumber = 2, PixmapNoSoloModify = 4,
  PixmapNoSelectedModify = 8
}
typedef QList< int > QIntList
typedef QString(* TooltipFunction )(const int clusterIndex, MarkerClusterHolder *const mch, void *const yourdata)

Public Slots

void clearFiltering ()
void clearSelection ()
void setAllowFiltering (const bool allow)
void setAllowSelection (const bool allow)
void setAutoRedrowOnMarkerAdd (const bool doRedraw)
void setSelectedMarkers (const MarkerClusterHolder::MarkerInfoList &markerList, const bool setAsSelected=true, const bool resetOthers=true)
void setSelectedMarkers (const QIntList &markerIndicesList, const bool setAsSelected=true, const bool resetOthers=true)
void setSoloMarkers (const MarkerClusterHolder::MarkerInfoList &markerList, const bool setAsSolo=true, const bool resetOthers=true)
void setSoloMarkers (const QIntList &markerIndicesList, const bool setAsSolo=true, const bool resetOthers=true)
void setTooltipFunction (TooltipFunction newTooltipFunction, void *const yourdata)
void zoomIntoCluster (ClusterInfo cluster)

Signals

void signalSelectionChanged ()
void signalSoloChanged ()

Public Member Functions

 MarkerClusterHolder (Marble::MarbleWidget *const marbleWidget)
 ~MarkerClusterHolder ()
void addMarker (const MarkerInfo &marker)
void addMarkers (const QList< MarkerInfo > &markerList)
bool autoRedrawOnMarkerAdd () const
void clear ()
ClusterInfo & cluster (const int clusterIndex)
int findClusterAt (const QPoint pos) const
MouseMode getMouseMode () const
MarkerInfo::List indicesToMarkers (const QIntList indicesList) const
MarkerInfo & marker (const int markerIndex)
void paintOnMarble (Marble::GeoPainter *const painter)
void reorderClusters ()
MarkerInfo::List selectedMarkers () const
void setClusterPixmapFunction (const ClusterPixmapFunction clusterPixmapFunction, void *const yourdata)
void setCustomPaintFunction (const CustomPaintFunction customPaintFunction, void *const yourdata)
void setMarkerDataEqualFunction (const MarkerDataEqualFunction compareFunction, void *const yourdata)
void setMouseMode (const MouseMode mode)
MarkerInfo::List soloMarkers () const

Protected Member Functions

void computeClusterDistances ()
bool eventFilter (QObject *obj, QEvent *event)
bool markersEqual (const MarkerInfo &one, const MarkerInfo &two)
void paintOnMarbleInternal (Marble::GeoPainter *const painter)
void redrawIfNecessary (const bool force=false)
void reorderClustersPixelGrid ()
void updateClusterStates ()

Static Protected Member Functions

static void ExternalDrawCallback (Marble::GeoPainter *painter, void *yourdata)

Detailed Description

Definition at line 49 of file markerclusterholder.h.


Member Typedef Documentation

typedef QList<ClusterInfo> Digikam::MarkerClusterHolder::ClusterInfoList

Definition at line 316 of file markerclusterholder.h.

typedef PixmapOperations(* Digikam::MarkerClusterHolder::ClusterPixmapFunction)(const int clusterIndex, MarkerClusterHolder *const mch, const QSize &maxSize, void *const yourdata, QPixmap *const clusterPixmap)

Creates the pixmap for a cluster.

This function has to be implemented by the client application. It is only needed if pixmaps are to be displayed instead of circles.

Parameters:
clusterIndex Index of the cluster whose pixmap is requested
mch Pointer to the MarkerClusterHolder requesting the pixmap
maxSize Maximum size of the pixmap
yourdata User data for the pixmap function
clusterPixmap Pointer to a QPixmap where the pixmap is to be stored
Returns:
PixmapValid if a pixmap was returned

Definition at line 367 of file markerclusterholder.h.

typedef void(* Digikam::MarkerClusterHolder::CustomPaintFunction)(Marble::GeoPainter *const geoPainter, const bool isBefore, void *const yourdata)

Custom painting before/after clusters.

Definition at line 372 of file markerclusterholder.h.

typedef bool(* Digikam::MarkerClusterHolder::MarkerDataEqualFunction)(const QVariant &one, const QVariant &two, void *const yourdata)

Comparison function for the user data of markers.

This function has to be implemented by the client application. It is only needed if the user data stored in the markers is a user defined type.

Parameters:
yourdata User data for the compare function
Returns:
true if the data in the two QVariants is equal

Definition at line 327 of file markerclusterholder.h.

typedef QList<MarkerInfo> Digikam::MarkerClusterHolder::MarkerInfoList

Definition at line 211 of file markerclusterholder.h.

typedef QList<int> Digikam::MarkerClusterHolder::QIntList

Definition at line 55 of file markerclusterholder.h.

typedef QString(* Digikam::MarkerClusterHolder::TooltipFunction)(const int clusterIndex, MarkerClusterHolder *const mch, void *const yourdata)

Returns the tooltip text for a cluster.

This function has to be implemented by the client application. It is only needed if tooltips are to be displayed for markers. The application can decide whether a tooltip is useful depending on the number of markers in the cluster. If no tooltip should be shown, it should return an empty string.

Parameters:
clusterIndex Index of the cluster whose tooltip is requested
mch Pointer to the MarkerClusterHolder requesting the tooltip
yourdata User data for the tooltip function
Returns:
The text for the tooltip

Definition at line 343 of file markerclusterholder.h.


Member Enumeration Documentation

enum Digikam::MarkerClusterHolder::MouseMode
Enumerator:
MouseModePan 
MouseModeFilter 
MouseModeSelect 
MouseModeZoomCluster 

Definition at line 57 of file markerclusterholder.h.

enum Digikam::MarkerClusterHolder::PixmapOperations
Enumerator:
PixmapInvalid 
PixmapValid 
PixmapNoAddNumber 
PixmapNoSoloModify 
PixmapNoSelectedModify 

Definition at line 345 of file markerclusterholder.h.


Constructor & Destructor Documentation

Digikam::MarkerClusterHolder::MarkerClusterHolder ( Marble::MarbleWidget *const   marbleWidget  ) 

Constructs a MarkerClusterHolder.

Parameters:
marbleWidget Map on which the clusters should be shown. Will also be used as parent for this object.

Definition at line 160 of file markerclusterholder.cpp.

Digikam::MarkerClusterHolder::~MarkerClusterHolder (  ) 

Definition at line 194 of file markerclusterholder.cpp.


Member Function Documentation

void Digikam::MarkerClusterHolder::addMarker ( const MarkerInfo &  marker  ) 

Adds a marker.

Parameters:
marker Marker to be added

Definition at line 210 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::addMarkers ( const QList< MarkerInfo > &  markerList  ) 

Adds a list of markers.

Parameters:
markerList List of markers to be added

Definition at line 221 of file markerclusterholder.cpp.

bool Digikam::MarkerClusterHolder::autoRedrawOnMarkerAdd (  )  const

Returns whether the map should be updated when a marker is added/deleted.

Returns:
Whether the map is updated automatically

Definition at line 542 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::clear (  ) 

Clears all markers and clusters.

Definition at line 515 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::clearFiltering (  )  [slot]

Clear filtering on all markers.

Definition at line 836 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::clearSelection (  )  [slot]

Clear selections for all markers.

Definition at line 850 of file markerclusterholder.cpp.

MarkerClusterHolder::ClusterInfo & Digikam::MarkerClusterHolder::cluster ( const int  clusterIndex  ) 

Returns a cluster for a given index.

Parameters:
clusterIndex Index of the cluster
Returns:
The requested cluster

Definition at line 1492 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::computeClusterDistances (  )  [protected]

Calculate the distances between the clusters.

Definition at line 793 of file markerclusterholder.cpp.

bool Digikam::MarkerClusterHolder::eventFilter ( QObject *  obj,
QEvent *  event 
) [protected]

Eventfilter for filtering mouse interactions with Marble::MarbleWidget.

Gets called by Qt

Parameters:
obj Pointer to object for which the event occurred
event Pointer to the event that occurred
Returns:
true if the event was filtered by this function

Definition at line 1139 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::ExternalDrawCallback ( Marble::GeoPainter *  painter,
void *  yourdata 
) [static, protected]

Callback function for custom painting, called by ExternalDrawPlugin.

Parameters:
painter Painter to paint clusters on
yourdata Pointer to MarkerClusterHolder

Definition at line 147 of file markerclusterholder.cpp.

int Digikam::MarkerClusterHolder::findClusterAt ( const QPoint  pos  )  const

Finds the cluster shown at position pos.

Parameters:
pos Position of interest
Returns:
Index of cluster under position pos, or -1 if no cluster was found

Definition at line 1112 of file markerclusterholder.cpp.

MarkerClusterHolder::MouseMode Digikam::MarkerClusterHolder::getMouseMode (  )  const

Definition at line 1533 of file markerclusterholder.cpp.

MarkerClusterHolder::MarkerInfo::List Digikam::MarkerClusterHolder::indicesToMarkers ( const QIntList  indicesList  )  const

Returns the markers for a list of indices.

Parameters:
indicesList Indices of the markers
Returns:
List of markers for the given indices

Definition at line 927 of file markerclusterholder.cpp.

MarkerClusterHolder::MarkerInfo & Digikam::MarkerClusterHolder::marker ( const int  markerIndex  ) 

Returns a marker for a given index.

Parameters:
markerIndex Index of the marker
Returns:
The requested marker

Definition at line 1502 of file markerclusterholder.cpp.

bool Digikam::MarkerClusterHolder::markersEqual ( const MarkerInfo &  one,
const MarkerInfo &  two 
) [protected]

Checks whether two markers can are the same.

If custom types are used in the data-QVariant, a MarkerDataEqualFunction has to be set using setMarkerDataEqualFunction, otherwise the comparison will fail

Parameters:
one First marker
two Second marker
Returns:
true if the markers are equal
See also:
setMarkerDataEqualFunction, MarkerDataEqualFunction

Definition at line 1320 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::paintOnMarble ( Marble::GeoPainter *const   painter  ) 

Paints the clusters on MarbleWidget.

Call this function from a customPaint of a Marble::MarbleWidget subclass If you do not want to subclass Marble::MarbleWidget yourself, use MarbleSubClassWidget

Parameters:
painter Painter on which the clusters should be painted

Definition at line 358 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::paintOnMarbleInternal ( Marble::GeoPainter *const   painter  )  [protected]

Paints the clusters on MarbleWidget.

This function is called internally either from paintOnMarble or from the externaldraw-plugin, if found

Parameters:
painter Painter on which the clusters should be painted

Definition at line 379 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::redrawIfNecessary ( const bool  force = false  )  [protected]

Causes the map to be redrawn if the number of markers has changed and autoRedrawOnMarkerAdd is set.

Parameters:
force Force a redraw

Definition at line 530 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::reorderClusters (  ) 

Reorders the markers into clusters.

Definition at line 559 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::reorderClustersPixelGrid (  )  [protected]

Reorder the clusters if the map has changed.

Definition at line 579 of file markerclusterholder.cpp.

MarkerClusterHolder::MarkerInfo::List Digikam::MarkerClusterHolder::selectedMarkers (  )  const

returns the currently selected markers

Returns:
List of currently selected markers

Definition at line 942 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setAllowFiltering ( const bool  allow  )  [slot]

Set whether the user can select clusters for filtering or not.

Parameters:
allow Whether filtering is enabled

Definition at line 1347 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setAllowSelection ( const bool  allow  )  [slot]

Set whether the user can select clusters.

Parameters:
allow Whether the user can select clusters

Definition at line 1358 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setAutoRedrowOnMarkerAdd ( const bool  doRedraw  )  [slot]

Set whether the map should be updated when a marker is added/deleted.

Parameters:
doRedraw Whether the map is redrawn on changes

Definition at line 551 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setClusterPixmapFunction ( const ClusterPixmapFunction  clusterPixmapFunction,
void *const   yourdata 
)

Set the pixmap generation helper function.

Parameters:
clusterPixmapFunction Function which creates pixmaps for clusters
yourdata User data for pixmap generation function

Definition at line 1384 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setCustomPaintFunction ( const CustomPaintFunction  customPaintFunction,
void *const   yourdata 
)

Set the function for custom painting for the application.

Parameters:
customPaintFunction Function which does custom painting for the application
yourdata User data for custom painting function

Definition at line 1395 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setMarkerDataEqualFunction ( const MarkerDataEqualFunction  compareFunction,
void *const   yourdata 
)

Sets the comparison function for the marker user data.

Parameters:
compareFunction Function which compares the user data parts of two markers
yourdata user data passed into the function

Definition at line 1337 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setMouseMode ( const MouseMode  mode  ) 
void Digikam::MarkerClusterHolder::setSelectedMarkers ( const MarkerClusterHolder::MarkerInfoList &  markerList,
const bool  setAsSelected = true,
const bool  resetOthers = true 
) [slot]

Sets which markers should be selected.

Parameters:
markerList List of markers to be changed
setAsSelected Whether the given markers are to be set as selected or not selected
resetOthers Whether other markers should be set as not selected

Definition at line 1006 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setSelectedMarkers ( const QIntList &  markerIndicesList,
const bool  setAsSelected = true,
const bool  resetOthers = true 
) [slot]

Sets which markers should be selected.

Parameters:
markerIndicesList Indices of markers to be changed
setAsSelected Whether the given markers are to be set as selected or not selected
resetOthers Whether other markers should be set as not selected

Definition at line 979 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setSoloMarkers ( const MarkerClusterHolder::MarkerInfoList &  markerList,
const bool  setAsSolo = true,
const bool  resetOthers = true 
) [slot]

Sets which markers should be 'solo'.

Parameters:
markerList List of markers to be changed
setAsSolo Whether the markers are to be set as solo or not solo
resetOthers Whether other markers are to be reset to not solo

Definition at line 894 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setSoloMarkers ( const QIntList &  markerIndicesList,
const bool  setAsSolo = true,
const bool  resetOthers = true 
) [slot]

Sets which markers should be 'solo'.

Parameters:
markerIndicesList Indices of the markers to be changed
setAsSolo Whether the markers are to be set as solo or not solo
resetOthers Whether other markers are to be reset to not solo

Definition at line 867 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::setTooltipFunction ( TooltipFunction  newTooltipFunction,
void *const   yourdata 
) [slot]

Set the tooltip helper function.

Set this to zero to disable tooltips

Parameters:
newTooltipFunction Function which returns the tooltip text for a given cluster
yourdata user data passed into the function

Definition at line 1373 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::signalSelectionChanged (  )  [signal]
void Digikam::MarkerClusterHolder::signalSoloChanged (  )  [signal]
MarkerClusterHolder::MarkerInfo::List Digikam::MarkerClusterHolder::soloMarkers (  )  const

returns the currently solo markers

Returns:
List of markers currently marked as 'solo'

Definition at line 958 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::updateClusterStates (  )  [protected]

Updates the selected/solo states of the clusters from the states of the markers.

Definition at line 1046 of file markerclusterholder.cpp.

void Digikam::MarkerClusterHolder::zoomIntoCluster ( ClusterInfo  cluster  )  [slot]

Zoom into the area covered by a cluster.

Parameters:
cluster Cluster defining the area to be shown

Definition at line 1405 of file markerclusterholder.cpp.


The documentation for this class was generated from the following files:
  • markerclusterholder.h
  • markerclusterholder.cpp

digikam

Skip menu "digikam"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • digikam
Generated for API Reference by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal