Hi,
I want to get Min and Max of scalar field by simply using getCurrentInScalarField()->getMin(), but I got the access violation error. I don't know why? Please help me!
The codes:
ccPointCloud* compCloud = new ccPointCloud;
results->clone(compCloud);
ScalarType minVal_0 = compCloud->getCurrentInScalarField()->getMin();
ScalarType maxVal_0 = compCloud->getCurrentInScalarField()->getMax();
The error:
Thanks
(Solved)get Min scalar field error
(Solved)get Min scalar field error
Last edited by fblue on Thu Nov 22, 2018 9:48 am, edited 1 time in total.
Re: get Min scalar field error
Well, you must first check that the cloud has a 'IN' scalar field currently specified! (if it's not the case, the getCurrentInScalarField method will return a NULL pointer).
You may try with the currently 'displayed' scalar field also (it depends on how the cloud was generated / where it comes from).
You may try with the currently 'displayed' scalar field also (it depends on how the cloud was generated / where it comes from).
Daniel, CloudCompare admin
Re: get Min scalar field error
As you said, I try getCurrentDisplayedScalarField() and it works!! Thanks!
But what's the difference with the two?
But what's the difference with the two?
Re: (Solved)get Min scalar field error
Well, the 'current displayed' scalar field is the one selected by the user.
The current 'in' scalar field, needs to be setup by the developer (it is used mostly implicitly by algorithms of the CCLib library that access the default scalar field via the generic cloud interface).
The current 'in' scalar field, needs to be setup by the developer (it is used mostly implicitly by algorithms of the CCLib library that access the default scalar field via the generic cloud interface).
Daniel, CloudCompare admin