Search in sources :

Example 1 with BigDogArray_I32

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;
}
Also used : Point3D_F32(georegression.struct.point.Point3D_F32) Point3dRgbI_F64(boofcv.struct.Point3dRgbI_F64) BigDogArray_I32(org.ddogleg.struct.BigDogArray_I32) DogArray(org.ddogleg.struct.DogArray)

Aggregations

Point3dRgbI_F64 (boofcv.struct.Point3dRgbI_F64)1 Point3D_F32 (georegression.struct.point.Point3D_F32)1 BigDogArray_I32 (org.ddogleg.struct.BigDogArray_I32)1 DogArray (org.ddogleg.struct.DogArray)1