![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
The definition of a MapLink feature, for use with TSLFeatureList and TSLFeatureClassConfig classes.
A feature is defined by a feature name. For each TSLFeature instance this will be a singular string such as 'roads' or 'motorways'. Some methods on TSLFeature and the TSLFeatureList will allow hierarchical names such as 'roads.motorways'. In this example the parent feature called 'roads' has a child feature called 'motorways'.
Each TSLFeature contains an instance of TSLRenderingAttributes. These attributes will be used by the TSLFeatureClassConfig when styling data. Rendering attributes will be inherited by a feature's children, however they may be overridden by the child's rendering attributes if specified.
Public Member Functions | |
TSLFeature () | |
Default Constructor. | |
TSLFeature (const char *name, const char *product=NULL) | |
TSLFeature (const char *name, const TSLRenderingAttributes &renderingAttributes, const char *product=NULL) | |
TSLFeature (const TSLFeature &other) | |
void | destroy () |
Delete this feature. | |
TSLRenderingAttributes & | rendering () |
const TSLRenderingAttributes & | getRendering () const |
void | setRendering (const TSLRenderingAttributes &attribs) |
void | getRenderingIncludingParent (TSLRenderingAttributes &attribs) const |
void | clearRendering () |
Clear the rendering attributes of this feature. | |
unsigned int | numAttributes () const |
const char * | getAttribute (unsigned int index) const |
void | addAttribute (const char *attributeName) |
bool | removeAttribute (unsigned int index) |
bool | removeAttribute (const char *attributeName) |
const char * | getTextLabelAttribute () const |
void | setTextLabelAttribute (const char *attributeName) |
TSLFeature * | parent () const |
unsigned int | numChildren () const |
void | addChild (TSLFeature *child) |
TSLFeature * | getChild (unsigned int index) const |
TSLFeature * | getChild (const char *featureName, bool caseSensitive=false) const |
bool | removeChild (unsigned int index) |
bool | removeChild (const char *featureName, bool caseSensitive=false) |
bool | renameChild (const char *featureName, const char *newFeatureName, bool caseSensitive=false) |
const char * | getName () const |
Query the name of this feature. | |
void | getFullName (TSLSimpleString &name) const |
bool | setName (const char *name) |
const char * | getProduct () const |
void | setProduct (const char *product) |
TSLFeatureList * | featureList () const |
void * | operator new (size_t size) TSL_NO_THROW |
void * | operator new (size_t size, char *filename, int line) |
TSLFeature::TSLFeature | ( | ) |
Default Constructor.
TSLFeature::TSLFeature | ( | const char * | name, |
const char * | product = NULL ) |
Constructor.
name | The name of this feature, not including any parent features. |
product | The product specification of the feature. |
TSLFeature::TSLFeature | ( | const char * | name, |
const TSLRenderingAttributes & | renderingAttributes, | ||
const char * | product = NULL ) |
Constructor.
name | The name of this feature, not including any prefixes or parents. |
renderingAttributes | The rendering attributes for this feature. |
product | The product specification of the feature. |
TSLFeature::TSLFeature | ( | const TSLFeature & | other | ) |
Copy constructor.
void TSLFeature::addAttribute | ( | const char * | attributeName | ) |
Add an attribute definition to this feature.
This function will silently fail if the attribute name already exists.
attributeName | The name of the attribute. |
void TSLFeature::addChild | ( | TSLFeature * | child | ) |
Add a child feature.
This feature will take ownership of the provided child feature. The application must not delete the child once this method has been called.
child | The child feature to add. |
void TSLFeature::clearRendering | ( | ) |
Clear the rendering attributes of this feature.
void TSLFeature::destroy | ( | ) |
Delete this feature.
TSLFeatureList * TSLFeature::featureList | ( | ) | const |
Query the feature list containing this feature.
const char * TSLFeature::getAttribute | ( | unsigned int | index | ) | const |
Query an attribute name.
index | The index of the attribute. |
TSLFeature * TSLFeature::getChild | ( | const char * | featureName, |
bool | caseSensitive = false ) const |
Query a child feature.
The provided feature name may be a direct child of this feature, or a feature within the hierarchy.
featureName | The name of the child to query. |
caseSensitive | Whether the string comparison should be case sensitive or not. |
TSLFeature * TSLFeature::getChild | ( | unsigned int | index | ) | const |
Query a child feature.
The returned feature may be modified, but must not be deleted by the application.
index | The index of the child. |
void TSLFeature::getFullName | ( | TSLSimpleString & | name | ) | const |
Query the full name of this feature, including any parents.
The returned name will be the full hierarchical name of the feature, including all parent features, separated by '.'.
The returned name will not include the feature section.
If this feature has no parent this will return the same as getName.
name | The string (TSLSimpleString) will be populated with the full hierarchical name of this feature. |
const char * TSLFeature::getName | ( | ) | const |
Query the name of this feature.
const char * TSLFeature::getProduct | ( | ) | const |
Query this feature's product specification.
This string represents a product specification, or feature book section in MapLink Studio. This allows the feature to be marked as part of a product, to avoid collisions with otherwise identical features. This product name will be used when processing the data through TSLFeatureClassConfig::getProcessedFeatureList and TSLFeatureClassConfig::processGeometry.
If this feature has a parent then the parent's section will be returned.
const TSLRenderingAttributes & TSLFeature::getRendering | ( | ) | const |
Query the rendering attributes of this feature.
These rendering attributes do not include those inherited from parent features.
void TSLFeature::getRenderingIncludingParent | ( | TSLRenderingAttributes & | attribs | ) | const |
Query the effective rendering attributes of this feature, including those inherited from parent features.
Any rendering attributes which are not defined for this feature, but defined for the parent feature, will be inherited from the parent.
attribs | Will be set to the effective rendering attributes of this feature. |
const char * TSLFeature::getTextLabelAttribute | ( | ) | const |
Query the name of the attribute to display as a text label.
This value may be inherited from a parent feature.
unsigned int TSLFeature::numAttributes | ( | ) | const |
Query the number of attributes defined for this feature.
unsigned int TSLFeature::numChildren | ( | ) | const |
Query the number of child features under this feature.
void * TSLFeature::operator new | ( | size_t | size | ) |
void * TSLFeature::operator new | ( | size_t | size, |
char * | filename, | ||
int | line ) |
TSLFeature * TSLFeature::parent | ( | ) | const |
Query the parent of this feature.
bool TSLFeature::removeAttribute | ( | const char * | attributeName | ) |
Remove an attribute definition from this feature.
attributeName | The name of the attribute. |
true
if the attribute was removed, false
otherwise. bool TSLFeature::removeAttribute | ( | unsigned int | index | ) |
Remove an attribute definition from this feature.
index | The index of the attribute. |
true
if the attribute was removed, false
otherwise. bool TSLFeature::removeChild | ( | const char * | featureName, |
bool | caseSensitive = false ) |
Remove a child feature.
The provided feature name may be a direct child of this feature, or a feature within the hierarchy.
featureName | The name of the child to remove. |
caseSensitive | Whether the string comparison should be case sensitive or not. |
true
if the child was removed, false
otherwise. bool TSLFeature::removeChild | ( | unsigned int | index | ) |
Remove a child feature.
index | The index of the child to remove. |
true
if the child was removed, false
otherwise. bool TSLFeature::renameChild | ( | const char * | featureName, |
const char * | newFeatureName, | ||
bool | caseSensitive = false ) |
Rename a child feature.
featureName | The name of the child to rename. |
newFeatureName | The new name for the child. |
caseSensitive | Whether the string comparison should be case sensitive or not. |
true
if the child was renamed, false
otherwise. TSLRenderingAttributes & TSLFeature::rendering | ( | ) |
Access the rendering attributes of this feature.
These rendering attributes may be modified, but they do not include those inherited from parent features.
bool TSLFeature::setName | ( | const char * | name | ) |
Set the name of this feature.
This name does not include any prefixes or parent feature names. Any '.' in the provided name will be replaced with '_'.
If this feature is contained within a TSLFeatureList it may only be renamed by calling TSLFeatureList::renameFeature.
name | The new name of the feature. |
true
if the name was set, false
otherwise. void TSLFeature::setProduct | ( | const char * | product | ) |
Set this feature's product specification.
product | The product specification to assign this feature to. |
void TSLFeature::setRendering | ( | const TSLRenderingAttributes & | attribs | ) |
Set the rendering attributes of this feature.
attribs | The new rendering attributes (TSLRenderingAttributes) for this feature. |
void TSLFeature::setTextLabelAttribute | ( | const char * | attributeName | ) |
Set the attribute to display as a text label.
When this feature is processed the value of this attribute will be added to any displayed data as a textual entity. Rendering attributes for this entity will be taken from this feature's rendering attributes.
This setting will be inherited by any child features.
attributeName | A string containing the attribute name. |