ToolMap
Loading...
Searching...
No Matches
tmLayerManager Class Reference

GIS class for dealing with layers. More...

#include <tmlayermanager.h>

Inheritance diagram for tmLayerManager:

Public Member Functions

 tmLayerManager (wxWindow *parent, TocCtrl *tocctrl, tmRenderer *renderer, wxStatusBar *status, tmScaleCtrlCombo *scalectrl)
 Constructor.
 
 ~tmLayerManager ()
 Destructor.
 
void InitScaleCtrlList ()
 
bool InitLayerManager (DataBaseTM *db)
 Init the layer manager with a project.
 
bool UnInitLayerManager ()
 Un-Init the layer manager.
 
void SetMemoryProject (PrjDefMemManage *memoryprj)
 
void RemoveLayer (wxCommandEvent &event)
 Response to the event sent by the #tmTOCCtrl.
 
void AddLayer (wxCommandEvent &event)
 Response to the event sent by the "Add Gis Data" menu.
 
void AddWebLayer ()
 
void GroupAdd (wxCommandEvent &event)
 
bool OpenLayer (const wxFileName &filename, bool replace=false, const wxString &originalname=wxEmptyString)
 
tmGISScaleGetScale ()
 
bool ZoomToLayer (long layerid)
 
void ZoomToSelectedLayer ()
 
void ZoomToFrameLayer ()
 
void OnSizeChange (wxCommandEvent &event)
 Called when windows size change.
 
void OnUpdateCoordinates (wxCommandEvent &event)
 Respond to mouse mouve inside renderer area.
 
void OnUpdateAngle (wxCommandEvent &event)
 
void OnShowLayer (wxCommandEvent &event)
 Called when showing or hiding a layer.
 
void OnScaleChanged (wxCommandEvent &event)
 Called when user change scale.
 
void OnDisplayProperties (wxCommandEvent &event)
 Show properties dialog.
 
void OnDisplayLabels (wxCommandEvent &event)
 
void OnTocEdited (wxCommandEvent &event)
 
void OnZoomToFit ()
 Called when user press Zoom to fit.
 
void OnZoomRectangle ()
 
void OnPan ()
 
void OnSelect ()
 
bool ZoomPrevious ()
 
bool HasZoomPrevious ()
 
bool SelectedSearch (const wxRect &rect, bool shiftdown=false)
 Searching data for selection.
 
bool SelectedClear ()
 Clear all selected objects.
 
bool SelectedInvert ()
 Invert selected values.
 
bool SelectByOid ()
 
void CheckGeometryValidity ()
 
void ExportSelectedGeometries (const wxFileName &file)
 
bool LoadProjectLayers ()
 Load all layers (non threaded)
 
bool ReloadProjectLayers (bool bFullExtent=TRUE, bool bInvalidateFullExt=TRUE)
 
tmSelectedDataMemoryGetSelectedDataMemory ()
 
void BlockRefreshProcess (bool block=true)
 
bool GetRefreshBlocked ()
 
void SetSelectionColour (const wxColour &col)
 
void SetSelectionHalo (bool hashalo)
 

Static Public Member Functions

static void EnableLogging (bool enable=true)
 
static bool IsLoggingEnabled ()
 

Detailed Description

GIS class for dealing with layers.

This is the super class for dealing with GIS. This class is the central point dealing with :

  • Database (DataBaseTM)
  • TOC controls (#tmTOCCtrl)
  • GIS progress indicator (#tmProgressIndicator)
  • ...
    Author
    Lucien Schreiber (c) CREALP 2008
    Date
    07 July 2008

Constructor & Destructor Documentation

◆ tmLayerManager()

tmLayerManager::tmLayerManager ( wxWindow *  parent,
TocCtrl tocctrl,
tmRenderer renderer,
wxStatusBar *  status,
tmScaleCtrlCombo scalectrl 
)

Constructor.

Init values to default and init members.

Author
Lucien Schreiber (c) CREALP 2008
Date
07 July 2008

◆ ~tmLayerManager()

tmLayerManager::~tmLayerManager ( )

Destructor.

Author
Lucien Schreiber (c) CREALP 2008
Date
07 July 2008

Member Function Documentation

◆ AddLayer()

void tmLayerManager::AddLayer ( wxCommandEvent &  event)

Response to the event sent by the "Add Gis Data" menu.

This function is doing following operations :

  • Checking that #tmTOCCtrl is ready : tmTOCCtrl::IsTOCReady()
  • Importing data
  • Saving layer to the database and getting back his real ID
  • Adding layer to the tmTOCCtrl with his real ID.
    Author
    Lucien Schreiber (c) CREALP 2008
    Date
    11 July 2008

◆ GroupAdd()

void tmLayerManager::GroupAdd ( wxCommandEvent &  event)

Create the group, and add it to the database. Then call the TocCtrl and add it.

◆ InitLayerManager()

bool tmLayerManager::InitLayerManager ( DataBaseTM db)

Init the layer manager with a project.

Call this function when a project is opened, this allows the needed initialization to takes place.

Parameters
dbPointer to a valid DataBaseTM object (ASSERT is done in debug mode)
Returns
Always TRUE for the moment
Author
Lucien Schreiber (c) CREALP 2008
Date
07 July 2008

◆ LoadProjectLayers()

bool tmLayerManager::LoadProjectLayers ( )

Load all layers (non threaded)

This functions does closely the same that the ReloadProjectLayers() one but isn't threaded and is called during project opening.

Author
Lucien Schreiber (c) CREALP 2008
Date
24 July 2008

◆ OnDisplayProperties()

void tmLayerManager::OnDisplayProperties ( wxCommandEvent &  event)

Show properties dialog.

Parameters
eventContain the tmLayerProperties info. Use GetClientInfo() for getting info out.
Author
Lucien Schreiber (c) CREALP 2008
Date
22 October 2008

◆ OnScaleChanged()

void tmLayerManager::OnScaleChanged ( wxCommandEvent &  event)

Called when user change scale.

This function is called by the Scale control (tmScaleCtrlCombo) when user specify a scale.

Parameters
eventempty.
Author
Lucien Schreiber (c) CREALP 2008
Date
14 October 2008

◆ OnShowLayer()

void tmLayerManager::OnShowLayer ( wxCommandEvent &  event)

Called when showing or hiding a layer.

This function is called by the TOC (#tmTOCCtrl) when a layers is displayed or hidden

Parameters
eventempty.
Author
Lucien Schreiber (c) CREALP 2008
Date
14 October 2008

◆ OnSizeChange()

void tmLayerManager::OnSizeChange ( wxCommandEvent &  event)

Called when windows size change.

This function is called by the renderer (tmRenderer) when the size change. It call the rendering of all layers in a multi-threaded way.

Parameters
eventContain a tmArraySize with :
  • Item 0 containing the old Size (in pixels).
  • Item 1 containing the new size (in pixels).
Author
Lucien Schreiber (c) CREALP 2008
Date
14 October 2008

◆ OnUpdateCoordinates()

void tmLayerManager::OnUpdateCoordinates ( wxCommandEvent &  event)

Respond to mouse mouve inside renderer area.

This function is called automatically by the tmRenderer class when the mouse is moved inside the display area

Author
Lucien Schreiber (c) CREALP 2008
Date
24 July 2008

◆ OnZoomToFit()

void tmLayerManager::OnZoomToFit ( )

Called when user press Zoom to fit.

This functions does the following :

  • Loading all visible layers (computing maximum extent)
  • Drawing This function is threaded, one can call this multiple time, if a thread allready exists it will be destroyed and a new one will be started
    Author
    Lucien Schreiber (c) CREALP 2008
    Date
    24 July 2008

◆ RemoveLayer()

void tmLayerManager::RemoveLayer ( wxCommandEvent &  event)

Response to the event sent by the #tmTOCCtrl.

Item was already deleted from the tmTOCCtrl and is now removed from the DB and the display is refreshed.

Parameters
eventContain the layer database ID into the GetExtraLong() function
Author
Lucien Schreiber (c) CREALP 2008
Date
11 July 2008

◆ SelectedClear()

bool tmLayerManager::SelectedClear ( )

Clear all selected objects.

This function clear all selected objects

Returns
true if they where selected items, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
31 March 2009

◆ SelectedInvert()

bool tmLayerManager::SelectedInvert ( )

Invert selected values.

Returns
true if sucess, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
31 March 2009

◆ SelectedSearch()

bool tmLayerManager::SelectedSearch ( const wxRect &  rect,
bool  shiftdown = false 
)

Searching data for selection.

This function search and update the tmSelectedDataMemory structure with searched data. If this function return true we should redraw all layers

Parameters
rectarea we sould search for selecting data
shiftdownstatus of the shift key. If down we mainly add data to the selection
Returns
true if function succeed and we should reload layers, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
29 October 2008

◆ UnInitLayerManager()

bool tmLayerManager::UnInitLayerManager ( )

Un-Init the layer manager.

Call this function when a project is closed

Author
Lucien Schreiber (c) CREALP 2008
Date
07 July 2008

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