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

Class for attributing data. More...

#include <tmattributiondata.h>

Inheritance diagram for tmAttributionData:
tmAttributionDataLabel tmAttributionDataLine tmAttributionDataPoint

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 &copyfrom)
 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
 
DataBaseTMm_pDB
 
wxString m_TableName
 

Detailed Description

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

Author
Lucien Schreiber (c) CREALP 2008
Date
06 November 2008

Constructor & Destructor Documentation

◆ tmAttributionData()

tmAttributionData::tmAttributionData ( )

Default constructor.

Use the tmAttributionData::Create() function after for two step construction

Author
Lucien Schreiber (c) CREALP 2008
Date
06 November 2008

◆ ~tmAttributionData()

tmAttributionData::~tmAttributionData ( )

Destructor.

Author
Lucien Schreiber (c) CREALP 2008
Date
06 November 2008

Member Function Documentation

◆ CleanAttributesAdvanced()

bool tmAttributionData::CleanAttributesAdvanced ( long  objectid,
PrjDefMemManage prjdef,
PRJDEF_LAYERS_TYPE  layertype 
)
virtual

Clean advanced attribution.

Because we don't have relationnal intergrity, we delete advanced attribution when advanced attribution is changed for a n object

Parameters
prjdefproject definition
layertypeone of the spatial type
Returns
true if deleting was successfull
Author
Lucien Schreiber (c) CREALP 2009
Date
30 March 2009

◆ CopyAttributesBasic()

bool tmAttributionData::CopyAttributesBasic ( const long &  copyfrom)
virtual

Copy attribution between objects.

Use tmAttributionData::Create for setting database and the Multiples OID of the objects we copy attributes to

Parameters
copyfromOID of the object we copy attributes from
Returns
true if copy succeed, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
16 February 2009

◆ Create()

void tmAttributionData::Create ( wxArrayLong *  selected,
DataBaseTM database 
)
virtual

◆ GetAdvancedAttribution()

bool tmAttributionData::GetAdvancedAttribution ( ProjectDefMemoryLayers layer,
wxArrayString &  values,
wxArrayString &  codes,
long  selected 
)

Get advanced attribution for a layer.

Parameters
layerAdress of a valid layer
valuesAn array, data will be added to
selectedThe selected object ID
Returns
true if getting values succeed, false otherwise.
Author
Lucien Schreiber (c) CREALP 2009
Date
25 March 2009

◆ GetAttributesAdvanced()

bool tmAttributionData::GetAttributesAdvanced ( long  objectid,
PrjMemLayersArray *  layers,
wxArrayString &  values 
)
virtual

Get advanced attribution in all layers for an object ID.

Parameters
layersArray of layers for advanced attribution
valueswxArrayString filled by the actual values
Returns
true if all was ok (maybe no attribution returned) and false if an error occur
Author
Lucien Schreiber (c) CREALP 2009
Date
25 March 2009

◆ GetAttributionLayersID()

virtual bool tmAttributionData::GetAttributionLayersID ( const long &  geomid,
tmLayerValueArray &  layersid 
)
inlinevirtual

◆ GetBasicNameFromID()

bool tmAttributionData::GetBasicNameFromID ( const tmAttributionBasic myAttribObj,
wxArrayString &  txtvalues 
)

Get Basic attribution string from database.

Parameters
myAttribObjobject of type tmAttributionBasic
txtvaluesIf function return true, This array will be filled with basic attribution strings
Returns
true if attribution values returned succesfully, false otherwise. If true is returned, txtvalues may still be empty = no attributions.
Author
Lucien Schreiber (c) CREALP 2009
Date
03 March 2009

◆ GetConcatenedBasicName()

bool tmAttributionData::GetConcatenedBasicName ( const tmAttributionBasicArray &  myAttrib,
wxArrayString &  concatenedattrib 
)

Get Concatened basic attribution values for object.

Parameters
myAttribContain attribution for all selected objects
concatenedattriban array of string containing all attribution basic values concatenated
Returns
true if function return successfully, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
03 March 2009

◆ GetInfoBasic()

virtual bool tmAttributionData::GetInfoBasic ( AttribObjType_PANEL panel)
inlinevirtual

◆ GetInfoBasicArray()

bool tmAttributionData::GetInfoBasicArray ( tmAttributionBasicArray &  values)
virtual

Get basic attributions for selected objets.

Parameters
valuesobject of type : tmAttributionBasic Array containing all ids and values for selected objects
Returns
true if attribution was retrieved, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
02 March 2009

◆ GetInfoBasicValues()

bool tmAttributionData::GetInfoBasicValues ( const long &  selected,
wxArrayLong &  values 
)
virtual

Get basic attribution values for passed ID.

Parameters
selectedThe feature ID we want attribution for
valuesThe returned attribution values
Returns
true if attributions where returned, false otherwise
Author
Lucien Schreiber (c) CREALP 2009
Date
13 February 2009

◆ IsAttributionSimilar()

bool tmAttributionData::IsAttributionSimilar ( const tmAttributionBasicArray &  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.

Parameters
valuesan tmAttributionBasicArray containing OID and attribution values
Returns
true if all OID share the same attribution
Author
Lucien Schreiber (c) CREALP 2009
Date
02 March 2009

◆ IsValid()

bool tmAttributionData::IsValid ( )
protectedvirtual

Verify validity of member objects.

Returns
true if all objects are valid and correctly initialized, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
06 November 2008

◆ PrepareAttributionStatement()

void tmAttributionData::PrepareAttributionStatement ( wxString &  statement,
const wxString &  tablename,
wxArrayLong *  checkedVal 
)
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.

Parameters
statementString for storing statement
tablenamename of the database table to insert into (generic_aat, etc.)
checkedValAdress of an array containing all checked IDs
Author
Lucien Schreiber (c) CREALP 2008
Date
06 November 2008

◆ PrepareCleaningStatement()

void tmAttributionData::PrepareCleaningStatement ( wxString &  statement,
const wxString &  tablename 
)
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.

Parameters
statementString for storing statement
tablenamename of the database table to insert into (generic_aat, etc.)
Author
Lucien Schreiber (c) CREALP 2008
Date
06 November 2008

◆ PrepareGetAttributionLayersID()

bool tmAttributionData::PrepareGetAttributionLayersID ( const long &  geomid,
tmLayerValueArray &  layersid,
const wxString &  tablename,
int  layertype 
)
protected

Get Layer attributed for selected geometry.

When doing advanced attribution, we should know what are the layers we should display control for.

Parameters
geomidthe object id we search attribution layers
layersidan (empty) wxArrayLong used by this function for storing returned layers id
layertypeone of the following value :
  • LAYER_SPATIAL_LINE
  • LAYER_SPATIAL_POINT
  • LAYER_SPATIAL_POLYGON
tablenamethe name of the table containing the basic attribution.
Returns
true if layers where returned, false otherwise (no basic attribution for exemple or error in the query)
Author
Lucien Schreiber (c) CREALP 2009
Date
16 March 2009

◆ PrepareGetInfoMultipleStatement()

void tmAttributionData::PrepareGetInfoMultipleStatement ( wxString &  statement,
const wxString &  tablename 
)
protected

Create MySQL statement for getting info.

Get info for all selected object

Parameters
statementused for storing the returned statement
tablenamethe tablename to use
Author
Lucien Schreiber (c) CREALP 2009
Date
02 March 2009

◆ PrepareGetInfoStatement()

void tmAttributionData::PrepareGetInfoStatement ( wxString &  statement,
const wxString &  tablename 
)
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.

Parameters
statementa place for storing the statement
tablenameName of the table : see TABLE_NAME_GIS_ATTRIBUTION
Author
Lucien Schreiber (c) CREALP 2008
Date
07 November 2008

◆ SetAttributeBasic()

virtual bool tmAttributionData::SetAttributeBasic ( AttribObjType_PANEL panel)
inlinevirtual

◆ SetAttributeBasicValues()

bool tmAttributionData::SetAttributeBasicValues ( wxArrayLong *  values)
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

Parameters
valuesAn array of long containing the values for attribution
Returns
Return true if all works correctly, otherwise false
Author
Lucien Schreiber (c) CREALP 2008
Date
18 December 2008

◆ SetAttributesAdvanced()

bool tmAttributionData::SetAttributesAdvanced ( long  objid,
PrjMemLayersArray *  layers,
const wxArrayString &  values 
)
virtual

Set advanced attribution.

Parameters
layersAdress of a valid array of ProjectDefMemoryLayers
valuesa valid wxArrayString containing all attributions
Returns
true if advanced attribution was done successfully
Author
Lucien Schreiber (c) CREALP 2009
Date
24 March 2009

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