ToolMap
|
Store ID of selected data into memory. More...
#include <tmselecteddatamemory.h>
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. | |
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.
tmSelectedDataMemory::tmSelectedDataMemory | ( | ) |
Constructor.
Init defaut values only
tmSelectedDataMemory::~tmSelectedDataMemory | ( | ) |
Destructor.
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
selected | Adress of a wxArrayLong structure. This dosen't take ownership of the wxArrayInt and it is the responsability of the caller to destroy it |
unsigned int tmSelectedDataMemory::GetCount | ( | ) |
Count the number of selected features.
long tmSelectedDataMemory::GetSelectedUnique | ( | ) |
Get the selected value.
This function is designed to get the selected value when only one object is selected.
wxArrayLong * tmSelectedDataMemory::GetSelectedValues | ( | ) |
Getting selected values.
bool tmSelectedDataMemory::IsSelected | ( | const long & | value | ) |
Is this object selected.
value | the Object ID value we want to check for selected state |
bool tmSelectedDataMemory::Remove | ( | wxArrayLong * | selected = nullptr | ) |
Removing items from the array.
May be used for following operations :
selected | array of items we want to remove. If nullptr, all values are removed |
|
protected |
Search for existing item in the array.
value | value we are searching for |
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.
layerID | ID of the layer on which we want to operate |
void tmSelectedDataMemory::SetSelected | ( | long | selected | ) |
Save any geometry into database.
This function clear the actual selection and specifiy as the selection the passed value
selected | The selected value |