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

Store snapping status into memory. More...

#include <tmsnappingmemory.h>

Inheritance diagram for tmSnappingMemory:

Public Member Functions

 tmSnappingMemory ()
 Constructor.
 
 ~tmSnappingMemory ()
 Destructor.
 
void AddSnappingMemory (long lid, int snapstatus)
 Add snapping to memory.
 
unsigned int GetCount ()
 
bool DeleteSnappingMemory (const long &lid)
 Delete a layer from the memory array.
 
int GetSnappingMemoryStatus (const long &lid)
 Get the snapping status for specified layer.
 
bool SetSnappingMemoryStatus (const long &lid, int snapstatus)
 Change, or set snapping to existing layer.
 
bool GetSnappingInfo (unsigned int iIndex, long &lid, int &snapstatus)
 Get snapping info by index.
 
void Clear ()
 
void ClearSnappingStatus ()
 Set all snapping status to tmSNAPPING_OFF.
 
void SetTolerence (int tolereance)
 
int GetTolerence ()
 
bool IsSnappingEnabled ()
 Checks if snapping is enabled.
 

Protected Member Functions

int FindSnappingItem (const long &lid)
 Search for specified layer ID in memory array.
 

Detailed Description

Store snapping status into memory.

Snapping is stored in

  • The database
  • The memory. Snapping is also stored in memory for faster direct access to them during editing. When layers are added or removed, they are stored directly into the database but the snapping status is only stored when project is closed.
    Author
    Lucien Schreiber (c) CREALP 2009
    Date
    21 January 2009

Constructor & Destructor Documentation

◆ tmSnappingMemory()

tmSnappingMemory::tmSnappingMemory ( )

Constructor.

Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

◆ ~tmSnappingMemory()

tmSnappingMemory::~tmSnappingMemory ( )

Destructor.

Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

Member Function Documentation

◆ AddSnappingMemory()

void tmSnappingMemory::AddSnappingMemory ( long  lid,
int  snapstatus 
)

Add snapping to memory.

Store in an array the passed values

Parameters
lidID value of the layer (see TOC_ID in the prj_snapping table)
snapstatussnap status : one of the following :
  • 0 : No snapping
  • 1: Snapping vertex
  • 2: Snapping BeginEnd
  • 3: Snapping both = snapping vertex
Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

◆ ClearSnappingStatus()

void tmSnappingMemory::ClearSnappingStatus ( )

Set all snapping status to tmSNAPPING_OFF.

This function doesn't remove layers from the memory

Author
Lucien Schreiber (c) CREALP 2009
Date
22 January 2009

◆ DeleteSnappingMemory()

bool tmSnappingMemory::DeleteSnappingMemory ( const long &  lid)

Delete a layer from the memory array.

Parameters
lidlayer ID
Returns
true if the item was deleted from memory (if the item was found in memory). False otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

◆ FindSnappingItem()

int tmSnappingMemory::FindSnappingItem ( const long &  lid)
protected

Search for specified layer ID in memory array.

Parameters
lidlayer ID (see TOC_ID in prj_snapping table)
Returns
the zero based index of the found item or wxNOT_FOUND otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

◆ GetSnappingInfo()

bool tmSnappingMemory::GetSnappingInfo ( unsigned int  iIndex,
long &  lid,
int &  snapstatus 
)

Get snapping info by index.

Parameters
iIndexthe zero based index of the snapping info we want back
lidthe layer id
snapstatusthe snapping status
Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

◆ GetSnappingMemoryStatus()

int tmSnappingMemory::GetSnappingMemoryStatus ( const long &  lid)

Get the snapping status for specified layer.

Parameters
lidthe layer id (as stored into database)
Returns
one of the snapping status. If the layer dosen't exist into the snapping array stored in memory, it will return 0
Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

◆ IsSnappingEnabled()

bool tmSnappingMemory::IsSnappingEnabled ( )

Checks if snapping is enabled.

This function checks if at least one layer contain a defined snapping and if the space key isn't pressed. If space key is pressed, snapping is totally disabled

Returns
true if at least one layer has snapping enabled
Author
Lucien Schreiber (c) CREALP 2009
Date
26 January 2009

◆ SetSnappingMemoryStatus()

bool tmSnappingMemory::SetSnappingMemoryStatus ( const long &  lid,
int  snapstatus 
)

Change, or set snapping to existing layer.

Parameters
lidlayer ID to modify
snapstatusthe new snapping status
Returns
true if the layer ID exists, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

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