Beispiel #1
0
    /// <summary>
    /// Calls the Exportfunction of the Daimler hdf5 addon that all files that were imorted get exorted to the given path
    /// </summary>
    /// <param name="exportPath_inp">Export path inp.</param>
    public static void ExportHdf5_DaimlerLidar(string exportPath_inp)
    {
        sessionHandler = ReferenceHandler.Instance.GetSessionHandler();

        for (int i = 0; i < sessionHandler.Session._pointClouds.Count; i++)
        {
            var container = MetaData.Hdf5_DaimlerLidar._importedContainers[i];
            var indexToID = MetaData.Hdf5_DaimlerLidar._tableIndexToID[i];

            PointCloud        cloud     = sessionHandler.Session._pointClouds[i];
            List <GameObject> pointList = cloud._validPoints;

            string[] filePaths;
            try
            {
                filePaths = Directory.GetFiles(exportPath_inp);
            }
            catch
            {
                exportPath_inp = exportPath_inp + "//";
                Debug.Log(exportPath_inp + "is not a valid Directory => trying: " + exportPath_inp);
                filePaths = Directory.GetFiles(exportPath_inp);
            }

            exportDataPath = Path.Combine(exportPath_inp, Path.GetFileName(cloud._pathToPointCloudData));

            if (filePaths.ToList().Contains(exportDataPath))
            {
                //overwrite
                HDF5Addon.OverwriteHdf5_DaimlerLidar(i, indexToID, container, pointList, exportDataPath);
            }
            else
            {
                //create new
                HDF5Addon.CreateNewHdf5File_DaimlerLidar(i, indexToID, container, pointList, exportDataPath);
            }
            Debug.Log("hdf5-Files exported to " + exportDataPath);
        }
    }
Beispiel #2
0
    public static List <PointCloud> ImportHdf5_DaimlerLidar(string loadPath_inp)
    {
        List <PointCloud> pointClouds_out = new List <PointCloud>();
        List <List <InternalDataFormat> > listOfDataLists = new List <List <InternalDataFormat> >();
        List <string> paths = new List <string>();
        Quaternion    hdf5ToUnityCS_Rotation  = Quaternion.Euler(-90, -90, 0);
        Vector3       hdf5ToUnityCS_Mirroring = new Vector3(-1, 1, 1);

        listOfDataLists = HDF5Addon.ReadHdf5_DaimlerLidar(loadPath_inp, ref paths);
        Debug.Log("List of read Data: " + listOfDataLists.Count);

        for (int i = 0; i < listOfDataLists.Count; i++)
        {
            GroundPointSegmentation.SetGroundLabels(listOfDataLists.ElementAt(i));
        }

        for (int i = 0; i < listOfDataLists.Count; i++)
        {
            pointClouds_out.Add(new PointCloud(listOfDataLists[i], paths[i], hdf5ToUnityCS_Rotation, hdf5ToUnityCS_Mirroring));
            //pointClouds_out.Add(new PointCloud(listOfDataLists[i], paths[i], Quaternion.Euler(0, 0, 0), Vector3.one));
        }

        return(pointClouds_out);
    }