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

Detailed Description

TMS TSLInteropConfig defines the interoperability configurations that are to be used by the TSLInteropManager when pre-processing or post-processing data.

TSLInteropConfig objects should be allocated on the heap using the new operator. They cannot be instantiated on the stack. They should be destroyed by calling the destroy method rather than deleting them since the calls are redirected internally to MapLink.

Public Member Functions

 TSLInteropConfig ()
 
bool addEntityExclusionAttribute (const char *attributeName, const TSLVariant &attributeValue)
 
bool addExternalAttribute (const char *attributeName, const TSLVariant &attributeValue)
 
void basefilename (TSLSimpleString &baseFilename) const
 
bool basefilename (const char *value)
 
bool decomposeBorderedPolygons () const
 
void decomposeBorderedPolygons (bool value)
 
void destroy ()
 
bool excludeAttribute (const char *attributeName)
 
void excludeAttributeType (TSLInteropAttributeType attributeType, bool value)
 
void groupingAttribute (TSLSimpleString &groupAttribute) const
 
bool groupingAttribute (const char *value)
 
bool renameAttribute (const char *internalName, const char *externalName)
 
void reset ()
 
void resetAttributeExclusionList ()
 
void resetAttributeRenaming ()
 
void resetEntityExclusionList ()
 
void resetExternalAttributeList ()
 
bool splitIntoHomogGeomLayers () const
 
void splitIntoHomogGeomLayers (bool value)
 
bool useNativeRenderingAttributes () const
 
void useNativeRenderingAttributes (bool value)
 
void * operator new (size_t size) TSL_NO_THROW
 
void * operator new (size_t size, char *filename, int line)
 

Constructor & Destructor Documentation

◆ TSLInteropConfig()

TSLInteropConfig::TSLInteropConfig ( )

Creates a default TSLInteropConfig.

Member Function Documentation

◆ addEntityExclusionAttribute()

bool TSLInteropConfig::addEntityExclusionAttribute ( const char * attributeName,
const TSLVariant & attributeValue )

Add attribute to the entity exclusion list.

The exclusion list consists of a set of (name,value) pairs. If an entity has an attribute whose name and value matches an element in the exclusion list then the entity is excluded from export.

This configuration setting applies to export only.

Parameters
attributeNameName of the attribute.
attributeValueValue of the attribute.
Returns
true on success; false otherwise.

◆ addExternalAttribute()

bool TSLInteropConfig::addExternalAttribute ( const char * attributeName,
const TSLVariant & attributeValue )

Add attribute to the external attribute list.

An external attribute consists of a name and value and corresponds to some "externally supplied" data such as extracts from a database. The individual attributes are copied to the entity dataset for each entity and will therefore be generated identically on all entities created in the export process.

This configuration setting applies to export only. However, note that if data is exported and then reimported then the external attributes that were copied to the dataset on export will be reimported as dataset attributes. A subsequent export can therefore lead to duplicate copies of the attributes within the dataset.

Parameters
attributeNameName of the attribute.
attributeValueValue of the attribute.
Returns
true on success; false otherwise.

◆ basefilename() [1/2]

bool TSLInteropConfig::basefilename ( const char * value)

Sets the basefilename.

The filename component of each item in a TSLInteropExportSet will be built up using the basename, the individual values of the entity grouping attribute, and a code indicating the geometrical type of the objects.

The basefilename is optional but one, or both, of the basefilename and grouping attribute must be provided. If neither is defined then an error will be returned.

This configuration setting applies to export only.

Parameters
valueNew value for the basefilename.
Returns
true on success; false otherwise.

◆ basefilename() [2/2]

void TSLInteropConfig::basefilename ( TSLSimpleString & baseFilename) const

Returns the basefilename in baseFilename.

The filename component of each item in a TSLInteropExportSet will be built up using the basename, the individual values of the entity grouping attribute, and a code indicating the geometrical type of the objects.

This configuration setting applies to export only.

◆ decomposeBorderedPolygons() [1/2]

bool TSLInteropConfig::decomposeBorderedPolygons ( ) const

Returns the decomposeBorderedPolygons flag.

For export, if this flag is set then each TSLBorderedPolygon object will be processed as a TSLPolygon and a set of TSLPolygons will be created for each for each straight line segment of the bordered polygon. Each of these TSLPolygons will be output accordingly and contain attribution that defines their relationship as components of the TSLBorderedPolygon from which they were derived. If this flag is not set then each TSLBorderedPolygon is passed through verbatim as a TSLBorderedPolygon for the filter to interpret.

For import, if this flag is set and a set of TSLPolygons is encountered that contains the TSLBorderedPolygon attribution then the relationships defined in the attribution are used construct the TSLBorderedPolygon. If this flag is not set then the individual entities are imported as an arbitrary collection of TSLPoygons.

◆ decomposeBorderedPolygons() [2/2]

void TSLInteropConfig::decomposeBorderedPolygons ( bool value)

Sets the decomposeBorderedPolygons flag.

For export, if this flag is set then each TSLBorderedPolygon object will be processed as a TSLPolygon and a set of TSLPolygons will be created for each for each straight line segment of the bordered polygon. Each of these TSLPolygons will be output accordingly and contain attribution that defines their relationship as components of the TSLBorderedPolygon from which they were derived. If this flag is not set then each TSLBorderedPolygon is passed through verbatim as a TSLBorderedPolygon for the filter to interpret.

For import, if this flag is set and a set of TSLPolygons is encountered that contains the TSLBorderedPolygon attribution then the relationships defined in the attribution are used construct the TSLBorderedPolygon. If this flag is not set then the individual entities are imported as an arbitrary collection of TSLPoygons.

Parameters
valueNew value for the decomposeBorderedPolygons flag.

◆ destroy()

void TSLInteropConfig::destroy ( )

Destroy method. This should be called rather than deleting the object, since the calls are redirected internally to MapLink.

◆ excludeAttribute()

bool TSLInteropConfig::excludeAttribute ( const char * attributeName)

Add attribute to the attribute exclusion list.

For export, all attribute types are available for export: "property", "rendering", "external" and "dataset". For import, only the attributes of type "dataset" are available.

If an attribute's name appears on the attribute exclusion list then it is neither exported nor imported.

Parameters
attributeNameName of the attribute.
Returns
true on success; false otherwise.
Note
in the case where attribute renaming has been setup the attribute name for determining exclusion is taken to be the "internal" name, that is, the name that follows renaming on import. This convention maintains consistency between the import and export procedures.
since the external attribute list is defined by the client the external attributes are always exported.

◆ excludeAttributeType()

void TSLInteropConfig::excludeAttributeType ( TSLInteropAttributeType attributeType,
bool value )

Set flag to indicate whether all attributes of a given type should be excluded (true) or included (false).

For export, all attribute types are available for export: "property", "rendering" and "dataset". For import, only the attributes of type "dataset" are available.

Parameters
attributeTypeType of attribute for which the exclusion flag is being set.
valueNew value for the exclusion flag.
Note
since the external attribute list is defined by the client the external attributes are always exported.

◆ groupingAttribute() [1/2]

bool TSLInteropConfig::groupingAttribute ( const char * value)

Sets the name of the grouping attribute.

Setting this to a non-empty string allows grouping of entities based on attribute value. Separate items will be created in the TSLInteropExportSet for each separate value of this attribute. The layer component of the TSLInteropExportSet item will contain the data grouped for a particular attribute value; the filename component will specify the corresponding filename based on the grouping criteria.

The attribute may be one of the following types: "properties", "rendering" or "dataset". Entities for which this attribute does not exist will be placed together in one group.

This configuration setting applies to export only.

Parameters
valueNew value for the grouping attribute.
Returns
true on success; false otherwise.

◆ groupingAttribute() [2/2]

void TSLInteropConfig::groupingAttribute ( TSLSimpleString & groupAttribute) const

Returns the name of the grouping attribute in groupAttribute.

Setting this to a non-empty string allows grouping of entities based on attribute value. Separate items will be created in the TSLInteropExportSet for each separate value of this attribute. The layer component of the TSLInteropExportSet item will contain the data grouped for a particular attribute value; the filename component will specify the corresponding filename based on the grouping criteria.

The attribute may be one of the following types: "properties", "rendering" or "dataset". Entities for which this attribute does not exist will be placed together in one group.

This configuration setting applies to export only.

◆ operator new() [1/2]

void * TSLInteropConfig::operator new ( size_t size)

Overridden allocation to redirect to MapLink

◆ operator new() [2/2]

void * TSLInteropConfig::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ renameAttribute()

bool TSLInteropConfig::renameAttribute ( const char * internalName,
const char * externalName )

Rename attribute.

This method provides functionality for renaming attributes on both import and export. When a rename pair (internalName,externalName) is added to the configuration, all attributes having name internalName will be renamed externalName on export, and vice-versa on import.

The user adds an "internalName to externalName" mapping to the configuration. The corresponding "externalName to internalName" mapping is then added implicitly. The former mapping will always apply. However, the latter will apply provided the mapping defines a one-to-one correspondence. It is the user's responsibility to ensure this. If the mapping from internal names to external names is many-one then on import a name externalName will be mapped to the name internalName defined by the last (internalName,externalName) pair added to the configuration.

Parameters
internalNameinternal name of the attribute.
externalNameexternal name of the attribute.
Returns
true on success; false otherwise.

◆ reset()

void TSLInteropConfig::reset ( )

Resets the configuration settings to the default values.

Specific settings are as follows.

Remove all elements in the attribute exclusion list. Remove all elements in the attribute renaming lists. Remove all elements in the entity exclusion list. Remove all elements in the external attribute list. Set basefilename = "". Set decomposeBorderedPolygons = true. Set splitIntoHomogGeomLayers = false. Set groupingAttribute = "". Set useNativeRenderingAttributes = true.

◆ resetAttributeExclusionList()

void TSLInteropConfig::resetAttributeExclusionList ( )

Remove all elements in the attribute exclusion list.

◆ resetAttributeRenaming()

void TSLInteropConfig::resetAttributeRenaming ( )

Remove all elements in the attribute renaming lists.

◆ resetEntityExclusionList()

void TSLInteropConfig::resetEntityExclusionList ( )

Remove all elements in the entity exclusion list.

◆ resetExternalAttributeList()

void TSLInteropConfig::resetExternalAttributeList ( )

Remove all elements in the external attribute list.

◆ splitIntoHomogGeomLayers() [1/2]

bool TSLInteropConfig::splitIntoHomogGeomLayers ( ) const

Returns the splitIntoHomogGeomLayers flag.

Setting this to true allows grouping of entities based on geometrical type. Each entity will be grouped under one of the following categories: points, polylines, polygons and text. For each geometrical category that contains entities a separate item will be created in the TSLInteropExportSet. The layer component of the TSLInteropExportSet item will contain the data grouped for a particular geometrical category; the filename component will provide the corresponding filename based on the grouping criteria. The filename contains a tag for the geometrical code as follows: "_x" (points), " _l" (polylines), "_p" (polygons), "_t" (text).

This configuration setting applies to export only.

◆ splitIntoHomogGeomLayers() [2/2]

void TSLInteropConfig::splitIntoHomogGeomLayers ( bool value)

Sets the splitIntoHomogGeomLayers flag.

Setting this to true allows grouping of entities based on geometrical type. Each entity will be grouped under one of the following categories: points, polylines, polygons and text. For each geometrical category that contains entities a separate item will be created in the TSLInteropExportSet. The layer component of the TSLInteropExportSet item will contain the data grouped for a particular geometrical category; the filename component will provide the corresponding filename based on the grouping criteria. The filename contains a tag for the geometrical code as follows: "_x" (points), " _l" (polylines), "_p" (polygons), "_t" (text).

This configuration setting applies to export only.

Parameters
valueNew value for the splitIntoHomogGeomLayers flag.

◆ useNativeRenderingAttributes() [1/2]

bool TSLInteropConfig::useNativeRenderingAttributes ( ) const

Returns the useNativeRenderingAttributes flag.

This flag specifies whether the import and export routines use native rendering information where the target data format supports it (for example, MIF rendering clauses) of whether to override this and explicitly set the TMF rendering parameters using information stored in the dataset. The precise meaning of this flag for import and export is as follows.

For export, if the flag is true then the TMF rendering parameters will be transferred into equivalent native rendering parameters in the target exchange set geometry model. The actual conversion is the responsibility of the filter and is dependent on an output data format that supports rendering information. If the flag is false then no TMF rendering parameters will be transferred on export. Note that this has no effect on whether the TMF rendering attributes are copied to the dataset on export; this behaviour is controlled by the attribute exclusion configuration settings. The precise meaning of the flag is to indicate whether the manager should remove TMF rendering information from the data when it is pre-processed and before it is passed to an export filter.

For import, the filter will convert native rendering information (for example, MIF rendering clauses) into TMF rendering attributes. If the flag is true then when the TSLInteropManager post-processes the data it will ignore any TMF rendering attributes that are present in the dataset. If the flag is false then TMF rendering information that is present in the dataset will be used to set the equivalent TMF rendering attributes on the imported entities. Note that the required TMF rendering attributes must be present in the dataset; this behaviour is controlled by the attribute exclusion configuration settings on export.

◆ useNativeRenderingAttributes() [2/2]

void TSLInteropConfig::useNativeRenderingAttributes ( bool value)

Sets the useNativeRenderingAttributes flag.

This flag specifies whether the import and export routines use native rendering information where the target data format supports it (for example, MIF rendering clauses) of whether to override this and explicitly set the TMF rendering parameters using information stored in the dataset. The precise meaning of this flag for import and export is as follows.

For export, if the flag is true then the TMF rendering parameters will be transferred into equivalent native rendering parameters in the target exchange set geometry model. The actual conversion is the responsibility of the filter and is dependent on an output data format that supports rendering information. If the flag is false then no TMF rendering parameters will be transferred on export. Note that this has no effect on whether the TMF rendering attributes are copied to the dataset on export; this behaviour is controlled by the attribute exclusion configuration settings. The precise meaning of the flag is to indicate whether the manager should remove TMF rendering information from the data when it is pre-processed and before it is passed to an export filter.

For import, the filter will convert native rendering information (for example, MIF rendering clauses) into TMF rendering attributes. If the flag is true then when the TSLInteropManager post-processes the data it will ignore any TMF rendering attributes that are present in the dataset. If the flag is false then TMF rendering information that is present in the dataset will be used to set the equivalent TMF rendering attributes on the imported entities. Note that the required TMF rendering attributes must be present in the dataset; this behaviour is controlled by the attribute exclusion configuration settings on export.

Parameters
valueNew value of the useNativeRenderingAttributes flag.