![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
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) |
TSLInteropConfig::TSLInteropConfig | ( | ) |
Creates a default TSLInteropConfig.
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.
attributeName | Name of the attribute. |
attributeValue | Value of the attribute. |
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.
attributeName | Name of the attribute. |
attributeValue | Value of the attribute. |
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.
value | New value for the basefilename. |
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.
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.
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.
value | New value for the decomposeBorderedPolygons flag. |
void TSLInteropConfig::destroy | ( | ) |
Destroy method. This should be called rather than deleting the object, since the calls are redirected internally to MapLink.
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.
attributeName | Name of the attribute. |
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.
attributeType | Type of attribute for which the exclusion flag is being set. |
value | New value for the exclusion flag. |
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.
value | New value for the grouping attribute. |
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.
void * TSLInteropConfig::operator new | ( | size_t | size | ) |
Overridden allocation to redirect to MapLink
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.
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.
internalName | internal name of the attribute. |
externalName | external name of the attribute. |
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.
void TSLInteropConfig::resetAttributeExclusionList | ( | ) |
Remove all elements in the attribute exclusion list.
void TSLInteropConfig::resetAttributeRenaming | ( | ) |
Remove all elements in the attribute renaming lists.
void TSLInteropConfig::resetEntityExclusionList | ( | ) |
Remove all elements in the entity exclusion list.
void TSLInteropConfig::resetExternalAttributeList | ( | ) |
Remove all elements in the external attribute list.
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.
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.
value | New value for the splitIntoHomogGeomLayers flag. |
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.
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.
value | New value of the useNativeRenderingAttributes flag. |