ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

extract point data through traverseAllPointData by using spatial filtering.

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
dreamtnsrnd1
835 Views, 2 Replies

extract point data through traverseAllPointData by using spatial filtering.

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.

 

Edgar Lee
2 REPLIES 2
Message 2 of 3
kubitTilo
in reply to: dreamtnsrnd1

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 Smiley Wink




Tilo Pfliegner
Message 3 of 3
dreamtnsrnd1
in reply to: kubitTilo

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

 

 

 

 

 

Edgar Lee

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost