MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLFeatureClassConfig Class Reference

Detailed Description

This class defines a feature class configuration.

A feature class configuration provides:

  • A TSLFeatureList
    This list is a base list of features, usually defined by reading the top-level features from data or by adding named features from a product specification.
  • Feature masking settings
    Feature masking allows specific features (and their children) to be excluded from the feature hierarchy. Features may be included or excluded by default.
  • Feature classification settings
    Each feature within the TSLFeatureList may have multiple feature classifications defined. These classifications may create additional child features in the hierarchy based on the values of data attributes.
See also
TSLFeatureList
TSLFeature

Public Types

enum  FeatureMaskingMode { FeatureMaskingModeIncludeMarked , FeatureMaskingModeExcludeMarked }
 

Public Member Functions

 TSLFeatureClassConfig ()
 Constructor.
 
 TSLFeatureClassConfig (const TSLFeatureClassConfig &other)
 Copy constructor.
 
 ~TSLFeatureClassConfig ()
 Destructor.
 
TSLFeatureClassConfigoperator= (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)
 
TSLFeatureClassifierqueryClassifier (const char *featureName, unsigned int index, const char *product=NULL) const
 
bool removeClassifier (const char *featureName, unsigned int index, const char *product=NULL)
 
TSLFeatureListfeatureList ()
 
const TSLFeatureListfeatureList () const
 
TSLFeatureListgetProcessedFeatureList (const char *product=NULL) const
 
TSLFeatureprocessGeometry (TSLMUGeometry *geometry, const TSLFeatureList *featureList, const char *product=NULL) const
 

Member Enumeration Documentation

◆ FeatureMaskingMode

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.

See also
setFeatureMaskingMode
setFeatureMasking
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.

Constructor & Destructor Documentation

◆ TSLFeatureClassConfig() [1/2]

TSLFeatureClassConfig::TSLFeatureClassConfig ( )

Constructor.

◆ TSLFeatureClassConfig() [2/2]

TSLFeatureClassConfig::TSLFeatureClassConfig ( const TSLFeatureClassConfig & other)

Copy constructor.

◆ ~TSLFeatureClassConfig()

TSLFeatureClassConfig::~TSLFeatureClassConfig ( )

Destructor.

Member Function Documentation

◆ addClassifier()

bool TSLFeatureClassConfig::addClassifier ( const char * featureName,
TSLFeatureClassifier * classifier,
const char * product = NULL )

Add a feature classifier definition.

Parameters
featureNameThe name of the feature.
classifierThe feature classifier definition to add (TSLFeatureClassifier). Ownership of this object will be transferred to the TSLFeatureClassConfig.
productThe product specification of the feature.
Returns
true if the definition was added, false otherwise.

◆ clearAllFeatureMasking()

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.

◆ featureList() [1/2]

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.

See also
getProcessedFeatureList.
Returns
A reference to the unprocessed TSLFeatureList.

◆ featureList() [2/2]

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.

Returns
A const reference to the unprocessed TSLFeatureList.

◆ getFeatureMasking()

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.

See also
TSLFeatureClassConfig::FeatureMaskingMode
setFeatureMaskingMode
Parameters
featureNameThe name of the feature.
maskThe mask state of the feature.
productThe product specification of the feature.
Returns
true if a mask value was present, false otherwise.

◆ getFeatureMaskingMode()

TSLFeatureClassConfig::FeatureMaskingMode TSLFeatureClassConfig::getFeatureMaskingMode ( ) const

Query the feature masking mode.

Returns
The feature masking mode as a TSLFeatureClassConfig::FeatureMaskingMode enumeration value.

◆ getProcessedFeatureList()

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.

Parameters
productThe product specification to process. Only features from this product will be processed.
Returns
The processed feature list. The application is responsible for deleting this object.

◆ load() [1/2]

bool TSLFeatureClassConfig::load ( const char * fileName)

Load the feature class configuration from a style file.

Parameters
fileNameSpecifies the file and path to the file to be loaded
Returns
true on success false otherwise.

◆ load() [2/2]

bool TSLFeatureClassConfig::load ( TSLifstream & stream)

Load the feature class configuration from a stream.

Parameters
streamThe stream (TSLifstream) to load from
Returns
true on success false otherwise.

◆ numClassifiers()

unsigned int TSLFeatureClassConfig::numClassifiers ( const char * featureName,
const char * product = NULL ) const

Query the number of feature classifier definitions for a feature.

Parameters
featureNameThe name of the feature.
productThe product specification of the feature.
Returns
The number of feature classifiers definitions for the feature.

◆ operator=()

TSLFeatureClassConfig & TSLFeatureClassConfig::operator= ( const TSLFeatureClassConfig & other)

Assignment operator.

◆ processGeometry()

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:

  • The existing feature name of the geometry.
  • The attribute(s) present on the geometry, and their values.
  • The feature classification and masking settings.

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.

Parameters
geometryThe geometry to process. If this points to a TSLMUGeometrySet this method will return null.
featureListThe list of features. This should be created by calling getProcessedFeatureList.
productThe product specification to process. Only features from this product will be processed.
Returns
A pointer to the resulting feature. This feature remains owned by the featureList and must not be deleted. If null is returned then the geometry has been masked out/cannot be classified as a feature.

◆ queryClassifier()

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.

Parameters
featureNameThe name of the feature.
indexThe index of the classifier definition.
productThe product specification of the feature.
Returns
The requested classifier definition, or null on error.

◆ removeClassifier()

bool TSLFeatureClassConfig::removeClassifier ( const char * featureName,
unsigned int index,
const char * product = NULL )

Remove a feature classifier definition.

Parameters
featureNamethe name of the feature.
indexThe index of the classifier definition.
productThe product specification of the feature.
Returns
true if the classifier definition was removed, false otherwise.

◆ save() [1/2]

bool TSLFeatureClassConfig::save ( const char * fileName)

Save the feature class configuration to a style file.

Parameters
fileNameSpecifies the file and path to the file to be saved.
Returns
true on success false otherwise.

◆ save() [2/2]

bool TSLFeatureClassConfig::save ( TSLofstream & stream)

Save the feature class configuration to a stream.

Parameters
streamThe stream (TSLifstream) to save to
Returns
true on success false otherwise.

◆ setFeatureMasking()

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.

See also
TSLFeatureClassConfig::FeatureMaskingMode
setFeatureMaskingMode
Parameters
featureNameThe name of the feature.
maskWhether to set the mask or not.
productThe product specification of the feature.
Returns
true if the mask value was set, false otherwise.

◆ setFeatureMaskingMode()

void TSLFeatureClassConfig::setFeatureMaskingMode ( TSLFeatureClassConfig::FeatureMaskingMode mode)

Set the feature masking mode.

This will determine how feature masking is processed.

See also
TSLFeatureClassConfig::FeatureMaskingMode
Parameters
modeThe feature masking mode to set.