Ejemplo n.º 1
0
        public static PatchHierarchyInfo FromXmlFile(PatchHierarchyXML ph)
        {
            var patchHierarchyInfo = new PatchHierarchyInfo();

            patchHierarchyInfo.AvgGeometrySizes = ph.AverageGeometrySizes;

            patchHierarchyInfo.AcquisitionDate = ph.AcquisitionDate;
            patchHierarchyInfo.TagList         = ph.TagList;
            patchHierarchyInfo.RootPatch       = ph.RootPatchName;

            patchHierarchyInfo.AvgPixelSizes = (new ImagePyramidXML(ph.OpcPaths)).AveragePixelSizes;

            patchHierarchyInfo.PatchTree = ph.PatchTree;

            return(patchHierarchyInfo);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns OpcPaths with all paths created from a given OPC folder.
        /// This involves Loading of a PatchHierarchyInfo cache from disk. If the cache does not
        /// exist RootPatchName is read from xml.
        /// </summary>
        public static OpcPaths FullPathsFrom(string baseDirectory)
        {
            var paths         = new OpcPaths(baseDirectory);
            var rootPatchName = string.Empty;

            //get RootPatchName from cache file or read from xml
            if (StorageConfig.FileExists(paths.CachedPatchHierarchyPath))
            {
                var info = Load.As <PatchHierarchyInfo>(paths.CachedPatchHierarchyPath);
                rootPatchName = info.RootPatch;
            }
            else
            {
                rootPatchName = PatchHierarchyXML.From(baseDirectory).RootPatchName;
            }

            Requires.NotEmpty(rootPatchName, "RootPatchName could not be retrieved");

            paths.SetRootPatchName(rootPatchName);

            return(paths);
        }