use of org.ddogleg.struct.BigDogArray_I32 in project BoofCV by lessthanoptimal.
the class PointCloudViewerSwing method copyCloud.
@Override
public DogArray<Point3dRgbI_F64> copyCloud(@Nullable DogArray<Point3dRgbI_F64> copy) {
if (copy == null)
copy = new DogArray<>(Point3dRgbI_F64::new);
else
copy.reset();
DogArray<Point3dRgbI_F64> _copy = copy;
// See if it has color information on the points or not
final PackedArray<Point3D_F32> cloudXyz = panel.getCloudXyz();
final BigDogArray_I32 cloudColor = panel.getCloudColor();
synchronized (cloudXyz) {
if (cloudXyz.size() == cloudColor.size) {
cloudXyz.forIdx(0, cloudXyz.size(), (idx, point) -> _copy.grow().setTo(point.x, point.y, point.z, cloudColor.get(idx)));
} else {
cloudXyz.forIdx(0, cloudXyz.size(), (idx, point) -> _copy.grow().setTo(point.x, point.y, point.z));
}
}
return copy;
}
Aggregations