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

Store ID of selected data into memory. More...

#include <tmselecteddatamemory.h>

Inheritance diagram for tmSelectedDataMemory:

Public Member Functions

 tmSelectedDataMemory ()
 Constructor.
 
 ~tmSelectedDataMemory ()
 Destructor.
 
bool AddSelected (wxArrayLong *selected)
 Add selected ID to memory.
 
bool Remove (wxArrayLong *selected=nullptr)
 Removing items from the array.
 
bool IsSelected (const long &value)
 Is this object selected.
 
unsigned int GetCount ()
 Count the number of selected features.
 
void SetSelected (long selected)
 Save any geometry into database.
 
void SetLayerID (long layerID)
 Set on which layer we are working on.
 
void Clear ()
 
wxColour GetSelectionColour ()
 
void SetSelectionColour (const wxColour &col)
 
void SetSelectionHalo (bool hashalo)
 
bool GetSelectionHalo ()
 
long GetSelectedLayer ()
 
wxArrayLong * GetSelectedValues ()
 Getting selected values.
 
long GetSelectedUnique ()
 Get the selected value.
 

Protected Member Functions

int Search (const long &value)
 Search for existing item in the array.
 

Detailed Description

Store ID of selected data into memory.

This class may be used by the tmLayerManager for storing Seleted data's ID. Only data from one layers at a time may be selected so we keep also the Layers ID. For futher developpement we also keep a wxBrush object used for drawing selected object.

Author
Lucien Schreiber (c) CREALP 2008
Date
28 October 2008

Constructor & Destructor Documentation

◆ tmSelectedDataMemory()

tmSelectedDataMemory::tmSelectedDataMemory ( )

Constructor.

Init defaut values only

Author
Lucien Schreiber (c) CREALP 2008
Date
28 October 2008

◆ ~tmSelectedDataMemory()

tmSelectedDataMemory::~tmSelectedDataMemory ( )

Destructor.

Author
Lucien Schreiber (c) CREALP 2008
Date
28 October 2008

Member Function Documentation

◆ AddSelected()

bool tmSelectedDataMemory::AddSelected ( wxArrayLong *  selected)

Add selected ID to memory.

Principal behaviour is to add items to the sorted array. But if selected contain only one item and this item allready exists into the array it is removed from the array

Parameters
selectedAdress of a wxArrayLong structure. This dosen't take ownership of the wxArrayInt and it is the responsability of the caller to destroy it
Returns
true if adding successfull
Author
Lucien Schreiber (c) CREALP 2008
Date
28 October 2008

◆ GetCount()

unsigned int tmSelectedDataMemory::GetCount ( )

Count the number of selected features.

Returns
the number of selected features
Author
Lucien Schreiber (c) CREALP 2008
Date
29 October 2008

◆ GetSelectedUnique()

long tmSelectedDataMemory::GetSelectedUnique ( )

Get the selected value.

This function is designed to get the selected value when only one object is selected.

Returns
The oid of the selected layer, or -1 if an error occur
Author
Lucien Schreiber (c) CREALP 2009
Date
06 February 2009

◆ GetSelectedValues()

wxArrayLong * tmSelectedDataMemory::GetSelectedValues ( )

Getting selected values.

Returns
Adress of a wxArrayLong. or null in case of error. The returned array may be destroyed saftly by the caller.
Author
Lucien Schreiber (c) CREALP 2008
Date
06 November 2008

◆ IsSelected()

bool tmSelectedDataMemory::IsSelected ( const long &  value)

Is this object selected.

Parameters
valuethe Object ID value we want to check for selected state
Returns
true if the item is selected
Author
Lucien Schreiber (c) CREALP 2008
Date
28 October 2008

◆ Remove()

bool tmSelectedDataMemory::Remove ( wxArrayLong *  selected = nullptr)

Removing items from the array.

May be used for following operations :

  • Removing one item
  • Removing multiple items
  • Removing all items
    Parameters
    selectedarray of items we want to remove. If nullptr, all values are removed
    Returns
    return true if removing items successfull
    Author
    Lucien Schreiber (c) CREALP 2008
    Date
    28 October 2008

◆ Search()

int tmSelectedDataMemory::Search ( const long &  value)
protected

Search for existing item in the array.

Parameters
valuevalue we are searching for
Returns
the 0 based index of the result or wxNOT_FOUND
Author
Lucien Schreiber (c) CREALP 2008
Date
28 October 2008

◆ SetLayerID()

void tmSelectedDataMemory::SetLayerID ( long  layerID)

Set on which layer we are working on.

This function ensure that only selection in one layer is done : if layerID is different from member m_LayerID then it indicates that we are trying to operate on another layer and all selected data are removed from the selection.

Parameters
layerIDID of the layer on which we want to operate
Author
Lucien Schreiber (c) CREALP 2008
Date
29 October 2008

◆ SetSelected()

void tmSelectedDataMemory::SetSelected ( long  selected)

Save any geometry into database.

This function clear the actual selection and specifiy as the selection the passed value

Parameters
selectedThe selected value
Author
Lucien Schreiber (c) CREALP 2009
Date
04 February 2009

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