ToolMap
|
Class for attributing data. More...
#include <tmattributiondata.h>
Public Member Functions | |
tmAttributionData () | |
Default constructor. | |
tmAttributionData (wxArrayLong *selected, DataBaseTM *database) | |
virtual void | Create (wxArrayLong *selected, DataBaseTM *database) |
~tmAttributionData () | |
Destructor. | |
virtual void | SetDataBaseTable (const wxString &tablename) |
virtual bool | SetAttributeBasic (AttribObjType_PANEL *panel) |
virtual bool | SetAttributeBasicValues (wxArrayLong *values) |
Set Basic attribution. | |
virtual bool | CleanAttributesAdvanced (long objectid, PrjDefMemManage *prjdef, PRJDEF_LAYERS_TYPE layertype) |
Clean advanced attribution. | |
virtual bool | SetAttributesAdvanced (long objectid, PrjMemLayersArray *layers, const wxArrayString &values) |
Set advanced attribution. | |
virtual bool | CopyAttributesBasic (const long ©from) |
Copy attribution between objects. | |
virtual bool | GetInfoBasic (AttribObjType_PANEL *panel) |
virtual bool | GetInfoBasic (long oid, wxArrayLong &objid, wxArrayString &objcode, wxArrayString &objname) |
virtual bool | GetInfoBasicValues (const long &selected, wxArrayLong &values) |
Get basic attribution values for passed ID. | |
virtual bool | GetInfoBasicArray (tmAttributionBasicArray &values) |
Get basic attributions for selected objets. | |
bool | GetBasicNameFromID (const tmAttributionBasic &myAttribObj, wxArrayString &txtvalues) |
Get Basic attribution string from database. | |
bool | GetConcatenedBasicName (const tmAttributionBasicArray &myAttrib, wxArrayString &concatenedattrib) |
Get Concatened basic attribution values for object. | |
virtual bool | GetAttributesAdvanced (long objectid, PrjMemLayersArray *layers, wxArrayString &values) |
Get advanced attribution in all layers for an object ID. | |
bool | GetAdvancedAttribution (ProjectDefMemoryLayers *layer, wxArrayString &values, wxArrayString &codes, long selected) |
Get advanced attribution for a layer. | |
bool | GetAdvancedAttribution (int layerid, long geomoid, wxArrayString &values) |
virtual bool | GetAttributionLayersID (const long &geomid, tmLayerValueArray &layersid) |
virtual bool | GetAttributionLayersIDFull (const long &geomid, tmLayerValueArray &layersid) |
Static Public Member Functions | |
static bool | IsAttributionSimilar (const tmAttributionBasicArray &values) |
Check array for similar attribution. | |
Protected Member Functions | |
virtual bool | IsValid () |
Verify validity of member objects. | |
void | PrepareAttributionStatement (wxString &statement, const wxString &tablename, wxArrayLong *checkedVal) |
Create MySQL statement for attribution. | |
void | PrepareCleaningStatement (wxString &statement, const wxString &tablename) |
Create MySQL statement for attribution. | |
void | PrepareGetInfoStatement (wxString &statement, const wxString &tablename) |
Create MySQL statement for getting info. | |
void | PrepareGetInfoMultipleStatement (wxString &statement, const wxString &tablename) |
Create MySQL statement for getting info. | |
bool | PrepareGetAttributionLayersID (const long &geomid, tmLayerValueArray &layersid, const wxString &tablename, int layertype) |
Get Layer attributed for selected geometry. | |
bool | _GetInfoBasic (long oid, wxArrayLong &objid, wxArrayString &objcode, wxArrayString &objname, int layertype) |
Protected Attributes | |
wxArrayLong * | m_SelIDs |
DataBaseTM * | m_pDB |
wxString | m_TableName |
Class for attributing data.
This class is the bridge between tmAttributionManager and the data stored in the database. The open design based on class hierarchy allows us to attributes different objets if needed in the futur
tmAttributionData::tmAttributionData | ( | ) |
Default constructor.
Use the tmAttributionData::Create() function after for two step construction
tmAttributionData::~tmAttributionData | ( | ) |
Destructor.
|
virtual |
Clean advanced attribution.
Because we don't have relationnal intergrity, we delete advanced attribution when advanced attribution is changed for a n object
prjdef | project definition |
layertype | one of the spatial type |
|
virtual |
Copy attribution between objects.
Use tmAttributionData::Create for setting database and the Multiples OID of the objects we copy attributes to
copyfrom | OID of the object we copy attributes from |
|
virtual |
Reimplemented in tmAttributionDataLabel, tmAttributionDataLine, and tmAttributionDataPoint.
bool tmAttributionData::GetAdvancedAttribution | ( | ProjectDefMemoryLayers * | layer, |
wxArrayString & | values, | ||
wxArrayString & | codes, | ||
long | selected | ||
) |
Get advanced attribution for a layer.
layer | Adress of a valid layer |
values | An array, data will be added to |
selected | The selected object ID |
|
virtual |
Get advanced attribution in all layers for an object ID.
layers | Array of layers for advanced attribution |
values | wxArrayString filled by the actual values |
|
inlinevirtual |
Reimplemented in tmAttributionDataLabel, tmAttributionDataLine, and tmAttributionDataPoint.
bool tmAttributionData::GetBasicNameFromID | ( | const tmAttributionBasic & | myAttribObj, |
wxArrayString & | txtvalues | ||
) |
Get Basic attribution string from database.
myAttribObj | object of type tmAttributionBasic |
txtvalues | If function return true, This array will be filled with basic attribution strings |
bool tmAttributionData::GetConcatenedBasicName | ( | const tmAttributionBasicArray & | myAttrib, |
wxArrayString & | concatenedattrib | ||
) |
Get Concatened basic attribution values for object.
myAttrib | Contain attribution for all selected objects |
concatenedattrib | an array of string containing all attribution basic values concatenated |
|
inlinevirtual |
Reimplemented in tmAttributionDataLabel, tmAttributionDataLine, and tmAttributionDataPoint.
|
virtual |
Get basic attributions for selected objets.
values | object of type : tmAttributionBasic Array containing all ids and values for selected objects |
|
virtual |
Get basic attribution values for passed ID.
selected | The feature ID we want attribution for |
values | The returned attribution values |
|
static |
Check array for similar attribution.
The array store the OID and an array of attribution. This function return true if all OID share the same attribution. Used mainly for lines merging.
values | an tmAttributionBasicArray containing OID and attribution values |
|
protectedvirtual |
Verify validity of member objects.
|
protected |
Create MySQL statement for attribution.
This function may be used for preparing generic statement for attribution for TOC_NAME_LINES, TOC_NAME_LABELS and TOC_NAME_POINTS. For TOC_NAME_ANNOTATION it won't work.
statement | String for storing statement |
tablename | name of the database table to insert into (generic_aat, etc.) |
checkedVal | Adress of an array containing all checked IDs |
|
protected |
Create MySQL statement for attribution.
This function may be used for preparing generic statement for cleaning, a.k.a as removing attribution for TOC_NAME_LINES, TOC_NAME_LABELS and TOC_NAME_POINTS. For TOC_NAME_ANNOTATION it won't work.
statement | String for storing statement |
tablename | name of the database table to insert into (generic_aat, etc.) |
|
protected |
Get Layer attributed for selected geometry.
When doing advanced attribution, we should know what are the layers we should display control for.
geomid | the object id we search attribution layers |
layersid | an (empty) wxArrayLong used by this function for storing returned layers id |
layertype | one of the following value :
|
tablename | the name of the table containing the basic attribution. |
|
protected |
Create MySQL statement for getting info.
Get info for all selected object
statement | used for storing the returned statement |
tablename | the tablename to use |
|
protected |
Create MySQL statement for getting info.
Returning info works only for one selected feature so we get selected values only for the first selected values.
statement | a place for storing the statement |
tablename | Name of the table : see TABLE_NAME_GIS_ATTRIBUTION |
|
inlinevirtual |
Reimplemented in tmAttributionDataLabel, tmAttributionDataLine, and tmAttributionDataPoint.
|
virtual |
Set Basic attribution.
This function attributes the selected object with the specified values. This works in two steps : First we delete all values for selected object and then we insert specified values for selected objects This function is mainly used for attribution by shortcuts
values | An array of long containing the values for attribution |
|
virtual |
Set advanced attribution.
layers | Adress of a valid array of ProjectDefMemoryLayers |
values | a valid wxArrayString containing all attributions |