LVectorBase::GetActiveLayer
#include "ltwrappr.h"
virtual L_INT LVectorBase::GetActiveLayer(pVectorLayer);
LVectorLayer * pVectorLayer; |
/* pointer to vector layer object */ |
Gets the active layer inside the class object's vector.
Parameter |
Description |
pVectorLayer |
Pointer to an LVectorLayer object to be updated with the active layer. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
Some functions will use the active layer when NULL is passed for a pLVectorLayer parameter. This makes it easier to work with the toolkit when layers are not needed.
Required DLLs and Libraries
LVKRN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
|
Topics: |
Example
// This example copies all objects from the active layer of the vector source
// to the destination vector (active layer)
class LMyVectorLayer: public LVectorLayer
{
public:
LVectorBase *m_pVectorDst;
public:
LMyVectorLayer() {};
virtual ~LMyVectorLayer(){};
virtual L_INT EnumObjectsCallBack(pVECTORHANDLE pVector, pVECTOROBJECT pObject);
};
L_INT LMyVectorLayer::EnumObjectsCallBack(pVECTORHANDLE pVector, pVECTOROBJECT pObject)
{
LVectorBase VectorBase(pVector);
LVectorObject VectorObject(pObject, &VectorBase);
m_pVectorDst->CopyObject(&VectorObject);
VectorBase.SetHandle(NULL, FALSE);
return SUCCESS ;
}
L_VOID Example76(HWND hWnd, LVectorBase *pVectorDst)
{
//Load a source vector
LVectorBase VectorSrc;
VectorSrc.Load(TEXT("square3.dxf"));
//Get the active layer of source
LMyVectorLayer VectorLayer;
VectorSrc.GetActiveLayer(&VectorLayer);
//Set the destination vector where objects from source will be copied
VectorLayer.m_pVectorDst = pVectorDst;
//Enumerate all objects in Active layer (and copy to destination vector)
VectorLayer.EnumObjects();
}