![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This class defines a feature class configuration.
A feature class configuration provides:
Public Types | |
enum | FeatureMaskingMode { FeatureMaskingModeIncludeMarked , FeatureMaskingModeExcludeMarked } |
Public Member Functions | |
TSLFeatureClassConfig () | |
Constructor. | |
TSLFeatureClassConfig (const TSLFeatureClassConfig &other) | |
Copy constructor. | |
~TSLFeatureClassConfig () | |
Destructor. | |
TSLFeatureClassConfig & | operator= (const TSLFeatureClassConfig &other) |
Assignment operator. | |
bool | load (const char *fileName) |
bool | load (TSLifstream &stream) |
bool | save (const char *fileName) |
bool | save (TSLofstream &stream) |
void | setFeatureMaskingMode (TSLFeatureClassConfig::FeatureMaskingMode mode) |
TSLFeatureClassConfig::FeatureMaskingMode | getFeatureMaskingMode () const |
bool | setFeatureMasking (const char *featureName, bool mask, const char *product=NULL) |
bool | getFeatureMasking (const char *featureName, bool &mask, const char *product=NULL) const |
void | clearAllFeatureMasking () |
unsigned int | numClassifiers (const char *featureName, const char *product=NULL) const |
bool | addClassifier (const char *featureName, TSLFeatureClassifier *classifier, const char *product=NULL) |
TSLFeatureClassifier * | queryClassifier (const char *featureName, unsigned int index, const char *product=NULL) const |
bool | removeClassifier (const char *featureName, unsigned int index, const char *product=NULL) |
TSLFeatureList & | featureList () |
const TSLFeatureList & | featureList () const |
TSLFeatureList * | getProcessedFeatureList (const char *product=NULL) const |
TSLFeature * | processGeometry (TSLMUGeometry *geometry, const TSLFeatureList *featureList, const char *product=NULL) const |
Feature masking mode.
This enumeration defines how the TSLFeatureClassConfig will interpret feature masking settings.
The feature masking mode may be set be calling setFeatureMaskingMode. The default feature masking mode is TSLFeatureClassConfig::FeatureMaskingModeExcludeMarked.
Enumerator | |
---|---|
FeatureMaskingModeIncludeMarked | By default exclude all features and only include those marked by calling setFeatureMasking. |
FeatureMaskingModeExcludeMarked | By default include all features and only exclude those marked by calling setFeatureMasking. |
TSLFeatureClassConfig::TSLFeatureClassConfig | ( | ) |
Constructor.
TSLFeatureClassConfig::TSLFeatureClassConfig | ( | const TSLFeatureClassConfig & | other | ) |
Copy constructor.
TSLFeatureClassConfig::~TSLFeatureClassConfig | ( | ) |
Destructor.
bool TSLFeatureClassConfig::addClassifier | ( | const char * | featureName, |
TSLFeatureClassifier * | classifier, | ||
const char * | product = NULL ) |
Add a feature classifier definition.
featureName | The name of the feature. |
classifier | The feature classifier definition to add (TSLFeatureClassifier). Ownership of this object will be transferred to the TSLFeatureClassConfig. |
product | The product specification of the feature. |
true
if the definition was added, false
otherwise. void TSLFeatureClassConfig::clearAllFeatureMasking | ( | ) |
Clear feature masking for all features.
This will not affect the feature masking mode, but will reset the mask setting of all features.
TSLFeatureList & TSLFeatureClassConfig::featureList | ( | ) |
Access the feature configuration's TSLFeatureList.
This is the unprocessed feature list, and as such will not be affected by feature masking or classified definitions. To create a processed feature list, which includes the effects of masking/classification see getProcessedFeatureList.
This feature list may be modified.
const TSLFeatureList & TSLFeatureClassConfig::featureList | ( | ) | const |
Query the feature configuration's TSLFeatureList.
This is the unprocessed feature list, and as such will not be affected by feature masking or classification definitions.
bool TSLFeatureClassConfig::getFeatureMasking | ( | const char * | featureName, |
bool & | mask, | ||
const char * | product = NULL ) const |
Query feature masking for a feature.
If feature masking has not been set for the feature this method will return false. The value passed to setFeatureMaskingMode will determine how the feature mask is interpreted.
featureName | The name of the feature. |
mask | The mask state of the feature. |
product | The product specification of the feature. |
true
if a mask value was present, false
otherwise. TSLFeatureClassConfig::FeatureMaskingMode TSLFeatureClassConfig::getFeatureMaskingMode | ( | ) | const |
Query the feature masking mode.
TSLFeatureList * TSLFeatureClassConfig::getProcessedFeatureList | ( | const char * | product = NULL | ) | const |
Query the processed feature list.
This feature list will be created by combining the unprocessed feature list, the feature classification definitions, and feature masking settings.
Features may be added/removed from the unprocessed list. Depending on the type of feature classification, specific feature names and rendering attributes may be assigned to the created features.
If classification using TSLFeatureClassifierCategorised, new features will not be added at this point. In order to perform this type of classification, attribute values must be read from data. This type of classification may be processed by the processGeometry method, or by using the methods on TSLFeatureClassifierCategorised directly.
Features will only be processed for the provided product. This may be null in order to process the generic features, or one of the product specifications used within the unprocessed feature list.
product | The product specification to process. Only features from this product will be processed. |
bool TSLFeatureClassConfig::load | ( | const char * | fileName | ) |
Load the feature class configuration from a style file.
fileName | Specifies the file and path to the file to be loaded |
true
on success false
otherwise. bool TSLFeatureClassConfig::load | ( | TSLifstream & | stream | ) |
Load the feature class configuration from a stream.
stream | The stream (TSLifstream) to load from |
true
on success false
otherwise. unsigned int TSLFeatureClassConfig::numClassifiers | ( | const char * | featureName, |
const char * | product = NULL ) const |
Query the number of feature classifier definitions for a feature.
featureName | The name of the feature. |
product | The product specification of the feature. |
TSLFeatureClassConfig & TSLFeatureClassConfig::operator= | ( | const TSLFeatureClassConfig & | other | ) |
Assignment operator.
TSLFeature * TSLFeatureClassConfig::processGeometry | ( | TSLMUGeometry * | geometry, |
const TSLFeatureList * | featureList, | ||
const char * | product = NULL ) const |
Process geometry.
Before calling this method applications should first call getProcessedFeatureList. These methods are separated to allow most of the processing to be done prior to loading data.
The feature name of the provided TSLMUGeometry may be modified, based on the feature classification/masking settings. This feature name will be determined by:
If the resulting feature is already present in the featureList it will be returned without modification. If the resulting feature is not already present it will be added and returned. The rendering attributes for this feature will be determined by its parents and the feature configuration.
geometry | The geometry to process. If this points to a TSLMUGeometrySet this method will return null. |
featureList | The list of features. This should be created by calling getProcessedFeatureList. |
product | The product specification to process. Only features from this product will be processed. |
TSLFeatureClassifier * TSLFeatureClassConfig::queryClassifier | ( | const char * | featureName, |
unsigned int | index, | ||
const char * | product = NULL ) const |
Query a feature classifier definition.
The returned definition may be modified, however must not be deleted by the application.
featureName | The name of the feature. |
index | The index of the classifier definition. |
product | The product specification of the feature. |
bool TSLFeatureClassConfig::removeClassifier | ( | const char * | featureName, |
unsigned int | index, | ||
const char * | product = NULL ) |
Remove a feature classifier definition.
featureName | the name of the feature. |
index | The index of the classifier definition. |
product | The product specification of the feature. |
true
if the classifier definition was removed, false
otherwise. bool TSLFeatureClassConfig::save | ( | const char * | fileName | ) |
Save the feature class configuration to a style file.
fileName | Specifies the file and path to the file to be saved. |
true
on success false
otherwise. bool TSLFeatureClassConfig::save | ( | TSLofstream & | stream | ) |
Save the feature class configuration to a stream.
stream | The stream (TSLifstream) to save to |
true
on success false
otherwise. bool TSLFeatureClassConfig::setFeatureMasking | ( | const char * | featureName, |
bool | mask, | ||
const char * | product = NULL ) |
Set feature masking for a feature.
The value passed to setFeatureMaskingMode will determine how the feature mask is interpreted.
The specified feature must be present in the feature list, if not this function will return false
.
featureName | The name of the feature. |
mask | Whether to set the mask or not. |
product | The product specification of the feature. |
true
if the mask value was set, false
otherwise. void TSLFeatureClassConfig::setFeatureMaskingMode | ( | TSLFeatureClassConfig::FeatureMaskingMode | mode | ) |
Set the feature masking mode.
This will determine how feature masking is processed.
mode | The feature masking mode to set. |