Gets the active layer inside the class object's vector.
#include "ltwrappr.h"
virtual L_INT LVectorBase::GetActiveLayer(pVectorLayer);
Pointer to an LVectorLayer object to be updated with the active layer.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
// This example copies all objects from the active layer of the vector source
// to the destination vector (active layer)
class LMyVectorLayer1: public LVectorLayer
{
public:
LVectorBase *m_pVectorDst;
public:
LMyVectorLayer1() {};
virtual ~LMyVectorLayer1(){};
virtual L_INT EnumObjectsCallBackGAL(pVECTORHANDLE pVector, pVECTOROBJECT pObject);
};
L_INT LMyVectorLayer1::EnumObjectsCallBackGAL(pVECTORHANDLE pVector, pVECTOROBJECT pObject)
{
LVectorBase VectorBase(pVector);
LVectorObject VectorObject(pObject, &VectorBase);
m_pVectorDst->CopyObject(&VectorObject);
VectorBase.SetHandle(NULL, FALSE);
return SUCCESS ;
}
L_INT LVectorBase__GetActiveLayerExample(HWND hWnd, LVectorBase *pVectorDst)
{
UNREFERENCED_PARAMETER(hWnd);
//Load a source vector
L_INT nRet;
LVectorBase VectorSrc;
nRet = VectorSrc.Load(MAKE_IMAGE_PATH(TEXT("random.dxf")));
if(nRet != SUCCESS)
return nRet;
//Get the active layer of source
LMyVectorLayer1 VectorLayer;
nRet = VectorSrc.GetActiveLayer(&VectorLayer);
if(nRet != SUCCESS)
return nRet;
//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)
nRet = VectorLayer.EnumObjects();
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.