53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
|
|
#define _CRT_SECURE_NO_WARNINGS
|
||
|
|
#include "SG_fireBrick.h"
|
||
|
|
#include "SG_fireBrickAlgo.h"
|
||
|
|
#include <string.h>
|
||
|
|
#include <stdlib.h>
|
||
|
|
|
||
|
|
#define API_VERSION "1.0.0"
|
||
|
|
|
||
|
|
int VzCreateAIObject(SVzAICreateParam* pParam) {
|
||
|
|
if (nullptr == pParam)
|
||
|
|
return -1;
|
||
|
|
|
||
|
|
strcpy(pParam->szName, "SG_fireBrickPositioning");
|
||
|
|
strcpy(pParam->szVersion, API_VERSION);
|
||
|
|
pParam->pVoid = (void*)CSG_fireBrick::CreateInstance();
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
int VzDeleteAIObject(SVzAICreateParam* pParam) {
|
||
|
|
if (nullptr == pParam)
|
||
|
|
return -1;
|
||
|
|
|
||
|
|
memcpy(pParam->szName, 0, sizeof(pParam->szName));
|
||
|
|
memcpy(pParam->szVersion, 0, sizeof(pParam->szVersion));
|
||
|
|
delete (CSG_fireBrick*)(pParam->pVoid);
|
||
|
|
pParam->pVoid = nullptr;
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
class CSG_fireBrickImpl :
|
||
|
|
public CSG_fireBrick
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
virtual void GetBrickPose(SVzNL3DLaserLine* scanData, std::vector<SSG_6AxisAttitude>& brickPoses, int* errCode) override;
|
||
|
|
virtual void SortBrickPoses(std::vector<SSG_6AxisAttitude>& brickPoses, ESG_poseSortingMode sortingMode) override;
|
||
|
|
};
|
||
|
|
|
||
|
|
CSG_fireBrick* CSG_fireBrick::CreateInstance() {
|
||
|
|
return new CSG_fireBrickImpl();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void CSG_fireBrickImpl::GetBrickPose(SVzNL3DLaserLine* scanData, std::vector<SSG_6AxisAttitude>& brickPoses, int* errCode) {
|
||
|
|
return sgGetBrickPose(scanData, brickPoses, errCode);
|
||
|
|
}
|
||
|
|
|
||
|
|
void CSG_fireBrickImpl::SortBrickPoses(std::vector<SSG_6AxisAttitude>& brickPoses, ESG_poseSortingMode sortingMode)
|
||
|
|
{
|
||
|
|
return sgSortBrickPoses(brickPoses, sortingMode);
|
||
|
|
}
|