Autodesk ObjectARX
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I think you are confused by the abstract class declaration. The fact that its members are pure virtual does not mean you can't call them. You should be able to call IAcPcDataBuffer::size() to get the number of points in the buffer each time your IAcPcPointProcessor::filter() and IAcPcPointProcessor:: processPoints() functions are called.
Owen Wengerd
ManuSoft
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
What I tried to do was
Acad::ErrorStatus err = acdbProcessPointCloudData(pEntity, boundingBox, 100, ptProc); IAcPcDataBuffer* buf = ptProc->buffer(); DWORD size = buf->size();
This resulted in a runtime error.
I tried what you mentioned and put in the finished() as well as the processPoints()
DWORD size = this->buffer()->size();
and was OK.
In the finished() function it was 0 size array but in every processPoints() function call there was 1 million Pts which makes sense.
This makes things a bit more clear now. The buffer is allocated and deallocated after iteration so accessing the buffer as I did (when the call has ended) is not possible as its deallocated already. What helped me understand is that in the finished() function the array was 0 size. Pretty much if I want to do anything with the points I need to keep/store them somewhere else and do that in the processPoints().
Thank you for you help !
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I'm not sure why you are accessing the data in the finished() function. That function is for you to signal to the processor that you are finished processing. Also, you should never dereference the data pointer without first checking that it isn't NULL.
Owen Wengerd
ManuSoft
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
No reason really !
I was just trying to understand what was going on with the buffer.
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hm one more question if I may.
I actually set a proper query and I see something weird I think.
Just to confirm some things before going on here is some info for my point cloud entity from Acad
AcDbExtents boundBox;
pEntity->getGeomExtents(boundBox);
// min Value {x=704669.92000000004 y=5751465.0200000005 z=115.55000000000000 }
// max value {x=704680.00000000000 y=5755356.0000000000 z=160.00000000000000 }So I set as my search
// set bounding box for query AcGePoint3d ptmin(704669.0, 5755340.0, 0); AcGePoint3d ptmax(704680.0, 5755356.0, 160); const AcDbExtents boundingBox( ptmin, ptmax);
The returned buffer size was 175108 which makes sense for a converted LAS file.
When I access the points by
AcPcPointFloat* pt = this->buffer()->floatPoints();
the all are like this
0x0000000040940040 {m_x=-11470.385 m_y=1847.1350 m_z=-41.020000 ...}
This is definitely not in the extents that I am queryin for. Any idea ? Am i doing something wrong ?
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
It looks like you are assuming the points are in float format. Call nativeDbl() first to check the format, or call floatPoint() instead to get individual points if you want them in float format.
Owen Wengerd
ManuSoft
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
This time I actually had tested that ![]()
The this->buffer()->doublePoints(); was returning NULL and this is what the documentation says while also the nativeDbl is false.
Both calls to floatPoint and doublePoint return the exact same coordinates !
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Did you notice the comments for the offset() and entityTransform() functions?
Owen Wengerd
ManuSoft
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Mhm I did not apply that transformation ...
I just tried it though and it seems that the matrix is just identity though so no difference.
AcPcPointFloat* pt = this->buffer()->floatPoints(); AcGeMatrix3d trans; bool b = this->buffer()->entityTransform(trans); AcGePoint3d tmpDBPoint(pt->m_x,pt->m_y,pt->m_z); tmpDBPoint.transformBy(trans);
I am sure that there is no offset by the way just to rule out that one as well.
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Mhm lets just forget my last statement.
Seems like the point cloud engine is doing something and there is an offset even if my insertion point is (0,0,0).
Cheers !


