I want to extract point data through traverseAllPointData of AcDbPointCloudEx by defining a spatial filter. bellow is my codes.
in traverseAllPointData(...), if I set spatial filter to NULL, the process is success(err == eOK), if set as following code, then fail to callback process(err == eOutOfMemory).
what is the wrong? and how can correct use the spatial filter in AcDbPointCloudEx::traverseAllPointData(...)?
//----------------------------------------------------------------
class IPsAcDbPointCloudSpatialFilter : public IAcDbPointCloudSpatialFilter
{
public:
IPsAcDbPointCloudSpatialFilter() {;}
virtual ~IPsAcDbPointCloudSpatialFilter(){;}
virtual FilterResult testCell(const AcGePoint3d& min, const AcGePoint3d& max) const { return IAcDbPointCloudSpatialFilter::FILTER_INSIDE; }
virtual FilterResult testPoint(const AcGePoint3d& point) const { return IAcDbPointCloudSpatialFilter::FILTER_INSIDE; }
virtual IAcDbPointCloudSpatialFilter* transformFilter(const AcGeMatrix3d& mat) const { return NULL; }
virtual IAcDbPointCloudSpatialFilter* clone() const { return NULL; }
virtual void freeObject() { ; }
};
//----------------------------------------------------------------------------
AcDbPointCloudEx *pPCloudEntity = CPointShapeAPI::GetPointCloudExEntity(objID);
IPsAcPcPointProcessorEx pcProcessor;
IPsAcDbPointCloudSpatialFilter pcSpatialFilter;
pcSpatialFilter.testCell(min, max); // min, max are pre-calculated.
err = pPCloudEntity->traverseAllPointData((IAcDbPointCloudPointProcessor*)&pcProcessor, (IAcDbPointCloudSpatialFilter*)&pcSpatialFilter, IAcDbPointCloudDataBuffer::DataType::kIntensity, 100);
//--------------------------------------------------------------------------------------------------------
Regards!
Edgar Lee.
Solved! Go to Solution.
Solved by kubitTilo. Go to Solution.
Edgar,
you really need to fully implement the spatial filter interface, particularly
virtual IAcDbPointCloudSpatialFilter* transformFilter(const AcGeMatrix3d& mat) const = 0; virtual IAcDbPointCloudSpatialFilter* clone() const = 0; virtual void freeObject() = 0;
Hope this helps.
Are you guys at PointShape migrating to AutoCAD 2015, huh? Maybe we can share some experiences
Hi Tilo,
Thanks for your advice, it's helpfull to resolve this problem.
I have successfully completed the point query processor by implementing the spatial filtering class.
I feel the data query(extracting) performance is fine.
And, as you said, I'm a member of pointshape.
I also hope to sharing any experiences each other.
best regards!
Edgar Lee.
e1seop@gmail.com
Can't find what you're looking for? Ask the community or share your knowledge.