Working with Vector Layers
LEADTOOLS provides a number of functions for working with the vector layers within a vector handle. Several functions provide a means of obtaining information about vector layers, while other functions provide a means of actually modifying vector layers.
Getting Information about Vector Layers
A vector handle may contain multiple vector layers. The LVectorBase::GetLayerCount returns the number of layers present in the class object's associated vector handle. Once the number of layers present is known, each layer can be obtained using LVectorBase::GetLayerByIndex. If the name of a layer is known, that layer can be obtained using LVectorBase::GetLayerByName. LVectorBase::EnumLayers actually enumerates all the layers present in a vector handle. The LVectorBase::EnumLayersCallBack function called by LVectorBase::EnumLayers lets you process each enumerated layer.
Within a vector handle one layer is active. LVectorBase::GetActiveLayer obtains a handle to the active vector layer. LVectorBase::SetActiveLayer lets you set the active layer within a vector handle.
Once a handle to a vector layer is obtained, information about that vector layer can be obtained using LVectorLayer::GetLayerDesc. This vector layer information can then be modified using LVectorLayer::SetLayerDesc. LVectorLayer::GetLayerDesc fills a VECTORLAYERDESC structure with the information about the class object's vector layer. The information within the VECTORLAYERDESC structure can then be modified and the vector layer information updated using LVectorLayer::SetLayerDesc.
Manipulating Vector Layers
LEADTOOLS provides a number of functions for manipulating vector layers. LVectorBase::SetActiveLayer and LVectorLayer::SetLayerDesc let you set the active layer in a vector handle and modify information about a specific vector layer. For more information, refer to Getting Information About Vector Layers above, or the functions themselves.
LVectorLayer::EmptyLayer remove all vector objects from a vector layer. LVectorLayer::DeleteLayer actually removes a vector layer from a vector handle.
The contents of one layer can be copied to another layer using LVectorBase::CopyLayer.
LVectorBase::AddLayer lets you add a new layer to a vector handle.