ToolMap
Loading...
Searching...
No Matches
DataBaseTM Class Reference
Inheritance diagram for DataBaseTM:
DataBase

Public Member Functions

bool CreateLangDefData ()
 
bool TableExist (const wxString &tablename)
 
int OpenTMDatabase (const wxString &pathname)
 
bool CreateTMDatabase (PrjDefMemManage *pPrjDefinition)
 
bool IsProjectDataDefined ()
 Check if project data are defined.
 
bool SetProjectData (PrjDefMemManage *pPrjDefinition)
 
bool GetProjectData (PrjDefMemManage *pPrjDefinition)
 Retrieve basic project data.
 
bool InitProjectWithStartingWizard (PrjDefMemManage *pPrjDefinition)
 
int GetDatabaseToolMapVersion ()
 
bool SetProjectExportData (int iExportType, const wxString &spath)
 
bool SetProjectLastExported (const wxArrayString &layers)
 
bool SetProjectBackupPath (const wxString &spath)
 
int GetProjectExportData (int &iExportType, wxString &spath)
 Get the export data from the database.
 
wxArrayString GetProjectLastExported ()
 
int GetProjectBackupPath (wxString &spath)
 Get the backup path from the database.
 
bool AddLayer (ProjectDefMemoryLayers *myLayer)
 
bool AddLayerPolygonDefaultBorder (ProjectDefMemoryLayers *myLayer)
 Add border default value for polygons layer.
 
void SetActiveLayerId (ProjectDefMemoryLayers *myLayer)
 
int GetActiveLayerId ()
 
int GetNextLayer (ProjectDefMemoryLayers *myLayer)
 
bool UpdateLayer (ProjectDefMemoryLayers *myLayer, wxString &sSqlSentence)
 Prepare statement for updating layer.
 
bool DeleteLayer (const wxArrayLong &deletelist, PrjDefMemManage *projectdef, wxString &sSqlSentence)
 Prepare statement for deleting layer(s)
 
int GetLayerID (TOC_GENERIC_NAME layertype)
 Return the layer ID based on layer type.
 
bool AddObject (ProjectDefMemoryObjects *myObject, int DBlayerIndex=-1)
 
bool EditObject (ProjectDefMemoryObjects *myObject)
 Insert or update an object.
 
bool DataBaseGetNextResultAsObject (ProjectDefMemoryObjects *object, int ilayertype)
 
int DeleteMultipleObjects (PrjDefMemManage *pProjet)
 
void DeleteLayersObjects (int iLayer, wxString &sSqlSentence)
 Delete all objects from a layer.
 
bool LoadLayerObjects (ProjectDefMemoryLayers *layer)
 
bool AddField (ProjectDefMemoryFields *myField)
 
bool GetFields (PrjMemFieldArray &fieldarray, ProjectDefMemoryLayers *actuallayer)
 Get all fields for specified layer.
 
int GetFieldsFromDB (PrjDefMemManage *myPrj)
 Fill an existing project with fields.
 
bool UpdateField (ProjectDefMemoryFields *myField, int iLayer, wxString &sSqlSentence)
 Prepare statement for updating fields.
 
bool DeleteField (wxArrayString &myFields, int iLayer, wxString &sSqlSentence)
 Prepare statement for deleting.
 
bool DeleteFields (int iLayer)
 
bool GetObjectListByLayerType (int ilayertype, bool bOrder=FALSE)
 Retrive objects from the object table.
 
wxArrayString GetLayerNameByType (int ilayertype)
 Return list of layers name for selected type.
 
long GetNextScaleValue (long &DBindex, bool bFirst)
 
bool EditScale (ProjectDefMemoryScale *myScaleObj)
 
int DeleteMultipleScales (PrjDefMemManage *pProjet)
 
bool SetRank (ListGenReport *list, int icol, const wxString &stable, const wxString &sfield, bool bStringType=FALSE, const wxString &rankfield=_T("RANK"))
 Update a rank field.
 
bool SetScaleRank (ScaleList *list, int icol, const wxString &stable, const wxString &sfield, const wxString &rankfield=_T("RANK"))
 Update a rank field for scale table.
 
PrjDefMemManageGetProjectDataFromDB ()
 
bool UpdateDataBaseProject (PrjDefMemManage *pProjDef)
 Update database.
 
bool InitTOCGenericLayers ()
 Init the TOC.
 
tmLayerPropertiesGetNextTOCEntry (bool userelativepath)
 Get entry from the TOC.
 
long AddTOCLayer (tmLayerProperties *item)
 Add TOC item to the database.
 
bool RemoveTOCLayer (const long &itemid)
 Delete a TOC item from the database.
 
void PrepareTOCStatusUpdate (wxString &sentence, tmLayerProperties *item, int itemRank=0, const wxString &symbology=wxEmptyString)
 
bool GetNextQueries (long &qid, wxString &name, wxString &description, bool bfirst)
 Get all queries.
 
bool GetQueriesById (const long &qid, int &target, wxString &name, wxString &description)
 Get a queries by ID.
 
bool EditQueries (int target, const wxString &name, const wxString &description, long qid=-1)
 Edit or add a query.
 
bool DeleteQuery (long qid)
 Delete a query.
 
bool GetNextShortcutByLayerType (int layer_type, wxString &key, wxString &description, bool bFirstLoop)
 Load shortcut from the DB based on layer type.
 
bool GetAllUnusedShortcuts (wxArrayString &keylist)
 Get All unused shortcut key.
 
bool GetNextShortCutObject (long &shortcutid, const int &key, bool bFirstLoop)
 Get checked values for given shortcut key.
 
bool EditShortcut (int shortcutkey, const wxString &description, const wxArrayLong &types)
 Append or edit a shortcut.
 
bool DeleteShortcut (int shortcutkey)
 Delete specified shortcut.
 
bool GetNextShortcutFull (bool bFirstLoop, int &layertype, int &key, wxString &description, long &shortcutvalue)
 Get Full informations for shortcuts.
 
bool GetNextSnapping (long &lid, wxString &layername, int &snapstatus, bool bfirstloop)
 Get the snapping from database.
 
bool GetValidLayersForSnapping (wxArrayLong &lids, wxArrayString &lnames)
 Get all layers valid for snapping.
 
bool AddLayersSnapping (const wxArrayLong &lids, int snappingstatus)
 Save new snapping layers into database.
 
bool DeleteLayerSnapping (int layersid)
 Delete a snapping layer from the database.
 
bool SaveSnappingAllStatus (tmSnappingMemory *snapmemory)
 Save snapping status to the database.
 
bool SetSnappingTolerence (int iTolerence)
 Save the tolerence into database.
 
int GetSnappingTolerence ()
 Get the tolerence from the database.
 
bool GeometryDelete (wxArrayLong *selected, int layertype)
 Delete geometry from the database.
 
long GeometrySave (OGRGeometry *geometry, int layertype)
 
bool GeometryUpdate (OGRGeometry *geometry, long oid, int layertype)
 
OGRGeometry * GeometryLoad (long oid, int layertype)
 
bool DeleteAttribution (wxArrayLong *selected, int layertype)
 Delete attribution from the database.
 
wxArrayLong GetObjectsFromFeature (long selectedfeature, int layertype)
 
long GetSelectedLayerId (long ojectid)
 
bool DeleteAdvancedAttribution (long selectedobject, long selectedlayerid)
 
bool SaveBezierSettings (BezierSettingsData *data)
 
bool LoadBezierSettings (BezierSettingsData *data)
 
- Public Member Functions inherited from DataBase
 DataBase (const wxString &errmsgpath=wxEmptyString)
 
bool DataBaseCreateNew (const wxString &datadir, const wxString &name)
 
bool DataBaseOpen (const wxString &datadir, const wxString &name)
 Open a mysql / mariadb database This function performs the following work:
 
bool DataBaseDelete ()
 
wxString DataBaseGetName ()
 
wxString DataBaseGetPath ()
 
wxString DataBaseGetSize (int precision=2, const wxString &failmsg=_("Not available"))
 
wxString DataBaseGetLastError ()
 
bool DataBaseThreadInit ()
 Init internal variables for new thread.
 
void DataBaseThreadEnd ()
 End internal variables for new thread.
 
bool DataBaseQueryNoResults (const wxString &query, bool logerror=true)
 
bool DataBaseQuery (const wxString &query, bool logerror=true)
 
int DataBaseQueriesNumber (const wxString &query)
 
long DataBaseGetLastInsertedID ()
 
long DataBaseGetAffectedRows ()
 
bool DataBaseHasResults ()
 
void DataBaseClearResults ()
 
bool DataBaseGetResultSize (unsigned int *pcols, long *prows)
 
bool DataBaseGetNextResult (wxString &result)
 
bool DataBaseGetNextResult (wxArrayString &results)
 
bool DataBaseGetNextResult (long &result)
 
bool DataBaseGetNextResult (wxArrayLong &results)
 
bool DataBaseGetNextResult (wxDouble &result)
 
bool DataBaseGetNextResult (wxArrayDouble &results)
 
bool DataBaseGetNextRowResult (MYSQL_ROW &row, tmArrayULong &lengths)
 
bool DataBaseGetResults (wxArrayString &results)
 
bool DataBaseGetResults (wxArrayLong &results)
 
bool DataBaseGetResults (wxArrayDouble &results)
 
bool DataBaseGetResults (DataBaseResult *results)
 

Static Public Member Functions

static bool ConvertPath (wxString &path)
 
- Static Public Member Functions inherited from DataBase
static wxString DataBaseGetVersion ()
 
static bool DataBaseStringEscapeQuery (const wxString &query, wxString &results)
 

Member Function Documentation

◆ AddLayerPolygonDefaultBorder()

bool DataBaseTM::AddLayerPolygonDefaultBorder ( ProjectDefMemoryLayers myLayer)

Add border default value for polygons layer.

Parameters
myLayerpointer to a valid ProjectDefMemoryLayers object
Returns
true if adding succesfull
Author
Lucien Schreiber (c) CREALP 2008
Date
03 November 2008

◆ AddLayersSnapping()

bool DataBaseTM::AddLayersSnapping ( const wxArrayLong &  lids,
int  snappingstatus 
)

Save new snapping layers into database.

This function add into the database one or more layers used for snapping.

Parameters
lidsids of the layers to add
Returns
true if query was successfull, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
20 January 2009

◆ AddTOCLayer()

long DataBaseTM::AddTOCLayer ( tmLayerProperties item)

Add TOC item to the database.

Called when a new layer is added.

Parameters
itemThe item to add to the database
Returns
The database ID of the added item or -1 if an error occur
Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

◆ DeleteAttribution()

bool DataBaseTM::DeleteAttribution ( wxArrayLong *  selected,
int  layertype 
)

Delete attribution from the database.

Parameters
selectedAn array of selected values. Caller must destroy the object. This function doesn't take ownership of the object
layertypeone of the TOC_GENERIC_NAME values (must be < TOC_NAME_NOT_GENERIC)
Returns
true if attribution for selected geometry was successfully destroyed
Author
Lucien Schreiber (c) CREALP 2009
Date
05 February 2009

◆ DeleteField()

bool DataBaseTM::DeleteField ( wxArrayString &  myFields,
int  iLayer,
wxString &  sSqlSentence 
)

Prepare statement for deleting.

This prepare the SQL statement for deleting fields stored into the PrjDefMemManage::m_StoreDeleteFields.

Parameters
myFieldsthe array containing the name of the fields we want to delete
iLayerthe zero based layer index of the fields (Number used for table name)
sSqlSentenceThe string we filled with the issued SQL sentence
Returns
TRUE if the passed Array (myFields) is greater than 0
Author
Lucien Schreiber (c) CREALP 2007
Date
28 April 2008

◆ DeleteLayer()

bool DataBaseTM::DeleteLayer ( const wxArrayLong &  deletelist,
PrjDefMemManage projectdef,
wxString &  sSqlSentence 
)

Prepare statement for deleting layer(s)

This append to the sentence the SQL code for deleting all layers which have their IDs stored into the deletelist array. This function operate on the TABLE_NAME_LAYERS table.

Parameters
deletelistA wxArrayLong containing all ID we want to delete
sSqlSentenceSQL sentence which will be modified with the new delete statement
Returns
allways true for the moment
Author
Lucien Schreiber (c) CREALP 2007
Date
16 April 2008

◆ DeleteLayerSnapping()

bool DataBaseTM::DeleteLayerSnapping ( int  layersid)

Delete a snapping layer from the database.

Parameters
layersidthe layers ID (TOC_ID field in prj_snapping table)
Returns
true if the item was deleted from the database, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
20 January 2009

◆ DeleteLayersObjects()

void DataBaseTM::DeleteLayersObjects ( int  iLayer,
wxString &  sSqlSentence 
)

Delete all objects from a layer.

Delete all objects belonging to a layers. May be used when one try to delete a layer. This function dosen't delete the table but issued a sentence for this purpose.

Parameters
iLayerIndex of the layer (Starts at 1 in MySQL)
sSqlSentenceThe sentence for storing the SQL sentence issued in the function
Author
Lucien Schreiber (c) CREALP 2007
Date
28 April 2008

◆ DeleteQuery()

bool DataBaseTM::DeleteQuery ( long  qid)

Delete a query.

Parameters
qidid of the query to delete
Returns
true if the query was deleted
Author
Lucien Schreiber (c) CREALP 2008
Date
10 November 2008

◆ DeleteShortcut()

bool DataBaseTM::DeleteShortcut ( int  shortcutkey)

Delete specified shortcut.

Parameters
shortcutkeythe shortcut ID used (1.... 12)
Returns
true if query was successfully passed
Author
Lucien Schreiber (c) CREALP 2008
Date
15 December 2008

◆ EditObject()

bool DataBaseTM::EditObject ( ProjectDefMemoryObjects myObject)

Insert or update an object.

This function insert or update an object in the database depending of the myObject->m_Object_ID value : bigger or egal to 0 means to update and smaller than 0 means to insert

Parameters
myObjectparameter of the object to modify into the DB
Returns
TRUE if all went OK or FALSE if the query or something else dosen't work as espected
Author
Lucien Schreiber (c) CREALP 2007
Date
18 March 2008

◆ EditQueries()

bool DataBaseTM::EditQueries ( int  target,
const wxString &  name,
const wxString &  description,
long  qid = -1 
)

Edit or add a query.

Parameters
targetInt of the target (allowed values : TOC_GENERIC_NAME)
nameName of the query
descriptionSQL code of the query
qidID of the query for modification or -1 for adding query
Returns
true if a query was modified or added and false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
10 November 2008

◆ EditShortcut()

bool DataBaseTM::EditShortcut ( int  shortcutkey,
const wxString &  description,
const wxArrayLong &  types 
)

Append or edit a shortcut.

Parameters
shortcutkeythe index of the selected shortcut (1...12)
descriptionDescription used for the shortcut
typesArray of integer containing the types of objects
Returns
true if the shortcut was edited successfully
Author
Lucien Schreiber (c) CREALP 2008
Date
15 December 2008

◆ GeometryDelete()

bool DataBaseTM::GeometryDelete ( wxArrayLong *  selected,
int  layertype 
)

Delete geometry from the database.

Parameters
selectedAn array of selected values. Caller must destroy the object. This function doesn't take ownership of the object
layertypeone of the TOC_GENERIC_NAME values (must be < TOC_NAME_NOT_GENERIC)
Returns
true if geometry was successfully destroyed
Author
Lucien Schreiber (c) CREALP 2009
Date
05 February 2009

◆ GetAllUnusedShortcuts()

bool DataBaseTM::GetAllUnusedShortcuts ( wxArrayString &  keylist)

Get All unused shortcut key.

All shortcut allready assigned (F1... F12) aren't returned into array.

Parameters
keylistwxArrayString will be filled with unused shortcut key
Returns
false if an error occur, true otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
12 December 2008

◆ GetFields()

bool DataBaseTM::GetFields ( PrjMemFieldArray &  fieldarray,
ProjectDefMemoryLayers actuallayer 
)

Get all fields for specified layer.

Parameters
fieldarrayThis array contain all fields for specified layer
actuallayerthe layer for wich to retreive fields
Returns
true if fields where returned, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
13 November 2008

◆ GetFieldsFromDB()

int DataBaseTM::GetFieldsFromDB ( PrjDefMemManage myPrj)

Fill an existing project with fields.

The myPrj parameter must point to a existing project in memory. containing all layers. This function will add all fields into this project

Parameters
myPrjPointer to an existing PrjDefMemManage containing all layers
Returns
return the number of fields added, or -1 if something goes wrong
Author
Lucien Schreiber (c) CREALP 2008
Date
19 June 2008

◆ GetLayerID()

int DataBaseTM::GetLayerID ( TOC_GENERIC_NAME  layertype)

Return the layer ID based on layer type.

This function works only for following "unique" layers :

  • TOC_NAME_LINES
  • TOC_NAME_POINTS,
  • TOC_NAME_LABELS,
  • TOC_NAME_ANNOTATIONS,
  • TOC_NAME_FRAME, for others type, wxNOT_FOUND is returned
    Parameters
    layertypeOne of the TOC_GENERIC_NAME values, see above
    Returns
    the layer ID or wxNOT_FOUND if an error occur or the layer dosen't exist
    Author
    Lucien Schreiber (c) CREALP 2008
    Date
    11 November 2008

◆ GetLayerNameByType()

wxArrayString DataBaseTM::GetLayerNameByType ( int  ilayertype)

Return list of layers name for selected type.

This function returns all layers name corresponding to a layer type. Layer type are defined there : PRJDEF_LAYERS_TYPE

Note
There is a special behaviour in case of ilayertype = LAYER_LINE (0). In this case the function returns all line layers and all polygons layers too. Because we should be able to define lines for creating polygons
See also
Bug #25
Parameters
ilayertypeone of the PRJDEF_LAYERS_TYPE
Returns
An array containing all layers name for the selected layer type
Author
Lucien Schreiber (c) CREALP 2008
Date
31 October 2008

◆ GetNextQueries()

bool DataBaseTM::GetNextQueries ( long &  qid,
wxString &  name,
wxString &  description,
bool  bfirst 
)

Get all queries.

Return all queries one after the other. Call this function recursivelly for getting all queries.

Parameters
qidreturn the ID of the query
namereturn the name of the query
descriptionreturn the description of the query
bfirstset to true during the first call for creating the MySQL statement
Returns
true if a query was returned successfull
Author
Lucien Schreiber (c) CREALP 2008
Date
10 November 2008

◆ GetNextShortcutByLayerType()

bool DataBaseTM::GetNextShortcutByLayerType ( int  layer_type,
wxString &  key,
wxString &  description,
bool  bFirstLoop 
)

Load shortcut from the DB based on layer type.

Parameters
layer_typeThe layer type, valid values are :
  • TOC_NAME_LINES
  • TOC_NAME_POINTS
  • TOC_NAME_LABELS
keyA wxString containing The key (F1...F12)
descriptionA wxString containing the shortcut description
bFirstLoopIndicate if we are running the first loop.
Returns
true if a result was returned, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
11 December 2008

◆ GetNextShortcutFull()

bool DataBaseTM::GetNextShortcutFull ( bool  bFirstLoop,
int &  layertype,
int &  key,
wxString &  description,
long &  shortcutvalue 
)

Get Full informations for shortcuts.

This function is used for storing shortcuts into memory.

Parameters
bFirstLoopset to true if this is the first loop (issue the query)
layertypeget the layer type (see PRJDEF_LAYERS_TYPE)
keyget the shortcut key (as int, between 1-12)
descriptionget the shortcut description
shortcutvalueget the shortcut value
Returns
return true if all is correct, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
18 December 2008

◆ GetNextShortCutObject()

bool DataBaseTM::GetNextShortCutObject ( long &  shortcutid,
const int &  key,
bool  bFirstLoop 
)

Get checked values for given shortcut key.

Parameters
shortcutidID checked corresponding to the key shortcut
keythe shortcut key we are searching values for (F1....F12), values are : (1-12)
bFirstLooptrue during the first loop (do the query) and should be set to false otherwise
Returns
true if ID is correctly returned (shortcutid), false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
15 December 2008

◆ GetNextSnapping()

bool DataBaseTM::GetNextSnapping ( long &  lid,
wxString &  layername,
int &  snapstatus,
bool  bfirstloop 
)

Get the snapping from database.

Parameters
lidreturn the layer id (CONTENT_ID of prj_toc table)
layernamereturn the layer name
snapstatusreturn the snapping status 0 = no snapping, 1 = Snapping for vertex, 2 = Snapping for Begin/End (only for lines)
bfirstloopset to true if the first loop to issue the query
Returns
true if the query was successfull, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
19 January 2009

◆ GetNextTOCEntry()

tmLayerProperties * DataBaseTM::GetNextTOCEntry ( bool  userelativepath)

Get entry from the TOC.

This function returns all entry from the TOC one by one. Only one request is issued and then each time this function is called the next layer is returned

Returns
a tmLayerProperties pointer, or nullptr if no more layer to proceed
Note
if result isn't nullptr, you need to delete pointer after use.
Author
Lucien Schreiber (c) CREALP 2008
Date
07 July 2008

◆ GetObjectListByLayerType()

bool DataBaseTM::GetObjectListByLayerType ( int  ilayertype,
bool  bOrder = FALSE 
)

Retrive objects from the object table.

This functions may be called for getting all objects from within a layer type. This is used by the "Object definition dialog" but also by the "Attribution window".

Parameters
ilayertypethe zero based type of layer, see PRJDEF_LAYERS_TYPE
bOrderReturn the result in the "RANK" order if set to TRUE
Returns
FALSE if the query wasn't valid
Author
Lucien Schreiber (c) CREALP 2008
Date
21 May 2008

◆ GetProjectBackupPath()

int DataBaseTM::GetProjectBackupPath ( wxString &  spath)

Get the backup path from the database.

Retrive the Backup path type from the database

Parameters
spathThis variable will be filled with the backup path from the database if return value is different of PATH_EMPTY
Returns
the returned values is a flag of type PATH_ERROR
Author
Lucien Schreiber (c) CREALP 2007
Date
28 March 2008

◆ GetProjectData()

bool DataBaseTM::GetProjectData ( PrjDefMemManage pPrjDefinition)

Retrieve basic project data.

This may be used for filling a PrjDefMemManage object with basic data from project such as Project name, path, units,... In facts all stuff from the Project Definition dialog (except the spatial model)

Parameters
pPrjDefinitiona pointer to an existing PrjDefMemManage object, will be used for storing project data (path, name,...)
Returns
bool return TRUE if data was found from the Database
Author
Lucien Schreiber (c) CREALP 2007
Date
14 April 2008

◆ GetProjectExportData()

int DataBaseTM::GetProjectExportData ( int &  iExportType,
wxString &  spath 
)

Get the export data from the database.

Retrive the Export path and the export type from the database

Parameters
iExportTypeThis value will be modified with one of the PRJDEF_EXPORT_TYPE.
spathThis variable will be filled with the spath if return value is different of PATH_EMPTY
Returns
the returned values is a flag of type PATH_ERROR
Author
Lucien Schreiber (c) CREALP 2007
Date
28 March 2008

◆ GetQueriesById()

bool DataBaseTM::GetQueriesById ( const long &  qid,
int &  target,
wxString &  name,
wxString &  description 
)

Get a queries by ID.

Return the corresponding queries based on ID.

Parameters
qidMySQL id of the searched queries
target: one of the TOC_GENERIC_NAME value indicating to wich layers the queries is dedicated to.
namereturn the query name
descriptionreturn the query description
Returns
true if a query returned, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
10 November 2008

◆ GetSnappingTolerence()

int DataBaseTM::GetSnappingTolerence ( )

Get the tolerence from the database.

Returns
the tolerence value
Author
Lucien Schreiber (c) CREALP 2009
Date
22 January 2009

◆ GetValidLayersForSnapping()

bool DataBaseTM::GetValidLayersForSnapping ( wxArrayLong &  lids,
wxArrayString &  lnames 
)

Get all layers valid for snapping.

This function returns all layers that are :

  • Not allready in the snapping list
  • Valid a.k.a. Vector layers
    Parameters
    lidsAn array filled with list of arrays id
    lnamesAn array filled with list of arrays name
    Returns
    true if the query was successfull, false otherwise
    Author
    Lucien Schreiber (c) CREALP 2009
    Date
    20 January 2009

◆ InitProjectWithStartingWizard()

bool DataBaseTM::InitProjectWithStartingWizard ( PrjDefMemManage pPrjDefinition)

adding layers, and for each layer add object and fields related to this layer

◆ InitTOCGenericLayers()

bool DataBaseTM::InitTOCGenericLayers ( )

Init the TOC.

This function fill the TOC with generic layers which are :

  • generic_points : For storing all points
  • generic_lines : For storing all lines and limits of polygons
  • generic_labels : For storing all polygon's labels
  • generic_notes : For storing all notes, errors, questions.
    Note
    User could'nt remove those layers. Value of column GENERIC_LAYERS is linked to the TOC_GENERIC_NAME
    Returns
    TRUE if table was succesfully filled, FALSE if an error occur (see log)
    Author
    Lucien Schreiber (c) CREALP 2008
    Date
    26 June 2008

◆ IsProjectDataDefined()

bool DataBaseTM::IsProjectDataDefined ( )

Check if project data are defined.

This function check the existance of a line into the PRJ_SETTINGS table.

Returns
TRUE if a line exist containing project data (in the PRJ_SETTINGS table)
Author
Lucien Schreiber (c) CREALP 2007
Date
25 March 2008

◆ RemoveTOCLayer()

bool DataBaseTM::RemoveTOCLayer ( const long &  itemid)

Delete a TOC item from the database.

Called when a layer is removed.

Parameters
itemiddatabase ID of the item to remove
Returns
TRUE if item sucessfully removed, FALSE otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
14 July 2008

◆ SaveSnappingAllStatus()

bool DataBaseTM::SaveSnappingAllStatus ( tmSnappingMemory snapmemory)

Save snapping status to the database.

Parameters
snapmemorya valid tmSnappingMemory object
Returns
true if snapping status was saved successfully
Author
Lucien Schreiber (c) CREALP 2009
Date
21 January 2009

◆ SetRank()

bool DataBaseTM::SetRank ( ListGenReport list,
int  icol,
const wxString &  stable,
const wxString &  sfield,
bool  bStringType = FALSE,
const wxString &  rankfield = _T("RANK") 
)

Update a rank field.

This may be used to update a rank field using items from a ListGenReport. This way we can store the order of items wanted by the end user

Parameters
lista pointer to a ListGenReport object containing items
icolspecify the column of interest in the list (zero based index)
stablethe name of the table in which we want to add rank values
sfieldthe field name for the field containing values of the selected column (icol)
bStringTypeTRUE if the column store textual values, FALSE otherwise. In fact this function prepend brackets if TRUE for dealing with strings with spaces (Default is FALSE)
rankfieldName of the field where we want to update the rank (Default is field "RANK") this field must be of type integer
Returns
Return TRUE if the query pass without problem and FALSE otherwise
Author
Lucien Schreiber (c) CREALP 2007
Date
01 April 2008

◆ SetScaleRank()

bool DataBaseTM::SetScaleRank ( ScaleList list,
int  icol,
const wxString &  stable,
const wxString &  sfield,
const wxString &  rankfield = _T("RANK") 
)

Update a rank field for scale table.

This function is a specialized function of DataBaseTM::SetRank() used to update rank for scale table (because of scale table store only long values but displays 1: before the scale value

Parameters
lista pointer to a ScaleList object containing items
icolspecify the column of interest in the list (zero based index)
stablethe name of the table in which we want to add rank values
sfieldthe field name for the field containing values of the selected column (icol)
rankfieldName of the field where we want to update the rank (Default is field "RANK") this field must be of type integer
Returns
Return TRUE if the query pass without problem and FALSE otherwise
Author
Lucien Schreiber (c) CREALP 2007
Date
01 April 2008

◆ SetSnappingTolerence()

bool DataBaseTM::SetSnappingTolerence ( int  iTolerence)

Save the tolerence into database.

Parameters
iTolerenceThe tolerence
Returns
true if the tolerence was successfully saved, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
22 January 2009

◆ UpdateDataBaseProject()

bool DataBaseTM::UpdateDataBaseProject ( PrjDefMemManage pProjDef)

Update database.

This function update the project's data. This is a "clever" function, only modified data is changed

Parameters
pProjDefObject of type PrjDefMemManage containing new project values.
Returns
return TRUE if project was updated successfully
Author
Lucien Schreiber (c) CREALP 2007
Date
14 April 2008

◆ UpdateField()

bool DataBaseTM::UpdateField ( ProjectDefMemoryFields myField,
int  iLayer,
wxString &  sSqlSentence 
)

Prepare statement for updating fields.

This function prepare the SQL sentence used for updating the fields. The main concept is the ProjectDefMemoryFields::m_FieldID :

  • if this integer is greather than 0, we update the field
  • if this integer is egal to 0, we prepare a sentence for adding a new field
    Parameters
    myFielda ProjectDefMemoryFields object containing all the field data
    iLayerThe layer index the field belong to.
    sSqlSentencethe string containing the SQL sentence we want to modify
    Returns
    Allways true for the moment
    Author
    Lucien Schreiber (c) CREALP 2007
    Date
    23 April 2008

◆ UpdateLayer()

bool DataBaseTM::UpdateLayer ( ProjectDefMemoryLayers myLayer,
wxString &  sSqlSentence 
)

Prepare statement for updating layer.

This function return the prepared SQL statement for updating or inserting data into the TABLE_NAME_LAYERS.

Note
the most important thing is to be sure that myLayer->m_LayerID is correctly set for function's good behaviour.
Parameters
myLayerpointer to a ProjectDefMemoryLayers object with new data. In case of modification the m_LayerID member must be set correctly
sSqlSentencereference to a wxString in which we are going to put the issued sentence
Returns
TRUE if a modification statement was issued or FALSE if we were preparing an INSERT statement
Author
Lucien Schreiber (c) CREALP 2007
Date
15 April 2008

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