diff --git a/3rdPartyLICENSES/Hack-Regular.LICENCE.txt b/3rdPartyLICENSES/Hack-Regular.LICENCE.txt
new file mode 100644
index 00000000..7c475e1a
--- /dev/null
+++ b/3rdPartyLICENSES/Hack-Regular.LICENCE.txt
@@ -0,0 +1,45 @@
+The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License
+
+The work in the DejaVu project was committed to the public domain.
+
+Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
+
+### MIT License
+
+Copyright (c) 2018 Source Foundry Authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+### BITSTREAM VERA LICENSE
+
+Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
+
+The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
+
+The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
+
+This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
+
+The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.
\ No newline at end of file
diff --git a/Build.fs b/Build.fs
index 3b12a7f3..3a9647f3 100644
--- a/Build.fs
+++ b/Build.fs
@@ -93,7 +93,7 @@ Target.create "AddNativeResources" (fun _ ->
let binDirs =
(
- dirs "bin" "(^netcoreapp.*$)|(^net4.*$)|(^net5.0$)|^Debug$|^Release$" SearchOption.AllDirectories
+ dirs "bin" "(^netcoreapp.*$)|(^net4.*$)|(^net5.0$)|(^net6.0$)|^Debug$|^Release$" SearchOption.AllDirectories
|> Array.toList
)
@@ -128,7 +128,7 @@ Target.create "AddNativeResources" (fun _ ->
()
)
-let outDirs = [ @"bin\Debug\netcoreapp3.1"; @"bin\Release\netcoreapp3.1"; @"bin\Release\net5.0"; @"bin\Debug\net5.0"; ]
+let outDirs = [ @"bin\Debug\net6.0"; @"bin\Release\net6.0"; @"bin\Release\net5.0"; @"bin\Debug\net5.0"; ]
let resources =
[
//"lib\Dependencies\PRo3D.Base\windows"; // currently handled by native dependency injection mechanism
@@ -341,7 +341,7 @@ Target.create "CopyToElectron" (fun _ ->
if System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX) then
"src/PRo3D.Viewer/PRo3D.Viewer.fsproj" |> DotNet.publish (fun o ->
{ o with
- Framework = Some "net5.0"
+ Framework = Some "net6.0"
Runtime = Some "osx-x64"
Common = { o.Common with CustomParams = Some "-p:InPublish=True -p:DebugType=None -p:DebugSymbols=false -p:BuildInParallel=false" }
//SelfContained = Some true // https://github.com/dotnet/sdk/issues/10566#issuecomment-602111314
@@ -355,7 +355,7 @@ Target.create "CopyToElectron" (fun _ ->
else
"src/PRo3D.Viewer/PRo3D.Viewer.fsproj" |> DotNet.publish (fun o ->
{ o with
- Framework = Some "net5.0"
+ Framework = Some "net6.0"
Runtime = Some "win10-x64"
Common = { o.Common with CustomParams = Some "-p:PublishSingleFile=false -p:InPublish=True -p:DebugType=None -p:DebugSymbols=false -p:BuildInParallel=false" }
Configuration = DotNet.BuildConfiguration.Release
diff --git a/CREDITS.MD b/CREDITS.MD
index b8b1dca9..2c55d407 100644
--- a/CREDITS.MD
+++ b/CREDITS.MD
@@ -17,6 +17,7 @@
- FShade
- FSharp
- GLSLang
+ - Hack-Regular.LICENCE
- ImageSharp
- InstrumentDLL
- jQuery
@@ -1644,6 +1645,56 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\****************************************************************************/
```
+## Hack-Regular.LICENCE
+
+
+```The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License
+
+The work in the DejaVu project was committed to the public domain.
+
+Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
+
+### MIT License
+
+Copyright (c) 2018 Source Foundry Authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+### BITSTREAM VERA LICENSE
+
+Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
+
+The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
+
+The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
+
+This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
+
+The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.
+```
+
## ImageSharp
diff --git a/README.md b/README.md
index 3f23df52..02e69082 100644
--- a/README.md
+++ b/README.md
@@ -65,10 +65,10 @@ Demo data and the pre-built application versions can be found on our [Github Rel
for contributions and when compiling from source windows is the recommended platform but it can be run on osx with .net 5.0 as well.
-* install [dotnet 6.0 sdk and dotnet 5.0 sdk](https://dotnet.microsoft.com/download)
-* `git clone git@github.com:vrvis/PRo3D.git`
+* install [dotnet 6.0 sdk](https://dotnet.microsoft.com/download)
+* `git clone git@github.com:pro3d-space/PRo3D.git`
* run `build.cmd` or `./build.sh`
-* `dotnet run --project src/PRo3D.Viewer/PRo3D.Viewer.fsproj` or open `/src/PRo3D.sln` with Visual Studio 2019
+* `dotnet run --project src/PRo3D.Viewer/PRo3D.Viewer.fsproj` or open `/src/PRo3D.sln` with Visual Studio 2022
A reconstruction of the Cape Desire outcrop at the rim of Victoria crater can be found [here](http://download.vrvis.at/realtime/PRo3D/CapeDesire/Cape_Desire_RGB.zip). For loading the data please watch the video-based introduction to PRo3D can be found in the [Getting Started](http://www.pro3d.space/#started) section of [PRo3D.space](http://www.pro3d.space)
diff --git a/aardium/CREDITS.MD b/aardium/CREDITS.MD
index b8b1dca9..2c55d407 100644
--- a/aardium/CREDITS.MD
+++ b/aardium/CREDITS.MD
@@ -17,6 +17,7 @@
- FShade
- FSharp
- GLSLang
+ - Hack-Regular.LICENCE
- ImageSharp
- InstrumentDLL
- jQuery
@@ -1644,6 +1645,56 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\****************************************************************************/
```
+## Hack-Regular.LICENCE
+
+
+```The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License
+
+The work in the DejaVu project was committed to the public domain.
+
+Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
+
+### MIT License
+
+Copyright (c) 2018 Source Foundry Authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+### BITSTREAM VERA LICENSE
+
+Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
+
+The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
+
+The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
+
+This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
+
+The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.
+```
+
## ImageSharp
diff --git a/aardium/main.js b/aardium/main.js
index a05e73c6..a7c53410 100644
--- a/aardium/main.js
+++ b/aardium/main.js
@@ -396,7 +396,10 @@ function ready() {
var args = process.argv;
args.shift();
- const WINDOW_WIDTH = 640;
+
+
+
+ const WINDOW_WIDTH = 640;
const WINDOW_HEIGHT = 300;
//Definindo centro da tela principal
@@ -423,19 +426,24 @@ function ready() {
splash.show()
console.log('showed.')
-
- const runningProcess = proc.spawn(p, ["--server"].concat(args));
- console.log('spawned.' + ["--server"].concat(args))
- const rx = /.*url:[ \t]+(.*)/;
+ const rx = /.*url:[ \t]+(.*)/;
var spawned = false;
- var sendLog = function(){
+ var buffer = "";
+ var sendLog = function(s){
+ var data = JSON.parse(s);
+ if(data.text != undefined) {
+ buffer = buffer.concat("\n", data.text);
+ }
};
const server =
ws.createServer(function (conn) {
conn.on("error", function() { console.warn("err");});
+ conn.send(JSON.stringify({type: "stdout", text: buffer }));
+ buffer = "";
+
sendLog = function(data) {
// ignore otherwise
if(conn.readyState == conn.OPEN)
@@ -447,6 +455,8 @@ function ready() {
const logging = new BrowserWindow({
width: 500,
height: 400,
+ x: 100,
+ y: 100,
frame: true,
title: "PRo3D Log",
webPreferences : {
@@ -461,16 +471,22 @@ function ready() {
server.close();
})
+
- runningProcess.stderr.on("data", (data) => {
+ const runningProcess = proc.spawn(p, ["--server"].concat(args));
+ console.log('spawned.' + ["--server"].concat(args))
+
+ runningProcess.stderr.on("data", (data) => {
+ console.log("err: " + data);
sendLog(JSON.stringify({type: "stderr", text: data.toString() }));
});
runningProcess.stdout.on("data", (data) => {
+ console.log("log: " + data);
if(spawned){
- console.log("log: " + data);
- sendLog(JSON.stringify({type: "stdout", text: data.toString() }));
+ sendLog(JSON.stringify({type: "stdout", text: data.toString() }));
}
else{
+ sendLog(JSON.stringify({type: "stdout", text: data.toString() }));
const m = data.toString().match(rx);
if (m) {
console.log('matched.' + data)
@@ -481,6 +497,7 @@ function ready() {
}
}
});
+
// Quit when all windows are closed.
app.on('window-all-closed', function () {
diff --git a/aardium/preload.js b/aardium/preload.js
index ae2d121d..8cbdf8c0 100644
--- a/aardium/preload.js
+++ b/aardium/preload.js
@@ -74,4 +74,5 @@ aardvark.captureFullscreen = function(path)
{
aardvark.electron.remote.require('fs').writeFile(path, e.toPNG());
});
-};
\ No newline at end of file
+};
+
diff --git a/build.fsx b/build.fsx
deleted file mode 100644
index bd289af1..00000000
--- a/build.fsx
+++ /dev/null
@@ -1,374 +0,0 @@
-#load "./.paket/load/net6.0/build/build.group.fsx"
-#load @"paket-files/build/aardvark-platform/aardvark.fake/DefaultSetup.fsx"
-
-open System
-open System.IO
-open System.Diagnostics
-open Aardvark.Fake
-open Fake.Core
-open Fake.Core.TargetOperators
-open Fake.Tools
-open Fake.IO.Globbing.Operators
-open System.Runtime.InteropServices
-open Fake.DotNet
-
-open Fake.IO
-open Fake.Api
-open Fake.Tools.Git
-
-open System.IO.Compression
-
-do // init fake
- let args = System.Environment.GetCommandLineArgs() |> Array.toList |> List.skip 2
- let ctx = Context.FakeExecutionContext.Create false "build.fsx" args
- Context.setExecutionContext (Context.RuntimeContext.Fake ctx)
- Target.initEnvironment()
-
-
-do Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
-
-let notes = ReleaseNotes.load "RELEASE_NOTES.md"
-printfn "%A" notes
-
-let outDirs = [ @"bin\Debug\netcoreapp3.1"; @"bin\Release\netcoreapp3.1"; @"bin\Release\net5.0"; @"bin\Debug\net5.0"; ]
-let resources =
- [
- //"lib\Dependencies\PRo3D.Base\windows"; // currently handled by native dependency injection mechanism
- //"lib/groupmappings"
- //"./lib/Native/JR.Wrappers/mac/"
- ]
-
-
-let copyResources outDirs =
- for r in resources do
- for outDir in outDirs do
- if Directory.Exists outDir then
- if Path.isDirectory r then
- printfn "copying dir %s => %s" r outDir
- Shell.copyDir outDir r (fun _ -> true)
- else
- printfn "copying file %s => %s" r outDir
- Shell.copyFile outDir r
-
-Target.create "CopyResources" (fun _ ->
- copyResources outDirs
-)
-
-let solutionName = "src/PRo3D.sln"
-DefaultSetup.install [solutionName]
-
-"Compile" ==> "CopyResources" ==> "AddNativeResources" |> ignore
-
-Target.create "Credits" (fun _ ->
- let allLicences =
- seq {
- yield! Directory.EnumerateFiles("3rdPartyLICENSES/","*.txt")
- yield! Directory.EnumerateFiles("3rdPartyLICENSES/","*.md")
- }
- let template = File.ReadAllText "3rdPartyLICENSES/CreditsTemplate"
-
- let summary = allLicences |> Seq.map Path.GetFileNameWithoutExtension
-
- let normalizeName (s : string) = s.Replace("-LICENSE","").Replace("_LICENSE","").Replace("_",".")
-
- let credits =
- template.Replace("__PACKAGES__", summary
- |> Seq.map (normalizeName >> sprintf " - %s")
- |> String.concat Environment.NewLine)
- printfn "%s" credits
-
- let licences =
- allLicences
- |> Seq.map (fun file ->
- if Path.GetExtension file = ".md" then
- sprintf "## %s\n\n\n```%s\n```\n" (file |> Path.GetFileNameWithoutExtension |> normalizeName) (File.ReadAllText file)
- else
- sprintf "## %s\n\n\n```%s\n```\n" (file |> Path.GetFileNameWithoutExtension |> normalizeName) (File.ReadAllText file))
- |> String.concat System.Environment.NewLine
-
- let credits = credits.Replace("__LICENCES__", licences)
-
- File.WriteAllText("CREDITS.MD", credits)
-)
-
-
-let r = System.Text.RegularExpressions.Regex("let viewerVersion.*=.*\"(.*)\"")
-let test = """let viewerVersion = "3.1.3" """
-
-(*let getInstalledPackageVersions() =
- //Build Fake.DotNet.Cli - 5.19.1
- let regex = Regex @"^([a-zA-Z_0-9]+)[ \t]*([^ ]+)[ \t]*-[ \t]*(.+)$"
-
- let paketPath =
- if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then @".paket/paket.exe"
- else ".paket/paket"
-
- let paketPath = System.IO.Path.GetFullPath paketPath
- let startInfo = new ProcessStartInfo()
- startInfo.FileName <- paketPath
- startInfo.Arguments <- "show-installed-packages"
- startInfo.UseShellExecute <- false
- startInfo.CreateNoWindow <- true
- startInfo.RedirectStandardOutput <- true
- startInfo.RedirectStandardError <- true
-
- let proc = Process.Start(startInfo)
- proc.WaitForExit()
-
- let mutable res = Map.empty
-
- if proc.ExitCode = 0 then
- while not proc.StandardOutput.EndOfStream do
- let line = proc.StandardOutput.ReadLine()
- let m = regex.Match line
- if m.Success then
- let g = m.Groups.[1].Value.Trim().ToLower()
- match g with
- | "main" ->
- let n = m.Groups.[2].Value
- let v = m.Groups.[3].Value |> SemVer.parse
- res <- Map.add n v res
- | _ ->
- ()
-
- res
- *)
-
-let aardiumVersion = "2.0.5"
- //let versions = getInstalledPackageVersions()
- //match Map.tryFind "Aardium" versions with
- //| Some v -> v
- //| None -> failwith "no aardium version found"
-
-
-Target.create "test" (fun _ ->
- let url = sprintf "https://www.nuget.org/api/v2/package/Aardium-Win32-x64/%s" aardiumVersion
- printf "url: %s" url
- let tempFile = Path.GetTempFileName()
- use c = new System.Net.WebClient()
- c.DownloadFile(url, tempFile)
- use a = new ZipArchive(File.OpenRead tempFile)
- let t = Path.GetTempPath()
- let tempPath = Path.Combine(t, Guid.NewGuid().ToString())
- a.ExtractToDirectory(tempPath)
- let target = Path.Combine("bin", "publish")
- Shell.copyDir (Path.Combine(target,"tools")) (Path.Combine(tempPath,"tools")) (fun _ -> true)
-)
-
-Target.create "Publish" (fun _ ->
-
- // 0.0 copy version over into source code...
- let programFs = File.ReadAllLines "src/PRo3D.Viewer/Program.fs"
- let patched =
- programFs
- |> Array.map (fun line ->
- if line.StartsWith "let viewerVersion" then
- sprintf "let viewerVersion = \"%s\"" notes.NugetVersion
- else line
- )
- File.WriteAllLines("src/PRo3D.Viewer/Program.fs", patched)
-
- if Directory.Exists "bin/publish" then
- Directory.Delete("bin/publish", true)
-
- // 1. publish exe
- "src/PRo3D.Viewer/PRo3D.Viewer.fsproj" |> DotNet.publish (fun o ->
- { o with
- Framework = Some "net5.0"
- Runtime = Some "win10-x64" //-p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true
- Common = { o.Common with CustomParams = Some "-p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true -p:InPublish=True -p:DebugType=None -p:DebugSymbols=false -p:BuildInParallel=false" }
- //SelfContained = Some true // https://github.com/dotnet/sdk/issues/10566#issuecomment-602111314
- Configuration = DotNet.BuildConfiguration.Release
- VersionSuffix = Some notes.NugetVersion
- OutputPath = Some "bin/publish/win-x64"
- }
- )
-
- // 1. publish exe
- "src/PRo3D.Viewer/PRo3D.Viewer.fsproj" |> DotNet.publish (fun o ->
- { o with
- Framework = Some "net5.0"
- Runtime = Some "osx-x64"
- Common = { o.Common with CustomParams = Some "-p:InPublish=True -p:DebugType=None -p:DebugSymbols=false -p:BuildInParallel=false" }
- //SelfContained = Some true // https://github.com/dotnet/sdk/issues/10566#issuecomment-602111314
- Configuration = DotNet.BuildConfiguration.Release
- VersionSuffix = Some notes.NugetVersion
- OutputPath = Some "bin/publish/mac-x64"
- }
- )
-
-
- // 1.1, copy most likely missing c++ libs, currently no reports of missing runtime libs
- //for dll in Directory.EnumerateFiles("data/runtime", "*.dll") do
- // let fileName = Path.GetFileName dll
- // let target = Path.Combine("bin/publish/",fileName)
- // Fake.Core.Trace.logfn "copying: %s -> %s" dll target
- // File.Copy(dll, Path.Combine("bin/publish/",fileName))
-
- // 2, copy licences
- File.Copy("CREDITS.MD", "bin/publish/win-x64/CREDITS.MD", true)
- File.Copy("CREDITS.MD", "bin/publish/mac-x64/CREDITS.MD", true)
-
- File.Copy("data/runtime/vcruntime140.dll", "bin/publish/win-x64/vcruntime140.dll")
- File.Copy("data/runtime/vcruntime140_1.dll", "bin/publish/win-x64/vcruntime140_1.dll")
- File.Copy("data/runtime/msvcp140.dll", "bin/publish/win-x64/msvcp140.dll")
-
- // 3, resources (currently everything included)
- // copyResources ["bin/publish"]
-
- if System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX) then ()
- else
- let url = sprintf "https://www.nuget.org/api/v2/package/Aardium-Win32-x64/%s" aardiumVersion
- printf "url: %s" url
- let tempFile = Path.GetTempFileName()
- use c = new System.Net.WebClient()
- c.DownloadFile(url, tempFile)
- use a = new ZipArchive(File.OpenRead tempFile)
- let t = Path.GetTempPath()
- let tempPath = Path.Combine(t, Guid.NewGuid().ToString())
- a.ExtractToDirectory(tempPath)
- let target = Path.Combine("bin", "publish")
- Shell.copyDir (Path.Combine(target, "mac-x64", "tools")) (Path.Combine(tempPath, "tools")) (fun _ -> true)
- Shell.copyDir (Path.Combine(target, "win-x64", "tools")) (Path.Combine(tempPath, "tools")) (fun _ -> true)
-
- File.Move("bin/publish/win-x64/PRo3D.Viewer.exe", sprintf "bin/publish/win-x64/PRo3D.Viewer.%s.exe" notes.NugetVersion)
-)
-
-"Credits" ==> "Publish"
-
-
-Target.create "CompileDebug" (fun _ ->
- let cfg = "Debug" //if config.debug then "Debug" else "Release"
-
- let tag =
- try
- let tag = getGitTag()
- let assemblyVersion = NugetInfo.assemblyVersion tag
- Some (tag, assemblyVersion)
- with _ -> None
-
- let props =
- [
- yield "Configuration", cfg
- match tag with
- | Some (tag, assemblyVersion) ->
- yield "AssemblyVersion", assemblyVersion
- yield "AssemblyFileVersion", assemblyVersion
- yield "InformationalVersion", assemblyVersion
- yield "ProductVersion", assemblyVersion
- yield "PackageVersion", tag
- | _ -> ()
- ]
-
- solutionName |> DotNet.build (fun o ->
- { o with
- NoRestore = true
- Configuration = DotNet.BuildConfiguration.Debug
- MSBuildParams =
- { o.MSBuildParams with
- Properties = props
- DisableInternalBinLog = true
- }
- }
- )
-)
-
-Target.create "CompileInstruments" (fun _ ->
- let cfg = "Debug" //if config.debug then "Debug" else "Release"
-
- let tag =
- try
- let tag = getGitTag()
- let assemblyVersion = NugetInfo.assemblyVersion tag
- Some (tag, assemblyVersion)
- with _ -> None
-
- let props =
- [
- yield "Configuration", cfg
- match tag with
- | Some (tag, assemblyVersion) ->
- yield "AssemblyVersion", assemblyVersion
- yield "AssemblyFileVersion", assemblyVersion
- yield "InformationalVersion", assemblyVersion
- yield "ProductVersion", assemblyVersion
- yield "PackageVersion", tag
- | _ -> ()
- ]
-
- "src/InstrumentPlatforms/JR.Wrappers.sln"|> DotNet.build (fun o ->
- { o with
- NoRestore = false
- Configuration = DotNet.BuildConfiguration.Debug
- MSBuildParams =
- { o.MSBuildParams with
- Properties = props
- DisableInternalBinLog = true
- }
- }
- )
-
- "src/InstrumentPlatforms/JR.Wrappers.sln"|> DotNet.build (fun o ->
- { o with
- NoRestore = false
- Configuration = DotNet.BuildConfiguration.Release
- MSBuildParams =
- { o.MSBuildParams with
- Properties = props
- DisableInternalBinLog = true
- }
- }
- )
-
-)
-
-
-Target.create "CopyJRWRapper" (fun _ ->
- File.Copy("bin/Debug/netstandard2.0/JR.Wrappers.dll", "lib/JR.Wrappers.dll", true)
-)
-
-
-
-"CompileInstruments" ==> "AddNativeResources"
-"AddNativeResources" ==> "CopyJRWrapper" ==> "Publish"
-
-
-
-Target.create "GitHubRelease" (fun _ ->
- let newVersion = notes.NugetVersion
- try
- try
- Branches.tag "." newVersion
- let token =
- match Environment.environVarOrDefault "github_token" "" with
- | s when not (System.String.IsNullOrWhiteSpace s) -> s
- | _ -> failwith "please set the github_token environment variable to a github personal access token with repro access."
-
- //let files = System.IO.Directory.EnumerateFiles("bin/publish")
- let release = sprintf "bin/PRo3D.Viewer.%s.zip" notes.NugetVersion
- let z = System.IO.Compression.ZipFile.CreateFromDirectory("bin/publish/win-x64", release)
-
- GitHub.createClientWithToken token
- |> GitHub.draftNewRelease "vrvis" "PRo3D" notes.NugetVersion (notes.SemVer.PreRelease <> None) notes.Notes
- |> GitHub.uploadFiles (Seq.singleton release)
- //|> GitHub.publishDraft
- |> Async.RunSynchronously
- |> ignore
- with e ->
- Branches.deleteTag "." newVersion
- finally
- ()
- //Branches.pushTag "." "origin" newVersion
-
-)
-
-
-
-#if DEBUG
-do System.Diagnostics.Debugger.Launch() |> ignore
-#endif
-
-"Publish" ==> "GithubRelease"
-
-entry()
-
diff --git a/legacy/Aardvark.Opc/Aardvark.Opc.csproj b/legacy/Aardvark.Opc/Aardvark.Opc.csproj
deleted file mode 100644
index f21e8093..00000000
--- a/legacy/Aardvark.Opc/Aardvark.Opc.csproj
+++ /dev/null
@@ -1,1032 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.30729
- 2.0
- {9000D727-3B4F-4F3E-916E-735E3A78E532}
- Library
- Properties
- Aardvark.Opc
- Aardvark.Opc
- v4.7.1
- 512
-
- ..\..\Solutions\
- true
-
-
-
-
- true
- full
- false
- WARNING, Do not change manually, is changed by Aardvark's MSBuildCleaner
- DEBUG;TRACE
- prompt
- 4
- AllRules.ruleset
- false
-
-
- pdbonly
- true
- WARNING, Do not change manually, is changed by Aardvark's MSBuildCleaner
- TRACE
- prompt
- 4
- AllRules.ruleset
- false
-
-
-
-
-
- False
- ..\..\BinPrebuilt\Release\x64\SlimDX.dll
-
-
-
- 3.5
-
-
-
-
- False
- ..\..\Packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll
- True
-
-
- False
- ..\..\Packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll
- True
-
-
-
- False
- ..\..\Packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll
- True
-
-
- False
- ..\..\Packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll
- True
-
-
- False
- ..\..\Packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll
- True
-
-
- False
- ..\..\Packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll
- True
-
-
-
-
- 3.5
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
- True
- Resources.resx
-
-
-
-
-
-
- {FC6B2005-B20D-4342-A973-F62FEA18F1A3}
- Aardvark.Algodat.Convertibles
-
-
- {EF27DA5E-0B38-4184-B8D4-15B6D10BCA10}
- Aardvark.Algodat.Points
-
-
- {E60CBB93-7847-437B-AA02-61A6241F7452}
- Aardvark.Algodat.Rendering
-
-
- {377da721-c821-45f6-b803-9c8724c7b37f}
- Aardvark.Base
-
-
- {D60A7E49-BA49-4256-9285-57F916C31684}
- Aardvark.Control
-
-
- {36E3FBC0-4742-4A5A-8EFC-CB76A3C391EF}
- Aardvark.DebugTools
-
-
- {31B2CBA7-C3A4-4D58-B3EE-C3C3C9FE8AD4}
- Aardvark.Lod
-
-
- {4b4c6b5f-a44e-41b5-b985-033ac23d3958}
- Aardvark.VRVis.Base
-
-
- {2cb9e062-0048-41f2-ace3-6b3bf01da052}
- Aardvark.VRVis.Geometry
-
-
- {61baa8c5-bdd5-4689-a9d0-475d45249f97}
- Aardvark.VRVis.Images
-
-
- {9BA25713-B1A9-41D5-8E23-8450F52EB306}
- Aardvark.Algodat.Images
-
-
- {E7B169D6-913C-43CB-B8E4-FCBF27989380}
- Aardvark.Runtime.IO
-
-
- {1EE33AD8-8832-482E-9BC6-2FCBAAC38E2E}
- Aardvark.Runtime.Kernel
-
-
- {23BCB484-7C50-4A88-B214-BFF2785E3615}
- Aardvark.Parser.Aara
-
-
- {7924D430-28E4-4765-8688-ACBCB6CA9A34}
- Aardvark.Rendering.SlimDx
-
-
- {B7EF7131-1C8F-45C8-8725-EF9D0937FD38}
- Aardvark.Algodat.Base
-
-
- {E6465D68-14F2-4700-89EB-0D7B6F8227EF}
- Aardvark.Algodat.Geometry
-
-
- {3F6BB612-53F1-4F7B-9BFE-CDA3396B9316}
- Aardvark.Runtime.Base
-
-
- {F5A9E328-7BBB-401A-A1B2-10B92E715EAD}
- Aardvark.SceneGraph.Base
-
-
- {7D896D1A-22EC-44F9-BBAE-3D3B0F8BC338}
- Aardvark.SceneGraph.Core
-
-
- {B774779C-6C17-4260-BBBD-E986140331A2}
- Aardvark.SceneGraph.Interaction
-
-
- {DFD0EB4A-C8DA-4DA8-947D-4D7139A15305}
- Aardvark.SceneGraph.Rules
-
-
-
-
- PublicResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
-
-
-
-
- $(SolutionDir)\Aardvark.targets
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
-
- ..\..\packages\build\BlackFox.VsWhere\lib\netstandard2.0\BlackFox.VsWhere.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Api.GitHub\lib\netstandard2.0\Fake.Api.GitHub.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.CommandLineParsing\lib\netstandard2.0\Fake.Core.CommandLineParsing.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Context\lib\netstandard2.0\Fake.Core.Context.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Environment\lib\netstandard2.0\Fake.Core.Environment.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.FakeVar\lib\netstandard2.0\Fake.Core.FakeVar.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Process\lib\netstandard2.0\Fake.Core.Process.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.ReleaseNotes\lib\netstandard2.0\Fake.Core.ReleaseNotes.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.SemVer\lib\netstandard2.0\Fake.Core.SemVer.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.String\lib\netstandard2.0\Fake.Core.String.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Target\lib\netstandard2.0\Fake.Core.Target.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Tasks\lib\netstandard2.0\Fake.Core.Tasks.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Trace\lib\netstandard2.0\Fake.Core.Trace.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Xml\lib\netstandard2.0\Fake.Core.Xml.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.DotNet.Cli\lib\netstandard2.0\Fake.DotNet.Cli.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.DotNet.MSBuild\lib\netstandard2.0\Fake.DotNet.MSBuild.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.DotNet.NuGet\lib\netstandard2.0\Fake.DotNet.NuGet.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.IO.FileSystem\lib\netstandard2.0\Fake.IO.FileSystem.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Net.Http\lib\netstandard2.0\Fake.Net.Http.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Tools.Git\lib\netstandard2.0\Fake.Tools.Git.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Farmer\lib\netstandard2.0\Farmer.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\FParsec\lib\netstandard2.0\FParsec.dll
- True
- True
-
-
- ..\..\packages\build\FParsec\lib\netstandard2.0\FParsecCS.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\FSharp.Control.Reactive\lib\net6.0\FSharp.Control.Reactive.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\FSharp.Core\lib\netstandard2.1\FSharp.Core.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build\lib\net6.0\Microsoft.Build.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build.Framework\lib\net6.0\Microsoft.Build.Framework.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build.Tasks.Core\lib\net6.0\Microsoft.Build.Tasks.Core.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build.Utilities.Core\lib\net6.0\Microsoft.Build.Utilities.Core.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.NET.StringTools\lib\netstandard2.0\Microsoft.NET.StringTools.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Win32.Registry\lib\netstandard2.0\Microsoft.Win32.Registry.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Win32.SystemEvents\lib\net6.0\Microsoft.Win32.SystemEvents.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.dll
- True
- True
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.Mdb.dll
- True
- True
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.Pdb.dll
- True
- True
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.Rocks.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\MSBuild.StructuredLogger\lib\netstandard2.0\StructuredLogger.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Common\lib\netstandard2.0\NuGet.Common.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Configuration\lib\netstandard2.0\NuGet.Configuration.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Frameworks\lib\netstandard2.0\NuGet.Frameworks.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Packaging\lib\net5.0\NuGet.Packaging.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Protocol\lib\net5.0\NuGet.Protocol.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Versioning\lib\netstandard2.0\NuGet.Versioning.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Octokit\lib\netstandard2.0\Octokit.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.CodeDom\lib\net6.0\System.CodeDom.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Collections.Immutable\lib\net6.0\System.Collections.Immutable.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Configuration.ConfigurationManager\lib\net6.0\System.Configuration.ConfigurationManager.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Drawing.Common\lib\net6.0\System.Drawing.Common.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Formats.Asn1\lib\net6.0\System.Formats.Asn1.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Reactive\lib\net5.0\System.Reactive.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Reflection.Metadata\lib\net6.0\System.Reflection.Metadata.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Resources.Extensions\lib\net6.0\System.Resources.Extensions.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Runtime.CompilerServices.Unsafe\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.AccessControl\lib\net6.0\System.Security.AccessControl.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.Cng\lib\netcoreapp3.0\System.Security.Cryptography.Cng.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.Pkcs\lib\net6.0\System.Security.Cryptography.Pkcs.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.ProtectedData\lib\net6.0\System.Security.Cryptography.ProtectedData.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.Xml\lib\net6.0\System.Security.Cryptography.Xml.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Permissions\lib\net6.0\System.Security.Permissions.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Principal.Windows\lib\netstandard2.0\System.Security.Principal.Windows.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Text.Encoding.CodePages\lib\net6.0\System.Text.Encoding.CodePages.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Text.Encodings.Web\lib\net6.0\System.Text.Encodings.Web.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Text.Json\lib\net6.0\System.Text.Json.dll
- True
- True
-
-
-
-
-
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
-
-
-
-
- ..\..\packages\build\System.Threading.Tasks.Dataflow\lib\net6.0\System.Threading.Tasks.Dataflow.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Windows.Extensions\lib\net6.0\System.Windows.Extensions.dll
- True
- True
-
-
-
-
-
\ No newline at end of file
diff --git a/legacy/Aardvark.Opc/Enums.cs b/legacy/Aardvark.Opc/Enums.cs
deleted file mode 100644
index eccfd3c5..00000000
--- a/legacy/Aardvark.Opc/Enums.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace Aardvark.Opc
-{
- public enum TileLayout
- {
- Single,
- Vertical,
- Horizontal,
- Full,
- Other
- }
-}
\ No newline at end of file
diff --git a/legacy/Aardvark.Opc/IndexArrayCache.cs b/legacy/Aardvark.Opc/IndexArrayCache.cs
deleted file mode 100644
index 6dbef766..00000000
--- a/legacy/Aardvark.Opc/IndexArrayCache.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using Aardvark.Base;
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-
-namespace Aardvark.Opc
-{
- public static class IndexArrayCache
- {
- static ConcurrentDictionary s_indexArrayTable;
- static ConcurrentDictionary s_triangleStripIndexArrayTable;
-
- public static int[] GetIndexArray(V2i size)
- {
- return GetIndexArray(size, null);
- }
-
- public static int[] GetIndexArray(V2i size, List invalidPoints)
- {
- if(invalidPoints != null)
- return OpcIndices.ComputeIndexArray(size, invalidPoints);
-
- if (s_indexArrayTable == null)
- {
- s_indexArrayTable = new ConcurrentDictionary();
- }
-
- lock (s_indexArrayTable)
- {
- int[] indices;
- s_indexArrayTable.TryGetValue(size, out indices);
-
- if (indices != null)
- return indices;
- else
- {
- Report.Begin("Computing Index Array Table for {0}", size);
- indices = OpcIndices.ComputeIndexArray(size, invalidPoints);
- if (!s_indexArrayTable.ContainsKey(size))
- {
- s_indexArrayTable.TryAdd(size, indices);
- }
- Report.End();
-
- return indices;
- }
- }
- }
-
- public static int[] GetTriangleStripIndexArray(V2i size)
- {
- if (s_triangleStripIndexArrayTable == null)
- {
- s_triangleStripIndexArrayTable = new ConcurrentDictionary();
- }
-
- int[] indices;
- s_triangleStripIndexArrayTable.TryGetValue(size, out indices);
-
- try
- {
- if (indices != null)
- return indices;
- else
- {
- indices = OpcIndices.ComputeTriangleStripIndexArray(size);
- s_triangleStripIndexArrayTable.TryAdd(size, indices);
-
- return indices;
- }
- }
- catch (ArgumentException)
- {
- return s_triangleStripIndexArrayTable[size];
- }
-
- //if (s_triangleStripIndexArrayTable.ContainsKey(size))
- // return s_triangleStripIndexArrayTable[size];
- //else
- //{
- // s_triangleStripIndexArrayTable.Add(size, OpcTile.ComputeTriangleStripIndexArray(size));
- // return s_triangleStripIndexArrayTable[size];
- //}
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/KdTree/KdTreeUtils.cs b/legacy/Aardvark.Opc/KdTree/KdTreeUtils.cs
deleted file mode 100644
index 9a982550..00000000
--- a/legacy/Aardvark.Opc/KdTree/KdTreeUtils.cs
+++ /dev/null
@@ -1,286 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reactive.Linq;
-using System.Reactive.Subjects;
-using System.Linq;
-using Aardvark.Runtime;
-using Aardvark.Opc.PatchHierarchy;
-using Aardvark.VRVis;
-using Aardvark.Base;
-using System.Threading;
-
-namespace Aardvark.Opc.KdTree
-{
- public static class KdTreeUtils
- {
- ///
- /// Loads level N kdtree. If level N kdtree does not exist it is built from rootpatch.
- ///
- public static KdIntersectionTree BuildOrLoadKdTreeN(OpcPaths opcPaths, PositionsType posType, PatchFileInfo patchFileInfo)
- {
- KdIntersectionTree kdiTree = null;
- var kdTreeNPatch = opcPaths.GetKdTreeNPath(posType);
- if (!StorageConfig.FileExists(kdTreeNPatch))
- {
- kdiTree = KdTreeUtils.BuildKdTreeForPatch(opcPaths.RootPatchName, -1, patchFileInfo, opcPaths, posType, saveTriangles: true);
- kdiTree.Save(opcPaths.RootPatchName);
- }
- else
- kdiTree = Load.As(opcPaths.GetKdTreeNPath(posType));
-
- return kdiTree;
- }
-
- public static void BuildKdtreeN(OpcPaths opcPaths, PositionsType posType, bool overrideExisting = false, float maxTriangleSize = float.PositiveInfinity)
- {
- var hierarchyInfo = PatchHierarchyInfo.BuildOrLoadCache(opcPaths);
- var patchInfo = hierarchyInfo.PatchTree.Info;
- opcPaths.SetRootPatchName(hierarchyInfo.RootPatch);
-
- if (posType == PositionsType.V2dPositions && !patchInfo.Has2dData)
- {
- Report.Warn("KdTreeUtils: 2d KdTreeN needs 2d data to be able to get built.");
- return;
- }
-
- if (overrideExisting || !StorageConfig.FileExists(opcPaths.GetKdTreeNPath(posType)))
- BuildKdTreeForPatch(opcPaths.RootPatchName, -1, patchInfo, opcPaths, posType, true, true, maxTriangleSize);
- }
-
- public static bool HasKdTreeForGeoResolution(OpcPaths opcPaths, double minGeometricResolution, PositionsType posType)
- {
- var hierarchyInfo = PatchHierarchyInfo.BuildOrLoadCache(opcPaths);
- var level = GetLevelFromResolution(hierarchyInfo.AvgGeometrySizes, minGeometricResolution);
- return HasKdTreeForLevel(opcPaths, level, posType, hierarchyInfo);
- }
-
- public static bool HasKdTreeForLevel(OpcPaths opcPaths, int level, PositionsType posType, PatchHierarchyInfo hierarchyInfo = null)
- {
- if (hierarchyInfo == null)
- hierarchyInfo = PatchHierarchyInfo.BuildOrLoadCache(opcPaths);
-
- opcPaths.SetRootPatchName(hierarchyInfo.RootPatch);
- var kdTreeSetPath = opcPaths.GetAggKdTreePath(level, posType);
-
- return StorageConfig.FileExists(kdTreeSetPath);
- }
-
- /// Used to select an appropriate level in the hierarchy to meet the specified minimum resolution criterion.
- /// Reports progress in increments which sum up to 1.
- public static void BuildKdTreeForGeoResolution(
- OpcPaths opcPaths, double minGeometricResolution, PositionsType posType,
- bool lazy = true, bool overrideExisting = false, IObserver progressObserver = null,
- CancellationToken cancelToken = default(CancellationToken))
- {
- var hierarchyInfo = PatchHierarchyInfo.BuildOrLoadCache(opcPaths);
- var level = GetLevelFromResolution(hierarchyInfo.AvgGeometrySizes, minGeometricResolution);
- BuildKdTreeForLevel(opcPaths, level, posType, lazy, overrideExisting, progressObserver, cancelToken, hierarchyInfo);
- }
-
- /// Selects hierarchy Level the kdtree is built of (-1 shouldn't be used, use BuildKdtreeN instead).
- /// Reports progress in increments which sum up to 1.
- public static void BuildKdTreeForLevel(
- OpcPaths opcPaths, int level, PositionsType posType,
- bool lazy = true, bool overrideExisting = false, IObserver progressObserver = null,
- CancellationToken cancelToken = default(CancellationToken), PatchHierarchyInfo hierarchyInfo = null,
- float maxTriangleSize = float.PositiveInfinity)
- {
- #region Preconditions
-
- if (hierarchyInfo == null)
- hierarchyInfo = PatchHierarchyInfo.BuildOrLoadCache(opcPaths);
-
- if (posType == PositionsType.V2dPositions && !hierarchyInfo.PatchTree.Info.Has2dData)
- {
- Report.Warn("KdTreeUtils: 2d KdTree needs 2d data to be able to get built.");
- progressObserver.OnNext(1f);
- progressObserver.OnCompleted();
- return;
- }
-
- opcPaths.SetRootPatchName(hierarchyInfo.RootPatch);
-
- var kdTreeSetPath = opcPaths.GetAggKdTreePath(level, posType);
- if (!overrideExisting && StorageConfig.FileExists(kdTreeSetPath))
- {
- progressObserver.OnNext(1f);
- progressObserver.OnCompleted();
- return;
- }
-
- #endregion
-
- hierarchyInfo.PatchTree.CreatePatchPaths(opcPaths.PatchesSubDir);
-
- // Get geometry patchinformations for certain level with a valid boundingbox
- var patchTrees = hierarchyInfo.RetrievePatchTreesOfLevel(level)
- .Where(x => !x.Info.GlobalBoundingBox.IsInvalid);
-
- IIntersectableObjectSet kdTree;
- var buildFlags =
- KdIntersectionTree.BuildFlags.Hierarchical |
- KdIntersectionTree.BuildFlags.EmptySpaceOptimization;
-
- // Decide lazy or eager
- if (lazy)
- {
- kdTree = BuildLazyKdTreeSet(patchTrees, opcPaths, level, posType, overrideExisting, progressObserver, cancelToken, maxTriangleSize);
- buildFlags |= KdIntersectionTree.BuildFlags.OptimalRaytracing;
- }
- else
- {
- kdTree = BuildConcreteKdTreeSet(patchTrees, opcPaths, level, posType, overrideExisting, progressObserver, cancelToken, maxTriangleSize);
- buildFlags |= KdIntersectionTree.BuildFlags.MediumIntersection;
- }
-
- // Save Kd-Tree
- var aggrTree = new KdIntersectionTree(kdTree, buildFlags);
- aggrTree.Save(kdTreeSetPath, waitMode: WaitMode.WaitUntilFinished);
- }
-
- public static int GetLevelFromResolution(List avgGeometrySizes, double resolution)
- {
- var level = -1;
-
- var sizes = avgGeometrySizes.ToArray();
- for (int i = 0; i < sizes.Length; i++)
- {
- if (resolution >= sizes[i])
- level = i;
- else
- break;
- }
-
- return level;
- }
-
- public static Subject GetKdTreeProgressObserver(OpcPaths opcPaths, int level, PositionsType posType)
- {
- var opcName = Path.GetFileName(opcPaths.BasePath);
- float totalProgress = 0f;
-
- var progress = new Subject();
- progress.Sample(TimeSpan.FromSeconds(1.0)).Subscribe(inc =>
- {
- totalProgress += inc;
- Report.Line("{0} - {1} - {2} - Progress {3:0.0}%",
- opcName, level, posType.ToString(), totalProgress * 100.0);
-
- //Report.ProgressDelta(tup.E1);
- });
-
- return progress;
- }
-
- #region private methods
-
- private static LazyKdTreeSet BuildLazyKdTreeSet(IEnumerable patches, OpcPaths opcPaths,
- int level, PositionsType posType, bool overrideExisting, IObserver progressObserver, CancellationToken cancelToken = default(CancellationToken),
- float maxTriangleSize = float.PositiveInfinity)
- {
- var placeHolders = new List();
- var progressInc = 1f / patches.Count();
-
- foreach (var p in patches)
- {
- cancelToken.ThrowIfCancellationRequested();
-
- var kdtreePath = opcPaths.GetKdTreePath(p.Id, level, posType);
- if (overrideExisting || !StorageConfig.FileExists(kdtreePath))
- BuildKdTreeForPatch(p.Id, level, p.Info, opcPaths, posType, saveTriangles: false, saveKdTree: true, maxTriangleSize: maxTriangleSize);
-
- // Create place holders
- placeHolders.Add(new LazyKdTreeSet.KdTreePlaceHolder()
- {
- BoundingBox = p.Info.GetGlobalBoundingBox(posType),
- Affine = p.Info.GetLocal2Global(posType),
- Path = opcPaths.GetKdTreePath(p.Id, level, posType),
- ObjectSetPath = p.GetPositionPath(posType)
- });
-
- if (progressObserver != null)
- progressObserver.OnNext(progressInc);
- }
-
- if (progressObserver != null)
- progressObserver.OnCompleted();
-
- return new LazyKdTreeSet(placeHolders);
- }
-
- ///
- /// NOT TESTED
- ///
- private static KdTreeSet BuildConcreteKdTreeSet(IEnumerable patches, OpcPaths opcPaths,
- int level, PositionsType posType, bool overrideExisting, IObserver progressObserver, CancellationToken cancelToken = default(CancellationToken),
- float maxTriangleSize = float.PositiveInfinity)
- {
- var kdTrees = new List();
- var progressInc = 1f / patches.Count();
-
- foreach (var p in patches)
- {
- cancelToken.ThrowIfCancellationRequested();
-
- KdIntersectionTree tree;
- var kdtreePath = opcPaths.GetKdTreePath(p.Id, level, posType);
- if (overrideExisting || !StorageConfig.FileExists(kdtreePath))
- tree = BuildKdTreeForPatch(p.Id, level, p.Info, opcPaths, posType, saveTriangles: true, saveKdTree: false, maxTriangleSize: maxTriangleSize);
- else tree = Load.As(kdtreePath);
-
- kdTrees.Add(tree.ToConcreteKdIntersectionTree());
-
- if (progressObserver != null)
- progressObserver.OnNext(progressInc);
- }
-
- if (progressObserver != null)
- progressObserver.OnCompleted();
-
- return new KdTreeSet(kdTrees);
- }
-
- ///
- /// Builds kdtree for specific patch.
- /// Kdtree is built according to specified positions type and hierarchy level.
- ///
- private static KdIntersectionTree BuildKdTreeForPatch(
- string patchName, int level, PatchFileInfo info, OpcPaths paths,
- PositionsType posType, bool saveTriangles = false, bool saveKdTree = true,
- float maxTriangleSize = float.PositiveInfinity)
- {
- var path = Path.Combine(paths.PatchesSubDir, patchName);
-
- var patchGeometry = new TriangleSet();
- //var patchGeometryTest = new TriangleSet();
- if ((maxTriangleSize < float.PositiveInfinity)&&(maxTriangleSize > 0.000001f))
- {
- patchGeometry = PatchLoadingStrategy.LoadPatchTriangleSetWithoutOversizedTriangles(info, path, posType, maxTriangleSize);
- //patchGeometryTest = PatchLoadingStrategy.LoadPatchTriangleSet(info, path, posType);
- }
- else
- {
- patchGeometry = PatchLoadingStrategy.LoadPatchTriangleSet(info, path, posType);
- }
-
- KdIntersectionTree kdIntTree =
- new KdIntersectionTree(patchGeometry,
- KdIntersectionTree.BuildFlags.MediumIntersection |
- KdIntersectionTree.BuildFlags.Hierarchical);
-
- if (!saveTriangles)
- kdIntTree.ObjectSet = null;
-
- if (saveKdTree)
- {
- var kdTreePath = paths.GetKdTreePath(patchName, level, posType);
- kdIntTree.Save(kdTreePath);
- }
-
- return kdIntTree;
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/legacy/Aardvark.Opc/KdTree/LazyKdTreeSet.cs b/legacy/Aardvark.Opc/KdTree/LazyKdTreeSet.cs
deleted file mode 100644
index 35ab365f..00000000
--- a/legacy/Aardvark.Opc/KdTree/LazyKdTreeSet.cs
+++ /dev/null
@@ -1,378 +0,0 @@
-using Aardvark.Algodat;
-using Aardvark.Base;
-using Aardvark.Rendering;
-using Aardvark.Runtime;
-using Aardvark.VRVis;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-namespace Aardvark.Opc.KdTree
-{
- public static class ObjectSetBuilder
- {
- public static TriangleSet GetTriangleSetFromPath(LazyKdTreeSet.KdTreePlaceHolder ph)
- {
- return GetTriangleSetFromPath(ph.ObjectSetPath, ph.Affine);
- }
-
- ///
- /// Loads positions from aara file and returns a TriangleSet (a regular grid for triangulation is assumed).
- /// Further a translation offset can be applied to the position data
- ///
- public static TriangleSet GetTriangleSetFromPath(string posPath, M44d affine)
- {
-
- //create empty vg
- var vg = new VertexGeometry(GeometryMode.TriangleList);
-
- //read grid from aara file
- var grid = AaraHelpers.PointSampleGrid2dFromAaraFile(posPath);
-
- //apply affine with double prec
- //var transPos = grid.Positions
- // .Select(x => (V3f)(affine.TransformPos(x)))
- // .ToArray();
-
- var positions = grid.Positions.ToArray();
-
- //get indices while handling invalid positions
- var invPoints = OpcIndices.GetInvalidPositions(positions);
- var indices = IndexArrayCache.GetIndexArray(grid.Resolution, invPoints.ToList());
-
- if (indices.Length == 0)
- indices = new int[] { 0, 0, 0 };
-
- vg.Positions = positions;
- vg.TransformV3d(affine);
- vg.Indices = indices;
-
- //build up triangle set
- var triangles = vg.Triangles
- .Where(x => !x.Point0.Position.IsNaN &&
- !x.Point1.Position.IsNaN &&
- !x.Point2.Position.IsNaN)
- .Select(x => x.ToTriangle3d());
-
- return new TriangleSet(triangles);
- }
- }
-
- [RegisterTypeInfo]
- public class LazyKdTreeSet : Map, IIntersectableObjectSet
- {
-
- [RegisterTypeInfo]
- public class KdTreePlaceHolder : IFieldCodeable
- {
- public string Path;
- public Box3d BoundingBox;
- public string ObjectSetPath;
- public M44d Affine;
- public KdIntersectionTree KdTree;
-
- public KdTreePlaceHolder() { }
-
-
- #region IFieldCodeable Members
-
- public IEnumerable GetFieldCoders(int version)
- {
- yield return new FieldCoder(0, "Path", (c, o) => c.CodeString(ref ((KdTreePlaceHolder)o).Path));
- yield return new FieldCoder(1, "BoundingBox", (c, o) => c.CodeBox3d(ref ((KdTreePlaceHolder)o).BoundingBox));
- yield return new FieldCoder(2, "ObjectSetPath", (c, o) => c.CodeString(ref ((KdTreePlaceHolder)o).ObjectSetPath));
- yield return new FieldCoder(3, "Affine", (c, o) => c.CodeM44d(ref ((KdTreePlaceHolder)o).Affine));
- }
-
- #endregion
- }
-
- private Box3d m_cachedBoundingBox = Box3d.Invalid;
-
- public const string Identifier = "LazyKdTreeSet";
-
- public static class Property
- {
- public const string KdTreePlaceholders = "KdTreePlaceholders";
- public const string Level = "Level";
- }
-
- public LazyKdTreeSet()
- {
- m_typeName = Identifier;
- this[Property.KdTreePlaceholders] = new List();
- }
-
- public LazyKdTreeSet(IEnumerable pathBox3dPairs)
- {
- m_typeName = Identifier;
- this[Property.KdTreePlaceholders] = pathBox3dPairs.ToList();
- }
-
- public List KdTreePlaceholders
- {
- get { return Get>(Property.KdTreePlaceholders); }
- }
-
- public int Level
- {
- get { return Get(Property.Level); }
- set { m_ht[Property.Level] = value; }
- }
-
- public int KdTreePlaceholdersCount
- {
- get { return KdTreePlaceholders.Count; }
- }
-
- public Box3d AggregateBoundingBox
- {
- get
- {
- if (m_cachedBoundingBox.IsInvalid)
- {
- var box = Box3d.Invalid;
- foreach (var ph in KdTreePlaceholders)
- {
- if (box.IsInvalid) box = ph.BoundingBox;
-
- box.ExtendBy(ph.BoundingBox);
- }
- return box;
- }
-
- return m_cachedBoundingBox;
- }
- }
-
- ///
- /// The number of objects for the triangle set to act as an
- /// IIntersectableObjectSet.
- ///
- public int ObjectCount
- {
- get { return KdTreePlaceholders.Count; }
- }
-
- public Box3d ObjectBoundingBox(
- int objectIndex
- )
- {
- if (objectIndex >= 0)
- {
- var x = KdTreePlaceholders[objectIndex];
- return x.BoundingBox; //.KdIntersectionTree.BoundingBox3d.Transformed(x.Trafo);
- }
-
- return AggregateBoundingBox;
-
- }
-
- public void UpdatePlaceHolderPaths(string newDirectory)
- {
- foreach (var ph in KdTreePlaceholders)
- {
- var newPath = UpdatePathDirectory(ph.Path, newDirectory);
- var newObjectPath = UpdatePathDirectory(ph.ObjectSetPath, newDirectory);
-
- ph.Path = newPath;
- ph.ObjectSetPath = newObjectPath;
- }
- }
-
- private static string UpdatePathDirectory(string path, string newDirectory)
- {
- var relPath = path.ToLower();
- var index = relPath.LastIndexOf("patches");
- relPath = relPath.Substring(index, relPath.Length - index);
- var newPath = Path.Combine(newDirectory, relPath);
-
- return newPath;
- }
-
-
- #region IIntersectableObjectset
-
- public class KdTreeCacheElement
- {
- public readonly string Path;
- public readonly KdIntersectionTree Tree;
-
- public KdTreeCacheElement(string path, KdIntersectionTree tree)
- {
- Path = path;
- Tree = tree;
- }
- }
-
- ///
- /// Full associative Cache
- ///
- private static KdTreeCacheElement[] s_cache;
- private static int s_cachePointer = 0;
-
- static LazyKdTreeSet()
- {
- s_cache = new KdTreeCacheElement[20];
- }
-
- public static void ResetCache(int size)
- {
- s_cache = new KdTreeCacheElement[size];
- s_cachePointer = 0;
- }
-
- ///
- /// Performs cache lookup and returns the element in O(n) or loads the instance
- /// into the cache.
- ///
- public static KdIntersectionTree LookupCache(KdTreePlaceHolder ph)
- {
- for (int i = 0; i < s_cache.Length; i++)
- {
- if (s_cache[i] != null && s_cache[i].Path == ph.Path)
- {
- return s_cache[i].Tree;
- }
- }
-
- // otherwise load and put into cache
- return LoadAndPutIntoCache(ph);
- }
-
- public static KdIntersectionTree LoadAndPutIntoCache(KdTreePlaceHolder ph)
- {
- var element = Load.As(ph.Path);
-
- s_cache[s_cachePointer] = new KdTreeCacheElement(ph.Path, element);
- s_cachePointer = (s_cachePointer + 1) % s_cache.Length;
-
- return element;
- }
-
- public bool ObjectsIntersectRay(
- int[] objectIndexArray, int firstIndex, int indexCount,
- FastRay3d fastRay,
- Func objectFilter,
- Func hitFilter,
- double tmin, double tmax,
- ref ObjectRayHit hit
- )
- {
- int kdTreeIndex = -1;
- for (int i = firstIndex, e = firstIndex + indexCount; i < e; i++)
- {
- var index = objectIndexArray[i];
- var placeHolder = KdTreePlaceholders[index];
-
- //if bounding box is hit, stream Kd-intersection tree
- double t; // this t is not needed, only for the bb intersection call!
- if (placeHolder.BoundingBox.Intersects(fastRay.Ray, out t))
- {
- var kdTree = LookupCache(placeHolder);
-
- if (kdTree.ObjectSet == null)
- {
- kdTree.ObjectSet = ObjectSetBuilder.GetTriangleSetFromPath(placeHolder);
- }
-
- if (kdTree.Intersect(fastRay, objectFilter, hitFilter, tmin, tmax, ref hit))
- kdTreeIndex = index;
- //}
- //catch (NullReferenceException)
- //{
- // if (kdTree.ObjectSet == null)
- // {
- // kdTree.ObjectSet = ObjectSetBuilder.GetTriangleSetFromPath(placeHolder);
-
- // if (kdTree.Intersect(fastRay, objectFilter, hitFilter, tmin, tmax, ref hit))
- // kdTreeIndex = index;
- // }
- //}
- }
- }
-
- if (kdTreeIndex < 0) return false;
-
- if (hit.ObjectStack == null)
- hit.ObjectStack = new List();
- hit.ObjectStack.Add(new SetObject(this, kdTreeIndex));
-
- return true;
- }
-
- public void ObjectHitInfo(
- ObjectRayHit hit,
- ref ObjectHitInfo hitInfo
- )
- {
- // this never needs to be called
- hit.SetObject.Set.ObjectHitInfo(hit, ref hitInfo);
- }
-
- public bool ClosestPoint(
- int[] objectIndexArray, int firstIndex, int indexCount,
- V3d query,
- Func ios_index_objectFilter,
- Func ios_index_part_ocp_pointFilter,
- ref ObjectClosestPoint closest
- )
- {
- //throw new NotImplementedException("ClosestPoint not implement for lazykdtree set");
-
- int kdTreeIndex = -1;
- for (int i = firstIndex, e = firstIndex + indexCount; i < e; i++)
- {
- int index = objectIndexArray[i];
- var ph = KdTreePlaceholders[index];
- var kdTree = Load.As(ph.Path);
- // var trafo = x.Trafo;
- //kdTree.KdIntersectionTree.ClosestPoint(trafo.Backward.TransformPos(query), ref closest)
-
- if (kdTree.ClosestPoint(query, ref closest))
- {
- kdTreeIndex = index;
- //closest.Point = trafo.Forward.TransformPos(closest.Point);
- }
- }
- if (kdTreeIndex < 0) return false;
-
- if (closest.ObjectStack == null)
- closest.ObjectStack = new List();
-
- closest.ObjectStack.Add(new SetObject(this, kdTreeIndex));
- return true;
- }
-
- public bool ObjectIntersectsBox(
- int objectIndex,
- Box3d box
- )
- {
- //throw new NotImplementedException("ObjectIntersectsBox not implement for lazykdtree set");
-
- //var x = ConcreteKdTreeList[objectIndex];
- //return x.KdIntersectionTree.IntersectsBox(box.Transformed(x.Trafo.Backward));
-
- var x = KdTreePlaceholders[objectIndex];
- return x.BoundingBox.Intersects(box);
- }
-
- public bool ObjectIsInsideBox(
- int objectIndex,
- Box3d box
- )
- {
- var ph = KdTreePlaceholders[objectIndex];
- var kdTree = Load.As(ph.Path);
-
- return kdTree.IsInsideBox(box);
-
- //var x = ConcreteKdTreeList[objectIndex];
- //return x.KdIntersectionTree.IsInsideBox(box.Transformed(x.Trafo.Backward));
- }
-
- #endregion
- }
-}
diff --git a/legacy/Aardvark.Opc/LevelOfDetail.cs b/legacy/Aardvark.Opc/LevelOfDetail.cs
deleted file mode 100644
index b796d3f2..00000000
--- a/legacy/Aardvark.Opc/LevelOfDetail.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-using Aardvark.Base;
-using Aardvark.SceneGraph;
-using Aardvark.VRVis;
-using System;
-using System.Collections.Generic;
-
-namespace Aardvark.Opc
-{
- public static class LevelOfDetail
- {
- public static Func DistanceFunc;
-
- public class LevelOfDetailSettings : IFieldCodeable
- {
- public double Max;
- public double Quadratic;
- public double Linear;
- public double Constant;
-
- #region IFieldCodeable Members
-
- public IEnumerable GetFieldCoders(int coderVersion)
- {
- return new[]
- {
- new FieldCoder(0, "Max", (c, o) => c.CodeDouble(ref ((LevelOfDetailSettings)o).Max)),
- new FieldCoder(1, "Quadratic", (c, o) => c.CodeDouble(ref ((LevelOfDetailSettings)o).Quadratic)),
- new FieldCoder(2, "Linear", (c, o) => c.CodeDouble(ref ((LevelOfDetailSettings)o).Linear)),
- new FieldCoder(3, "Constant", (c, o) => c.CodeDouble(ref ((LevelOfDetailSettings)o).Constant)),
- };
- }
-
- #endregion
- }
-
- public class LevelOfDetailDistances : IFieldCodeable
- {
- public const string FileName = "LodDistances.xml";
- public string[] LodDistances;
-
- public IEnumerable GetFieldCoders(int coderVersion)
- {
- return new[]
- {
- new FieldCoder(0, "LodDistances", (c, o) => c.CodeStringArray(ref ((LevelOfDetailDistances)o).LodDistances)),
- };
- }
- }
-
- ///
- /// Creates a distance metric value for a given hierarchy level depending on the polynomial equation
- /// specified through the coefficients in the supplied LevelOfDetailSettings structure. Assumes level 0
- /// to have the smallest distance
- ///
- public static double QuadraticDistance(int level, LevelOfDetailSettings settings)
- {
- return level * level * settings.Quadratic + level * settings.Linear + settings.Constant;
- }
-
- ///
- /// Creates a distance metric value for a given hierarchy level depending on the polynomial equation
- /// specified through the coefficients in the supplied LevelOfDetailSettings structure. Assumes Level 0
- /// to have the greatest distance.
- ///
- public static double QuadraticDistanceFalling(int level, LevelOfDetailSettings settings)
- {
- return (settings.Max / (level * level * settings.Quadratic + level * settings.Linear + 1.0)) + settings.Constant;
- }
-
- ///
- /// Returns an appropriate TileLayout value according to the 2d dimensions of a grid (z is ignored)
- ///
- public static TileLayout GetTileLayout(V3l dim)
- {
- if (dim.X >= 2 && dim.Y >= 2)
- return TileLayout.Full;
- else if (dim.X == 1 && dim.Y == 1)
- return TileLayout.Single;
- else if (dim.Y == 1)
- return TileLayout.Horizontal;
- else if (dim.X == 1)
- return TileLayout.Vertical;
- else
- throw new Exception("TileLayout not handled");
- }
-
- ///
- /// Computes the number of levels of a bottom-up hierarchy built on a grid of tiled elements. It is assumed
- /// that the root (top) of the hierarchy finally consists of one single tile.
- ///
- public static int ComputeHierarchyDepth(V2i gridSize)
- {
- var depth = System.Math.Log(System.Math.Max(gridSize.X, gridSize.Y), 2);
- return System.Math.Ceiling(depth).ToInt();
- }
-
- public static ISg CreateBottomUpLodBoxHierarchy(Volume vgsVolume, LevelOfDetailSettings settings)
- {
- var maxLevel = ComputeHierarchyDepth(vgsVolume.Size.XY.ToV2i());
-
- return LodBoxHierarchy(maxLevel-1, vgsVolume, settings, maxLevel-1);
- }
-
- public static ISg CreateBottomUpLodBoxHierarchyDataInLeaves(Volume vgsVolume, LevelOfDetailSettings settings)
- {
- var maxLevel = ComputeHierarchyDepth(vgsVolume.Size.XY.ToV2i());
-
- return LodBoxHierarchy(maxLevel, vgsVolume, settings, maxLevel);
- }
-
- private static ISg LodBoxHierarchy(
- int level, Volume vgsVolume, LevelOfDetailSettings settings, int maxLevel)
- {
- int detailCount = 1;
- if (vgsVolume.SX > 1) detailCount *= 2;
- if (vgsVolume.SY > 1) detailCount *= 2;
- if (vgsVolume.SZ > 1) detailCount *= 2;
-
- //detail count is 1 when space is not dividable
- #region detailCount == 1
- if (detailCount == 1)
- {
- //if level > 0 keep subsampling without subdivision
- if (level > 0) //|| ( level == 0 && (vgsVolume[0, 0, 0].TileSize.X > 256 || vgsVolume[0, 0, 0].TileSize.Y > 256)))
- {
- var detailNodeList = LodBoxHierarchy(level - 1, vgsVolume, settings, maxLevel).IntoList();
-
- var dist = DistanceFunc(level-1,settings);
-
- Report.Line("LOD.cs Level " + level + " " + dist);
-
- var box = new Sg.LodBox()
- {
- Name = "level" + level,
- DetailNodes = detailNodeList,
- Settings = new LodBoxSettings
- {
- Distance = dist,
- DeciderCombination = "Distance, ScreenPixToTriSize, ScreenPixToTexPix, VisualImpact => Distance",
- },
- };
-
- box["TileLayout"] = GetTileLayout(vgsVolume.Dim);
- return box;
- }
-
- return vgsVolume[0, 0, 0];
- }
- #endregion
-
- var detailNodes = new List(detailCount);
- for (int i = 0; i < 8; i++)
- {
- bool valid = true;
- V3l origin = V3l.Zero;
- V3l length = vgsVolume.Size;
-
- //compute splitting dimensions for each axis
- for (int dim = 0; dim < 3; dim++)
- {
- if ((i & (1 << dim)) == 0)
- {
- if (length[dim] > 1) length[dim] /= 2;
- }
- else
- {
- if (length[dim] > 1)
- {
- origin[dim] = length[dim] / 2;
- length[dim] = length[dim] - origin[dim];
- }
- else
- valid = false;
- }
- }
-
- if (valid)
- {
- ISg detailNode =
- LodBoxHierarchy(level - 1, vgsVolume.SubVolume(origin, length),settings, maxLevel);
- detailNodes.Add(detailNode);
- }
- }
-
- {
- var dist = LevelOfDetail.DistanceFunc(level-1, settings);
-
- //Report.Line("LOD.cs Level " + level + " " + dist);
-
- bool isMax = false; // level == maxLevel;
-
- var box = new Sg.LodBox()
- {
- Name = "level" + level,
- DetailNodes = detailNodes,
- Pinned = Sg.LodBox.PinnedOptions.Default,
- Settings = new LodBoxSettings
- {
- Distance = dist,
- DeciderCombination = !isMax ? "Distance, ScreenPixToTriSize, ScreenPixToTexPix, VisualImpact => Distance"
- : "Distance, ScreenPixToTriSize, ScreenPixToTexPix, VisualImpact => false",
- },
- };
-
- // s_numOfBoxes++;
-
- box["TileLayout"] = GetTileLayout(vgsVolume.Dim);
-
- //Report.Line("DIM: " + vgsVolume.Dim.ToString() + " "
- // + box["TileLayout"].ToString() + " __lvl: "
- // + level + " Desc.: " + box.DetailNodes.Count());
-
- var sg = Rsg.Apply(
- new ResourcePinningEnabledValue()
- {
- Value = level == maxLevel
- }, box);
-
- return box;
- }
- }
-
- public static void UpdateLodBoxAllow(Sg.LodBox node, bool allowTraversal)
- {
- //node.Settings.DeciderCombination = deciderCombination;
-
- node.AllowTraversal = allowTraversal;
-
- foreach (var subNode in node.DetailNodes)
- {
- var lodBox = subNode as Sg.LodBox;
- if(lodBox != null)
- {
- UpdateLodBoxAllow(lodBox, allowTraversal);
- }
- }
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/OpcEvents.cs b/legacy/Aardvark.Opc/OpcEvents.cs
deleted file mode 100644
index b2262c88..00000000
--- a/legacy/Aardvark.Opc/OpcEvents.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Collections.Generic;
-using Aardvark.Runtime;
-using Aardvark.Base;
-using PH = Aardvark.Opc.PatchHierarchy;
-
-namespace Aardvark.Opc
-{
- public static class OpcEvents
- {
- public class OpcMessage
- {
- public string ViewId;
- public string SetId;
- public IEnumerable Opcs;
- }
-
- public static EventDescription> AddOpcs
- = new EventDescription>("AddOpcs");
-
- public static EventDescription RemoveOpcs
- = new EventDescription("RemoveOpcs");
-
- ///
- /// Call back message to react on opc streaming finished. Opc attaches
- /// its id to the event.
- ///
- public static EventDescription StreamingFinished
- = new EventDescription("StreamingFinished");
- }
-}
diff --git a/legacy/Aardvark.Opc/OpcIndices.cs b/legacy/Aardvark.Opc/OpcIndices.cs
deleted file mode 100644
index 461fc2ce..00000000
--- a/legacy/Aardvark.Opc/OpcIndices.cs
+++ /dev/null
@@ -1,630 +0,0 @@
-using Aardvark.Algodat;
-using Aardvark.Base;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Aardvark.VRVis;
-
-namespace Aardvark.Opc
-{
- public class OpcIndices
- {
- #region Normals Computation
- ///
- /// Takes the input VertexGeometry and creates a Mesh from it to compute smooth normals. Creating a Mesh topology
- /// can be more time consuming than a straightforward Opc approach. Further the Mesh algorithm can not deal
- /// with holes in the geometry.
- ///
- //private static V3d[] GenerateNormalsByMeshing(VertexGeometry vg)
- //{
- // var triangleVertexIndexArray = vg.Indices;
-
- // // create mesh ...
- // var m = new Mesh();
-
- // // ... set vertex positions
- // m.VertexCount = vg.VertexCount;
- // var vertexPositions = new PerVertexAttributeSet(m, Interpolator.GetLinearV3f());
-
- // for (int pi = 0; pi < vg.VertexCount; pi++) vertexPositions[pi] = (V3f)vg.Positions.GetValue(pi);
- // m.VertexPositions = vertexPositions;
-
- // // ... set triangles
- // m.TriangleCount = triangleVertexIndexArray.Length / 3;
- // m.SetTriangles(triangleVertexIndexArray);
-
- // // ... create normals
- // m.AddPerVertexIndexedNormals(Conversion.RadiansFromDegrees(70));
-
- // // create vertex geometry from mesh
- // var resVg = m.GetVertexGeometry(Mesh.VertexGeometryMode.CompactLowPrecision);
-
- // return resVg.NormalsAsV3ds.ToArray();
- //}
-
- ///
- /// Generates smooth vertex normals for the given position grid specified by an index- and a data-array.
- ///
- /// Vertex normals (size: positions.Count()).
- public static V3d[] GenerateVertexNormals(int[] indices, V3d[] positions)
- {
- var numOfVertices = positions.Count();
- var vertexNormals = Enumerable.Repeat(V3d.OOO, numOfVertices).ToArray();
-
- V3d faceNormal = V3d.NaN;
- for (int i = 0; i < indices.Count(); i++)
- {
- // compute faceNormal when reaching first index of face
- if (i % 3 == 0)
- faceNormal = ComputeFaceNormal(
- positions[indices[i]],
- positions[indices[i + 1]],
- positions[indices[i + 2]]);
-
- // accumulate faceNormals per vertex
- vertexNormals[indices[i]] += faceNormal;
- }
-
- for (int i = 0; i < numOfVertices; i++)
- vertexNormals[i].Normalize();
-
- return vertexNormals;
- }
-
- ///
- /// Generates hard face normals for the given position grid specified by an index- and a data-array.
- ///
- /// Face normals (size: indices.Count()/3).
- public static V3d[] GenerateFaceNormals(int[] indices, V3d[] positions)
- {
- var faceNormals = new V3d[indices.Count() / 3];
-
- for (int i = 0; i < indices.Count() / 3; i++)
- {
- faceNormals[i] = ComputeFaceNormal(
- positions[indices[i * 3]],
- positions[indices[i * 3 + 1]],
- positions[indices[i * 3 + 2]]);
- }
-
- return faceNormals;
- }
-
- private static V3d ComputeFaceNormal(V3d p1, V3d p2, V3d p3)
- {
- if (p1.IsNaN || p2.IsNaN || p3.IsNaN)
- return V3d.NaN;
-
- var u = p2 - p1;
- var v = p3 - p1;
-
- return u.Cross(v).Normalized;
- }
-
- ///
- /// Computes the neighbour indices in grid for a given position.
- ///
- private static List GetGridNeighbourIndices(int x, int y, V2i tileSize)
- {
- var resultList = new List();
-
- //North
- if (y > 0)
- resultList.Add((y - 1) * tileSize.X + x);
-
- //East
- if (x < tileSize.X - 1)
- resultList.Add(y * tileSize.X + x + 1);
-
- //South
- if (y < tileSize.Y - 1)
- resultList.Add((y + 1) * tileSize.X + x);
-
- //West
- if (x > 0)
- resultList.Add(y * tileSize.X + x - 1);
-
- if (x == tileSize.X - 1)
- resultList.Add(y * tileSize.X + x - 1);
-
- //if (resultList.Count == 0)
- //{
- // resultList.Add((y - 1) * tileSize.X + x);
- // resultList.Add(y * tileSize.X + x - 1);
- //}
-
- return resultList;
- }
- #endregion
-
- public static IEnumerable GetInvalidPositions(V3d[] inputArray)
- {
- for (int i = 0; i < inputArray.Length; i++)
- {
- if (inputArray[i].IsNaN)
- yield return i;
- }
- }
-
- public static IEnumerable GetInvalidPositions(V3f[] inputArray)
- {
- var invPoints = new List();
- for (int i = 0; i < inputArray.Length; i++)
- {
- //if (!OpcIndices.IsValidPosition(inputArray[i]))
- if (inputArray[i].IsNaN)
- {
- invPoints.Add(i);
- }
- }
-
- return invPoints.ToArray();
- }
-
- public static int[] GetInvalidPositionsFromOversizedTriangles(V3f[] inputArray)
- {
- var invPoints = new List();
- for (int i = 0; i < inputArray.Length; i++)
- {
-
- //if (!OpcIndices.IsValidPosition(inputArray[i]))
- if (inputArray[i].IsNaN)
- {
- invPoints.Add(i);
- }
- }
-
- return invPoints.ToArray();
- }
-
- // searches for oversized triangles and removes and adds all 3 vertex indices to invalid point list
- // (if one triangle side > maxTriangleSize => skip whole triangle)
- public static int[] GetAllPositionsFromOversizedTriangles(int[] invalidpositions, VertexGeometry vg, float maxTriangleSize)
- {
- var invalidPoints = new List(invalidpositions);
-
- foreach (var t in vg.Triangles)
- {
- V3d p0, p1, p2;
- t.GetVertexPositions(out p0, out p1, out p2);
-
- if (p0.IsNaN || p1.IsNaN || p2.IsNaN) continue;
-
- double dist_p0p1 = V3d.Distance(p0, p1);
- double dist_p0p2 = V3d.Distance(p0, p2);
- double dist_p1p2 = V3d.Distance(p1, p2);
-
- if ((dist_p0p1 > maxTriangleSize) || (dist_p0p2 > maxTriangleSize) || (dist_p1p2 > maxTriangleSize))
- {
- foreach (var index in t.VertexIndices)
- {
- if (!Array.Exists(invalidPoints.ToArray(), x => x == index))
- invalidPoints.Add(index);
- }
- }
- }
-
- return invalidPoints.ToArray();
- }
-
- // searches for oversized triangles and adds only invalid indices to invalid point list
- // (keep vertex indices for triangle side < maxTriangleSize)
- public static int[] GetInvalidPositionsFromOversizedTriangles(int[] invalidpositions, VertexGeometry vg, float maxTriangleSize)
- {
- var invalidPoints = new List(invalidpositions);
-
- foreach (var t in vg.Triangles)
- {
- V3d p0, p1, p2;
- t.GetVertexPositions(out p0, out p1, out p2);
-
- if (p0.IsNaN || p1.IsNaN || p2.IsNaN) continue;
-
- List vertexlist = new List();
- int p0_counter = 0;
- int p1_counter = 0;
- int p2_counter = 0;
- if (V3d.Distance(p0, p1) > maxTriangleSize) { vertexlist.Add(p0); vertexlist.Add(p1); }
- if (V3d.Distance(p0, p2) > maxTriangleSize) { vertexlist.Add(p0); vertexlist.Add(p2); }
- if (V3d.Distance(p1, p2) > maxTriangleSize) { vertexlist.Add(p1); vertexlist.Add(p2); }
- foreach (var p in vertexlist)
- {
- if (p == p0) p0_counter++;
- if (p == p1) p1_counter++;
- if (p == p2) p2_counter++;
- }
-
- if ((p0_counter > 1) && (!Array.Exists(invalidPoints.ToArray(), x => x == t.VertexIndex0))) { invalidPoints.Add(t.VertexIndex0); }
- if ((p1_counter > 1) && (!Array.Exists(invalidPoints.ToArray(), x => x == t.VertexIndex1))) { invalidPoints.Add(t.VertexIndex1); }
- if ((p2_counter > 1) && (!Array.Exists(invalidPoints.ToArray(), x => x == t.VertexIndex2))) { invalidPoints.Add(t.VertexIndex2); }
-
- }
-
- return invalidPoints.ToArray();
- }
-
- // checks if an triangle has an oversized side length
- public static bool IsOversizedTriangle(V3f[] points, int index0, int index1, int index2, float maxTriangleSize)
- {
- V3f point0 = points[index0];
- V3f point1 = points[index1];
- V3f point2 = points[index2];
-
- double dist_p0p1 = V3f.Distance(point0, point1);
- double dist_p0p2 = V3f.Distance(point0, point2);
- double dist_p1p2 = V3f.Distance(point1, point2);
-
- if ((dist_p0p1 > maxTriangleSize) || (dist_p0p2 > maxTriangleSize) || (dist_p1p2 > maxTriangleSize))
- {
- return true;
- }
-
- return false;
- }
-
- // checks if the side length of an triangle has an oversized side length
- public static bool IsOversizedTriangleSideRatio(V3f[] points, int index0, int index1, int index2, float maxTriangleSize)
- {
- V3f point0 = points[index0];
- V3f point1 = points[index1];
- V3f point2 = points[index2];
-
- double dist_p0p1 = V3f.Distance(point0, point1);
- double dist_p0p2 = V3f.Distance(point0, point2);
- double dist_p1p2 = V3f.Distance(point1, point2);
-
- double sideRatio01 = Math.Abs(dist_p1p2 - dist_p0p2);
- double sideRatio02 = Math.Abs(dist_p0p1 - dist_p1p2);
- double sideRatio12 = Math.Abs(dist_p0p1 - dist_p0p2);
-
-
- if ((sideRatio01 > maxTriangleSize) || (sideRatio02 > maxTriangleSize) || (sideRatio12 > maxTriangleSize))
- {
- return true;
- }
-
- return false;
- }
- ///
- /// Check if point is valid according to Dibit magic numbers - all coords are -10000000.
- ///
- public static bool ValidPoint(V3d p)
- {
- return p.X != -10000000 && p.Y != -10000000 && p.Z != -10000000;
- }
-
- #region Index Computations
- ///
- /// Compute index array to triangulate an ordered point set with
- /// a resolution of size.x X size.y
- ///
- /// V2i specifying number of points
- /// in x and y direction respectively
- /// index array
- public static int[] ComputeIndexArray(V2i size)
- {
- return ComputeIndexArray(size, null);
- }
-
- ///
- /// Compute index array to triangulate an ordered point set with
- /// a resolution of size.x X size.y and specify a list of indices
- /// which shall be excluded from triangulation (i.e. invalid scan points).
- /// Affected faces will result in degenerated triangles.
- ///
- /// V2i specifying number of points
- /// in x and y direction respectively
- /// List of indices excluded from trianguation
- /// index array
- public static int[] ComputeIndexArray(V2i size, IEnumerable invalidPoints)
- {
- var indexArray = new int[(size.X - 1) * (size.Y - 1) * 6];
-
- int k = 0;
-
- bool hasInvalids = invalidPoints != null;
-
- #region no invalids
- if (!hasInvalids)
- {
- for (int y = 0; y < size.Y - 1; y++)
- {
- for (int x = 0; x < size.X - 1; x++)
- {
- indexArray[k] = y * size.X + x;
- indexArray[k + 1] = (y + 1) * size.X + x;
- indexArray[k + 2] = y * size.X + x + 1;
-
- indexArray[k + 3] = y * size.X + x + 1;
- indexArray[k + 4] = (y + 1) * size.X + x;
- indexArray[k + 5] = (y + 1) * size.X + x + 1;
-
- k += 6;
- }
- }
-
- return indexArray.ToArray();
- }
- #endregion
- #region has invalids
- else
- {
- var invalidDict = invalidPoints.ToDictionary(n => n);
- int a1, b1, c1;
- int a2, b2, c2;
- var indices = new List();
- bool invalidFace = false;
- int counter = 0;
-
- for (int y = 0; y < size.Y - 1; y++)
- {
- for (int x = 0; x < size.X - 1; x++)
- {
- a1 = y * size.X + x;
- b1 = (y + 1) * size.X + x;
- c1 = y * size.X + x + 1;
-
- a2 = y * size.X + x + 1;
- b2 = (y + 1) * size.X + x;
- c2 = (y + 1) * size.X + x + 1;
-
- indices.Clear();
- indices.Add(a1); indices.Add(b1); indices.Add(c1);
- indices.Add(a2); indices.Add(b2); indices.Add(c2);
-
- invalidFace = indices.Select(n => n).Where(m => invalidDict.ContainsKey(m)).ToList().Count() > 0;
-
- if (invalidFace)
- {
- //Console.WriteLine("Invalid Face Found");
- counter++;
- k += 6;
- continue;
- }
-
- indexArray[k] = a1;
- indexArray[k + 1] = b1;
- indexArray[k + 2] = c1;
-
- indexArray[k + 3] = a2;
- indexArray[k + 4] = b2;
- indexArray[k + 5] = c2;
-
- k += 6;
- }
- }
-
- if (counter > 0)
- Report.Line(5, "Invalid faces found: " + counter);
- return indexArray.ToArray();
- }
- #endregion
- }
-
- ///
- /// Compute index array to triangulate an ordered point set with
- /// a resolution of size.x X size.y and specify a list of indices
- /// which shall be excluded from triangulation (i.e. invalid scan points).
- /// Affected faces will result in degenerated triangles.
- /// Triangles with min. one side > maxTriangle size shall be excluded too.
- ///
- /// V2i specifying number of points
- /// in x and y direction respectively
- /// List of indices excluded from trianguation
- /// List of all 3d points
- /// Maximum side length of valid triangle
- /// index array
- public static int[] ComputeIndexArray(V2i size, IEnumerable invalidPoints, V3f[] points, float maxTriangleSize)
- {
- var indexArray = new int[(size.X - 1) * (size.Y - 1) * 6];
-
- int k = 0;
-
- var invalidDict = invalidPoints.ToDictionary(n => n);
- int a1, b1, c1;
- int a2, b2, c2;
- var indices = new List();
- bool invalidFace = false;
- int counter = 0;
- int oversized_counter = 0;
-
- for (int y = 0; y < size.Y - 1; y++)
- {
- for (int x = 0; x < size.X - 1; x++)
- {
- a1 = y * size.X + x;
- b1 = (y + 1) * size.X + x;
- c1 = y * size.X + x + 1;
-
- a2 = y * size.X + x + 1;
- b2 = (y + 1) * size.X + x;
- c2 = (y + 1) * size.X + x + 1;
-
- indices.Clear();
- indices.Add(a1); indices.Add(b1); indices.Add(c1);
- indices.Add(a2); indices.Add(b2); indices.Add(c2);
-
- invalidFace = indices.Select(n => n).Where(m => invalidDict.ContainsKey(m)).ToList().Count() > 0;
-
- if (invalidFace)
- {
- //Console.WriteLine("Invalid Face Found");
- counter++;
- k += 6;
- continue;
- }
-
- if (!IsOversizedTriangle(points, a1, b1, c1, maxTriangleSize))
- //if (!IsOversizedTriangleSideRatio(points, a1, b1, c1, maxTriangleSize))
- {
- indexArray[k] = a1;
- indexArray[k + 1] = b1;
- indexArray[k + 2] = c1;
- }
- else
- oversized_counter++;
-
- if (!IsOversizedTriangle(points, a2, b2, c2, maxTriangleSize))
- //if (!IsOversizedTriangleSideRatio(points, a2, b2, c2, maxTriangleSize))
- {
- indexArray[k + 3] = a2;
- indexArray[k + 4] = b2;
- indexArray[k + 5] = c2;
- }
- else
- oversized_counter++;
-
-
- k += 6;
- }
- }
-
- if (counter > 0)
- Report.Line(5, "Invalid faces found: " + counter);
- return indexArray.ToArray();
- }
-
- public static int[] ComputeLineStripIndexArray(V2i size)
- {
- var indexArray = new int[(size.X * size.Y)];
-
- for (int j = 0; j < size.Y; j++)
- {
- for (int i = 0; i < size.X; i++)
- {
- int index = j * size.X + i;
- indexArray[index] = index;
- }
- }
-
- return indexArray;
- }
-
- public static int[] ComputeTriangleStripIndexArray(V2i size, List invalidPoints)
- {
- return null;
- }
-
- public static int[] ComputeTriangleStripIndexArray(V2i size)
- {
- var numOfStrips = size.Y - 1;
- var numOfSwapIndices = (numOfStrips) * 2;
- var numOfStripIndices = numOfStrips * size.X * 2;
- var numOfIndices = numOfSwapIndices + numOfStripIndices;
-
- var indexArray = new int[numOfIndices];
-
- int linItr = 0;
- for (int y = 0; y < size.Y - 1; y++)
- {
- for (int x = 0; x < size.X; x++)
- {
- var indexUp = size.X * y + x;
- var indexDown = indexUp + size.X; //(size.X * (y + 1)) + x;
-
- if (x == 0)
- {
- indexArray[linItr] = indexUp;
- linItr++;
- }
-
- indexArray[linItr] = indexUp;
- linItr++;
- indexArray[linItr] = indexDown;
- linItr++;
-
- if (x == size.X - 1)
- {
- indexArray[linItr] = indexDown;
- linItr++;
- }
- }
- }
-
- return indexArray;
- }
-
- public static C4b[] ComputeColorMap(V2i size)
- {
- var length = size.X * size.Y;
- var indexArray = new C4b[length];
-
- var stepX = 255 / (double)size.X;
- var stepY = 255 / (double)size.Y;
-
- //var currColor = C4b.Black;
- for (int j = 0; j < size.Y; j++)
- {
- for (int i = 0; i < size.X; i++)
- {
- int index = j * size.X + i;
- var newR = (byte)(stepX * i);
- var newG = (byte)(stepY * j);
-
- indexArray[index] = new C4b(newR, newG, (byte)128);
- indexArray[index].Opacity = 255;
- }
- }
-
- indexArray[0] = C4b.Red;
- indexArray[length - 1] = C4b.Blue;
-
- return indexArray;
- }
-
- public static C4b[] DefaultColor(V2i size)
- {
- var length = size.X * size.Y;
- var indexArray = new C4b[length].Set(C4b.White);
-
- return indexArray;
- }
-
- #region Row/Colum Accessors
- public static int[] GetColumnAsIndices(V2i size, int colNumber)
- {
- var colInds = new List();
-
- for (int i = 0; i < size.Y; i++)
- colInds.Add(size.X * i + colNumber);
-
- return colInds.ToArray();
- }
-
- public static int[] GetRowAsIndices(V2i size, int rowNumber)
- {
- var colInds = new List();
-
- for (int i = 0; i < size.X; i++)
- colInds.Add(size.X * rowNumber + i);
-
- return colInds.ToArray();
- }
-
- //First
- public static int[] GetFirstColumnAsIndices(V2i size)
- {
- return GetColumnAsIndices(size, 0);
- }
-
- public static int[] GetFirstRowAsIndices(V2i size)
- {
- return GetRowAsIndices(size, 0);
- }
-
- //Last
- public static int[] GetLastColumnAsIndices(V2i size)
- {
- return GetColumnAsIndices(size, size.X - 1);
- }
-
- public static int[] GetLastRowAsIndices(V2i size)
- {
- return GetRowAsIndices(size, size.Y - 1);
- }
- #endregion
-
- #endregion
-
- }
-}
diff --git a/legacy/Aardvark.Opc/OpcResourceManager.cs b/legacy/Aardvark.Opc/OpcResourceManager.cs
deleted file mode 100644
index b0a72f8e..00000000
--- a/legacy/Aardvark.Opc/OpcResourceManager.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Aardvark.Runtime;
-using Aardvark.SceneGraph;
-using Aardvark.VRVis;
-using Aardvark.Base;
-
-namespace Aardvark.Opc
-{
- public static class SgResourceManager
- {
- private static int s_maximumLifeTime = 2;
- private static int s_maxTotalMemory = 600000000;
-
- ///
- /// describes the desired maximum life time of an object before it can be disposed in seconds
- ///
- public static int MaximumLifeTime
- {
- get { return SgResourceManager.s_maximumLifeTime; }
- set { SgResourceManager.s_maximumLifeTime = value; }
- }
-
- ///
- /// Memory threshold in bytes. When reached FreeMemory() is called automatically
- ///
- public static int MaxTotalMemory
- {
- get { return SgResourceManager.s_maxTotalMemory; }
- set { SgResourceManager.s_maxTotalMemory = value; }
- }
-
- static DateTime s_startTime = DateTime.Now;
- static SgResourceManager()
- {
-
- }
-
- private static Dictionary s_tileUsage
- = new Dictionary();
-
- //public static void Register(ISg sg, TraversalState state)
- //{
- // var replace = s_tileUsage.ContainsKey(sg) ? s_tileUsage[sg] : DateTime.MinValue;
- // s_tileUsage[sg] = replace;
- //}
-
- // private static bool m_forceFreeMemory = false;
- public static void Use(ISg sg, TraversalState state)
- {
- //if (s_tileUsage.ContainsKey(sg))
- // s_tileUsage.Remove(sg);
-
- s_tileUsage[sg] = (long)(DateTime.Now - s_startTime).TotalSeconds;
-
- //if (GC.GetTotalMemory(false) > 600000000)
- // m_forceFreeMemory = true;
- }
-
- public static void FreeMemory(TraversalState state)
- {
- Report.Line(1, "Free");
- var x = (long)((DateTime.Now - s_startTime).TotalSeconds);
-
- var tilesDescriptionsWhichCouldBeRemoved =
- from tileKvp in s_tileUsage
- where x - tileKvp.Value > MaximumLifeTime
- select tileKvp;
-
- var tdcbrArray = tilesDescriptionsWhichCouldBeRemoved.ToArray();
-
- Report.Line(1, "USED TILES BEF: " + s_tileUsage.Count);
- Report.Line(1, "REMOVING " + tdcbrArray.Length + "TILES");
- foreach (var tileKvp in tdcbrArray)
- {
- // Report.Line(0, "Tile disposed " + (currentCycle - tileKvp.Value));
- var tile = tileKvp.Key;
- s_tileUsage.Remove(tile);
- tile.DisposeAndRemove(state);
- }
- Report.Line(1, "USED TILES AFT: " + s_tileUsage.Count);
- }
-
- public static void DisposeAll(TraversalState state)
- {
- foreach (var tileKvp in s_tileUsage)
- {
- var tile = tileKvp.Key;
- s_tileUsage.Remove(tile);
- tile.DisposeAndRemove(state);
- }
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/OpcFileUtils.cs b/legacy/Aardvark.Opc/PatchHierarchy/OpcFileUtils.cs
deleted file mode 100644
index f5ea43ca..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/OpcFileUtils.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-using Aardvark.Runtime;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- public static class OpcFileUtils
- {
- ///
- /// Retrieves folderpaths within given directory which correspond to opc layout
- ///
- public static IEnumerable OpcPathsFromFolder(string opcFolderPath)
- {
- var opcFolders = StorageConfig.GetDirectories(opcFolderPath).Where(x => OpcFileUtils.IsOpc(x));
- var resultList = new List();
-
- foreach (var opc in opcFolders)
- {
- yield return opc;
- }
- }
-
- ///
- /// Gets the filepath to root patch.xml from opc folder
- ///
- public static string GetRootPatchPath(string inFilePath)
- {
- var filePath = Path.Combine(inFilePath, "patches\\patchhierarchy.xml");
-
- var xmlHierarchy = XElement.Load(filePath, LoadOptions.None);
- var patchHierarchy = xmlHierarchy.Elements("PatchHierarchy");
- var rootPatchname = patchHierarchy.Elements("RootPatch").First().Value.Trim();
-
- return Path.Combine(inFilePath, "patches\\" + rootPatchname + "\\patch.xml");
- }
-
- ///
- /// Checks for a given directory if the filestructure corresponds to VilmaSpec
- ///
- public static bool IsOpc(string filepath)
- {
- string imagePath = Path.Combine(filepath, "images");
- string patchPath = Path.Combine(filepath, "patches");
-
- bool dirsExist = StorageConfig.DirectoryExists(imagePath) && StorageConfig.DirectoryExists(patchPath);
- if (!dirsExist)
- return false;
-
- return StorageConfig.FileExists(patchPath + "\\patchhierarchy.xml");
- }
-
-
- ///
- /// Checks for a given directory if it contains surfaces
- ///
- public static bool IsSurfaceFolder(string dir)
- {
- bool isSurfaceFolder = false;
- var subfolders = Directory.GetDirectories(dir);
- foreach (var s in subfolders)
- {
- isSurfaceFolder |= IsOpc(s);
- }
-
- return isSurfaceFolder;
- }
-
- ///
- /// Takes first OPC in opcDirectory and returns its root patch info. This
- /// is typically needed to retrieve rendering offsets to prevent rounding errors.
- ///
- public static PatchFileInfo GetFirstPatchFileInfo(string opcDirectory, PositionsType posType)
- {
- var paths = OpcFileUtils.OpcPathsFromFolder(opcDirectory);
- var rootPatchPath = OpcFileUtils.GetRootPatchPath(paths.First());
-
- return PatchFileInfo.FromFile(rootPatchPath);
- }
- }
-}
-
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/OpcPaths.cs b/legacy/Aardvark.Opc/PatchHierarchy/OpcPaths.cs
deleted file mode 100644
index 91fe0230..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/OpcPaths.cs
+++ /dev/null
@@ -1,214 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Aardvark.Base;
-using Aardvark.Runtime;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- ///
- /// Helper class to manage/create various paths in an OPC folder
- ///
- public class OpcPaths
- {
- public class Identifiers
- {
- // patches/
- public const string PatchesSubDir = "patches";
- public const string CacheFileName = "cache.bin";
- public const string PatchHierarchyFileName = "patchhierarchy.xml";
- public const string ProfilLutFileName = "profilelut.bin";
-
- // per patch
- // Patch.xml
- // .aara files: Normals, Offset, Positions, Positions2d.....
-
- // KdTrees in root-patch directory
-
- public const string KdTreeExt = "aakd";
- public const string KdTreeN = "." + KdTreeExt;
- public const string KdTreeN2d = "-2d." + KdTreeExt;
- public const string KdTreeZero = "-0." + KdTreeExt;
- public const string KdTreeZero2d = "-0-2d." + KdTreeExt;
-
- // images/
- public const string ImagesSubDir = "images";
- public const string ImagePyramidFileName = "imagepyramid.xml";
- }
-
- #region Properties
- public string BasePath { get; private set; }
-
- public string PatchesSubDir { get; private set; }
- public string ImagesSubDir { get; private set; }
-
- public string PatchHierarchyPath { get; private set; }
- public List ImagePyramidPaths { get; private set; }
- public string CachedPatchHierarchyPath { get; private set; }
- public string ProfileLutPath { get; private set; }
-
- public string RootPatchName { get; private set; }
- public string RootPatchPath { get; private set; }
-
- public string ShortName { get; private set; }
-
- private string m_kdTreeNPath;
- private string m_kdTreeN2dPath;
- private string m_kdTreeZeroPath;
- private string m_kdTreeZero2dPath;
-
- public string GetKdTreeNPath(PositionsType posType)
- {
- if (posType == PositionsType.V3dPositions)
- return m_kdTreeNPath;
- else
- return m_kdTreeN2dPath;
- }
-
- public string GetKdTreeZeroPath(PositionsType posType)
- {
- if (posType == PositionsType.V3dPositions)
- return m_kdTreeZeroPath;
- else
- return m_kdTreeZero2dPath;
- }
- #endregion
-
- ///
- /// Creates path helper from a given OPC folder
- ///
- public OpcPaths(string basePath)
- {
- ImagePyramidPaths = new List();
-
- BasePath = basePath;
-
- PatchesSubDir = Path.Combine(basePath, Identifiers.PatchesSubDir);
- ImagesSubDir = Path.Combine(basePath, Identifiers.ImagesSubDir);
-
- CachedPatchHierarchyPath = Path.Combine(PatchesSubDir, Identifiers.CacheFileName);
- PatchHierarchyPath = Path.Combine(PatchesSubDir, Identifiers.PatchHierarchyFileName);
-
- ProfileLutPath = Path.Combine(PatchesSubDir, Identifiers.ProfilLutFileName);
-
- ShortName = Path.Combine(Directory.GetParent(BasePath).Name, Path.GetFileName(basePath));
-
- var subDirs = StorageConfig.GetDirectories(ImagesSubDir);
- foreach (var sd in subDirs)
- {
- var dir = Path.Combine(ImagesSubDir, sd);
- ImagePyramidPaths.Add(Path.Combine(dir, Identifiers.ImagePyramidFileName));
- }
- }
-
- ///
- /// Construction of specific paths (such as kdtree paths) is only possible
- /// with the name of an OPC' root patch
- ///
- public void SetRootPatchName(string rootPatchName)
- {
- RootPatchName = rootPatchName;
- RootPatchPath = Path.Combine(PatchesSubDir, RootPatchName);
- var kdTreeFileStub = Path.Combine(RootPatchPath, RootPatchName);
-
- m_kdTreeNPath = kdTreeFileStub + Identifiers.KdTreeN;
- m_kdTreeN2dPath = kdTreeFileStub + Identifiers.KdTreeN2d;
-
- m_kdTreeZeroPath = kdTreeFileStub + Identifiers.KdTreeZero;
- m_kdTreeZero2dPath = kdTreeFileStub + Identifiers.KdTreeZero2d;
- }
-
- ///
- /// Returns OpcPaths with with most paths created from a given OPC folder.
- /// All remaining paths need a RootPatchName to be created.
- ///
- public static OpcPaths From(string baseDirectory)
- {
- return new OpcPaths(baseDirectory);
- }
-
- ///
- /// 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.
- ///
- 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(paths.CachedPatchHierarchyPath);
- rootPatchName = info.RootPatch;
- }
- else
- rootPatchName = PatchHierarchyXML.From(baseDirectory).RootPatchName;
-
- Requires.NotEmpty(rootPatchName, "RootPatchName could not be retrieved");
-
- paths.SetRootPatchName(rootPatchName);
-
- return paths;
- }
-
-
-
- #region KdTree methods
-
- public int SelectLevelK()
- {
- var kList = FindLevelKPaths();
- if (kList.Count > 0)
- return kList.Min();
-
- return -1;
- }
-
- public List FindLevelKPaths()
- {
- var kList = new List();
- for (int i = 1; i < 6; i++)
- {
- var kdTreePath = GetAggKdTreePath(i, PositionsType.V3dPositions);
- if (StorageConfig.FileExists(kdTreePath))
- kList.Add(i);
- }
-
- return kList;
- }
-
- ///
- /// Gets the aggregate kdtree path according to the specified level and positions type. Level -1 indicates
- /// the path for a Level N kdtree
- ///
- public string GetAggKdTreePath(int level, PositionsType posType)
- {
- return GetKdTreePath(RootPatchName, level, posType);
- }
-
- ///
- /// Gets kdtree path for a certain patch according to name, level and postype.
- ///
- public string GetKdTreePath(string patchName, int level, PositionsType posType)
- {
- var fileName = GetKdTreeFileName(patchName, level, posType);
- var kdTreePath = Path.Combine(RootPatchPath, fileName);
-
- return kdTreePath;
- }
-
- public static string GetKdTreeFileName(string patchName, int level, PositionsType posType)
- {
- string levelSub = level > -1 ? "-" + level : string.Empty;
- string positionSub = posType == PositionsType.V3dPositions ? string.Empty : "-2d";
-
- var fileName = string.Format("{0}{1}{2}.{3}", patchName, levelSub, positionSub, Identifiers.KdTreeExt);
-
- return fileName;
- }
-
- #endregion
- }
-}
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/OpcSgBuilderStrategy.cs b/legacy/Aardvark.Opc/PatchHierarchy/OpcSgBuilderStrategy.cs
deleted file mode 100644
index 4679114c..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/OpcSgBuilderStrategy.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.IO;
-using System.Linq;
-using Aardvark.Lod;
-using Aardvark.SceneGraph;
-using Aardvark.VRVis;
-using Aardvark.Base;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- public interface IOpcSgBuilderStrategy
- {
- ISg CreateSceneGraph(OpcPaths paths, PatchHierarchy hier);
- }
-
- // probably make standard opc builder
-}
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/Patch.cs b/legacy/Aardvark.Opc/PatchHierarchy/Patch.cs
deleted file mode 100644
index dfeb85bb..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/Patch.cs
+++ /dev/null
@@ -1,330 +0,0 @@
-using Aardvark.Algodat;
-using Aardvark.Base;
-using Aardvark.Lod;
-using Aardvark.Opc.KdTree;
-using Aardvark.Rendering;
-using Aardvark.Rendering.SlimDx;
-using Aardvark.SceneGraph;
-using Aardvark.VRVis;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Drawing;
-using System.Drawing.Imaging;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- public enum PositionsType
- {
- V3dPositions,
- V2dPositions,
- }
-
- [RegisterTypeInfo]
- public class Patch : Instance
- {
- public const string Identifier = "Patch";
-
- public static class Properties
- {
- public const string PatchFilePath = "PatchFilePath";
- public const string ImageFilePath = "ImageFilePath";
-
- public const string PatchFileInfo = "PatchFileInfo";
- public const string Level = "Level";
- public const string MaxLevel = "MaxLevel";
-
- public const string PositionsType = "PositionsType";
- }
-
- public string PatchFilePath
- {
- get { return Get(Properties.PatchFilePath); }
- set { this[Properties.PatchFilePath] = value; }
- }
-
- public PatchFileInfo PatchFileInfo
- {
- get { return Get(Properties.PatchFileInfo); }
- set { this[Properties.PatchFileInfo] = value; }
- }
-
- public int Level
- {
- get { return Get(Properties.Level); }
- set { this[Properties.Level] = value; }
- }
-
- public int MaxLevel
- {
- get { return Get(Properties.MaxLevel); }
- set { this[Properties.MaxLevel] = value; }
- }
-
- public PositionsType PositionsType
- {
- get { return Get(Properties.PositionsType); }
- set { this[Properties.PositionsType] = value; }
- }
-
- public double AvgTexelSize { get; set; }
-
- public double DepthRanking { get; set; }
-
- public IPatchLoadingStrategy LoadingStrategy = new PatchLoadingStrategy();
-
- public bool InvertZ { get; set; }
- public float MaxTriangleSize { get; set; }
-
- //static volatile int patchCounter = 0;
-
- ///
- /// Represents a single patch of ordered positions including coords, textures, etc.
- ///
- public Patch(PatchFileInfo info, string patchPath, int level, int maxLevel, PositionsType posType, bool invertZ = false, float maxTriangleSize = float.PositiveInfinity)
- : base(Identifier)
- {
- PatchFilePath = patchPath;
- Level = level;
- PatchFileInfo = info;
- MaxLevel = maxLevel;
- PositionsType = posType;
- InvertZ = invertZ;
- MaxTriangleSize = maxTriangleSize;
- //patchCounter++;
- //Report.Line("++" + patchCounter);
- }
-
- //~Patch()
- //{
- // patchCounter--;
- // Report.Line("--" + patchCounter);
- //}
-
- public static Patch FromFile(string patchXmlPath, int level, int maxLevel, PositionsType posType)
- {
- return new Patch(PatchFileInfo.FromFile(patchXmlPath), patchXmlPath, level, maxLevel, posType);
- }
-
- public static C4f GetLodColor(int level, int maxLevel)
- {
- if (maxLevel == 0)
- return C4f.Red;
-
- float hue = ((float)level / (float)maxLevel) * 2 / (float)3;
-
- return C3f.FromHSV(hue, 1.0f, 1.0f).ToC4f();
- }
-
- public static AardvarkFormat GetTextureFormatFromPixelFormat(PixelFormat pixelFormat)
- {
- var size = Image.GetPixelFormatSize(pixelFormat);
- var result = AardvarkFormat.Dxt5;
-
- switch (size)
- {
- case 8:
- //8bit
- result = AardvarkFormat.L8;
- break;
- case 24:
- case 32:
- result = AardvarkFormat.Dxt5;
- break;
- default:
- break;
- }
-
- return result;
- }
- }
-
-
- [Rule(typeof(Patch))]
- public class PatchRule : IRule, IGetAvgTexelSize, IHasFinished
- {
-
- private Patch m_instance;
- private ISg m_returnISg;
- private Dictionary m_asyncTextures;
- private readonly Object asyncLock = new object();
-
- bool m_isInitialized = false;
-
-
- public PatchRule(Patch instance, AbstractTraversal traversal)
- {
- m_instance = instance;
- }
-
- public void InitForPath(AbstractTraversal t)
- {
- //Nop
- }
-
- public ISg SetParameters(AbstractTraversal t)
- {
- if (!m_isInitialized)
- {
- var info = m_instance.PatchFileInfo;
- var bb = m_instance.PositionsType == PositionsType.V3dPositions ?
- info.LocalBoundingBox : info.LocalBoundingBox2d;
-
- var patch = new StreamingJob(
- () =>
- {
- //TaskCombinators.Delay(100);
- //do importer logic here
-
- var patchVg = m_instance.LoadingStrategy.Load(m_instance.PatchFileInfo, m_instance.PatchFilePath, m_instance.PositionsType,
- true, true, true, m_instance.MaxTriangleSize);
-
- if (patchVg == null)
- return EmptyLeaf.Singleton;
-
- var lodColor = Patch.GetLodColor(m_instance.Level, m_instance.MaxLevel);
- patchVg["LodColor"] = lodColor;
-
- for (int i = 0; i < patchVg.Textures.Count; i++)
- {
- var key = patchVg.Textures.Keys.ToList()[i];
-
- var source = patchVg.Textures[key].Convertible;
- Convertible target = null;
-
- if (t.Renderer is SlimDx9Renderer)
- {
- target = SlimDx9TextureConvertible.Create(
- new SlimDx9TextureConvertible.SlimDx9TextureParameters()
- {
- //SlimDx9Format = SlimDX.Direct3D9.Format., // .Dxt5,
- Pool = SlimDX.Direct3D9.Pool.Default
- });
- source.ConvertInto(target);
- }
- else
- {
- // nothing todo in slimdx10renderer (this just loads the texture on demand)
- // fix this if you are fed up with framerate hick ups
- target = source;
- }
-
- patchVg.Textures[key] = new Texture(target);
- }
- lock (asyncLock)
- {
- m_asyncTextures = patchVg.Textures;
- }
-
- return patchVg.ToVertexGeometrySet();
- },
- bb, m_instance.MaxLevel - m_instance.Level, true);
-
- patch.DestructSideEffects = DisposeSideEffects;
-
- var placeHolder = Primitives.WireBox(bb, C4b.Red).ToVertexGeometrySet();
-
- m_returnISg = new AsyncStreamingNode(patch, placeHolder)
- {
- DebugName = Path.GetFileName(m_instance.PatchFilePath),
- };
-
- var local2Global = m_instance.PatchFileInfo.GetLocal2Global(m_instance.PositionsType);
-
- if (m_instance.InvertZ)
- local2Global = M44d.Scale(1, 1, -1) * local2Global;
-
- var global2Local = local2Global.Inverse;
- m_returnISg = Rsg.Apply(Rsg.Attribute.PushTrafo3d(new Trafo3d(local2Global, global2Local)), m_returnISg);
-
- m_isInitialized = true;
- }
-
- return m_returnISg;
- }
-
- public void DisposeSideEffects()
- {
- lock (asyncLock)
- {
- if (m_asyncTextures != null)
- {
- foreach (var tex in m_asyncTextures.Values)
- {
- var dxTex = SlimDx9TextureConvertible.OriginalTextureWithParameters(tex.Convertible);
- if (dxTex != null) dxTex.Dispose();
- }
- m_asyncTextures = null;
- }
- }
- }
-
- public bool DisposeAndRemove(DisposeAndRemoveTraversal t)
- {
- //patchCounter--;
- //Report.Line("--" + patchCounter);
-
- DisposeSideEffects();
-
- if (m_returnISg != null)
- return t.TryDisposeAndRemoveRule(m_instance, t, m_returnISg);
-
- return true;
- }
-
- public double GetAvgTexelSize(GetAvgTexelSizeTraversal traversal)
- {
- return m_instance.AvgTexelSize;
- }
-
- public bool HasFinished(HasFinishedTraversal t)
- {
- if (m_returnISg == null)
- return false;
-
- return m_returnISg.HasFinished(t);
- }
- }
-
- public class CachedCvg : Instance
- {
- public const string Identifier = "CachedCvg";
-
- public CachedCvg(ConcreteVertexGeometryLeaf cvg)
- : base(Identifier)
- {
- Cvg = cvg;
- }
-
- public readonly ConcreteVertexGeometryLeaf Cvg;
- }
-
- [Rule(typeof(CachedCvg))]
- public class CachedCvgRule : IRule
- {
- private readonly CachedCvg m_instance;
-
- public CachedCvgRule(CachedCvg instance, AbstractTraversal t)
- {
- m_instance = instance;
- }
-
- public void InitForPath(AbstractTraversal t)
- {
- // nop
- }
-
- public ISg SetParameters(AbstractTraversal t)
- {
- return m_instance.Cvg;
- }
-
- public bool DisposeAndRemove(DisposeAndRemoveTraversal t)
- {
- m_instance.Cvg.Dispose(t);
-
- return t.TryDisposeAndRemoveRule(m_instance, t);
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/PatchFileInfo.cs b/legacy/Aardvark.Opc/PatchHierarchy/PatchFileInfo.cs
deleted file mode 100644
index e3b442a2..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/PatchFileInfo.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-using Aardvark.Base;
-using Aardvark.Runtime;
-using Aardvark.VRVis;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- ///
- /// Aggregates Data from patch.xml in a class
- ///
- [RegisterTypeInfo(Version = 1)]
- public class PatchFileInfo : IFieldCodeable
- {
- public List TagList;
- public string GeometryType;
- public string QuadVertexSortOrder = QuadVertexSortOrderType.ColumnMajor;
-
- public M44d Local2Global;
- public Box3d GlobalBoundingBox;
- public Box3d LocalBoundingBox;
-
- public M44d Local2Global2d;
- public Box3d GlobalBoundingBox2d;
- public Box3d LocalBoundingBox2d;
-
- public string Positions;
- public string Positions2d;
- public string Normals;
- public string Offsets;
-
- public bool IsValid;
-
- public List Coordinates;
- public List Textures;
-
- public static class QuadVertexSortOrderType
- {
- public static readonly string ColumnMajor = "ColumnMajor";
- public static readonly string RowMajor = "RowMajor";
- }
-
- public PatchFileInfo() { }
-
- ///
- /// Reads full patch.xml into and returns a PatchFileInfo
- ///
- public static PatchFileInfo FromFile(string patchFilePath)
- {
- if (Path.GetFileName(patchFilePath) != "patch.xml")
- patchFilePath = Path.Combine(patchFilePath, "patch.xml");
-
- //var patch = XElement.Load(patchFilePath, LoadOptions.None).Element("Patch");
- var patch = XElement.Load(Load.AsMemoryStream(patchFilePath)).Element("Patch");
-
- var info = new PatchFileInfo()
- {
- TagList = ReadStringList(patch, "TagList"),
- GeometryType = ReadString(patch, "GeometryType"),
- QuadVertexSortOrder = ReadString(patch, "QuadVertexSortOrder", PatchFileInfo.QuadVertexSortOrderType.ColumnMajor),
-
- Local2Global = ReadM44d(patch, "Local2Global"),
- GlobalBoundingBox = ReadBox3d(patch, "GlobalBoundingBox"),
- LocalBoundingBox = ReadBox3d(patch, "LocalBoundingBox"),
-
- Positions = ReadString(patch, "Positions"),
-
- Coordinates = ReadStringList(patch, "Coordinates"),
- Textures = ReadStringList(patch, "Textures"),
- };
-
- if(HasNormalsAndOffsets(patch))
- {
- info.Normals = ReadString(patch, "Normals");
- info.Offsets = ReadString(patch, "Offsets");
- }
-
- //var x = patch.Element("Local2Global2D");
- //Report.Line(x.ToString());
- // //e.Element("GlobalBoundingBox2d") != null &&
- // //e.Element("LocalBoundingBox2d") != null &&
- // //e.Element("Positions2d") != null;
-
- if (XmlHas2dData(patch))
- {
- info.Local2Global2d = ReadM44d(patch, "Local2Global2D");
- info.GlobalBoundingBox2d = ReadBox3d(patch, "GlobalBoundingBox2D");
- info.LocalBoundingBox2d = ReadBox3d(patch, "LocalBoundingBox2D");
- info.Positions2d = ReadString(patch, "Positions2D");
- }
-
- if (!info.LocalBoundingBox2d.IsValid)
- Report.Warn("LocalBoundingBox2d is not valid");
-
- return info;
- }
-
- public bool Has2dData
- {
- get
- {
- return this.Positions2d != null &&
- LocalBoundingBox2d.IsValid &&
- GlobalBoundingBox2d.IsValid;
- }
- }
-
- public Box3d GetGlobalBoundingBox(PositionsType posType)
- {
- if (posType == PositionsType.V3dPositions)
- return GlobalBoundingBox;
- else
- return GlobalBoundingBox2d;
- }
-
- public Box3d GetLocalBoundingBox(PositionsType posType)
- {
- if (posType == PositionsType.V3dPositions)
- return LocalBoundingBox;
- else
- return LocalBoundingBox2d;
- }
-
- public M44d GetLocal2Global(PositionsType posType)
- {
- if (posType == PositionsType.V3dPositions)
- return Local2Global;
- else
- return Local2Global2d;
- }
-
- #region Parse Helpers
- private static M44d ReadM44d(XElement e, string tagName)
- {
- return M44d.Parse(e.Element(tagName).Value.Trim());
- }
-
- private static Box3d ReadBox3d(XElement e, string tagName)
- {
- return Box3d.Parse(e.Element(tagName).Value.Trim());
- }
-
- private static List ReadStringList(XElement e, string tagName)
- {
- return e.Element(tagName).Elements().Select(x => x.Value.Trim()).ToList();
- }
-
- private static string ReadString(XElement e, string tagName, string defaultValue = "")
- {
- return
- e.Element(tagName) == null
- ? defaultValue
- : e.Element(tagName).Value.Trim();
- }
-
- private static bool XmlHas2dData(XElement e)
- {
- return e.Element("Local2Global2D") != null &&
- e.Element("GlobalBoundingBox2D") != null &&
- e.Element("LocalBoundingBox2D") != null &&
- e.Element("Positions2D") != null;
- }
-
- private static bool HasNormalsAndOffsets(XElement e)
- {
- return e.Element("Normals") != null &&
- e.Element("Offsets") != null;
- }
- #endregion
-
- #region IFieldCodeable Members
-
- public IEnumerable GetFieldCoders(int coderVersion)
- {
- yield return new FieldCoder(0, "TagList", (c, o) => c.CodeList_of_String_(ref ((PatchFileInfo)o).TagList));
- yield return new FieldCoder(1, "GeometryType", (c, o) => c.CodeString(ref ((PatchFileInfo)o).GeometryType));
- yield return new FieldCoder(2, "QuadVertexSortOrder", 1, int.MaxValue, (c, o) => c.CodeString(ref ((PatchFileInfo)o).QuadVertexSortOrder));
-
- yield return new FieldCoder(3, "Local2Global", (c, o) => c.CodeM44d(ref ((PatchFileInfo)o).Local2Global));
- yield return new FieldCoder(4, "GlobalBoundingBox", (c, o) => c.CodeBox3d(ref ((PatchFileInfo)o).GlobalBoundingBox));
- yield return new FieldCoder(5, "LocalBoundingBox", (c, o) => c.CodeBox3d(ref ((PatchFileInfo)o).LocalBoundingBox));
-
- yield return new FieldCoder(6, "Local2Global2d", (c, o) => c.CodeM44d(ref ((PatchFileInfo)o).Local2Global2d));
- yield return new FieldCoder(7, "GlobalBoundingBox2d", (c, o) => c.CodeBox3d(ref ((PatchFileInfo)o).GlobalBoundingBox2d));
- yield return new FieldCoder(8, "LocalBoundingBox2d", (c, o) => c.CodeBox3d(ref ((PatchFileInfo)o).LocalBoundingBox2d));
-
- yield return new FieldCoder(9, "Positions", (c, o) => c.CodeString(ref ((PatchFileInfo)o).Positions));
- yield return new FieldCoder(10, "Positions2d", (c, o) => c.CodeString(ref ((PatchFileInfo)o).Positions2d));
- yield return new FieldCoder(11, "Normals", (c, o) => c.CodeString(ref ((PatchFileInfo)o).Normals));
- yield return new FieldCoder(12, "Offsets", (c, o) => c.CodeString(ref ((PatchFileInfo)o).Offsets));
-
- yield return new FieldCoder(13, "Coordinates", (c, o) => c.CodeList_of_String_(ref ((PatchFileInfo)o).Coordinates));
- yield return new FieldCoder(14, "Textures", (c, o) => c.CodeList_of_String_(ref ((PatchFileInfo)o).Textures));
- }
- #endregion
- }
-}
-
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchy.cs b/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchy.cs
deleted file mode 100644
index 3c825a8a..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchy.cs
+++ /dev/null
@@ -1,1564 +0,0 @@
-using Aardvark.Algodat;
-using Aardvark.Base;
-using Aardvark.Lod;
-using Aardvark.Opc.KdTree;
-using Aardvark.Runtime;
-using Aardvark.SceneGraph;
-using Aardvark.VRVis;
-using System;
-using System.Collections.Generic;
-using System.Reactive.Subjects;
-using System.Threading;
-using System.Threading.Tasks;
-using System.IO;
-using System.Text;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- public class OpcDescriptor
- {
- public string Id;
- public string Path;
- public string RootPatchName;
- public Box3d BoundingBox
- {
- get
- {
- return PosType == PositionsType.V3dPositions
- ? BoundingBoxXYZ
- : BoundingBoxSvBR;
- }
- }
- public Box3d BoundingBoxXYZ;
- public Box3d BoundingBoxSvBR;
- public PositionsType PosType;
- public bool IsZipped;
-
- public static OpcDescriptor From(string basePath, PositionsType posType = PositionsType.V3dPositions)
- {
- return OpcDescriptor.From(basePath, basePath, posType);
- }
-
- public static OpcDescriptor From(string id, string basePath, PositionsType posType, bool isZipped = false)
- {
- if (isZipped)
- {
- var fileStreamHandler = StorageConfig.FileStreamHandler as ZipContainerStreamHandler;
- if (fileStreamHandler == null)
- {
- fileStreamHandler = new ZipContainerStreamHandler();
- StorageConfig.FileStreamHandler = fileStreamHandler;
- }
-
- fileStreamHandler.RegisterFile(basePath);
- Report.Line("Found and registered OPC Zip files (" + basePath + ").");
- }
-
- // Load patchHierarchy.xml and Patch.xml(from root patch) for some basic infos
- var phiXML = PatchHierarchyXML.From(basePath);
- var info = PatchFileInfo.FromFile(phiXML.RootPatchPath);
-
- return new OpcDescriptor()
- {
- Id = id,
- Path = basePath,
- RootPatchName = phiXML.RootPatchName,
-
- PosType = posType,
- IsZipped = isZipped,
- BoundingBoxXYZ = info.GlobalBoundingBox,
- BoundingBoxSvBR = info.GlobalBoundingBox2d
- };
- }
- }
-
- public enum KdTreeLevel { Lvl_0, Lvl_K, Lvl_N };
-
- [RegisterTypeInfo]
- public class PatchHierarchy : Instance, IRayCastable
- {
- public const string Identifier = "PatchHierarchy";
-
- #region public properties
-
- public Symbol OpcId { get; private set; }
-
- public OpcPaths Paths { get; private set; }
- public string DirectoryPath
- {
- get
- {
- return Paths.BasePath;
- }
- }
-
- public Box3d BoundingBox
- {
- get
- {
- return PositionType == PositionsType.V3dPositions
- ? m_globalBoundingBoxXYZ
- : m_globalBoundingBoxSvBR;
- }
- }
- public PositionsType PositionType { get; private set; }
-
- public PatchHierarchyInfo PatchHierarchyInfo
- {
- get
- {
- if (!IsStreamingInProgress)
- StartAsyncLoadingPatchHierarchyInfo();
-
- if (!m_loadPatchHierarchyInfoTask.IsCompleted)
- Report.Warn("PatchHierarchy: Waiting for PatchHierarchyInfo to be loaded for OPC " + Paths.ShortName);
-
- return m_loadPatchHierarchyInfoTask.Result;
- }
- }
-
- public double MinSv
- {
- get
- {
- return m_globalBoundingBoxSvBR.Min.X;
- }
- }
- public double MaxSv
- {
- get
- {
- return m_globalBoundingBoxSvBR.Max.X;
- }
- }
-
- public KdTreeAttribute KdTreeN { get; private set; }
-
- public KdTreeAttribute KdTreeK
- {
- get
- {
- // start loading
- SetupAsyncLoadingKdTree_K();
-
- // loading finished
- if (m_loadKdTreeKTask.IsCompleted)
- return m_loadKdTreeKTask.Result;
-
- // keep waiting
- return null;
- }
- }
-
- public KdTreeAttribute KdTree0 { get; private set; }
-
- public ProfileLookUpTable ProfileLookUp { get; private set; }
-
- public bool IsStreamingInProgress { get; private set; }
- public bool IsStreamingFinished { get; private set; }
- public IObservable StreamingFinishedEvent
- {
- get { return m_isStreamedEvent; }
- }
-
- ///
- /// Checks if there is a LoD distance metric.
- ///
- public bool HasLoDMetric
- {
- get
- {
- return !LoDDistanceMetric.IsEmptyOrNull();
- }
- }
-
- #endregion
-
- #region public fields
-
- public IOpcSgBuilderStrategy SceneGraphBuilder;
- public bool IgnoreViewFrustumCulling;
- public List LoDDistanceMetric;
-
- public bool LoadKdTreeLevel_0;
- public bool LoadKdTreeLevel_K = false;
-
- #endregion
-
- #region private fields
-
- private Box3d m_globalBoundingBoxXYZ;
- private Box3d m_globalBoundingBoxSvBR;
-
- private Subject m_isStreamedEvent = new Subject();
- private Task m_loadPatchHierarchyInfoTask = null;
- private Task m_loadKdTreeKTask = null;
-
- #endregion
-
- #region constructors
-
- public PatchHierarchy(OpcDescriptor desc)
- : base(Identifier)
- {
- Requires.That(StorageConfig.DirectoryExists(desc.Path), desc.Path + " cannot be found");
-
- OpcId = desc.Id;
- PositionType = desc.PosType;
-
- Paths = OpcPaths.From(desc.Path);
- Paths.SetRootPatchName(desc.RootPatchName);
-
- m_globalBoundingBoxXYZ = desc.BoundingBoxXYZ;
- m_globalBoundingBoxSvBR = desc.BoundingBoxSvBR;
-
- LoadKdTreeLevel_0 = true;
- IsStreamingFinished = false;
- IsStreamingInProgress = false;
-
- SetupAsyncLoadingPatchHierarchyInfo();
- }
-
- public PatchHierarchy(OpcDescriptor desc, IOpcSgBuilderStrategy sceneGraphBuilder)
- : this(desc)
- {
- SceneGraphBuilder = sceneGraphBuilder;
- }
-
- #endregion
-
- #region public methods
-
- public static PatchHierarchy From(OpcDescriptor desc, IOpcSgBuilderStrategy sceneGraphBuilder)
- {
- return new PatchHierarchy(desc, sceneGraphBuilder);
- }
-
- public ConcreteKdIntersectionTree GetKdTree(KdTreeLevel level)
- {
- ConcreteKdIntersectionTree kdTreeList = null;
-
- switch (level)
- {
- case KdTreeLevel.Lvl_0:
- if (KdTree0 != null)
- kdTreeList = KdTree0.KdTree;
- break;
- case KdTreeLevel.Lvl_K:
- SetupAsyncLoadingKdTree_K();
- if (!m_loadKdTreeKTask.IsCompleted)
- Report.Warn("PatchHierarchy: Waiting for KdTree Lvl-K to be loaded for OPC " + Paths.ShortName);
-
- var kdTreeK = m_loadKdTreeKTask.Result;
- if (kdTreeK != null)
- {
- kdTreeList = kdTreeK.KdTree;
- break;
- }
-
- // if there is no Lvl-K, fallback to Lvl-N
- goto case KdTreeLevel.Lvl_N;
- default: // default is Lvl-N
- case KdTreeLevel.Lvl_N:
- if (KdTreeN != null)
- kdTreeList = KdTreeN.KdTree;
- break;
- }
-
- return kdTreeList;
- }
-
- #region EqualityComparer
-
- public static ByIdComparer ById = new ByIdComparer();
-
- public class ByIdComparer : IEqualityComparer
- {
- public bool Equals(PatchHierarchy ph1, PatchHierarchy ph2)
- {
- return ph1.OpcId == ph2.OpcId;
- }
- public int GetHashCode(PatchHierarchy ph)
- {
- return ph.OpcId.GetHashCode();
- }
- }
-
- #endregion
-
- #region IRayCastable
-
- public string GetKey()
- {
- return DirectoryPath;
- }
-
- #endregion
-
- #endregion
-
- #region private methods
-
- private void OnStreamingFinished()
- {
- IsStreamingInProgress = false;
- IsStreamingFinished = true;
- m_isStreamedEvent.OnNext(OpcId);
- OpcEvents.StreamingFinished.Fire(OpcId.ToString());
- }
-
- private void SetupAsyncLoadingPatchHierarchyInfo()
- {
- if (m_loadPatchHierarchyInfoTask == null)
- {
- m_loadPatchHierarchyInfoTask = new Task(() =>
- PatchHierarchyInfo.BuildOrLoadCache(Paths));
- }
- }
-
- private void StartAsyncLoadingPatchHierarchyInfo()
- {
- if (m_loadPatchHierarchyInfoTask.Status == TaskStatus.Created)
- {
- try { m_loadPatchHierarchyInfoTask.Start(); }
- catch (InvalidOperationException)
- {
- Report.Warn("PatchHierarchy: PatchHierarchyInfoTask seems to have been started more than once.");
- }
- }
- }
-
- private static KdIntersectionTree LoadKdTree0(OpcPaths paths, PositionsType posType)
- {
- var kdIntTree = Load.As(paths.GetKdTreeZeroPath(posType));
-
- if (kdIntTree == null)
- {
- Report.Error("PatchHierarchy: Loading " +
- (posType == PositionsType.V3dPositions ? "3d" : "2d") +
- " KdTree-0 failed for " + paths.ShortName);
- return null;
- }
-
- // update place-holder-paths of LazyKdTreeSets
- if (kdIntTree.ObjectSet is LazyKdTreeSet)
- {
- ((LazyKdTreeSet)kdIntTree.ObjectSet)
- .UpdatePlaceHolderPaths(paths.BasePath);
- }
- else Report.Error("PatchHierarchy: ObjectSet of KdIntersectionTree is not a LazyKdTreeSet.");
-
- return kdIntTree;
- }
-
- private void SetupAsyncLoadingKdTree_K(bool createHotTask = true)
- {
- if (m_loadKdTreeKTask == null)
- {
- m_loadKdTreeKTask = new Task(() =>
- {
- var kdIntTree = LoadKdTreeK(Paths);
- if (kdIntTree == null)
- return null;
- return new KdTreeAttribute(this, kdIntTree);
- });
-
- if (createHotTask)
- StartAsyncLoadingKdTree_K();
- }
- else
- {
- if (createHotTask && !IsStreamingInProgress)
- StartAsyncLoadingKdTree_K();
- }
- }
-
- private void StartAsyncLoadingKdTree_K()
- {
- if (m_loadKdTreeKTask.Status == TaskStatus.Created)
- {
- try { m_loadKdTreeKTask.Start(); }
- catch (InvalidOperationException)
- {
- Report.Warn("PatchHierarchy: LoadKdTreeKTask seems to have been started more than once.");
- }
- }
- }
-
- private static KdIntersectionTree LoadKdTreeK(OpcPaths paths)
- {
- var lvl_K = paths.SelectLevelK();
-
- if (lvl_K == -1)
- {
- Report.Warn("PatchHierarchy: No Level-k Kd-Tree available for OPC " + paths.ShortName);
- return null;
- }
-
- var pathKdTreeK = paths.GetAggKdTreePath(lvl_K, PositionsType.V3dPositions);
- var kdIntTree = Load.As(pathKdTreeK);
-
- if (kdIntTree == null)
- Report.Warn("PatchHierarchy: Couldn't load Kd-Tree K for OPC " + paths.ShortName);
-
- return kdIntTree;
- }
-
- #endregion
-
- [Rule(typeof(PatchHierarchy))]
- public class PatchHierarchyRule : IRule, IPickable, IGetKdTreeList
- {
- #region private fields
-
- private PatchHierarchy m_instance;
- private ISg m_asyncHierarchy;
- private PickingInfo m_pickingInfo;
- private CancellationTokenSource m_cancelStreaming = new CancellationTokenSource();
-
- private static Telemetry.CpuTime s_cpu_LoadKdTree0 = new Telemetry.CpuTime().Register("PatchHierarchyRule: Load KdTree0", true, true);
- private static Telemetry.CpuTime s_cpu_LoadOpc = new Telemetry.CpuTime().Register("PatchHierarchyRule: Load Opc", true, true);
-
- #endregion
-
- public string Name { get; private set; }
-
- public PatchHierarchyRule(PatchHierarchy instance, AbstractTraversal traversal)
- {
- m_instance = instance;
-
- Name = Path.GetFileName(Path.GetFullPath(Path.Combine(instance.DirectoryPath, @"..")));
-
- if (m_instance.LoadKdTreeLevel_K)
- m_instance.SetupAsyncLoadingKdTree_K(false);
-
- m_asyncHierarchy = SetupRenderNode(m_instance, this);
- }
-
- #region IRule
-
- public void InitForPath(AbstractTraversal t) { } //Nop
-
- public ISg SetParameters(AbstractTraversal t)
- {
- return m_asyncHierarchy;
- }
-
- public bool DisposeAndRemove(DisposeAndRemoveTraversal t)
- {
- m_cancelStreaming.Cancel();
-
- var childNodes = m_asyncHierarchy;
- m_asyncHierarchy = EmptyLeaf.Singleton;
- return t.TryDisposeAndRemoveRule(m_instance, t, childNodes);
- }
-
- #endregion
-
- #region IGetKdTreeList
-
- public List GetKdTreeList(GetKdTreeTraversal t)
- {
- var filter =
- t.Filter == "Level0" ? KdTreeLevel.Lvl_0 :
- t.Filter == "LevelK" ? KdTreeLevel.Lvl_K :
- KdTreeLevel.Lvl_N;
-
- var kdTree = m_instance.GetKdTree(filter);
-
- if (kdTree == null)
- return new List { };
- else return new List { kdTree };
- }
-
- #endregion
-
- #region IPickable
-
- public PickingInfo PickingInfo
- {
- get
- {
- return m_pickingInfo;
- }
- }
-
- #endregion
-
- #region private methods
-
- private static ISg SetupRenderNode(PatchHierarchy patchHier, PatchHierarchyRule patchHierRule)
- {
- var hierarchy = SetupStreamingJob(patchHier, patchHierRule);
-
- // center BB to avoid float conversion problem on transfer to GPU
- var bbCenter = patchHier.BoundingBox.Center;
- var placeHolder = Rsg.Apply(
- Rsg.Attribute.PushTrafo3d(Trafo3d.Translation(bbCenter)),
- Primitives.WireBox(patchHier.BoundingBox - bbCenter, C4b.Gray).ToVertexGeometrySet()
- );
-
- return new BoundingBoxAttribute(
- new GCHandle(
- new LoD(placeHolder, //simple
- new AsyncStreamingNode(hierarchy, placeHolder), //detail
- new TrivialNotSufficientDecider()
- ) { IsPinned = patchHier.IgnoreViewFrustumCulling })
- {
- DebugName = "PatchHierarchyLoDs " + patchHier.OpcId,
- IgnoreFrustumCulling = patchHier.IgnoreViewFrustumCulling,
- IsPinned = false
- }
- );
- }
-
- private static StreamingJob SetupStreamingJob(PatchHierarchy patchHier, PatchHierarchyRule patchHierRule)
- {
- var cancelToken = patchHierRule.m_cancelStreaming.Token;
-
- var hierarchy = new StreamingJob(
- () =>
- {
- Report.BeginTimed("PatchHierarchyRule: Streaming OPC {0}", patchHier.OpcId);
- Kernel.CQ.Enqueue(() => patchHier.IsStreamingInProgress = true);
-
- #region preload
-
- // Load PatchHierarchyInfo
- PatchHierarchyInfo phi = null;
- if (!cancelToken.IsCancellationRequested)
- {
- patchHier.StartAsyncLoadingPatchHierarchyInfo();
- phi = patchHier.m_loadPatchHierarchyInfoTask.Result;
- }
-
- // Load KdTreeN
- if (patchHier.KdTreeN == null && !cancelToken.IsCancellationRequested)
- {
- var kdIntTree =
- KdTreeUtils.BuildOrLoadKdTreeN(patchHier.Paths, patchHier.PositionType, phi.PatchTree.Info);
- Kernel.CQ.Enqueue(() =>
- patchHier.KdTreeN = new KdTreeAttribute(patchHier, kdIntTree));
- }
-
- // Load ProfileLut
- if (patchHier.ProfileLookUp == null && StorageConfig.FileExists(patchHier.Paths.ProfileLutPath) && !cancelToken.IsCancellationRequested)
- {
- var lut = Load.As(patchHier.Paths.ProfileLutPath);
- if (lut == null)
- Report.Warn("PatchHierarchy: Loading ProfileLookUpTable failed for OPC " + patchHier.OpcId);
- else
- lut.UpdateFilePaths(patchHier.Paths);
- Kernel.CQ.Enqueue(() => patchHier.ProfileLookUp = lut);
- }
-
- // Load KdTreeK
- if (patchHier.LoadKdTreeLevel_K &&
- patchHier.m_loadKdTreeKTask != null &&
- !cancelToken.IsCancellationRequested)
- {
- patchHier.StartAsyncLoadingKdTree_K();
- patchHier.m_loadKdTreeKTask.Wait();
- }
-
- // Load KdTree0
- if (patchHier.LoadKdTreeLevel_0 && patchHier.KdTree0 == null && !cancelToken.IsCancellationRequested)
- {
- using (s_cpu_LoadKdTree0.Timer)
- {
- //var kdTree0 = LoadKdTree0(patchHier);
- var kdTree0 = LoadKdTree0(patchHier.Paths, patchHier.PositionType);
-
- Kernel.CQ.Enqueue(() =>
- {
- patchHier.KdTree0 = new KdTreeAttribute(patchHier, kdTree0);
- // set pickingInfo
- patchHierRule.m_pickingInfo = new PickingInfo(new KdTreeSet(patchHier.KdTree0.KdTree));
- });
- }
- }
-
- #endregion
-
- if (cancelToken.IsCancellationRequested)
- {
- Report.End();
- return EmptyLeaf.Singleton;
- }
-
- //execute opc building strategy
- ISg isg;
- using (s_cpu_LoadOpc.Timer)
- {
- isg = patchHier.SceneGraphBuilder.CreateSceneGraph(patchHier.Paths, patchHier);
- }
-
- Kernel.CQ.Enqueue(() => patchHier.OnStreamingFinished());
- Report.End();
- return isg;
- }, patchHier.BoundingBox, 0);
-
- return hierarchy;
- }
-
- #endregion
- }
- }
-
- #region PatchHierarchy w/TaskCompletionSource
-
- //[RegisterTypeInfo]
- //public class PatchHierarchy : Instance, IRayCastable, IDisposable
- //{
- // #region public properties and fields
-
- // public const string Identifier = "PatchHierarchy";
-
- // public Symbol OpcId { get; private set; }
-
- // public OpcPaths Paths
- // {
- // get
- // {
- // if (m_paths.RootPatchName == null)
- // m_paths.SetRootPatchName(PatchHierarchyInfo.RootPatch);
- // return m_paths;
- // }
- // }
- // public string DirectoryPath
- // {
- // get
- // {
- // return m_paths.BasePath;
- // }
- // }
-
- // public Box3d BoundingBox { get; private set; }
- // public PositionsType PositionType { get; private set; }
- // public bool IgnoreViewFrustumCulling { get; set; }
-
- // public PatchHierarchyInfo PatchHierarchyInfo
- // {
- // get
- // {
- // if (m_loadPatchHierarchyInfoTask == null || !m_loadPatchHierarchyInfoTask.IsCompleted)
- // { // load, if not yet loaded asynchrounas
- // var tcs = new TaskCompletionSource();
- // m_loadPatchHierarchyInfoTask = tcs.Task;
- // var phi = PatchHierarchyInfo.BuildOrLoadCache(m_paths);
- // tcs.SetResult(phi);
- // }
-
- // return m_loadPatchHierarchyInfoTask.Result;
- // }
- // }
- // public double MinSv
- // {
- // get
- // {
- // return PatchHierarchyInfo.PatchTree.Info.GlobalBoundingBox2d.Min.X;
- // }
- // }
- // public double MaxSv
- // {
- // get
- // {
- // return PatchHierarchyInfo.PatchTree.Info.GlobalBoundingBox2d.Max.X;
- // }
- // }
-
- // public KdTreeAttribute KdTreeN
- // {
- // get
- // {
- // if (m_loadKdTreeNTask == null || !m_loadKdTreeNTask.IsCompleted)
- // return null;
- // return m_loadKdTreeNTask.Result;
- // }
- // }
- // public LazyKdTreeAttribute KdTreeK { get; set; }
- // public KdTreeAttribute KdTree0
- // {
- // get
- // {
- // if (m_loadKdTree0Task == null || !m_loadKdTree0Task.IsCompleted)
- // return null;
- // return m_loadKdTree0Task.Result;
- // }
- // }
-
- // public ProfileLookUpTable ProfileLookUp
- // {
- // get
- // {
- // if (m_loadLutTask == null || !m_loadLutTask.IsCompleted)
- // return null;
- // return m_loadLutTask.Result;
- // }
- // }
-
- // public bool IsStreamed = false;
- // public IObservable IsStreamedEvent
- // {
- // get { return m_isStreamedEvent; }
- // }
-
- // public IOpcSgBuilderStrategy SceneGraphBuilder { get; set; }
-
- // public bool MaxLevelToShow { get; set; }
-
- // public bool LoadLevel0KdTree { get; set; }
-
- // public List LoDDistanceMetric { get; set; }
-
- // ///
- // /// Checks if there is a LoD distance metric.
- // ///
- // public bool HasLoDMetric
- // {
- // get
- // {
- // return !LoDDistanceMetric.IsEmptyOrNull();
- // }
- // }
-
- // #endregion
-
- // #region private fields
-
- // private static Symbol s_Level0 = "Level0";
- // private static Symbol s_LevelK = "LevelK";
-
- // private Subject m_isStreamedEvent = new Subject();
- // private Task m_loadPatchHierarchyInfoTask = null;
- // private Task m_loadKdTreeNTask = null;
- // private Task m_loadLutTask = null;
- // private Task m_loadKdTree0Task = null;
- // private OpcPaths m_paths = null;
-
- // #endregion
-
- // #region constructors
-
- // public PatchHierarchy() { }
-
- // public PatchHierarchy(OpcDescriptor desc)
- // : base(Identifier)
- // {
- // Requires.That(StorageConfig.DirectoryExists(desc.Path), desc.Path + " cannot be found");
-
- // LoadLevel0KdTree = true;
-
- // OpcId = desc.Id;
- // BoundingBox = desc.BoundingBox;
- // PositionType = desc.PosType;
- // m_paths = OpcPaths.From(desc.Path);
- // }
-
- // public PatchHierarchy(OpcDescriptor desc, IOpcSgBuilderStrategy sceneGraphBuilder)
- // : this(desc)
- // {
- // SceneGraphBuilder = sceneGraphBuilder;
- // }
-
- // #endregion
-
- // #region public methods
-
- // public static PatchHierarchy From(OpcDescriptor desc, IOpcSgBuilderStrategy sceneGraphBuilder)
- // {
- // return new PatchHierarchy(desc, sceneGraphBuilder);
- // }
-
- // public ConcreteKdIntersectionTree GetKdTree(Symbol filter)
- // {
- // #region Level 0 KdTree
- // if (filter != null && filter == s_Level0)
- // {
- // // KdTree0 not loaded or not finished loading
- // if (KdTree0 == null)
- // return null;
-
- // ConcreteKdIntersectionTree kdTreeList = null;
- // try
- // {
- // kdTreeList = KdTree0.KdTree;
- // if (kdTreeList == null)
- // {
- // Report.Warn("PatchHierarchy: No Level-0 kdTree list associated with opc {0}", DirectoryPath);
- // return kdTreeList;
- // }
- // }
- // catch (KeyNotFoundException)
- // {
- // Report.Warn("PatchHierarchy: kdtree format fail");
- // }
-
- // var kdIntTree = kdTreeList.KdIntersectionTree;
- // if (kdIntTree != null)
- // {
- // var lazySet = kdIntTree.ObjectSet as LazyKdTreeSet;
- // if (lazySet != null)
- // lazySet.UpdatePlaceHolderPaths(DirectoryPath);
- // }
-
- // return kdTreeList;
- // }
- // #endregion
-
- // #region Level K KdTree
- // if (filter != null && filter == s_LevelK)
- // {
- // //kdTreek attribute not set create one
- // if (KdTreeK == null)
- // {
- // if (KdTreeN != null)
- // {
- // Report.Warn("PatchHierarchy: No KdTree-K found, falling back to KdTree-N in Opc " + OpcId);
- // return KdTreeN.KdTree;
- // }
- // else
- // Report.Warn("PatchHierarchy: No KdTree-K or KdTree-N found in Opc " + OpcId);
- // return null;
- // }
-
- // ConcreteKdIntersectionTree kdTreeList = null;
- // try
- // {
- // KdTreeK.Preload();
- // kdTreeList = KdTreeK.KdTree;
- // if (kdTreeList == null)
- // {
- // Report.Warn("PatchHierarchy: No Level-k kdTree list associated with opc {0}", DirectoryPath);
- // return kdTreeList;
- // }
- // }
- // catch (KeyNotFoundException)
- // {
- // Report.Warn("PatchHierarchy: kdtree format fail");
- // }
-
- // var kdIntTree = kdTreeList.KdIntersectionTree;
- // if (kdIntTree != null)
- // {
- // var lazySet = kdIntTree.ObjectSet as LazyKdTreeSet;
- // if (lazySet != null)
- // lazySet.UpdatePlaceHolderPaths(DirectoryPath);
- // }
-
- // return kdTreeList;
- // }
-
- // #endregion
-
- // // Level N KdTree
- // if (KdTreeN == null)
- // return null;
- // return KdTreeN.KdTree;
- // }
-
- // #region EqualityComparer
-
- // public static ByIdComparer ById = new ByIdComparer();
-
- // public class ByIdComparer : IEqualityComparer
- // {
- // public bool Equals(PatchHierarchy ph1, PatchHierarchy ph2)
- // {
- // return ph1.OpcId == ph2.OpcId;
- // }
- // public int GetHashCode(PatchHierarchy ph)
- // {
- // return ph.OpcId.GetHashCode();
- // }
- // }
-
- // #endregion
-
- // #region IRayCastable
-
- // // TODO: should be combination of OpcId and ViewerId or OpcId and PosType?!?!
- // public string GetKey()
- // {
- // return DirectoryPath;
- // }
-
- // #endregion
-
- // #region IDisposable
-
- // public void Dispose()
- // {
- // m_isStreamedEvent.OnCompleted();
- // m_isStreamedEvent.Dispose();
- // }
-
- // #endregion
-
- // #endregion
-
- // #region private methods
-
- // //private void LoadKdTree0()
- // //{
- // // if (m_loadKdTree0Task != null && !m_loadKdTree0Task.IsCompleted)
- // // return;
-
- // // var completionSource = new TaskCompletionSource();
- // // m_loadKdTree0Task = completionSource.Task;
-
- // // var kdTree0 = LoadKdTree0(this);
-
- // // completionSource.SetResult(kdTree0);
- // //}
-
- // private static KdTreeAttribute LoadKdTree0(PatchHierarchy ph)
- // {
- // if (ph.Paths.RootPatchName == null)
- // return null;
-
- // var kdIntTree = Load.As(ph.Paths.GetKdTreeZeroPath(ph.PositionType));
- // if (kdIntTree == null)
- // Report.Error("PatchHierarchy: Loading KdTree-0 failed for OPC " + ph.OpcId);
- // var kdTree0 = new KdTreeAttribute(ph, kdIntTree);
-
- // if (kdTree0.KdTree.KdIntersectionTree == null)
- // Report.Error("PatchHierarchy: KdIternsectionTree not available.");
- // else
- // {
- // var lazySet = kdTree0.KdTree.KdIntersectionTree.ObjectSet as LazyKdTreeSet;
- // if (lazySet == null)
- // Report.Error("PatchHierarchy: ObjectSet of KdIntersectionTree is not a LazyKdTreeSet.");
- // else
- // {
- // lazySet.KdTreePlaceholders.ForEach(x =>
- // {
- // var kdtreeName = Path.GetFileName(x.Path);
- // x.Path = Path.Combine(ph.Paths.RootPatchPath, kdtreeName);
-
- // string patchName, posName;
- // if (ph.PositionType == PositionsType.V3dPositions)
- // {
- // patchName = kdtreeName.Substring(0, kdtreeName.Length - 7);
- // posName = "positions.aara";
- // }
- // else
- // {
- // patchName = kdtreeName.Substring(0, kdtreeName.Length - 10);
- // posName = "positions2d.aara";
- // }
-
- // x.ObjectSetPath = Path.Combine(Path.Combine(ph.Paths.PatchesSubDir, patchName), posName);
- // Requires.That(StorageConfig.FileExists(x.Path), "level 0 patch " + patchName + " is missing. kdtree invalid");
- // });
- // }
- // }
-
- // return kdTree0;
- // }
-
- // #endregion
-
- // [Rule(typeof(PatchHierarchy))]
- // public class PatchHierarchyRule : IRule, IPickable, IGetKdTreeList
- // {
- // #region private fields
-
- // private PatchHierarchy m_instance;
- // private ISg m_asyncHierarchy;
- // private PickingInfo m_pickingInfo;
- // private bool m_initialized = false;
-
- // private TaskCompletionSource m_patchHierarchyInfoCS = null;
- // private TaskCompletionSource m_kdTreeNCS = null;
- // private TaskCompletionSource m_lutCS = null;
- // private TaskCompletionSource m_kdTree0CS = null;
- // private EventDescription m_streamingFinished;
-
- // private Stack m_disposables = new Stack();
-
- // private static Telemetry.CpuTime s_cpu_LoadKdTree0 = new Telemetry.CpuTime().Register("PatchHierarchyRule: Load KdTree0", true, true);
- // private static Telemetry.CpuTime s_cpu_LoadOpc = new Telemetry.CpuTime().Register("PatchHierarchyRule: Load Opc", true, true);
-
- // #endregion
-
- // public PatchHierarchyRule(PatchHierarchy instance, AbstractTraversal traversal)
- // {
- // m_instance = instance;
- // m_streamingFinished = new EventDescription("PatchHierarchyRule:StreamingFinished " + m_instance.OpcId);
- // m_disposables.Push
- // (Kernel.EQ.Where(m_streamingFinished).Subscribe((_) => StreamingFinishedCallback()));
- // }
-
- // private void StreamingFinishedCallback()
- // {
- // m_instance.IsStreamed = true;
- // m_instance.m_isStreamedEvent.OnNext(m_instance.OpcId);
- // OpcEvents.StreamingFinished.Fire(m_instance.OpcId.ToString());
- // }
-
- // #region IRule
-
- // public void InitForPath(AbstractTraversal t) { } //Nop
-
- // public ISg SetParameters(AbstractTraversal t)
- // {
- // if (!m_initialized)
- // {
- // #region Prepare TaskCompletionSources for threadsafe Feedback
-
- // if (m_instance.m_loadPatchHierarchyInfoTask == null)
- // { // PatchHierarchyInfo
- // m_patchHierarchyInfoCS = new TaskCompletionSource();
- // m_instance.m_loadPatchHierarchyInfoTask = m_patchHierarchyInfoCS.Task;
- // }
- // if (m_instance.m_loadKdTreeNTask == null)
- // { // KdTree N
- // m_kdTreeNCS = new TaskCompletionSource();
- // m_instance.m_loadKdTreeNTask = m_kdTreeNCS.Task;
- // }
- // if (m_instance.m_loadLutTask == null && StorageConfig.FileExists(m_instance.Paths.ProfileLutPath))
- // { // Lookup Table
- // m_lutCS = new TaskCompletionSource();
- // m_instance.m_loadLutTask = m_lutCS.Task;
- // }
- // if (m_instance.LoadLevel0KdTree && m_instance.m_loadKdTree0Task == null)
- // { // KdTree 0
- // m_kdTree0CS = new TaskCompletionSource();
- // m_instance.m_loadKdTree0Task = m_kdTree0CS.Task;
- // }
-
- // #endregion
-
- // var paths = new OpcPaths(m_instance.m_paths.BasePath);
-
- // // Setup OPC loading
- // var hierarchy = new StreamingJob(
- // () =>
- // {
- // Report.BeginTimed("PatchHierarchyRule: Streaming OPC {0}", m_instance.OpcId);
-
- // #region preload
-
- // if (!m_instance.IsStreamed)
- // {
- // // Load PatchHierarchyInfo
- // if (m_patchHierarchyInfoCS != null)
- // {
- // var phi = PatchHierarchyInfo.BuildOrLoadCache(paths);
- // m_patchHierarchyInfoCS.SetResult(phi);
- // }
- // paths.SetRootPatchName(m_instance.PatchHierarchyInfo.RootPatch);
-
- // // Load KdTreeN
- // if (m_kdTreeNCS != null)
- // {
- // var kdIntTree =
- // KdTreeUtils.BuildOrLoadKdTreeN(paths, m_instance.PositionType, m_instance.PatchHierarchyInfo.PatchTree.Info);
- // m_kdTreeNCS.SetResult(new KdTreeAttribute(m_instance, kdIntTree));
- // }
- // // Load ProfileLut
- // if (m_lutCS != null)
- // {
- // var lut = Load.As(paths.ProfileLutPath);
- // if (lut == null)
- // Report.Warn("PatchHierarchy: Loading ProfileLookUpTable failed for OPC " + m_instance.OpcId);
- // else
- // lut.UpdateFilePaths(paths);
- // m_lutCS.SetResult(lut);
- // }
- // // Load KdTree0
- // if (m_kdTree0CS != null)
- // {
- // using (s_cpu_LoadKdTree0.Timer)
- // {
- // var kdTree0 = LoadKdTree0(m_instance);
- // m_kdTree0CS.SetResult(kdTree0);
- // }
- // }
- // }
-
- // #endregion
-
- // //execute opc building strategy
- // ISg isg;
- // using (s_cpu_LoadOpc.Timer)
- // {
- // isg = m_instance.SceneGraphBuilder.CreateSceneGraph(paths, m_instance);
- // }
-
- // m_streamingFinished.Fire();
- // Report.End();
- // return isg;
- // }, m_instance.BoundingBox, 0);
-
- // // center BB to avoid float conversion problem on transfer to GPU
- // var bbCenter = m_instance.BoundingBox.Center;
- // var placeHolder = Rsg.Apply(
- // Rsg.Attribute.PushTrafo3d(Trafo3d.Translation(bbCenter)),
- // Primitives.WireBox(m_instance.BoundingBox - bbCenter, C4b.Gray).ToVertexGeometrySet()
- // );
-
- // m_asyncHierarchy = new BoundingBoxAttribute(
- // new GCHandle(
- // new LoD(placeHolder, //simple
- // new AsyncStreamingNode(hierarchy, placeHolder), //detail
- // new TrivialNotSufficientDecider()
- // ) { IsPinned = m_instance.IgnoreViewFrustumCulling })
- // {
- // DebugName = "PatchHierarchyLoDs " + m_instance.OpcId,
- // IgnoreFrustumCulling = m_instance.IgnoreViewFrustumCulling,
- // IsPinned = false
- // }
- // );
-
- // m_initialized = true;
- // }
-
- // // set pickingInfo
- // if (m_pickingInfo.Geometry == null && m_instance.KdTree0 != null && m_instance.IsStreamed)
- // {
- // var kdTree = m_instance.KdTree0.GetKdTreeList(t.State);
- // m_pickingInfo = new PickingInfo(new KdTreeSet(kdTree));
- // }
-
- // return m_asyncHierarchy;
- // }
-
- // public bool DisposeAndRemove(DisposeAndRemoveTraversal t)
- // {
- // m_disposables.DisposeAll();
- // m_instance.Dispose();
- // var childNodes = m_asyncHierarchy;
- // m_asyncHierarchy = EmptyLeaf.Singleton;
-
- // return t.TryDisposeAndRemoveRule(m_instance, t, childNodes);
- // }
-
- // #endregion
-
- // #region IGetKdTreeList
-
- // public List GetKdTreeList(GetKdTreeTraversal t)
- // {
- // var kdTree = m_instance.GetKdTree(t.Filter);
-
- // if (kdTree == null)
- // return new List { };
- // else return new List { kdTree };
- // }
-
- // #endregion
-
- // #region IPickable
-
- // public PickingInfo PickingInfo
- // {
- // get
- // {
- // return m_pickingInfo;
- // }
- // }
-
- // #endregion
- // }
- //}
-
- #endregion
-
- #region PatchHierarchy Old
-
- //[RegisterTypeInfo]
- //public class PatchHierarchy : Instance, IRayCastable //, IDisposable
- //{
- // public const string Identifier = "PatchHierarchy";
-
- // public Symbol OpcId { get; private set; }
-
- // #region public properties
-
- // public string DirectoryPath { get; private set; }
- // public Box3d BoundingBox { get; private set; }
- // public PositionsType PositionType { get; private set; }
- // public bool IgnoreViewFrustumCulling { get; set; }
- // public PatchHierarchyInfo PatchHierarchyInfo { get; set; }
- // public bool Visible { get; set; }
- // public KdTreeAttribute KdTreeN
- // {
- // get { return Get(Property.KdTreeN.ToString()); }
- // set { this[Property.KdTreeN.ToString()] = value; }
- // }
- // public LazyKdTreeAttribute KdTreeK
- // {
- // get { return Get(Property.KdTreeK.ToString()); }
- // set { this[Property.KdTreeK.ToString()] = value; }
- // }
- // public LazyKdTreeAttribute KdTree0
- // {
- // get { return Get(Property.KdTree0.ToString()); }
- // set { this[Property.KdTree0.ToString()] = value; }
- // }
-
- // public ProfileLookUpTable ProfileLookUp { get; set; }
-
- // public static class Property
- // {
- // public static readonly Symbol KdTree0 = "KdTree0";
- // public static readonly Symbol KdTreeK = "KdTreeK";
- // public static readonly Symbol KdTreeN = "KdTreeN";
- // }
-
- // public double GetMinSv()
- // {
- // if (PatchHierarchyInfo == null)
- // return double.NaN;
-
- // return PatchHierarchyInfo.PatchTree.Info.GlobalBoundingBox2d.Min.X;
- // }
-
- // public double GetMaxSv()
- // {
- // if (PatchHierarchyInfo == null)
- // return double.NaN;
-
- // return PatchHierarchyInfo.PatchTree.Info.GlobalBoundingBox2d.Max.X;
- // }
-
- // public EventSource IsStreamed;
-
- // public IOpcSgBuilderStrategy SceneGraphBuilder { get; set; }
-
- // public OpcPaths Paths { get; set; }
- // public bool MaxLevelToShow { get; set; }
-
- // public bool LoadLevel0KdTree { get; set; }
-
- // public List LoDDistanceMetric { get; set; }
-
- // #endregion
-
- // public PatchHierarchy() { }
-
- // public PatchHierarchy(OpcDescriptor desc)
- // : base(Identifier)
- // {
- // Requires.That(StorageConfig.DirectoryExists(desc.Path), desc.Path + " cannot be found");
-
- // //if (!LoadLevel0KdTree)
- // //{
- // // Report.Warn("Loading of Level0 kdtree is deactivated for {0}", desc.Path);
- // // Report.Warn("Picking is not possible");
- // //}
-
- // IsStreamed = new EventSource(false);
- // LoadLevel0KdTree = true;
-
- // OpcId = desc.Id;
- // DirectoryPath = desc.Path;
- // BoundingBox = desc.BoundingBox;
- // PositionType = desc.PosType;
- // }
-
- // public PatchHierarchy(OpcDescriptor desc, IOpcSgBuilderStrategy sceneGraphBuilder)
- // : this(desc)
- // {
- // SceneGraphBuilder = sceneGraphBuilder;
- // }
-
- // ///
- // /// Checks if there is a LoD distance metric.
- // ///
- // public bool HasLoDMetric
- // {
- // get
- // {
- // return !LoDDistanceMetric.IsEmptyOrNull();
- // }
- // }
- // public string GetKey()
- // {
- // return DirectoryPath; // TODO: should be combination of OpcId and ViewerId or OpcId and PosType?!?!
- // }
-
- // public static PatchHierarchy From(OpcDescriptor desc, IOpcSgBuilderStrategy sceneGraphBuilder)
- // {
- // return new PatchHierarchy(desc, sceneGraphBuilder);
- // }
-
- // private static Symbol s_Level0 = "Level0";
- // private static Symbol s_LevelK = "LevelK";
-
- // public ConcreteKdIntersectionTree GetKdTree(Symbol filter)
- // {
- // if (!IsStreamed.Latest)
- // return null;
-
- // #region Level 0 KdTree
- // if (filter != null && filter == s_Level0)
- // {
- // //kdTree0 attribute not set create one
- // if (KdTree0 == null)
- // {
- // if (Paths == null)
- // return null;
-
- // KdTree0 =
- // new LazyKdTreeAttribute(this, Paths.GetKdTreeZeroPath(PositionType));
- // }
-
- // Requires.NotNull(KdTree0);
-
- // ConcreteKdIntersectionTree kdTreeList = null;
- // try
- // {
- // KdTree0.Preload();
- // kdTreeList = KdTree0.KdTree;
- // if (kdTreeList == null)
- // {
- // Report.Warn("No Level-0 kdTree list associated with opc {0}", DirectoryPath);
- // return kdTreeList;
- // }
- // }
- // catch (KeyNotFoundException)
- // {
- // Report.Warn("kdtree format fail");
- // }
-
- // var kdIntTree = kdTreeList.KdIntersectionTree;
- // if (kdIntTree != null)
- // {
- // var lazySet = kdIntTree.ObjectSet as LazyKdTreeSet;
- // if (lazySet != null)
- // lazySet.UpdatePlaceHolderPaths(DirectoryPath);
- // }
-
- // return kdTreeList;
- // }
- // #endregion
-
- // #region Level K KdTree
- // if (filter != null && filter == s_LevelK)
- // {
- // //kdTreek attribute not set create one
- // if (KdTreeK == null)
- // {
- // return KdTreeN != null ? KdTreeN.KdTree : null;
- // }
-
- // ConcreteKdIntersectionTree kdTreeList = null;
- // try
- // {
- // KdTreeK.Preload();
- // kdTreeList = KdTreeK.KdTree;
- // if (kdTreeList == null)
- // {
- // Report.Warn("No Level-k kdTree list associated with opc {0}", DirectoryPath);
- // return kdTreeList;
- // }
- // }
- // catch (KeyNotFoundException)
- // {
- // Report.Warn("kdtree format fail");
- // }
-
- // var kdIntTree = kdTreeList.KdIntersectionTree;
- // if (kdIntTree != null)
- // {
- // var lazySet = kdIntTree.ObjectSet as LazyKdTreeSet;
- // if (lazySet != null)
- // lazySet.UpdatePlaceHolderPaths(DirectoryPath);
- // }
-
- // return kdTreeList;
- // }
-
- // #endregion
-
- // if (KdTreeN == null)
- // {
- // //Report.Warn("PatchHierarchy: m_instance.KdTree == null");
- // //Report.Warn("No kdtree N could be found");
- // return null;
- // }
-
- // //return kdTree N
- // return KdTreeN.KdTree;
- // }
-
- // #region EqualityComparer
-
- // public static ByIdComparer ById = new ByIdComparer();
-
- // public class ByIdComparer : IEqualityComparer
- // {
- // public bool Equals(PatchHierarchy ph1, PatchHierarchy ph2)
- // {
- // return ph1.OpcId == ph2.OpcId;
- // }
- // public int GetHashCode(PatchHierarchy ph)
- // {
- // return ph.OpcId.GetHashCode();
- // }
- // }
-
- // #endregion
-
- // // TODO: this is not used yet :(
- // public void Dispose()
- // {
- // IsStreamed.Emit(false);
- // IsStreamed.Values.TryDispose();
- // }
- //}
- //[Rule(typeof(PatchHierarchy))]
- //public class PatchHierarchyRule : IRule, IDisposeAndRemove, IPickable, IGetKdTreeList
- //{
- // #region private fields
-
- // private ISg m_asyncHierarchy;
- // private PatchHierarchy m_instance;
- // private PickingInfo m_pickingInfo;
- // private bool m_initialized = false;
-
- // #endregion
-
- // public PatchHierarchyRule(PatchHierarchy instance, AbstractTraversal traversal)
- // {
- // m_instance = instance;
- // }
-
- // public void InitForPath(AbstractTraversal t) { } //Nop
-
- // Group kdGroup = new Group();
- // public ISg SetParameters(AbstractTraversal t)
- // {
- // if (!m_initialized)
- // {
- // var hierarchy = new StreamingJob(
- // () =>
- // {
- // Report.BeginTimed("Streaming OPC {0}", m_instance.OpcId);
- // var paths = OpcPaths.From(m_instance.DirectoryPath);
-
- // m_instance.PatchHierarchyInfo = PatchHierarchyInfo.BuildOrLoadCache(paths);
-
- // paths.SetRootPatchName(m_instance.PatchHierarchyInfo.RootPatch);
-
- // m_instance.Paths = paths;
-
- // PatchHierarchyUtils.HandleKdTrees(m_instance);
-
- // if (StorageConfig.FileExists(paths.ProfileLutPath))
- // {
- // var lut = Load.As(paths.ProfileLutPath);
- // lut.UpdateFilePaths(paths);
- // m_instance.ProfileLookUp = lut;
- // }
-
- // //execute opc building strategy
- // var isg = m_instance.SceneGraphBuilder.CreateSceneGraph(paths, m_instance);
-
- // Requires.NotNull(isg);
- // m_instance.IsStreamed.Emit(true);
- // OpcEvents.StreamingFinished.Fire(m_instance.OpcId.ToString());
-
- // Report.End();
- // return isg;
-
- // }, m_instance.BoundingBox, 0);
-
- // // center BB to avoid float conversion problem on transfer to GPU
- // var bbCenter = m_instance.BoundingBox.Center;
- // var placeHolder = Rsg.Apply(
- // Rsg.Attribute.PushTrafo3d(Trafo3d.Translation(bbCenter)),
- // Primitives.WireBox(m_instance.BoundingBox - bbCenter, C4b.Gray).ToVertexGeometrySet()
- // );
-
- // m_asyncHierarchy = new BoundingBoxAttribute(
- // new GCHandle(
- // new LoD(placeHolder, //simple
- // new AsyncStreamingNode(hierarchy, placeHolder), //detail
- // new TrivialNotSufficientDecider()
- // ) { IsPinned = m_instance.IgnoreViewFrustumCulling })
- // {
- // DebugName = "patch_hier",
- // IgnoreFrustumCulling = m_instance.IgnoreViewFrustumCulling,
- // IsPinned = false
- // }
- // );
-
- // m_initialized = true;
- // }
-
-
- // if (m_instance.IsStreamed.Latest && m_instance.KdTree0 != null && m_pickingInfo.Geometry == null)
- // {
- // var kdTree = m_instance.KdTree0.GetKdTreeList(t.State);
-
- // #region debug
- // //var k = kdTree.First().KdIntersectionTree.ObjectSet as LazyKdTreeSet;
- // //var firstPoint = V3d.NaN;
-
- // //Report.Line(k.ToString());
-
- // //var vgs = k.ConcreteKdTreeList.Select(k1 =>
- // //{
- // // var triangles = k1.KdIntersectionTree.ObjectSet as TriangleSet;
- // // if (firstPoint.IsNaN)
- // // firstPoint = triangles.Position3dList.First();
-
- // // return triangles.Position3dList.Select(x => (x - firstPoint).ToV3f()).ToArray();
- // //}).Where(x => x.Length > 0)
- // //.Select(x => new VertexGeometry(GeometryMode.TriangleList) { Positions = x }).ToVertexGeometrySet();
-
- // //kdGroup.Add(vgs.Trafo(Trafo3d.Translation(firstPoint)));
- // #endregion
-
- // m_pickingInfo = new PickingInfo(new KdTreeSet(kdTree));
- // }
-
- // return new Group(m_asyncHierarchy, kdGroup);
- // }
-
- // public bool DisposeAndRemove(DisposeAndRemoveTraversal t)
- // {
- // var kdTreeNotNull = m_instance.KdTree0 != null && m_instance.KdTree0.KdTree != null &&
- // m_instance.KdTree0.KdTree.KdIntersectionTree != null && m_instance.KdTree0.KdTree.KdIntersectionTree.ObjectSet != null;
-
- // if (kdTreeNotNull)
- // {
- // Report.Line("Disposing KdTree");
-
- // var lazyKdTreeSet = m_instance.KdTree0.KdTree.KdIntersectionTree.ObjectSet as LazyKdTreeSet;
- // if (lazyKdTreeSet != null)
- // {
- // foreach (var ph in lazyKdTreeSet.KdTreePlaceholders)
- // {
- // ph.KdTree = null;
- // }
- // }
-
- // m_instance.KdTree0 = null; //.DisposeAndRemove(t.State);
- // //result = t.TryDisposeAndRemoveRule(m_instance, t, m_instance.KdTree0);
- // }
-
- // return t.TryDisposeAndRemoveRule(m_instance, t, m_asyncHierarchy);
- // }
-
- // public List GetKdTreeList(GetKdTreeTraversal t)
- // {
- // var kdTree = m_instance.GetKdTree(t.Filter);
-
- // if (kdTree == null)
- // return new List { };
- // else return new List { kdTree };
- // }
-
- // public PickingInfo PickingInfo
- // {
- // get { return m_pickingInfo; }
- // }
- //}
-
- #endregion
-}
\ No newline at end of file
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchyInfo.cs b/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchyInfo.cs
deleted file mode 100644
index ea6f8106..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchyInfo.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-using Aardvark.Base;
-using Aardvark.Runtime;
-using Aardvark.VRVis;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- public class PatchHierarchyInfo : IFieldCodeable
- {
- public List TagList;
- public string AcquisitionDate;
- public List AvgGeometrySizes;
- public List AvgPixelSizes;
- public string RootPatch;
- public PatchTree PatchTree;
-
- private int m_depth = -1;
- public int Depth
- {
- get
- {
- if (m_depth == -1)
- m_depth = PatchTree.ComputeDepth();
-
- return m_depth;
- }
- }
-
- public IEnumerable GetFieldCoders(int coderVersion)
- {
- yield return new FieldCoder(0, "TagList", (c, o) => c.CodeList_of_String_(ref ((PatchHierarchyInfo)o).TagList));
- yield return new FieldCoder(1, "AcquisitionDate", (c, o) => c.CodeString(ref ((PatchHierarchyInfo)o).AcquisitionDate));
-
- yield return new FieldCoder(2, "AvgGeometrySizes", (c, o) => c.CodeList_of_Double_(ref ((PatchHierarchyInfo)o).AvgGeometrySizes));
- yield return new FieldCoder(3, "AvgPixelSizes", (c, o) => c.CodeList_of_Double_(ref ((PatchHierarchyInfo)o).AvgPixelSizes));
- yield return new FieldCoder(4, "RootPatch", (c, o) => c.CodeString(ref ((PatchHierarchyInfo)o).RootPatch));
-
- yield return new FieldCoder(5, "PatchTree", (c, o) => c.CodeT(ref ((PatchHierarchyInfo)o).PatchTree));
- }
-
- public static PatchHierarchyInfo FromCacheFile(string filePath)
- {
- var patchHierarchyInfo = Load.As(filePath);
-
- if (patchHierarchyInfo == null)
- Report.Warn("PatchHierarchyInfo: Wrong format cache file at " + filePath);
-
- return patchHierarchyInfo;
- }
-
- public static PatchHierarchyInfo FromXmlFile(OpcPaths opcPaths)
- {
- return FromXmlFile(new PatchHierarchyXML(opcPaths));
- }
-
- 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;
- }
-
- ///
- /// Builds PatchHierarchyInfo from the xml file (if it doesn't exist yet) and saves it as cache.bin
- ///
- /// Creates and saves it, even if a cache.bin allready exists.
- public static void BuildAndSaveCache(OpcPaths paths, bool overrideExisting = true)
- {
- if (overrideExisting || !StorageConfig.FileExists(paths.CachedPatchHierarchyPath))
- {
- var patchHierarchyInfo = FromXmlFile(paths);
-
- if (patchHierarchyInfo == null)
- {
- Report.Error("PatchHierarchyInfo: Building cache failed.");
- return;
- }
-
- patchHierarchyInfo.Save(
- paths.CachedPatchHierarchyPath, waitMode: WaitMode.WaitUntilFinished);
- }
- }
-
- ///
- /// Loads PatchHierarchyInfo from cache file or xml, if cache doesn't exist.
- ///
- public static PatchHierarchyInfo BuildOrLoadCache(OpcPaths paths)
- {
- PatchHierarchyInfo patchHierarchyInfo = null;
-
- if (StorageConfig.FileExists(paths.CachedPatchHierarchyPath))
- patchHierarchyInfo = FromCacheFile(paths.CachedPatchHierarchyPath);
-
- if (patchHierarchyInfo == null)
- {
- Report.BeginTimed("PatchHierarchyInfo: Loading XML for " + paths.ShortName);
- patchHierarchyInfo = FromXmlFile(paths);
- Report.End();
- }
-
- if (patchHierarchyInfo == null)
- {
- Report.Error("PatchHierarchyInfo: Loading cache and XML failed for OPC " + paths.ShortName);
- return null;
- }
-
- return patchHierarchyInfo;
- }
-
- public List RetrievePatchTreesOfLevel(int level)
- {
- return RetrievePatchTreesOfLevel(level, x => true);
- }
-
- public List RetrievePatchTreesOfLevel(int level, Func filterFunc)
- {
- var collector = new List();
- RetrievePatchesRecurse(PatchTree, Depth, level, collector, filterFunc);
- return collector;
- }
-
- private static void RetrievePatchesRecurse(PatchTree patchTree, int currentLevel,
- int desiredLevel, List collector /* schirching around!! */, Func filterFunc)
- {
- var filteredSubNodes = patchTree.SubNodes.Where(filterFunc);
-
- if (patchTree.PatchPath == null)
- Report.Warn("patch path null");
-
- if (currentLevel == desiredLevel)
- collector.Add(patchTree);
- else
- {
- filteredSubNodes
- .ForEach(x => RetrievePatchesRecurse(x, currentLevel - 1, desiredLevel, collector, filterFunc));
- }
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchyXML.cs b/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchyXML.cs
deleted file mode 100644
index fa34ab29..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/PatchHierarchyXML.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-using Aardvark.Base;
-using Aardvark.Runtime;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- internal static class XmlTagsGlobal
- {
- public static string TagList = "TagList";
- public static string Item = "item";
- public static string Key = "key";
- public static string Val = "val";
- }
-
- public class PatchHierarchyXML
- {
- #region private properties and fields
-
- private static class XmlTags
- {
- public static string PatchHierarchy = "PatchHierarchy";
- public static string AcquisitionDate = "AcquisitionDate";
- public static string AvgGeometrySizes = "AvgGeometrySizes";
- public static string RootPatch = "RootPatch";
- public static string SubPatchMap = "SubPatchMap";
- }
-
- private XElement m_xmlPatchHierarchy = null;
- private OpcPaths m_paths;
-
- private XElement XmlPatchHierarchy
- {
- get
- {
- if (m_xmlPatchHierarchy == null)
- {
- var xmlHierarchy = XElement.Load(Load.AsMemoryStream(m_paths.PatchHierarchyPath));
- m_xmlPatchHierarchy = xmlHierarchy.Element(XmlTags.PatchHierarchy);
- }
-
- return m_xmlPatchHierarchy;
- }
- }
-
- #endregion
-
- #region public properties
-
- public OpcPaths OpcPaths
- {
- get
- {
- return m_paths;
- }
- }
-
- public List TagList
- {
- get
- {
- var returnList = new List();
- var tags = XmlPatchHierarchy.Elements(XmlTagsGlobal.TagList);
- if (tags.Count() > 0)
- {
- string tagString = tags.First().Value.Trim();
- if (!tagString.IsNullOrEmpty())
- {
- string subString = tagString.Substring(1, tagString.Length - 2);
- var sep = new char[] { ',' };
- string[] size = subString.Split(sep);
- returnList = size.ToList();
- }
- }
- return returnList;
- }
- }
-
- public string AcquisitionDate
- {
- get
- {
- var aquElements = XmlPatchHierarchy.Elements(XmlTags.AcquisitionDate);
-
- if (aquElements.Count() > 0)
- return aquElements.First().Value.Trim();
- else
- return String.Empty;
- }
- }
-
- public List AverageGeometrySizes
- {
- get
- {
- var returnList = new List();
- var avgGeometrySizes = XmlPatchHierarchy.Elements(XmlTags.AvgGeometrySizes);
- if (avgGeometrySizes.Count() > 0)
- {
- string avgString = avgGeometrySizes.First().Value.Trim();
- if (!avgString.IsNullOrEmpty())
- {
- string subString = avgString.Substring(1, avgString.Length - 2);
- var sep = new char[] { ',' };
- string[] size = subString.Split(sep);
- returnList = size.Select(x => Double.Parse(x, Localization.FormatEnUS)).ToList();
- }
- }
- return returnList;
- }
- }
-
- public string RootPatchName
- {
- get
- {
- return XmlPatchHierarchy.Element(XmlTags.RootPatch).Value.Trim();
- }
- }
-
- public string RootPatchPath
- {
- get
- {
- return Path.Combine(m_paths.PatchesSubDir, RootPatchName);
- }
- }
-
- public PatchTree PatchTree
- {
- get
- {
- var subPatchMapTag = XmlPatchHierarchy.Element(XmlTags.SubPatchMap);
-
- var subPatchMap = subPatchMapTag == null ?
- new Dictionary>() : XmlHelper.SubMap(subPatchMapTag);
-
- return PatchTreeFromPatchName(RootPatchName, m_paths.PatchesSubDir, subPatchMap);
- }
- }
-
- #endregion
-
- public PatchHierarchyXML(OpcPaths opcPaths)
- {
- m_paths = opcPaths;
- }
-
- public PatchHierarchyXML(string opcPath)
- : this(new OpcPaths(opcPath)) { }
-
- public static PatchHierarchyXML From(string opcPath)
- {
- return new PatchHierarchyXML(opcPath);
- }
-
- #region private methods
-
- ///
- /// Recursively traverses supplied subPatchMap dictionary and build up a PatchTree.
- ///
- /// form of [patchName, List[subPatchName]]
- private static PatchTree PatchTreeFromPatchName(string patchName, string patchesSubdir, Dictionary> subPatchMap)
- {
- IEnumerable subPatches = null;
- var path = Path.Combine(patchesSubdir, patchName);
-
- //read patchfileinfo
- var info = new PatchFileInfo();
-
- try
- {
- info = PatchFileInfo.FromFile(path);
- info.IsValid = true;
- }
- catch (Exception e)
- {
- Report.Warn("PatchHierarchyXML: Parsing of patch.xml of path {0} threw an exception {1}", path, e.Message.ToString());
- info.IsValid = false;
- }
-
- //if name does not exist in subPatchMap a leaf is reached
- if (!subPatchMap.TryGetValue(patchName, out subPatches))
- return new PatchTree(patchName, info);
-
- //if subnodes exist recurse
- return new PatchTree(patchName, info,
- subPatches.Select(x => PatchTreeFromPatchName(x, patchesSubdir, subPatchMap))
- .Where(x => x.Info.IsValid)
- .ToList());
- }
-
- #endregion
- }
-
- public class ImagePyramidXML
- {
- #region private properties and fields
-
- private XElement m_xmlImagePyramid = null;
- private OpcPaths m_paths;
-
- private static class XmlTags
- {
- public static string ImagePyramid = "ImagePyramid";
- public static string AvgPixelSizes = "AvgPixelSizes";
- public static string RootTile = "RootTile";
- public static string SubTileMap = "SubTileMap";
- }
-
- private XElement XmlImagePyramid
- {
- get
- {
- if (m_xmlImagePyramid == null)
- m_xmlImagePyramid = XElement.Load(
- Load.AsMemoryStream(m_paths.ImagePyramidPaths.FirstOrDefault()))
- .Element(XmlTags.ImagePyramid);
-
- return m_xmlImagePyramid;
- }
- }
-
- #endregion
-
- public ImagePyramidXML(OpcPaths opcPaths)
- {
- m_paths = opcPaths;
- }
-
- public ImagePyramidXML(string opcPath)
- : this (new OpcPaths(opcPath)) {}
-
- #region public properties
-
- public List TagList
- {
- get
- {
- var returnList = new List();
- var tags = XmlImagePyramid.Elements(XmlTagsGlobal.TagList);
- if (tags.Count() > 0)
- {
- string tagString = tags.First().Value.Trim();
- if (!tagString.IsNullOrEmpty())
- {
- string subString = tagString.Substring(1, tagString.Length - 2);
- var sep = new char[] { ',' };
- string[] size = subString.Split(sep);
- returnList = size.ToList();
- }
- }
- return returnList;
- }
- }
-
- public List AveragePixelSizes
- {
- get
- {
- var returnList = new List();
- var avgPixelSizes = XmlImagePyramid.Elements(XmlTags.AvgPixelSizes);
- if (avgPixelSizes.Count() > 0)
- {
- string avgString = avgPixelSizes.First().Value.Trim();
- if (!avgString.IsNullOrEmpty())
- {
- string subString = avgString.Substring(1, avgString.Length - 2);
- var sep = new char[] { ',' };
- string[] size = subString.Split(sep);
- returnList =
- size.Select(x => Double.Parse(x, Localization.FormatEnUS)).ToList();
- }
- }
- return returnList;
- }
- }
-
- public string RootTileName
- {
- get
- {
- return XmlImagePyramid.Element(XmlTags.RootTile).Value.Trim();
- }
- }
-
- public Dictionary> SubTileMap
- {
- get
- {
- return XmlHelper.SubMap(XmlImagePyramid.Element(XmlTags.SubTileMap));
- }
- }
-
- #endregion
- }
-
- internal static class XmlHelper
- {
- public static Dictionary> SubMap(XElement submap)
- {
- var xmlSubPatchMap = submap.Elements(XmlTagsGlobal.Item);
- return xmlSubPatchMap.ToDictionary(
- x => x.Element(XmlTagsGlobal.Key).Value.Trim(),
- y => y.Element(XmlTagsGlobal.Val).Elements().Select(z => z.Value.Trim())
- );
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/PatchLoadingStrategy.cs b/legacy/Aardvark.Opc/PatchHierarchy/PatchLoadingStrategy.cs
deleted file mode 100644
index a35255a4..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/PatchLoadingStrategy.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-using System;
-using System.IO;
-using System.Linq;
-using System.Collections.Generic;
-using Aardvark.Base;
-using Aardvark.VRVis;
-using Aardvark.Algodat;
-using Aardvark.Parser.Aara;
-using Aardvark.Rendering;
-using Aardvark.Runtime;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- public interface IPatchLoadingStrategy
- {
- ///
- /// Loads VertexGeometry from aara files. Beware: add Local2Global node for global space.
- ///
- /// Vertex Geometry in local OPC space.
- VertexGeometry Load(PatchFileInfo info, string basePath, PositionsType posType,
- bool loadTextures = true, bool loadNormals = true, bool loadTexCoords = true, float maxTriangleSize = float.PositiveInfinity);
- }
-
- public class PatchLoadingStrategy : IPatchLoadingStrategy
- {
- public bool LoadDiffTex = true;
- public bool LoadHueTex = true;
-
- #region implement IPatchLoadingStrategy
-
- public VertexGeometry Load(PatchFileInfo info, string basePath, PositionsType posType,
- bool loadTextures = true, bool loadNormals = true, bool loadTexCoords = true, float maxTriangleSize = float.PositiveInfinity)
- {
- //Array positions;
- //Symbol dataType;
- bool loadDiffTex = loadTextures ? LoadDiffTex : false;
- bool loadHueTex = loadTextures ? LoadHueTex : false;
-
- return LoadPatch(info, basePath, posType, //out positions, out dataType,
- loadNormals, loadTexCoords, loadDiffTex, loadHueTex, maxTriangleSize);
- }
-
- #endregion
-
- ///
- /// Gets Triangle Set loaded from AaraData and transformed to global space.
- ///
- public static TriangleSet LoadPatchTriangleSet(PatchFileInfo info, string basePath, PositionsType posType)
- {
- var vg = LoadPatch(info, basePath, posType, false, false, false, false, loadAsDoubles: false);
- if (vg == null) return new TriangleSet();
-
- var trafo = posType == PositionsType.V3dPositions ? info.Local2Global : info.Local2Global2d;
-
- vg.TransformV3d(trafo);
-
- var triangles = vg.Triangles
- .Where(x => !x.Point0.Position.IsNaN &&
- !x.Point1.Position.IsNaN &&
- !x.Point2.Position.IsNaN)
- .Select(x => x.ToTriangle3d());
-
- return new TriangleSet(triangles);
- }
-
- ///
- /// Gets Triangle Set loaded from AaraData and transformed to global space.
- /// Triangles side length < maxTriiangleSize
- ///
- public static TriangleSet LoadPatchTriangleSetWithoutOversizedTriangles(PatchFileInfo info, string basePath, PositionsType posType, float maxTriangleSize = float.PositiveInfinity)
- {
- var vg = LoadPatch(info, basePath, posType, false, false, false, false);
- if (vg == null) return new TriangleSet();
-
- vg.Transform(
- posType == PositionsType.V3dPositions ?
- info.Local2Global : info.Local2Global2d);
-
- var triangles = vg.Triangles
- .Where(x => !x.Point0.Position.IsNaN &&
- !x.Point1.Position.IsNaN &&
- !x.Point2.Position.IsNaN &&
- (V3d.Distance(x.Point0.Position, x.Point1.Position) < maxTriangleSize) &&
- (V3d.Distance(x.Point0.Position, x.Point2.Position) < maxTriangleSize) &&
- (V3d.Distance(x.Point1.Position, x.Point2.Position) < maxTriangleSize))
- .Select(x => x.ToTriangle3d());
-
- return new TriangleSet(triangles);
- }
-
- ///
- /// Loads VertexGeometry from aara files. Beware: add Local2Global node for global space.
- ///
- /// Vertex Geometry in local OPC space.
- public static VertexGeometry LoadPatch(PatchFileInfo info, string basePath, PositionsType posType,
- bool loadNormals = true, bool loadTexCoords = true, bool loadDiffTex = true, bool loadHueTex = true, float maxTriangleSize = float.PositiveInfinity, bool loadAsDoubles = false)
- {
- Array positions;
- Symbol dataType;
-
- return LoadPatch(info, basePath, posType, out positions, out dataType,
- loadNormals, loadTexCoords, loadDiffTex, loadHueTex, maxTriangleSize, loadAsDoubles);
- }
-
- ///
- /// Loads VertexGeometry from aara files. Beware: add Local2Global node for global space.
- ///
- /// Raw positions, read from aara files for possible further processing.
- /// DataType of positions.
- /// Vertex Geometry in local OPC space.
- public static VertexGeometry LoadPatch(PatchFileInfo info, string basePath, PositionsType posType, out Array positions, out Symbol dataType,
- bool loadNormals = true, bool loadTexCoords = true, bool loadDiffTex = true, bool loadHueTex = true, float maxTriangleSize = float.PositiveInfinity, bool loadAsDoubles = false)
- {
- var vg = new VertexGeometry(GeometryMode.TriangleList);
- positions = null;
-
- // load metadata
- var aara3dPos = AaraData.FromFile(
- Path.Combine(basePath, posType == PositionsType.V3dPositions
- ? info.Positions : info.Positions2d));
- dataType = aara3dPos.DataTypeAsSymbol;
-
- var resolution = new V2i(aara3dPos.Size);
- if (resolution.AnySmaller(2))
- {
- Report.Warn("ignoring patch {0} due to invalid gridresolution {1}", basePath, resolution);
- return null;
- }
-
- // load positions
- positions = aara3dPos.LoadElements();
- var positions3d = loadAsDoubles ? positions : AaraData.ConvertArrayToV3fs[aara3dPos.DataTypeAsSymbol](positions);
-
- //var positionsV3 = loadAsDoubles ?
- // (Array)AaraData.ConvertArrayToV3ds[aara3dPos.DataTypeAsSymbol](positions) :
- // (Array);
-
- vg.Positions = positions3d;
-
- var p = AaraData.ConvertArrayToV3fs[aara3dPos.DataTypeAsSymbol](positions);
-
- // calculate indices
- var invalidPoints = OpcIndices.GetInvalidPositions(p);
- // limit triangle size
- if ((maxTriangleSize < float.PositiveInfinity)&&(maxTriangleSize > 0.000001f))
- vg.Indices = OpcIndices.ComputeIndexArray(resolution, invalidPoints.ToList(), p, maxTriangleSize);
- else
- vg.Indices = OpcIndices.ComputeIndexArray(resolution, invalidPoints.ToList());
-
- // load normals
- if (loadNormals)
- {
- var normalPath = Path.Combine(basePath, "Normals.aara");
- if (StorageConfig.FileExists(normalPath))
- {
- var normals = AaraData.FromFile(normalPath);
- var normals3d = AaraData.ConvertArrayToV3fs[normals.DataTypeAsSymbol](normals.LoadElements());
- vg.Normals = normals3d;
- }
- }
-
- // load coordinates
- vg.Coordinates = new CoordinatesMap();
- if (loadTexCoords)
- {
- var coordPath = Path.Combine(basePath, info.Coordinates.First());
- var coordinates = AaraData.FromFile(coordPath).LoadElements() as V2f[];
- vg.Coordinates[VertexGeometry.Property.DiffuseColorCoordinates] = coordinates;
- }
-
- // load textures
- vg.Textures = new TexturesMap();
- if (loadDiffTex)
- {
- var texFile = Path.ChangeExtension(info.Textures.First(), ".dds");
- var texPath = Path.GetFullPath(Path.Combine(basePath, @"..\..\images", texFile));
-
- if (StorageConfig.FileExists(texPath))
- {
- var img = Convertible.FromFile(texPath);
-
- vg.Textures[VertexGeometry.Property.DiffuseColorTexture] =
- new Aardvark.Rendering.Texture(img)
- {
- ForceImmediateUpload = false
- };
- }
- }
- if (loadHueTex)
- {
- vg.Textures[VertexGeometry.Property.LightMapTexture] =
- new Aardvark.Rendering.Texture(Resources.HueColorMap.Convertible());
- }
-
- return vg;
- }
- }
-}
\ No newline at end of file
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/PatchTree.cs b/legacy/Aardvark.Opc/PatchHierarchy/PatchTree.cs
deleted file mode 100644
index b7fcca40..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/PatchTree.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-using Aardvark.Base;
-using Aardvark.VRVis;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- public interface IHierarchyNode : INode where T : IHierarchyNode
- {
- new IEnumerable SubNodes { get; }
- }
-
- [RegisterTypeInfo]
- public class PatchTree : IHierarchyNode, IFieldCodeable
- {
- ///
- /// For serialization only.
- ///
- public PatchTree() { }
-
- public PatchTree(string id, PatchFileInfo info, List subNodes = null)
- {
- if (subNodes == null) subNodes = new List();
-
- m_id = id;
- m_subNodes = subNodes;
- m_info = info;
- }
-
- private string m_id;
- private PatchFileInfo m_info;
- private List m_subNodes;
-
- public string Id
- {
- get { return m_id; }
- }
-
- public PatchFileInfo Info
- {
- get { return m_info; }
- }
-
- public IEnumerable SubNodes
- {
- get { return m_subNodes; }
- }
-
- ///
- /// Enables usage of INode routines on PatchTrees
- ///
- IEnumerable INode.SubNodes
- {
- get { return m_subNodes; }
- }
-
- public IEnumerable GetFieldCoders(int coderVersion)
- {
- return new[]
- {
- new FieldCoder(0, "Id", (c, o) => c.CodeString(ref ((PatchTree)o).m_id)),
- new FieldCoder(1, "Info", (c, o) => c.CodeT(ref ((PatchTree)o).m_info)),
- new FieldCoder(2, "SubNodes", (c, o) => c.CodeList_of_T_(ref ((PatchTree)o).m_subNodes)),
- };
- }
-
- public string PatchPath { get; set; }
-
- public string GetPositionPath(PositionsType posType)
- {
- if (posType == PositionsType.V3dPositions)
- return Path.Combine(PatchPath, Info.Positions);
- else
- return Path.Combine(PatchPath, Info.Positions2d);
- }
-
- ///
- /// Constructs patchpaths in a PatchTree hierarchy so that no absolute paths
- /// have to be saved within a PatchTree.
- ///
- public void CreatePatchPaths(string basePath)
- {
- var patchPath = Path.Combine(basePath, Id);
- PatchPath = patchPath;
- SubNodes.ForEach(x => x.CreatePatchPaths(basePath));
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/PatchHierarchy/ProfileLookUpTable.cs b/legacy/Aardvark.Opc/PatchHierarchy/ProfileLookUpTable.cs
deleted file mode 100644
index fa913fb9..00000000
--- a/legacy/Aardvark.Opc/PatchHierarchy/ProfileLookUpTable.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-using Aardvark.Algodat;
-using Aardvark.Base;
-using Aardvark.Parser.Aara;
-using Aardvark.Runtime;
-using Aardvark.VRVis;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-namespace Aardvark.Opc.PatchHierarchy
-{
- [RegisterTypeInfo]
- public class PatchFileHandle : Map
- {
- public const string Identifier = "PatchFileHandle";
-
- public static class Property
- {
- public const string PatchTree = "PatchTree";
- public const string FileLoader = "FileLoader";
- }
-
- public PatchFileHandle()
- : base(Identifier)
- {
- }
-
- public PatchFileHandle(PatchFileHandle pfh)
- : this()
- {
- PatchTree = pfh.PatchTree;
- FileLoader = new AaraData(pfh.FileLoader);
- }
-
- public PatchTree PatchTree
- {
- get { return Get(Property.PatchTree); }
- set { this[Property.PatchTree] = value; }
- }
-
- public AaraData FileLoader
- {
- get { return Get(Property.FileLoader); }
- set { this[Property.FileLoader] = value; }
- }
- }
-
- [RegisterTypeInfo]
- public class ProfileLookUpTableEntry : Map, IAwakeable
- {
- public const string Identifier = "ProfileLookUpTableEntry";
-
- public static class Property
- {
- public const string Index = "Index";
- public const string SvRange = "SvRange";
- public const string FileHandles = "FileHandles";
- }
-
- public ProfileLookUpTableEntry()
- : base(Identifier)
- {
- FileHandles2d = new List();
- }
-
- public int Index
- {
- get { return Get(Property.Index); }
- set { this[Property.Index] = value; }
- }
-
- public Range1d SvRange
- {
- get { return Get(Property.SvRange); }
- set { this[Property.SvRange] = value; }
- }
-
- public List FileHandles
- {
- get { return Get>(Property.FileHandles); }
- set { this[Property.FileHandles] = value; }
- }
-
- public List FileHandles2d { get; private set; }
-
- public void Awake(int codedVersion)
- {
- FileHandles2d = FileHandles.Select(x => new PatchFileHandle(x)).ToList();
- }
- }
-
- [RegisterTypeInfo]
- public class ProfileLookUpTable : Map
- {
- #region public members
-
- public const string Identifier = "ProfileLookUpTable";
-
- public static class Property
- {
- public const string SvRange = "SvRange";
- public const string Entries = "Entries";
- public const string AvgGeometrySize = "AvgGeometrySize";
- }
-
- public Range1d SvRange
- {
- get { return Get(Property.SvRange); }
- set { this[Property.SvRange] = value; }
- }
-
- public List Entries
- {
- get { return Get>(Property.Entries); }
- set { this[Property.Entries] = value; }
- }
-
- public double AvgGeomtrySize
- {
- get { return Get(Property.AvgGeometrySize); }
- set { this[Property.AvgGeometrySize] = value; }
- }
-
- #endregion
-
- #region private members
-
- private double m_last_sv = double.NaN;
- private Pair m_lastProfile;
-
- #endregion
-
- public ProfileLookUpTable()
- : base(Identifier)
- {
- }
-
- ///
- /// Construct absolute paths for FileHandle (PatchTree.Path, AaraData.SourceFileName) at runtime.
- ///
- public void UpdateFilePaths(OpcPaths paths)
- {
- var basePatchesPath = paths.PatchesSubDir;
-
- foreach (var e in Entries)
- {
- foreach (var fileHandle in e.FileHandles)
- {
- var patchTree = fileHandle.PatchTree;
- patchTree.PatchPath = Path.Combine(basePatchesPath, fileHandle.PatchTree.Id);
- fileHandle.FileLoader.SourceFileName = patchTree.GetPositionPath(PositionsType.V3dPositions);
- }
-
- foreach (var fileHandle in e.FileHandles2d)
- {
- var patchTree = fileHandle.PatchTree;
- patchTree.PatchPath = Path.Combine(basePatchesPath, fileHandle.PatchTree.Id);
- fileHandle.FileLoader.SourceFileName = patchTree.GetPositionPath(PositionsType.V2dPositions);
- }
- }
- }
-
- static Telemetry.CpuTime s_cpu_LookUpProfile = new Telemetry.CpuTime().Register("Dibit: LookUpProfile", true, true);
-
- ///
- /// Loads tunnel profile from file.
- ///
- /// Sv position to load the profile at.
- /// XYZ and SvBR profile.
- public Pair LookUpProfile(double sv)
- {
- //Requires.That(!double.IsNaN(sv));
- if (double.IsNaN(sv))
- return Pair.Create(new V3d[0], new V3d[0]);
-
- // sv didn't change that much, use last profile
- if (m_last_sv.ApproximateEquals(sv, AvgGeomtrySize))
- return m_lastProfile;
-
- //find patch row
- var entries = Entries
- .Where(x => x.SvRange.Contains(sv));
-
- // open files and read data
- var returnList = new List();
- var returnList2d = new List();
-
- using (s_cpu_LookUpProfile.Timer)
- {
- foreach (var entry in entries)
- {
- // pair together XZY and SvBR handles
- var handles = entry.FileHandles.Zip(entry.FileHandles2d, (xyz, svbr) => Pair.Create(xyz, svbr));
-
- var rowMajorCount = entry.FileHandles.Count(h => h.PatchTree.Info.QuadVertexSortOrder == PatchFileInfo.QuadVertexSortOrderType.RowMajor);
- // column major is default, so don't have to check for PatchFileInfo.Tag.ColumnMajor
-
- if (rowMajorCount > 0 && rowMajorCount < entry.FileHandles.Count())
- {
- Report.Warn("ProfileLookUpTable: Can't handle mixed row/column-major patches.");
- continue;
- }
- // resort patches to get a continuous line (only a problem in RowMajor data)
- else if (rowMajorCount == entry.FileHandles.Count())
- {
- handles = handles.Reverse();
- }
-
- foreach (var handle in handles)
- {
- var pnts = LookUpProfile(handle, sv, entry.SvRange);
- returnList.AddRange(pnts.E0);
- returnList2d.AddRange(pnts.E1);
- }
- }
- }
- m_last_sv = sv;
-
- return m_lastProfile = new Pair() { E0 = returnList.ToArray(), E1 = returnList2d.ToArray() };
- }
-
- ///
- /// Loads XYZ and SvBR profile from file at SV position.
- /// Multiple reloads of SvBR data might be possible to adjust off indexing based on malformed data.
- ///
- /// File handles for XYZ and SvBR data.
- /// Sv position to load data at.
- /// SvRange of patch (needed to calculate index).
- /// XYZ/SvBR profile
- private Pair> LookUpProfile(Pair handle, double sv, Range1d svRange)
- {
- // sv to array index
- var index =
- handle.E0.PatchTree.Info.QuadVertexSortOrder == PatchFileInfo.QuadVertexSortOrderType.RowMajor ?
- SvToArrayIndex(sv, svRange, handle.E0.FileLoader.NumOfRows) :
- SvToArrayIndex(sv, svRange, handle.E0.FileLoader.NumOfColumns);
-
- // Load SvBR data. If indexing was not exact keep reloading neighboring profiles
- var pntsSvbr = new V3d[0];
- var localSv = sv - handle.E1.PatchTree.Info.Local2Global2d.M03;
- int increment = 0;
- do
- {
- // Load data
- pntsSvbr = LookUpProfile(handle.E1, index);
-
- // For some reason we couldn't load any more data.....
- if (pntsSvbr == null || pntsSvbr.IsEmpty())
- break;
-
- // NaN line, try next one
- if (pntsSvbr.Where(p => !p.IsNaN).IsEmptyOrNull())
- {
- if (increment == 0)
- break;
- else
- {
- index += increment;
- continue;
- }
- }
-
- var avgSv = pntsSvbr.Where(p => !p.IsNaN).Average(p => p.X);
- // Profile close enough?
- if (avgSv.ApproximateEquals(localSv, AvgGeomtrySize / 2))
- break;
- else
- { // nope, indexing must be off, try next one
- if (increment == 0)
- increment = (avgSv < localSv) ? 1 : -1;
- // if increment flips, than me might have a bigger hole between lines than AvgGeoSize
- else if (increment != ((avgSv < localSv) ? 1 : -1))
- break;
- index += increment;
- }
- } while (!pntsSvbr.IsEmptyOrNull());
-
- // Load XYZ data
- var pntsXyz = LookUpProfile(handle.E0, index);
-
- return Pair.Create(
- pntsXyz.Select(pt => handle.E0.PatchTree.Info.Local2Global.TransformPos(pt)),
- pntsSvbr.Select(pt => handle.E0.PatchTree.Info.Local2Global2d.TransformPos(pt))
- );
- }
-
- private V3d[] LookUpProfile(PatchFileHandle handle, int index)
- {
- var pntArray =
- handle.PatchTree.Info.QuadVertexSortOrder == PatchFileInfo.QuadVertexSortOrderType.RowMajor ?
- handle.FileLoader.LoadRow(index) :
- handle.FileLoader.LoadColumn(index);
-
- return AaraData.ConvertArrayToV3ds[handle.FileLoader.DataTypeAsSymbol](pntArray);
- }
-
- private int SvToArrayIndex(double sv, Range1d svRange, int numOfSvLinesInArray)
- {
- var idNorm = ((sv - svRange.Min) / svRange.Size);
- if (idNorm > 1)
- {
- Report.Warn("ProfileLookUpTable: Lookup intended to read out of patch size.");
- return -1;
- }
-
- return (int)System.Math.Round(idNorm * (numOfSvLinesInArray - 1));
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/PointSampleExtensions.cs b/legacy/Aardvark.Opc/PointSampleExtensions.cs
deleted file mode 100644
index 04ec7c33..00000000
--- a/legacy/Aardvark.Opc/PointSampleExtensions.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-using Aardvark.Algodat.Points;
-using Aardvark.Base;
-using Aardvark.Parser.Aara;
-using System;
-using System.Collections.Generic;
-
-namespace Aardvark.Opc
-{
-
- public static class PointSampleExtension
- {
- ///
- /// Returns a subregion of an IEnumerable, which is expected to be a grid in the given resolution.
- ///
- /// upper left corner in the subpatch
- /// dimensions in number of entries
- /// Resolution of the expected grid
- public static IEnumerable GetSubPatch(this IEnumerable self, V2i origin, V2i size, V2i resolution)
- {
- //Exception for now - think of good handling of the different cases
- //return empty grid
- if (origin.X >= resolution.X || origin.Y >= resolution.Y)
- throw new NotImplementedException("requested origin outside of source grid");
-
- //return full grid
- if (size.X >= resolution.X || size.Y >= resolution.Y)
- throw new NotImplementedException("requested size bigger than source grid");
-
- //return grid as big as possible
- if (origin.X + size.X >= resolution.X || origin.Y + size.Y >= resolution.Y)
- throw new NotImplementedException("requested tile exceeds source grid boundaries");
-
- int i = -1;
- int firstIndex = origin.Y * resolution.X + origin.X;
- var last = origin + size;
- int lastIndex = (last.Y - 1) * resolution.X + last.X;
-
- int startRow = firstIndex;
- int endRow = firstIndex + size.X;
-
- Report.Line(1, "Skipping {0} entries", firstIndex);
- foreach (var x in self)
- {
- i++;
-
- if (i < firstIndex) continue;
-
- if (i >= startRow && i < endRow)
- {
- if (i == endRow - 1)
- {
- //Console.WriteLine();
- //Console.WriteLine("old start: {0},end: {1}", startRow, endRow);
- startRow += resolution.X;
- endRow += resolution.X;
- // Console.WriteLine("new start: {0},end: {1}", startRow, endRow);
- }
-
- yield return x;
- }
-
- if (i == lastIndex) yield break;
- }
- }
-
- public static IPointSampleGrid2d GetSubPatch(this IPointSampleGrid2d self, V2i origin, V2i size)
- {
- var result = self.Positions.GetSubPatch(origin, size, self.Resolution);
-
- return new PointSampleGrid2d(new PointSampleSet(result), size);
-
- //var posList = new List();
-
- //var xOffset = origin.X;
- //var yOffset = origin.Y;
-
- //var stream = self.Positions;
- //var rowOrigin = yOffset * self.Resolution.X + xOffset;
-
- //var enumerator = stream.GetEnumerator();
-
- //Report.BeginTimed("construction subset of size {0}", size.ToString());
- //Report.BeginTimed("skipping {0} objects", rowOrigin);
- //for (int i = 0; i < rowOrigin; i++)
- //{
- // enumerator.MoveNext();
- //}
- //Report.End();
-
-
- //for (int j = 0; j < size.Y; j++)
- //{
- // //take a row and add it to poslist
- // //move iterator to end of row
- // for (int i = 0; i < size.X; i++)
- // {
- // posList.Add(enumerator.Current);
- // enumerator.MoveNext();
- // }
-
- // //move iterator to begin of next row
- // for (int i = 0; i < size.X; i++) enumerator.MoveNext();
-
- // Report.Progress(posList.Count / (double)(size.X * size.Y));
- // Report.Line();
- //}
- //Report.End("done");
-
- }
- }
-
- public static class AaraHelpers
- {
- public static IPointSampleGrid2d PointSampleGrid2dFromAaraFile(string fileName)
- {
- if (fileName == null) throw new ArgumentNullException();
-
- var aara = AaraData.FromFile(fileName);
-
- // extract grid resolution
- var res = aara.Size;
- if (res.Length != 2) throw new ArgumentException("encountered aara file of unexpected dimensions - 2 expected");
-
- // extract points
- var elements = aara.LoadElements();
- V3d[] points = elements as V3d[];
-
- if (points == null)
- {
- if (elements is V3f[])
- points = elements.CopyAndConvert(V3d.FromV3f);
- else
- throw new ArgumentException(".aara contains unexpected type - V3d or V3f expected");
- }
-
- return new PointSampleGrid2d(new PointSampleSet(points), new V2i(res[0], res[1]));
- }
-
- }
-
-}
diff --git a/legacy/Aardvark.Opc/Properties/AssemblyInfo.cs b/legacy/Aardvark.Opc/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5f367075..00000000
--- a/legacy/Aardvark.Opc/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Aardvark.Opc")]
-[assembly: AssemblyDescription("")]
-#if !DEPLOY //(Automatic Code by BuildPatcher.) Removes these AssemblyAttributes for DEPLOY build since these are added with buildDeploy.bat.
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("VRVis Zentrum fuer Virtual Reality und Visualisierung Forschungs-GmbH")]
-[assembly: AssemblyProduct("Aardvark.Opc")]
-[assembly: AssemblyCopyright("Copyright © VRVis 2009")]
-[assembly: AssemblyTrademark("")]
-#endif //!DEPLOY (Automatic Code by BuildPatcher.)
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("4838ea39-2d30-4a3e-9b77-1cbc21519572")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-#if !DEPLOY //(Automatic Code by BuildPatcher.) Removes these AssemblyAttributes for DEPLOY build since these are added with buildDeploy.bat.
-[assembly: AssemblyFileVersion("1.0.0.0")]
-#endif //!DEPLOY (Automatic Code by BuildPatcher.)
diff --git a/legacy/Aardvark.Opc/Resources.Designer.cs b/legacy/Aardvark.Opc/Resources.Designer.cs
deleted file mode 100644
index 17e88695..00000000
--- a/legacy/Aardvark.Opc/Resources.Designer.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.18331
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace Aardvark.Opc {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- public class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Aardvark.Opc.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized resource of type System.Drawing.Bitmap.
- ///
- public static System.Drawing.Bitmap HueColorMap {
- get {
- object obj = ResourceManager.GetObject("HueColorMap", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
- }
-}
diff --git a/legacy/Aardvark.Opc/Resources.resx b/legacy/Aardvark.Opc/Resources.resx
deleted file mode 100644
index 4af943bc..00000000
--- a/legacy/Aardvark.Opc/Resources.resx
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- Resources\HueColorMap.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
\ No newline at end of file
diff --git a/legacy/Aardvark.Opc/Resources/HueColorMap.png b/legacy/Aardvark.Opc/Resources/HueColorMap.png
deleted file mode 100644
index 6f016c18..00000000
Binary files a/legacy/Aardvark.Opc/Resources/HueColorMap.png and /dev/null differ
diff --git a/legacy/Aardvark.Opc/SupplementalFilesHandling.cs b/legacy/Aardvark.Opc/SupplementalFilesHandling.cs
deleted file mode 100644
index 1c0cf446..00000000
--- a/legacy/Aardvark.Opc/SupplementalFilesHandling.cs
+++ /dev/null
@@ -1,521 +0,0 @@
-using Aardvark.Base;
-using Aardvark.Opc.PatchHierarchy;
-using Aardvark.Parser.Aara;
-using Aardvark.Rendering;
-using Aardvark.Rendering.SlimDx;
-using Aardvark.Runtime;
-using Aardvark.VRVis;
-using SlimDX.Direct3D9;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Reactive.Subjects;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Text;
-using Aardvark.Opc;
-using Aardvark.Algodat;
-using System.Windows.Media.Imaging;
-
-
-namespace Aardvark.Opc
-{
- public static class SupplementalFilesHandling
- {
- private static SlimDX.Direct3D10.Device device = new SlimDX.Direct3D10.Device(SlimDX.Direct3D10.DeviceCreationFlags.None);
- //private static SlimDX.Direct3D11.Device d = new SlimDX.Direct3D11.Device(SlimDX.Direct3D11.DriverType.Reference, SlimDX.Direct3D11.DeviceCreationFlags.None, new SlimDX.Direct3D11.FeatureLevel[] { SlimDX.Direct3D11.FeatureLevel.Level_9_1 });
-
- ///
- /// Converts .tif to .dds files in an opc directory for straight to gpu uploads of textures.
- ///
- public static int ConvertTiffsToDDSs(OpcPaths opcPaths, bool overrideExisting = false, IObserver progress = null, CancellationToken cancelToken = default(CancellationToken))
- {
- var tiffs = StorageConfig.GetDirectories(opcPaths.ImagesSubDir)
- .SelectMany(x => StorageConfig.GetFiles(x))
- .Where(x => Path.GetExtension(x) == ".tif");
-
- if (tiffs.IsEmptyOrNull())
- {
- if (progress != null)
- {
- progress.OnNext(1f);
- progress.OnCompleted();
- }
- return 0;
- }
-
- var inc = 1f / tiffs.Count();
- foreach (var f in tiffs)
- {
- cancelToken.ThrowIfCancellationRequested();
-
- // ConvertTiffToDDS2(f, overrideExisting);
- // ConvertTiffToDDS(f, overrideExisting);
- ConvertTiffToDDS3(f, overrideExisting);
-
- if (progress != null)
- progress.OnNext(inc);
- }
-
- if (progress != null)
- progress.OnCompleted();
- return tiffs.Count();
- }
-
- ///
- /// Converts .tif to .dds files in an opc directory for straight to gpu uploads of textures.
- /// tiffs are convert asynchrounos in parallel
- ///
- public static Task ConvertTiffsToDDSsAsync(OpcPaths opcPaths, bool overrideExisting = false, IProgress progress = null, CancellationToken cancelToken = default(CancellationToken))
- {
- var taskSource = new TaskCompletionSource();
-
- var tiffs = StorageConfig.GetDirectories(opcPaths.ImagesSubDir)
- .SelectMany(x => StorageConfig.GetFiles(x))
- .Where(x => Path.GetExtension(x) == ".tif");
-
- if (tiffs.IsEmptyOrNull())
- {
- if (progress != null)
- progress.Report(1f);
-
- taskSource.SetResult(0);
- return taskSource.Task;
- }
-
- var inc = 1f / tiffs.Count();
- var tasks = new List();
- foreach (var f in tiffs)
- {
- cancelToken.ThrowIfCancellationRequested();
-
- var task = Task.Run(() =>
- {
- ConvertTiffToDDS3(f, overrideExisting);
- if (progress != null)
- progress.Report(inc);
- });
- tasks.Add(task);
- }
-
- Task.WhenAll(tasks).ContinueWith(_ => taskSource.SetResult(tiffs.Count()));
-
- return taskSource.Task;
- }
-
- ///
- /// Deletes *.tif in an opc directory (if *.dds exist).
- ///
- public static int DeleteTiffs(OpcPaths opcPaths, IProgress> progress = null)
- {
- int deleteCounter = 0;
-
- var files = StorageConfig.GetDirectories(opcPaths.ImagesSubDir)
- .SelectMany(x => StorageConfig.GetFiles(x))
- .Where(x => Path.GetExtension(x) == ".tif");
-
- if (files.IsEmptyOrNull())
- {
- if (progress != null)
- progress.Report(Tup.Create(1f, "No tif images found."));
- return 0;
- }
-
- var inc = 1f / files.Count();
- foreach (var f in files)
- {
- string ddsPath = Path.ChangeExtension(f, ".dds");
- var msg = "";
-
- if (StorageConfig.FileExists(ddsPath))
- {
- File.Delete(f);
- deleteCounter++;
- }
- else msg = "dds file not deleted, because it doesn't have a coresponding tif file (" + f + ")";
-
- if (progress != null)
- progress.Report(Tup.Create(inc, msg));
- }
-
- return deleteCounter;
- }
-
- ///
- /// Deletes *.dds in an opc directory (if *.tif exists).
- ///
- public static int DeleteDDSs(OpcPaths opcPaths, IProgress> progress = null)
- {
- int deleteCounter = 0;
-
- var files = StorageConfig.GetDirectories(opcPaths.ImagesSubDir)
- .SelectMany(x => StorageConfig.GetFiles(x))
- .Where(x => Path.GetExtension(x) == ".dds");
-
- if (files.IsEmptyOrNull())
- {
- if (progress != null)
- progress.Report(Tup.Create(1f, "No dds images found."));
- return 0;
- }
-
- var inc = 1f / files.Count();
- foreach (var f in files)
- {
- string tifPath = Path.ChangeExtension(f, ".tif");
- var msg = "";
-
- if (StorageConfig.FileExists(tifPath))
- {
- File.Delete(f);
- deleteCounter++;
- }
- else msg = "dds file not deleted, because it doesn't have a coresponding tif file (" + f + ")";
-
- if (progress != null)
- progress.Report(Tup.Create(inc, msg));
- }
-
- return deleteCounter;
- }
-
- ///
- /// Builds look up table for profile "intersection" in 2d data.
- ///
- public static void BuildLookUpTable(OpcPaths opcPaths, bool overrideExisting, IProgress> progress, CancellationToken cancelToken = default(CancellationToken))
- {
- var sub = new Subject>();
- sub.Subscribe(tup => progress.Report(tup));
- BuildLookUpTable(opcPaths, overrideExisting, sub, cancelToken);
- }
-
- ///
- /// Builds look up table for profile "intersection" in 2d data.
- ///
- public static void BuildLookUpTable(OpcPaths opcPaths, bool overrideExisting = false, IObserver> progress = null, CancellationToken cancelToken = default(CancellationToken))
- {
- if (!overrideExisting && StorageConfig.FileExists(opcPaths.ProfileLutPath))
- {
- if (progress != null)
- {
- progress.OnNext(Tup.Create(1f, ""));
- progress.OnCompleted();
- }
- Report.Line("LookUpTable already exists at {0}", opcPaths.ProfileLutPath);
- }
-
- // PatchHierarchyInfo
- var info = PatchHierarchyInfo.BuildOrLoadCache(opcPaths);
- info.PatchTree.CreatePatchPaths(opcPaths.PatchesSubDir);
-
- // Level 0 Patches
- var lvl0Patches =
- info.RetrievePatchTreesOfLevel(0);
-
- if (progress != null)
- progress.OnNext(Tup.Create(.1f, ""));
-
- // group by BB-2d: Min-X, Max-X
- var patchesGroupedByBB = lvl0Patches
- .GroupBy(patchTree => Tup.Create(patchTree.Info.GlobalBoundingBox2d.Min.X, patchTree.Info.GlobalBoundingBox2d.Max.X)).ToArray();
-
- var entries = new List();
- #region Create ProfileLookUpTableEntries
-
- for (int index = 0; index < patchesGroupedByBB.Count(); index++)
- {
- if (cancelToken.IsCancellationRequested)
- {
- if (progress != null)
- progress.OnNext(Tup.Create(0f, "Building LookUpTabele cancelled."));
- cancelToken.ThrowIfCancellationRequested();
- }
-
- //sort patches according to their b (sv_b_r) value
- var patchesGroupedBySvBR = patchesGroupedByBB[index]
- .OrderBy(k => k.Info.GlobalBoundingBox2d.Min.Y);
-
- var fileHandleList = new List();
- #region build PatchFileHandles
-
- foreach (var patchTree in patchesGroupedBySvBR)
- {
- if (patchTree.Info.Positions2d.IsNullOrEmpty())
- {
- Report.Warn("ProfileLutCreation: Skipping Patchtree {0}, because of missing 2d positions.", patchTree.Id);
- if (progress != null)
- progress.OnNext(Tup.Create(0f, "ProfileLutCreation: Skipping Patchtree " + patchTree.Id + ", because of missing 2d positions."));
- continue;
- }
- var pos2dPath = patchTree.GetPositionPath(PositionsType.V2dPositions);
-
- //CAUTION absolute path needs to be repaired during loading
- var file = AaraData.FromFile(pos2dPath);
- file.SourceFileName = string.Empty;
-
- fileHandleList.Add(new PatchFileHandle()
- {
- PatchTree = patchTree,
- FileLoader = file,
- });
- }
-
- #endregion
-
- // Create ProfileLookupTableEntries
- var firstPatchBB = patchesGroupedBySvBR.First().Info.GlobalBoundingBox2d;
- entries.Add(new ProfileLookUpTableEntry()
- {
- Index = index,
- SvRange = new Range1d(firstPatchBB.Min.X, firstPatchBB.Max.X),
- FileHandles = fileHandleList,
- });
-
- var progressInc = 0.8f / patchesGroupedByBB.Count();
- if (progress != null)
- progress.OnNext(Tup.Create(progressInc, ""));
- }
- entries.Reverse();
-
- #endregion
-
- #region Save LUT
-
- var lut = new ProfileLookUpTable()
- {
- SvRange = new Range1d(info.PatchTree.Info.GlobalBoundingBox2d.Min.X, info.PatchTree.Info.GlobalBoundingBox2d.Max.X),
- Entries = entries,
- AvgGeomtrySize = info.AvgGeometrySizes.First()
- };
-
- lut.Save(opcPaths.ProfileLutPath);
-
- #endregion
-
- if (progress != null)
- {
- progress.OnNext(Tup.Create(0.1f, ""));
- progress.OnCompleted();
- }
- }
-
- ///
- /// Creates normals for the OPC in opcBasePath and saves them as Normals.aara.
- ///
- public static void BuildNormals(OpcPaths opcPaths, bool overrideExisting, IProgress> progress, CancellationToken cancelToken = default(CancellationToken))
- {
- var sub = new Subject>();
- sub.Subscribe(tup => progress.Report(tup));
- BuildNormals(opcPaths, overrideExisting, sub, cancelToken);
- }
-
- ///
- /// Creates normals for the OPC in opcBasePath and saves them as Normals.aara.
- ///
- public static void BuildNormals(OpcPaths opcPaths, bool overrideExisting = false, IObserver> progress = null, CancellationToken cancelToken = default(CancellationToken))
- {
- var normalFileName = "Normals.aara";
-
- var posFiles = StorageConfig.GetDirectories(opcPaths.PatchesSubDir)
- .SelectMany(x => StorageConfig.GetFiles(x))
- .Where(fileWpath => fileWpath.EndsWith("Positions.aara", StringComparison.OrdinalIgnoreCase));
-
- foreach (var file in posFiles)
- {
- if (cancelToken.IsCancellationRequested)
- {
- if (progress != null)
- {
- progress.OnNext(Tup.Create(0f, "Building normals cancelled."));
- progress.OnCompleted();
- }
- cancelToken.ThrowIfCancellationRequested();
- }
-
- var normalsFilePath = Path.Combine(Path.GetDirectoryName(file), normalFileName);
-
- if (overrideExisting || !StorageConfig.FileExists(normalsFilePath))
- {
- var posAara = AaraData.FromFile(file);
- var tileSize = new V2i(posAara.Size[0], posAara.Size[1]);
-
- var posArray = AaraData.ConvertArrayToV3ds[posAara.DataTypeAsSymbol](posAara.LoadElements());
-
- var invalidPoints = OpcIndices.GetInvalidPositions(posArray);
- var indices = OpcIndices.ComputeIndexArray(tileSize, invalidPoints);
- var normals = OpcIndices.GenerateVertexNormals(indices, posArray)
- .Select(p => p.ToV3f()).ToArray();
-
- WriteV3fArrayAsAara(normalsFilePath, normals, tileSize);
- }
-
- if (progress != null)
- progress.OnNext(Tup.Create(1f / posFiles.Count(), ""));
- }
-
- if (progress != null)
- progress.OnCompleted();
- }
-
- ///
- /// Deletes *.dds in an opc directory.
- ///
- public static int DeleteNormals(OpcPaths opcPaths, IProgress progress = null)
- {
- var files = StorageConfig.GetDirectories(opcPaths.PatchesSubDir)
- .SelectMany(x => StorageConfig.GetFiles(x))
- .Where(fileWpath => fileWpath.EndsWith("Normals.aara", StringComparison.OrdinalIgnoreCase));
-
- if (files.IsEmptyOrNull())
- {
- if (progress != null)
- progress.Report(1f);
- return 0;
- }
-
- var inc = 1f / files.Count();
- foreach (var f in files)
- {
- File.Delete(f);
- if (progress != null)
- progress.Report(inc);
- }
- return files.Count();
- }
-
- public static bool HasNormals(OpcPaths opcPaths)
- {
- var normalFileName = "Normals.aara";
-
- return StorageConfig.GetDirectories(opcPaths.PatchesSubDir)
- .All(dir => StorageConfig.FileExists(dir + "\\" + normalFileName));
- }
-
- #region helper methods
-
- public static void ConvertTiffToDDS(string tiffPath, bool overrideExisting = false)
- {
- string ddsPath = Path.ChangeExtension(tiffPath, ".dds");
-
- if (overrideExisting || !StorageConfig.FileExists(ddsPath))
- {
- var bitmap = new Bitmap(tiffPath);
-
- // Konvertierung
- var target = SlimDx9TextureConvertible.CreateFile(
- new SlimDx9TextureConvertible.SlimDx9TextureParameters()
- {
- AardvarkFormat = Patch.GetTextureFormatFromPixelFormat(bitmap.PixelFormat),
- AardvarkUsage = AardvarkUsage.None,
- FileName = ddsPath,
- Pool = Pool.Scratch,
- MipMapLevels = 0
- });
-
- var bitmapConvertible = new Convertible("BitmapMemory", bitmap);
- bitmapConvertible.ConvertInto(target);
- }
- }
- public static void ConvertTiffToDDS3(string tiffPath, bool overrideExisting = false)
- {
- var ddsPath = Path.ChangeExtension(tiffPath, ".dds");
- if (StorageConfig.FileExists(ddsPath) && !overrideExisting)
- return;
-
- var info = SlimDX.Direct3D10.ImageLoadInformation.FromDefaults();
-
- //var image = PixImage.Create(tiffPath, PixLoadOptions.UseSystemImage);
- //if (image.PixFormat == PixFormat.ByteGray)
- // info.Format = SlimDX.DXGI.Format.A8_UNorm;
-
- var tex = SlimDX.Direct3D10.Texture2D.FromFile(device, tiffPath, info);
- SlimDX.Direct3D10.Texture2D.SaveTextureToFile(tex, SlimDX.Direct3D10.ImageFileFormat.Dds, ddsPath);
- tex.Dispose();
- }
- public static void ConvertTiffToDDS2(string tiffPath, bool overrideExisting = false)
- {
- string ddsPath = Path.ChangeExtension(tiffPath, ".dds");
-
- if (overrideExisting || !StorageConfig.FileExists(ddsPath))
- {
- var image = PixImage.Create(tiffPath, PixLoadOptions.UseSystemImage);
- // image.SaveAsImage(pngPath);
-
- var outFormat = image.PixFormat == PixFormat.ByteGray ?
- Rendering.AardvarkFormat.L8 : Rendering.AardvarkFormat.Dxt5;
-
- var target = SlimDx9TextureConvertible.CreateFile(
- new SlimDx9TextureConvertible.SlimDx9TextureParameters()
- {
- AardvarkFormat = outFormat,
- AardvarkUsage = AardvarkUsage.None,
- FileName = ddsPath,
- Pool = Pool.Scratch,
- MipMapLevels = 0
- });
-
- var con = image.Convertible();
- con.ConvertInto(target);
- }
- }
-
- public static void WriteV3dArrayAsAara(string filePath, V3d[] elements, V2i sizeV)
- {
- var file = File.Open(filePath, FileMode.Create);
-
- using (var writer = new BinaryWriter(file, Encoding.UTF8))
- {
- string typeName = "V3d";
- byte dimensions = (byte)2;
- int[] size = { sizeV.X, sizeV.Y };
-
- writer.Write(typeName);
- writer.Write(dimensions);
-
- writer.Write(size[0]);
- writer.Write(size[1]);
-
- for (int i = 0; i < elements.Length; i++)
- {
- writer.Write(elements[i].X);
- writer.Write(elements[i].Y);
- writer.Write(elements[i].Z);
- }
-
- writer.Flush();
- }
- file.Dispose();
- }
- public static void WriteV3fArrayAsAara(string filePath, V3f[] elements, V2i sizeV)
- {
- var file = File.Open(filePath, FileMode.Create);
-
- using (var writer = new BinaryWriter(file, Encoding.UTF8))
- {
- string typeName = "V3f";
- byte dimensions = (byte)2;
- int[] size = { sizeV.X, sizeV.Y };
-
- writer.Write(typeName);
- writer.Write(dimensions);
-
- writer.Write(size[0]);
- writer.Write(size[1]);
-
- for (int i = 0; i < elements.Length; i++)
- {
- writer.Write(elements[i].X);
- writer.Write(elements[i].Y);
- writer.Write(elements[i].Z);
- }
-
- writer.Flush();
- }
- file.Dispose();
- }
-
- #endregion
- }
-}
\ No newline at end of file
diff --git a/legacy/Aardvark.Opc/VertexGeometryContent.cs b/legacy/Aardvark.Opc/VertexGeometryContent.cs
deleted file mode 100644
index 2bd25356..00000000
--- a/legacy/Aardvark.Opc/VertexGeometryContent.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Collections.Generic;
-using Aardvark.Runtime;
-using Aardvark.Algodat;
-using Aardvark.VRVis;
-
-namespace Aardvark.Opc
-{
- public class VertexGeometryContent : IFieldCodeable
- {
- public List VertexGeometries;
-
- public VertexGeometryContent()
- {
- VertexGeometries = new List();
- }
-
- public VertexGeometryContent(List vgs)
- {
- VertexGeometries = vgs;
- }
-
- public VertexGeometryContent(VertexGeometry vg)
- {
- VertexGeometries = new List() { vg };
- }
-
- #region IFieldCodeable Members
-
- public IEnumerable GetFieldCoders(int coderVersion)
- {
- return new[]
- {
- new FieldCoder(0, "VertexGeometries", (c, o) => c.CodeList_of_T_(ref ((VertexGeometryContent)o).VertexGeometries)),
- };
- }
-
- #endregion
- }
-}
diff --git a/legacy/Aardvark.Opc/packages.config b/legacy/Aardvark.Opc/packages.config
deleted file mode 100644
index 3d3f8086..00000000
--- a/legacy/Aardvark.Opc/packages.config
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/legacy/Aardvark.Parser.Aara/AaraData.cs b/legacy/Aardvark.Parser.Aara/AaraData.cs
deleted file mode 100644
index d6bca624..00000000
--- a/legacy/Aardvark.Parser.Aara/AaraData.cs
+++ /dev/null
@@ -1,340 +0,0 @@
-using Aardvark.Base;
-using Aardvark.Runtime;
-using Aardvark.SceneGraph;
-using Aardvark.VRVis;
-using System;
-using System.Linq;
-
-namespace Aardvark.Parser.Aara
-{
- [RegisterTypeInfo(Version = 1)]
- public class AaraData : Instance
- {
- #region public properties and fields
-
- public const string Identifier = "AaraData";
- public static class Property
- {
- public const string DataType = "DataType";
- public const string DataTypeAsSymbol = "DataTypeAsSymbol";
- public const string Size = "Size";
- public const string ElementCount = "ElementCount";
- public const string SourceFileName = "SourceFileName";
- public const string HeaderSize = "HeaderSize";
- }
-
- public string SourceFileName
- {
- get { return this.Get(Property.SourceFileName); }
- set { this[Property.SourceFileName] = value; }
- }
-
- public int ElementCount
- {
- get { return this.Get(Property.ElementCount); }
- private set { this[Property.ElementCount] = value; }
- }
-
- public Symbol DataTypeAsSymbol
- {
- get { return this.Get(Property.DataTypeAsSymbol); }
- private set { this[Property.DataTypeAsSymbol] = value; }
- }
- public string DataType
- {
- get { return DataTypeAsSymbol.ToString(); }
- private set { throw new NotImplementedException(); }
- }
-
- ///
- /// 1 to 3 dimensional. Number of columns / rows / pages.
- ///
- public int[] Size
- {
- get { return this.Get(Property.Size); }
- private set { this[Property.Size] = value; }
- }
- public byte Dimensions
- {
- get { return (byte)Size.Count(); }
- }
- public int NumOfColumns
- {
- get { return Size[0]; }
- }
- public int NumOfRows
- {
- get { return Size[1]; }
- }
-
- ///
- /// Size of the header in bytes
- ///
- public int HeaderSize
- {
- get { return this.Get(Property.HeaderSize); }
- private set { this[Property.HeaderSize] = value; }
- }
-
- public static SymbolDict> ConvertArrayToV3fs = new SymbolDict>()
- {
- {"V3d", (Array a) => a.CopyAndConvert(V3f.FromV3d)},
- {"V3f", (Array a) => a.To()}
- };
-
- public static SymbolDict> ConvertArrayToV3ds = new SymbolDict>()
- {
- {"V3d", (Array a) => a.To()},
- {"V3f", (Array a) => a.CopyAndConvert(V3d.FromV3f)},
- };
-
- public static SymbolDict> CreateEmptyArray = new SymbolDict>()
- {
- {"V3d", () => new V3d[0]},
- {"V3f", () => new V3f[0]},
- };
-
- #endregion
-
- #region private properties and fields
-
- private static SymbolDict s_sizeTable =
- #region Definition
- new SymbolDict
- {
- { "byte", sizeof(byte)},
- { "int", sizeof(int)},
- { "float", sizeof(float)},
- { "double", sizeof(double)},
- { "V2f", sizeof(float) * 2},
- { "V3f", sizeof(float) * 3},
- { "V2d", sizeof(double) * 2},
- { "V3d", sizeof(double) * 3},
- { "C3b", sizeof(byte) * 3},
- { "C3f", sizeof(float) * 3},
- { "C4b", sizeof(byte) * 4},
- { "C4f", sizeof(float) * 4}
- };
- #endregion
-
- private static SymbolDict> s_readBigFuncs =
- #region Definition
- new SymbolDict>
- {
- { "byte", (r,c) => { var a = new byte[c]; r.ReadArray(a,0,c); return a; } },
- { "int", (r,c) => { var a = new int[c]; r.ReadArray(a,0,c); return a; } },
- { "float", (r,c) => { var a = new float[c]; r.ReadArray(a,0,c); return a; } },
- { "double", (r,c) => { var a = new double[c]; r.ReadArray(a,0,c); return a; } },
- { "V2f", (r,c) => { var a = new V2f[c]; r.ReadArray(a,0,c); return a; } },
- { "V3f", (r,c) => { var a = new V3f[c]; r.ReadArray(a,0,c); return a; } },
- { "V2d", (r,c) => { var a = new V2d[c]; r.ReadArray(a,0,c); return a; } },
- { "V3d", (r,c) => { var a = new V3d[c]; r.ReadArray(a,0,c); return a; } },
- //{ "V3d", (r,c) => { var a = new V3d[c]; r.ReadBig(a,0,c);
- // var b = a.CopyAndConvert(V3f.FromV3d);
- // return b; } },
- { "C3b", (r,c) => { var a = new C3b[c]; r.ReadArray(a,0,c); return a; } },
- { "C3f", (r,c) => { var a = new C3f[c]; r.ReadArray(a,0,c); return a; } },
- { "C4b", (r,c) => { var a = new C4b[c]; r.ReadArray(a,0,c); return a; } },
- { "C4f", (r,c) => { var a = new C4f[c]; r.ReadArray(a,0,c); return a; } },
- };
- #endregion
-
- private static Telemetry.CpuTime s_cpu_AaraDataReadMemoryStream = new Telemetry.CpuTime().Register("AaraData: Loading cpu-time", true, true);
-
- #endregion
-
- #region constructors
-
- public AaraData()
- : base(Identifier) { }
-
- public AaraData(AaraData ad)
- : this()
- {
- DataTypeAsSymbol = ad.DataTypeAsSymbol;
- Size = ad.Size;
- ElementCount = ad.ElementCount;
- SourceFileName = ad.SourceFileName;
- HeaderSize = ad.HeaderSize;
- DataTypeAsSymbol = ad.DataTypeAsSymbol;
- }
-
- public AaraData(string fileName)
- : this()
- {
- InitializeFromFileHeader(fileName);
- }
-
- public static AaraData FromFile(string fileName)
- { return new AaraData(fileName); }
-
- #endregion
-
- #region Public Methods
-
- ///
- /// Reads all data from the aara file.
- ///
- ///
- public Array LoadElements()
- {
- return LoadElements(ElementCount);
- }
-
- ///
- /// Reads data from the aara file.
- ///
- /// Number of elements to read.
- /// Position of first element to read in the data block (header will be skipped).
- ///
- public Array LoadElements(int count, int startPos = 0)
- {
- using (s_cpu_AaraDataReadMemoryStream.Timer)
- {
- if ((count + startPos) > ElementCount)
- {
- Report.Warn("AaraData tried reading over end of file '" + SourceFileName + "'");
- return CreateEmptyArray[DataTypeAsSymbol]();
- } else if (startPos < 0)
- {
- Report.Warn("AaraData tried indexing < 0 in file '" + SourceFileName + "'");
- return CreateEmptyArray[DataTypeAsSymbol]();
- }
-
- var countInByte = count * s_sizeTable[DataTypeAsSymbol];
- var startPosInByte = startPos * s_sizeTable[DataTypeAsSymbol];
- var readFun = s_readBigFuncs[DataTypeAsSymbol];
-
- // load from file to memory
- var memStream = Load.AsMemoryStream(SourceFileName, HeaderSize + startPosInByte, countInByte);
-
- // convert from memory stream to actual data
- return readFun(new StreamCodeReader(memStream), count);
- }
- }
-
- ///
- /// Reads data from the aara file.
- ///
- /// Number of elements to read.
- /// Column to start reading.
- /// Row to start reading.
- ///
- public Array LoadElements(int count, int columnPos, int rowPos)
- {
- return LoadElements(count, columnPos + NumOfColumns * rowPos);
- }
-
- ///
- /// Reads data from the aara file.
- ///
- /// Number of elements to read.
- /// Column to start reading.
- /// Row to start reading.
- /// Page to start reading
- ///
- public Array LoadElements(int count, int columnPos, int rowPos, int pagePos)
- {
- return LoadElements(count, columnPos + NumOfColumns * (rowPos + NumOfRows * pagePos));
- }
-
- ///
- /// Returns entire row.
- ///
- /// Row to read.
- ///
- public Array LoadRow(int rowPos)
- {
- return LoadElements(NumOfColumns, 0, rowPos);
- }
-
- ///
- /// Returns entire column. Warning: This is slow, because elemnts have to been seeked out.
- ///
- /// Column to read.
- ///
- public Array LoadColumn(int columnPos)
- {
- return LoadColumn(columnPos, 0, NumOfRows);
- }
-
- ///
- /// Returns a column in the range of rowStart to rowEnd. Warning: This is slow, because elemnts have to been seeked out.
- ///
- /// Column to read.
- ///
- ///
- ///
- public Array LoadColumn(int columnPos, int rowStart, int rowEnd)
- {
- using (s_cpu_AaraDataReadMemoryStream.Timer)
- {
- var readFun = s_readBigFuncs[DataTypeAsSymbol];
- var byteSize = s_sizeTable[DataTypeAsSymbol];
-
- var rowCount = rowEnd - rowStart;
- var byteOffset = HeaderSize + byteSize * columnPos;
- var byteStride = byteSize * NumOfColumns;
-
- // load from file to memory
- var chunks = Enumerable.Range(0, rowCount).Select(i => Tup.Create((long)(byteOffset + i * byteStride), (long)byteSize));
- var memStream = Load.AsMemoryStream(SourceFileName, chunks);
-
- // convert from memory stream to actual data
- var r = readFun(new StreamCodeReader(memStream), rowCount);
- return r;
- }
- }
-
-
-
- #endregion
-
- #region implement IAwakeable
-
- public override void Awake(int codedVersion)
- {
- base.Awake(codedVersion);
-
- if (codedVersion == 0)
- {
- DataTypeAsSymbol = (string)this[Property.DataType];
- this.Remove(Property.DataType);
- }
- }
-
- #endregion
-
- #region private methods
-
- private void InitializeFromFileHeader(string fileName)
- {
- using (s_cpu_AaraDataReadMemoryStream.Timer)
- {
- var typeNameLength = Load.AsByteArray(fileName, 0, 1)[0];
-
- var dataType = new string(Load.AsByteArray(fileName, 1, typeNameLength)
- .Select(b => (char)b).ToArray());
-
- var dimensions = Load.AsByteArray(fileName, 1 + typeNameLength, 1)[0];
-
- // Size
- var elementCount = 1;
- var size = new int[dimensions];
- for (var i = 0; i < dimensions; i++)
- elementCount *= size[i] = BitConverter.ToInt32(
- Load.AsByteArray(fileName, 2 + typeNameLength + i * sizeof(int), sizeof(int)),
- 0);
-
- // -- set AaraData --
- SourceFileName = fileName;
- DataTypeAsSymbol = dataType;
- ElementCount = elementCount;
- Size = size;
- HeaderSize = 1 + typeNameLength + 1 + dimensions * sizeof(int);
- }
- }
-
- #endregion
- }
-}
diff --git a/legacy/Aardvark.Parser.Aara/Aardvark.Parser.Aara.csproj b/legacy/Aardvark.Parser.Aara/Aardvark.Parser.Aara.csproj
deleted file mode 100644
index 77faf17d..00000000
--- a/legacy/Aardvark.Parser.Aara/Aardvark.Parser.Aara.csproj
+++ /dev/null
@@ -1,886 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.30729
- 2.0
- {23BCB484-7C50-4A88-B214-BFF2785E3615}
- Library
- Properties
- Aardvark.Parser.Aara
- Aardvark.Parser.Aara
- v4.7.1
- 512
-
-
-
- true
- full
- false
- WARNING, Do not change manually, is changed by Aardvark's MSBuildCleaner
- DEBUG;TRACE
- prompt
- 4
- AllRules.ruleset
- false
-
-
- pdbonly
- true
- WARNING, Do not change manually, is changed by Aardvark's MSBuildCleaner
- TRACE
- prompt
- 4
- AllRules.ruleset
- false
-
-
-
-
- 3.5
-
-
- 3.5
-
-
- 3.5
-
-
-
-
-
-
-
-
-
-
- {377da721-c821-45f6-b803-9c8724c7b37f}
- Aardvark.Base
-
-
- {4b4c6b5f-a44e-41b5-b985-033ac23d3958}
- Aardvark.VRVis.Base
-
-
- {E7B169D6-913C-43CB-B8E4-FCBF27989380}
- Aardvark.Runtime.IO
-
-
- {B7EF7131-1C8F-45C8-8725-EF9D0937FD38}
- Aardvark.Algodat.Base
-
-
- {3F6BB612-53F1-4F7B-9BFE-CDA3396B9316}
- Aardvark.Runtime.Base
-
-
- {1ee33ad8-8832-482e-9bc6-2fcbaac38e2e}
- Aardvark.Runtime.Kernel
-
-
- {F5A9E328-7BBB-401A-A1B2-10B92E715EAD}
- Aardvark.SceneGraph.Base
-
-
-
- $(SolutionDir)\Aardvark.targets
-
-
-
-
-
-
-
- ..\..\packages\build\BlackFox.VsWhere\lib\netstandard2.0\BlackFox.VsWhere.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Api.GitHub\lib\netstandard2.0\Fake.Api.GitHub.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.CommandLineParsing\lib\netstandard2.0\Fake.Core.CommandLineParsing.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Context\lib\netstandard2.0\Fake.Core.Context.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Environment\lib\netstandard2.0\Fake.Core.Environment.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.FakeVar\lib\netstandard2.0\Fake.Core.FakeVar.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Process\lib\netstandard2.0\Fake.Core.Process.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.ReleaseNotes\lib\netstandard2.0\Fake.Core.ReleaseNotes.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.SemVer\lib\netstandard2.0\Fake.Core.SemVer.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.String\lib\netstandard2.0\Fake.Core.String.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Target\lib\netstandard2.0\Fake.Core.Target.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Tasks\lib\netstandard2.0\Fake.Core.Tasks.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Trace\lib\netstandard2.0\Fake.Core.Trace.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Core.Xml\lib\netstandard2.0\Fake.Core.Xml.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.DotNet.Cli\lib\netstandard2.0\Fake.DotNet.Cli.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.DotNet.MSBuild\lib\netstandard2.0\Fake.DotNet.MSBuild.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.DotNet.NuGet\lib\netstandard2.0\Fake.DotNet.NuGet.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.IO.FileSystem\lib\netstandard2.0\Fake.IO.FileSystem.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Net.Http\lib\netstandard2.0\Fake.Net.Http.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Fake.Tools.Git\lib\netstandard2.0\Fake.Tools.Git.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Farmer\lib\netstandard2.0\Farmer.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\FParsec\lib\netstandard2.0\FParsec.dll
- True
- True
-
-
- ..\..\packages\build\FParsec\lib\netstandard2.0\FParsecCS.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\FSharp.Control.Reactive\lib\net6.0\FSharp.Control.Reactive.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\FSharp.Core\lib\netstandard2.1\FSharp.Core.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build\lib\net6.0\Microsoft.Build.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build.Framework\lib\net6.0\Microsoft.Build.Framework.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build.Tasks.Core\lib\net6.0\Microsoft.Build.Tasks.Core.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Build.Utilities.Core\lib\net6.0\Microsoft.Build.Utilities.Core.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.NET.StringTools\lib\netstandard2.0\Microsoft.NET.StringTools.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Win32.Registry\lib\netstandard2.0\Microsoft.Win32.Registry.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Microsoft.Win32.SystemEvents\lib\net6.0\Microsoft.Win32.SystemEvents.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.dll
- True
- True
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.Mdb.dll
- True
- True
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.Pdb.dll
- True
- True
-
-
- ..\..\packages\build\Mono.Cecil\lib\netstandard2.0\Mono.Cecil.Rocks.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\MSBuild.StructuredLogger\lib\netstandard2.0\StructuredLogger.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Common\lib\netstandard2.0\NuGet.Common.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Configuration\lib\netstandard2.0\NuGet.Configuration.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Frameworks\lib\netstandard2.0\NuGet.Frameworks.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Packaging\lib\net5.0\NuGet.Packaging.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Protocol\lib\net5.0\NuGet.Protocol.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\NuGet.Versioning\lib\netstandard2.0\NuGet.Versioning.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\Octokit\lib\netstandard2.0\Octokit.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.CodeDom\lib\net6.0\System.CodeDom.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Collections.Immutable\lib\net6.0\System.Collections.Immutable.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Configuration.ConfigurationManager\lib\net6.0\System.Configuration.ConfigurationManager.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Drawing.Common\lib\net6.0\System.Drawing.Common.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Formats.Asn1\lib\net6.0\System.Formats.Asn1.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Reactive\lib\net5.0\System.Reactive.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Reflection.Metadata\lib\net6.0\System.Reflection.Metadata.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Resources.Extensions\lib\net6.0\System.Resources.Extensions.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Runtime.CompilerServices.Unsafe\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.AccessControl\lib\net6.0\System.Security.AccessControl.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.Cng\lib\netcoreapp3.0\System.Security.Cryptography.Cng.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.Pkcs\lib\net6.0\System.Security.Cryptography.Pkcs.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.ProtectedData\lib\net6.0\System.Security.Cryptography.ProtectedData.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Cryptography.Xml\lib\net6.0\System.Security.Cryptography.Xml.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Permissions\lib\net6.0\System.Security.Permissions.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Security.Principal.Windows\lib\netstandard2.0\System.Security.Principal.Windows.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Text.Encoding.CodePages\lib\net6.0\System.Text.Encoding.CodePages.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Text.Encodings.Web\lib\net6.0\System.Text.Encodings.Web.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Text.Json\lib\net6.0\System.Text.Json.dll
- True
- True
-
-
-
-
-
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
- True
-
-
-
-
-
-
- ..\..\packages\build\System.Threading.Tasks.Dataflow\lib\net6.0\System.Threading.Tasks.Dataflow.dll
- True
- True
-
-
-
-
-
-
-
-
- ..\..\packages\build\System.Windows.Extensions\lib\net6.0\System.Windows.Extensions.dll
- True
- True
-
-
-
-
-
\ No newline at end of file
diff --git a/legacy/Aardvark.Parser.Aara/Properties/AssemblyInfo.cs b/legacy/Aardvark.Parser.Aara/Properties/AssemblyInfo.cs
deleted file mode 100644
index ed3880c7..00000000
--- a/legacy/Aardvark.Parser.Aara/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Aardvark.Parser.Aara")]
-[assembly: AssemblyDescription("")]
-#if !DEPLOY //(Automatic Code by BuildPatcher.) Removes these AssemblyAttributes for DEPLOY build since these are added with buildDeploy.bat.
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("VRVis Zentrum fuer Virtual Reality und Visualisierung Forschungs-GmbH")]
-[assembly: AssemblyProduct("Aardvark.Parser.Aara")]
-[assembly: AssemblyCopyright("Copyright © VRVis 2009")]
-[assembly: AssemblyTrademark("")]
-#endif //!DEPLOY (Automatic Code by BuildPatcher.)
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("cba5df90-190b-4943-bc0b-9aed4a251673")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-#if !DEPLOY //(Automatic Code by BuildPatcher.) Removes these AssemblyAttributes for DEPLOY build since these are added with buildDeploy.bat.
-[assembly: AssemblyFileVersion("1.0.0.0")]
-#endif //!DEPLOY (Automatic Code by BuildPatcher.)
diff --git a/paket.dependencies b/paket.dependencies
index f4c75cb5..dfcd1c8e 100644
--- a/paket.dependencies
+++ b/paket.dependencies
@@ -1,4 +1,4 @@
-framework: netstandard2.0, netcoreapp3.1, net5.0, net6.0
+framework: netstandard2.0, net6.0
source https://api.nuget.org/v3/index.json
source https://vrvis.myget.org/F/aardvark_public/api/v3/index.json
@@ -7,11 +7,9 @@ storage: none
nuget Aardvark.Build ~> 1.0.11
-nuget FSharp.Core ~> 5.0.0 lowest_matching: true
+nuget FSharp.Core ~> 5.0.2 lowest_matching: true
nuget FSharp.Data ~> 3.1.1
-nuget Aardvark.Build
-
nuget FSharp.Data.Adaptive ~> 1.2.6
nuget Aardvark.Base ~> 5.2.12
@@ -42,17 +40,15 @@ nuget Aardvark.Service.Giraffe ~> 5.3.1
nuget Adaptify.MSBuild = 1.1.5
nuget Adaptify.Core = 1.1.5
-nuget Aardium ~> 2.0.10-prerelease0007
-nuget Uncodium.Eigensystems ~> 1.1.2
+nuget Aardvark.Data.Wavefront ~> 5.2.5
+nuget Aardvark.GeoSpatial.Opc ~> 5.8.1
+nuget Aardium ~> 2.0.10-prerelease0007
nuget OPCViewer.Base ~> 1.1.1
-nuget Aardvark.Data.Wavefront ~> 5.2.5
-
-nuget Aardvark.GeoSpatial.Opc ~> 5.8.1
-
+nuget Uncodium.Eigensystems ~> 1.1.2
nuget Chiron ~> 6.3.1
nuget RestSharp ~> 106.6.9
@@ -62,6 +58,25 @@ nuget Giraffe
nuget Saturn
nuget Thoth.Json.Giraffe
+
+group Test
+ framework: net6.0, net6.0-windows
+ source https://api.nuget.org/v3/index.json
+
+ nuget FSharp.Core ~> 5.0.2 lowest_matching: true
+ nuget NUnit ~> 3.13.3
+ nuget FsUnit ~> 5.0.0
+ nuget FsCheck ~> 2.16.4
+ nuget FsCheck.NUnit ~> 2.16.4
+ nuget NUnit3TestAdapter ~> 4.2.1
+ nuget Microsoft.NET.Test.Sdk ~> 17.2.0
+ nuget Expecto ~> 9.0.4
+ nuget Expecto.FsCheck ~> 9.0.4
+ nuget YoloDev.Expecto.TestSdk ~> 0.12.20
+
+ nuget BenchmarkDotNet ~> 0.13.1
+
+
group Build
framework: net6.0
source https://api.nuget.org/v3/index.json
@@ -72,7 +87,6 @@ nuget Fake.Api.GitHub
nuget Fake.Core.ReleaseNotes
nuget Octokit
nuget Fake.Core.Target
-nuget Fake.IO.FileSystem
nuget Farmer
nuget Fake.DotNet.Cli ~> 5.23.0
nuget Fake.DotNet.NuGet
diff --git a/paket.lock b/paket.lock
index 9e41fce1..e9260039 100644
--- a/paket.lock
+++ b/paket.lock
@@ -1,49 +1,49 @@
STORAGE: NONE
-RESTRICTION: || (== net5.0) (== net6.0) (== netcoreapp3.1) (== netstandard2.0)
+RESTRICTION: || (== net6.0) (== netstandard2.0)
NUGET
remote: https://api.nuget.org/v3/index.json
Aardium (2.0.10-prerelease0007)
FSharp.Core (>= 4.7)
FSys (>= 0.0.1 < 0.1)
- Aardvark.Application (5.2.13)
+ Aardvark.Application (5.2.15)
Aardvark.Base.Essentials (>= 5.2.11 < 5.3)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
+ Aardvark.Rendering (5.2.15)
FShade.Core (>= 5.2.9 < 5.3)
FShade.GLSL (>= 5.2.9)
FSharp.Core (>= 5.0)
- Aardvark.Application.Slim (5.2.13)
- Aardvark.Application (5.2.13)
+ Aardvark.Application.Slim (5.2.15)
+ Aardvark.Application (5.2.15)
Aardvark.Base.Essentials (>= 5.2.11 < 5.3)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.Runtime (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
+ Aardvark.Rendering (5.2.15)
FShade (>= 5.2.9 < 5.3)
FSharp.Core (>= 5.0)
Silk.NET.GLFW (2.15)
Unofficial.OpenTK (>= 3.0.19 < 3.1)
- Aardvark.Application.Slim.GL (5.2.13)
- Aardvark.Application (5.2.13)
- Aardvark.Application.Slim (5.2.13)
+ Aardvark.Application.Slim.GL (5.2.15)
+ Aardvark.Application (5.2.15)
+ Aardvark.Application.Slim (5.2.15)
Aardvark.Base.Essentials (>= 5.2.11 < 5.3)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.Runtime (>= 5.2.11 < 5.3)
Aardvark.Base.Tensors (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
- Aardvark.Rendering.GL (5.2.13)
+ Aardvark.Rendering (5.2.15)
+ Aardvark.Rendering.GL (5.2.15)
FShade (>= 5.2.9 < 5.3)
FSharp.Core (>= 5.0)
Silk.NET.Core (2.15)
Silk.NET.GLFW (2.15)
Unofficial.OpenTK (>= 3.0.19 < 3.1)
- Aardvark.Application.Slim.Vulkan (5.2.13)
- Aardvark.Application (5.2.13)
- Aardvark.Application.Slim (5.2.13)
+ Aardvark.Application.Slim.Vulkan (5.2.15)
+ Aardvark.Application (5.2.15)
+ Aardvark.Application.Slim (5.2.15)
Aardvark.Base.Essentials (>= 5.2.11 < 5.3)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.Runtime (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
- Aardvark.Rendering.Vulkan (5.2.13)
+ Aardvark.Rendering (5.2.15)
+ Aardvark.Rendering.Vulkan (5.2.15)
FShade (>= 5.2.9 < 5.3)
FSharp.Core (>= 5.0)
GLSLangSharp (>= 0.4.14 < 0.5)
@@ -54,83 +54,83 @@ NUGET
Aardvark.Base.Runtime (>= 5.2.7 < 5.3)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2.13 < 1.3)
- Aardvark.Base (5.2.12)
- Aardvark.Base.Telemetry (5.2.12)
+ Aardvark.Base (5.2.13)
+ Aardvark.Base.Telemetry (5.2.13)
System.Collections.Immutable (>= 5.0)
- System.Reflection.Metadata (>= 5.0) - restriction: || (&& (== net5.0) (< netcoreapp3.1)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
+ System.Reflection.Metadata (>= 5.0) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Text.Json (>= 4.7.2)
- Aardvark.Base.Essentials (5.2.12)
- Aardvark.Base (5.2.12)
+ Aardvark.Base.Essentials (5.2.13)
+ Aardvark.Base (5.2.13)
System.Collections.Immutable (>= 5.0)
- Aardvark.Base.FSharp (5.2.12)
- Aardvark.Base (5.2.12)
+ Aardvark.Base.FSharp (5.2.13)
+ Aardvark.Base (5.2.13)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
FsPickler (>= 5.3.2 < 5.4)
System.Dynamic.Runtime (>= 4.3 < 4.4)
- Aardvark.Base.Incremental (5.2.12)
- Aardvark.Base (5.2.12)
- Aardvark.Base.FSharp (5.2.12)
+ Aardvark.Base.Incremental (5.2.13)
+ Aardvark.Base (5.2.13)
+ Aardvark.Base.FSharp (5.2.13)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
FsPickler (>= 5.3.2 < 5.4)
- Aardvark.Base.IO (5.2.12)
- Aardvark.Base (5.2.12)
- Aardvark.Base.Tensors (5.2.12)
+ Aardvark.Base.IO (5.2.13)
+ Aardvark.Base (5.2.13)
+ Aardvark.Base.Tensors (5.2.13)
System.Dynamic.Runtime (>= 4.3 < 4.4)
- Aardvark.Base.Runtime (5.2.12)
- Aardvark.Base.FSharp (5.2.12)
- Aardvark.Base.Incremental (5.2.12)
+ Aardvark.Base.Runtime (5.2.13)
+ Aardvark.Base.FSharp (5.2.13)
+ Aardvark.Base.Incremental (5.2.13)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
FsPickler (>= 5.3.2 < 5.4)
- Aardvark.Base.Telemetry (5.2.12)
- Aardvark.Base.Tensors (5.2.12)
- Aardvark.Base (5.2.12)
- Aardvark.Base.FSharp (5.2.12)
+ Aardvark.Base.Telemetry (5.2.13)
+ Aardvark.Base.Tensors (5.2.13)
+ Aardvark.Base (5.2.13)
+ Aardvark.Base.FSharp (5.2.13)
FSharp.Core (>= 5.0)
SixLabors.ImageSharp (>= 2.0 < 2.1)
Aardvark.Base.TypeProviders (4.5.15)
FSharp.Core (>= 4.2.3)
Aardvark.Build (1.0.13)
- Aardvark.Data.Wavefront (5.2.5)
- Aardvark.Geometry.PolyMesh (5.2.5)
- Aardvark.Geometry (5.2.12)
- Aardvark.Base (5.2.12)
- Aardvark.Base.FSharp (5.2.12)
- Aardvark.Base.Tensors (5.2.12)
+ Aardvark.Data.Wavefront (5.2.12)
+ Aardvark.Geometry.PolyMesh (5.2.12)
+ Aardvark.Geometry (5.2.13)
+ Aardvark.Base (5.2.13)
+ Aardvark.Base.FSharp (5.2.13)
+ Aardvark.Base.Tensors (5.2.13)
Aardvark.Base.TypeProviders (>= 4.5.15 < 4.6)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2 < 1.3)
FsPickler (>= 5.3.2 < 5.4)
Unofficial.LibTessDotNet (>= 2.0.2 < 2.1)
- Aardvark.Geometry.Clustering (5.2.5)
- Aardvark.Base (>= 5.2.5 < 5.3)
- Aardvark.Geometry.PointTree (5.2.5)
+ Aardvark.Geometry.Clustering (5.2.12)
+ Aardvark.Base (>= 5.2.12 < 5.3)
+ Aardvark.Geometry.PointTree (5.2.12)
FSharp.Core (>= 5.0)
- Aardvark.Geometry.Intersection (5.2.5)
- Aardvark.Base.IO (>= 5.2.5 < 5.3)
- Aardvark.Geometry.PointTree (5.2.5)
- Aardvark.Base.IO (>= 5.2.5 < 5.3)
- Aardvark.Geometry.PolyMesh (5.2.5)
- Aardvark.Base (>= 5.2.5 < 5.3)
- Aardvark.Geometry.Clustering (5.2.5)
- Aardvark.Geometry.Intersection (5.2.5)
- Aardvark.Rendering (>= 5.2.5)
- Aardvark.GPGPU (5.2.13)
+ Aardvark.Geometry.Intersection (5.2.12)
+ Aardvark.Base.IO (>= 5.2.12 < 5.3)
+ Aardvark.Geometry.PointTree (5.2.12)
+ Aardvark.Base.IO (>= 5.2.12 < 5.3)
+ Aardvark.Geometry.PolyMesh (5.2.12)
+ Aardvark.Base (>= 5.2.12 < 5.3)
+ Aardvark.Geometry.Clustering (5.2.12)
+ Aardvark.Geometry.Intersection (5.2.12)
+ Aardvark.Rendering (>= 5.2.13)
+ Aardvark.GPGPU (5.2.15)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
+ Aardvark.Rendering (5.2.15)
FShade.Core (>= 5.2.9 < 5.3)
FShade.GLSL (>= 5.2.9)
FSharp.Core (>= 5.0)
- Aardvark.PixImage.DevIL (5.2.12)
- Aardvark.Base (5.2.12)
- Aardvark.Base.Tensors (5.2.12)
+ Aardvark.PixImage.DevIL (5.2.13)
+ Aardvark.Base (5.2.13)
+ Aardvark.Base.Tensors (5.2.13)
DevILSharp
- Aardvark.Rendering (5.2.13)
+ Aardvark.Rendering (5.2.15)
Aardvark.Base.Essentials (>= 5.2.11 < 5.3)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.Tensors (>= 5.2.11 < 5.3)
@@ -138,55 +138,55 @@ NUGET
FShade.GLSL (>= 5.2.9)
FSharp.Core (>= 5.0)
FSharp.Data.Adaptive (>= 1.2.13 < 1.3)
- Aardvark.Rendering.GL (5.2.13)
+ Aardvark.Rendering.GL (5.2.15)
Aardvark.Assembler (>= 0.0.6 < 0.1)
Aardvark.Base.Essentials (>= 5.2.11 < 5.3)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.Runtime (>= 5.2.11 < 5.3)
Aardvark.Base.Tensors (>= 5.2.11 < 5.3)
Aardvark.Geometry (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
+ Aardvark.Rendering (5.2.15)
FShade (>= 5.2.9 < 5.3)
FSharp.Core (>= 5.0)
Unofficial.OpenTK (>= 3.0.19 < 3.1)
- Aardvark.Rendering.Text (5.2.13)
+ Aardvark.Rendering.Text (5.2.15)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
- Aardvark.SceneGraph (5.2.13)
+ Aardvark.Rendering (5.2.15)
+ Aardvark.SceneGraph (5.2.15)
CommonMark.NET (>= 0.15.1 < 0.16)
FShade.Core (>= 5.2.9 < 5.3)
FShade.GLSL (>= 5.2.9)
FSharp.Core (>= 5.0)
Unofficial.LibTessDotNet (>= 2.0.2 < 2.1)
Unofficial.Typography (>= 0.1 < 0.2)
- Aardvark.Rendering.Vulkan (5.2.13)
+ Aardvark.Rendering.Vulkan (5.2.15)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.Runtime (>= 5.2.11 < 5.3)
Aardvark.Base.Tensors (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
+ Aardvark.Rendering (5.2.15)
FShade (>= 5.2.9 < 5.3)
FSharp.Core (>= 5.0)
GLSLangSharp (>= 0.4.14 < 0.5)
- Aardvark.SceneGraph (5.2.13)
+ Aardvark.SceneGraph (5.2.15)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
+ Aardvark.Rendering (5.2.15)
FShade.Core (>= 5.2.9 < 5.3)
FShade.GLSL (>= 5.2.9)
FSharp.Core (>= 5.0)
- Aardvark.SceneGraph.IO (5.2.13)
+ Aardvark.SceneGraph.IO (5.2.15)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.Tensors (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
- Aardvark.SceneGraph (5.2.13)
+ Aardvark.Rendering (5.2.15)
+ Aardvark.SceneGraph (5.2.15)
AssimpNet (>= 5.0.0-beta1 < 5.1.0-beta)
FShade.Core (>= 5.2.9 < 5.3)
FShade.GLSL (>= 5.2.9)
FSharp.Core (>= 5.0)
- Aardvark.SceneGraph.Opc (5.2.13)
+ Aardvark.SceneGraph.Opc (5.2.15)
Aardvark.Base.Incremental (>= 5.2.11 < 5.3)
Aardvark.Base.IO (>= 5.2.11 < 5.3)
- Aardvark.Rendering (5.2.13)
- Aardvark.SceneGraph (5.2.13)
+ Aardvark.Rendering (5.2.15)
+ Aardvark.SceneGraph (5.2.15)
FSharp.Core (>= 5.0)
SharpZipLib (>= 1.2 < 1.3)
Aardvark.Service (5.3.2)
@@ -261,7 +261,7 @@ NUGET
CommonMark.NET (0.15.1)
DevILSharp (0.2.19)
FSharp.Core (>= 5.0)
- Fable.Core (3.7.1) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ Fable.Core (3.7.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
FParsec (1.1.1)
FSharp.Core (>= 4.3.4)
FShade (5.2.9)
@@ -291,10 +291,10 @@ NUGET
FShade.Core (5.2.9)
FShade.Imperative (5.2.9)
FSharp.Core (>= 5.0)
- FSharp.Control.Websockets (0.2.2) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ FSharp.Control.Websockets (0.2.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
FSharp.Core (>= 4.3.4)
Microsoft.IO.RecyclableMemoryStream (>= 1.2.2)
- FSharp.Core (5.0.1)
+ FSharp.Core (5.0.2)
FSharp.Data (3.1.1)
FSharp.Core (>= 4.3.4)
FSharp.Data.Adaptive (1.2.13)
@@ -310,22 +310,22 @@ NUGET
FSys (0.0.1)
FSharp.Core (>= 4.7)
Giraffe (5.0)
- FSharp.Core (>= 5.0) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Giraffe.ViewEngine (>= 1.3) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Microsoft.IO.RecyclableMemoryStream (>= 1.3.6) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Newtonsoft.Json (>= 12.0.3) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Ply (>= 0.3.1) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- System.Text.Json (>= 5.0.2) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Utf8Json (>= 1.3.7) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Giraffe.ViewEngine (1.4) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ FSharp.Core (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Giraffe.ViewEngine (>= 1.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Microsoft.IO.RecyclableMemoryStream (>= 1.3.6) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Newtonsoft.Json (>= 12.0.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Ply (>= 0.3.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ System.Text.Json (>= 5.0.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Utf8Json (>= 1.3.7) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Giraffe.ViewEngine (1.4) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
FSharp.Core (>= 5.0)
GLSLangSharp (0.4.14)
FSharp.Core (>= 5.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (6.0.8) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.10) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ Microsoft.AspNetCore.Authentication.JwtBearer (6.0.8) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.10) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
Microsoft.Bcl.AsyncInterfaces (6.0)
- System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
- Microsoft.Bcl.HashCode (1.1.1) - restriction: || (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
+ Microsoft.Bcl.HashCode (1.1.1) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.CSharp (4.7)
Microsoft.Diagnostics.NETCore.Client (0.2.328102)
Microsoft.Bcl.AsyncInterfaces (>= 1.1)
@@ -339,13 +339,13 @@ NUGET
System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
Microsoft.DotNet.PlatformAbstractions (3.1.6)
Microsoft.Extensions.DependencyInjection (6.0)
- Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
- System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.Extensions.DependencyInjection.Abstractions (6.0)
- Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
- System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
+ System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.Extensions.DependencyModel (6.0)
System.Buffers (>= 4.5.1)
System.Memory (>= 4.5.4)
@@ -353,38 +353,38 @@ NUGET
System.Text.Encodings.Web (>= 6.0)
System.Text.Json (>= 6.0)
Microsoft.Extensions.Logging (6.0)
- Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.Extensions.DependencyInjection (>= 6.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
Microsoft.Extensions.Logging.Abstractions (>= 6.0)
Microsoft.Extensions.Options (>= 6.0)
System.Diagnostics.DiagnosticSource (>= 6.0)
Microsoft.Extensions.Logging.Abstractions (6.0.1)
- System.Buffers (>= 4.5.1) - restriction: || (== net5.0) (&& (== net6.0) (>= net461)) (== netcoreapp3.1) (== netstandard2.0)
- System.Memory (>= 4.5.4) - restriction: || (== net5.0) (&& (== net6.0) (>= net461)) (== netcoreapp3.1) (== netstandard2.0)
+ System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
+ System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
Microsoft.Extensions.Options (6.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
Microsoft.Extensions.Primitives (>= 6.0)
- System.ComponentModel.Annotations (>= 5.0) - restriction: || (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ System.ComponentModel.Annotations (>= 5.0) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.Extensions.Primitives (6.0)
- System.Memory (>= 4.5.4) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netcoreapp3.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== netcoreapp3.1) (>= net461)) (== netstandard2.0)
+ System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
- Microsoft.IdentityModel.Abstractions (6.22) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
- Microsoft.IdentityModel.JsonWebTokens (6.22) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ Microsoft.IdentityModel.Abstractions (6.22) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
+ Microsoft.IdentityModel.JsonWebTokens (6.22) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
Microsoft.IdentityModel.Tokens (>= 6.22)
- Microsoft.IdentityModel.Logging (6.22) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ Microsoft.IdentityModel.Logging (6.22) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
Microsoft.IdentityModel.Abstractions (>= 6.22)
- Microsoft.IdentityModel.Protocols (6.22) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ Microsoft.IdentityModel.Protocols (6.22) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
Microsoft.IdentityModel.Logging (>= 6.22)
Microsoft.IdentityModel.Tokens (>= 6.22)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (6.22) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ Microsoft.IdentityModel.Protocols.OpenIdConnect (6.22) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
Microsoft.IdentityModel.Protocols (>= 6.22)
System.IdentityModel.Tokens.Jwt (>= 6.22)
- Microsoft.IdentityModel.Tokens (6.22) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ Microsoft.IdentityModel.Tokens (6.22) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
Microsoft.CSharp (>= 4.5)
Microsoft.IdentityModel.Logging (>= 6.22)
System.Security.Cryptography.Cng (>= 4.5)
- Microsoft.IO.RecyclableMemoryStream (2.2) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ Microsoft.IO.RecyclableMemoryStream (2.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
Microsoft.NETCore.Platforms (6.0.5)
Microsoft.NETCore.Targets (5.0)
NETStandard.Library (2.0.3)
@@ -407,18 +407,18 @@ NUGET
FsPickler (>= 5.3.2 < 5.4)
FsPickler.Json (>= 5.3.2 < 5.4)
Uncodium.Eigensystems (>= 1.1.2 < 1.2)
- Ply (0.3.1) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ Ply (0.3.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
FSharp.Core (>= 4.6.2)
System.Threading.Tasks.Extensions (>= 4.5.4)
RestSharp (106.6.10)
Saturn (0.15)
- FSharp.Control.Websockets (>= 0.2.2) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- FSharp.Core (>= 5.0.1) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Giraffe (>= 5.0) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 5.0.7) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ FSharp.Control.Websockets (>= 0.2.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ FSharp.Core (>= 5.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Giraffe (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Microsoft.AspNetCore.Authentication.JwtBearer (>= 5.0.7) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
SharpZipLib (1.2)
Silk.NET.Core (2.15)
- Microsoft.Bcl.HashCode (>= 1.1.1) - restriction: || (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ Microsoft.Bcl.HashCode (>= 1.1.1) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.CSharp (>= 4.7)
Microsoft.DotNet.PlatformAbstractions (>= 3.1.6)
Microsoft.Extensions.DependencyModel (>= 5.0)
@@ -429,9 +429,9 @@ NUGET
Silk.NET.Core (>= 2.15)
Ultz.Native.GLFW (>= 3.3.3.1)
SixLabors.ImageSharp (2.0)
- System.Buffers (>= 4.5.1) - restriction: || (&& (== net5.0) (>= net472)) (&& (== net5.0) (< netcoreapp2.1)) (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== netcoreapp3.1) (>= net472)) (&& (== netcoreapp3.1) (< netcoreapp2.1)) (== netstandard2.0)
- System.Memory (>= 4.5.4) - restriction: || (&& (== net5.0) (>= net472)) (&& (== net5.0) (< netcoreapp2.1)) (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== netcoreapp3.1) (>= net472)) (&& (== netcoreapp3.1) (< netcoreapp2.1)) (== netstandard2.0)
- System.Numerics.Vectors (>= 4.5) - restriction: || (&& (== net5.0) (>= net472)) (&& (== net5.0) (< netcoreapp2.1)) (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== netcoreapp3.1) (>= net472)) (&& (== netcoreapp3.1) (< netcoreapp2.1)) (== netstandard2.0)
+ System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)
+ System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)
+ System.Numerics.Vectors (>= 4.5) - restriction: || (&& (== net6.0) (>= net472)) (&& (== net6.0) (< netcoreapp2.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 5.0)
System.Text.Encoding.CodePages (>= 5.0)
Suave (2.5.6)
@@ -442,15 +442,15 @@ NUGET
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Collections.Immutable (6.0)
- System.Memory (>= 4.5.4) - restriction: || (== net5.0) (&& (== net6.0) (>= net461)) (== netcoreapp3.1) (== netstandard2.0)
+ System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
- System.ComponentModel.Annotations (5.0) - restriction: || (&& (== net5.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
+ System.ComponentModel.Annotations (5.0) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
System.Diagnostics.Debug (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Diagnostics.DiagnosticSource (6.0)
- System.Memory (>= 4.5.4) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< net5.0)) (== netcoreapp3.1) (== netstandard2.0)
+ System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< net5.0)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Dynamic.Runtime (4.3)
System.Collections (>= 4.3)
@@ -467,12 +467,12 @@ NUGET
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Threading (>= 4.3)
- System.Formats.Asn1 (6.0) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ System.Formats.Asn1 (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
System.Globalization (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
- System.IdentityModel.Tokens.Jwt (6.22) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
+ System.IdentityModel.Tokens.Jwt (6.22) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
Microsoft.IdentityModel.JsonWebTokens (>= 6.22)
Microsoft.IdentityModel.Tokens (>= 6.22)
System.IO (4.3)
@@ -506,9 +506,9 @@ NUGET
System.Runtime.Extensions (>= 4.3)
System.Threading (>= 4.3)
System.Memory (4.5.5)
- System.Buffers (>= 4.5.1) - restriction: || (&& (== net5.0) (>= monotouch)) (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netcoreapp2.0)) (&& (== net5.0) (< netstandard1.1)) (&& (== net5.0) (< netstandard2.0)) (&& (== net5.0) (>= xamarinios)) (&& (== net5.0) (>= xamarinmac)) (&& (== net5.0) (>= xamarintvos)) (&& (== net5.0) (>= xamarinwatchos)) (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (&& (== netcoreapp3.1) (>= monotouch)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= xamarinios)) (&& (== netcoreapp3.1) (>= xamarinmac)) (&& (== netcoreapp3.1) (>= xamarintvos)) (&& (== netcoreapp3.1) (>= xamarinwatchos)) (== netstandard2.0)
- System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net5.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== netcoreapp3.1) (< netcoreapp2.0)) (== netstandard2.0)
- System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net5.0) (>= monotouch)) (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netcoreapp2.0)) (&& (== net5.0) (< netcoreapp2.1)) (&& (== net5.0) (< netstandard1.1)) (&& (== net5.0) (< netstandard2.0)) (&& (== net5.0) (>= uap10.1)) (&& (== net5.0) (>= xamarinios)) (&& (== net5.0) (>= xamarinmac)) (&& (== net5.0) (>= xamarintvos)) (&& (== net5.0) (>= xamarinwatchos)) (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (&& (== netcoreapp3.1) (>= monotouch)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0)) (&& (== netcoreapp3.1) (< netcoreapp2.1)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= uap10.1)) (&& (== netcoreapp3.1) (>= xamarinios)) (&& (== netcoreapp3.1) (>= xamarinmac)) (&& (== netcoreapp3.1) (>= xamarintvos)) (&& (== netcoreapp3.1) (>= xamarinwatchos)) (== netstandard2.0)
+ System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
+ System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net6.0) (< netcoreapp2.0)) (== netstandard2.0)
+ System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
System.Numerics.Vectors (4.5)
System.ObjectModel (4.3)
System.Collections (>= 4.3)
@@ -523,10 +523,10 @@ NUGET
System.Reflection.Primitives (>= 4.3)
System.Runtime (>= 4.3)
System.Reflection.Emit (4.7)
- System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net5.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net5.0) (< netstandard1.1)) (&& (== net5.0) (< netstandard2.0)) (&& (== net5.0) (>= uap10.1)) (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== netcoreapp3.1) (< netcoreapp2.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= uap10.1)) (== netstandard2.0)
+ System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
System.Reflection.Emit.ILGeneration (4.7)
System.Reflection.Emit.Lightweight (4.7)
- System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net5.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net5.0) (< netstandard2.0)) (&& (== net5.0) (< portable-net45+wp8)) (&& (== net5.0) (>= uap10.1)) (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (< portable-net45+wp8)) (&& (== net6.0) (>= uap10.1)) (&& (== netcoreapp3.1) (< netcoreapp2.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (< portable-net45+wp8)) (&& (== netcoreapp3.1) (>= uap10.1)) (== netstandard2.0)
+ System.Reflection.Emit.ILGeneration (>= 4.7) - restriction: || (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (< portable-net45+wp8)) (&& (== net6.0) (>= uap10.1)) (== netstandard2.0)
System.Reflection.Extensions (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
@@ -553,14 +553,14 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
System.Runtime (>= 4.3.1)
- System.Security.Cryptography.Cng (5.0) - restriction: || (&& (== net5.0) (>= net6.0)) (== net6.0) (&& (== netcoreapp3.1) (>= net6.0)) (&& (== netstandard2.0) (>= net6.0))
- System.Formats.Asn1 (>= 5.0) - restriction: || (== net5.0) (== net6.0) (== netcoreapp3.1) (&& (== netstandard2.0) (>= netcoreapp3.0))
+ System.Security.Cryptography.Cng (5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0))
+ System.Formats.Asn1 (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.0))
System.Text.Encoding (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Text.Encoding.CodePages (6.0)
- System.Memory (>= 4.5.4) - restriction: || (&& (== net5.0) (>= net461)) (&& (== net5.0) (< netcoreapp3.1)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== netcoreapp3.1) (>= net461)) (== netstandard2.0)
+ System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Encodings.Web (6.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
@@ -574,13 +574,13 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
- System.Threading.Tasks.Extensions (4.5.4) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netcoreapp3.1) (< netstandard2.1)) (== netstandard2.0)
- System.ValueTuple (4.5) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ System.Threading.Tasks.Extensions (4.5.4)
+ System.ValueTuple (4.5) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
Thoth.Json.Giraffe (5.0)
- FSharp.Core (>= 5.0.1) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Giraffe (>= 5.0) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Thoth.Json.Net (>= 5.0) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
- Thoth.Json.Net (8.0) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ FSharp.Core (>= 5.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Giraffe (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Thoth.Json.Net (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
+ Thoth.Json.Net (8.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
Fable.Core (>= 3.0 < 4.0)
FSharp.Core (>= 4.7.2)
Newtonsoft.Json (>= 11.0.2)
@@ -591,7 +591,7 @@ NUGET
Unofficial.OpenTK (3.0.21)
Unofficial.Typography (0.1)
System.Numerics.Vectors (>= 4.5)
- Utf8Json (1.3.7) - restriction: || (== net5.0) (== net6.0) (&& (== netcoreapp3.1) (>= net5.0)) (&& (== netstandard2.0) (>= net5.0))
+ Utf8Json (1.3.7) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net5.0))
System.Reflection.Emit (>= 4.3)
System.Reflection.Emit.Lightweight (>= 4.3)
System.Threading.Tasks.Extensions (>= 4.4)
@@ -828,3 +828,118 @@ NUGET
System.Threading.Tasks.Dataflow (6.0)
System.Windows.Extensions (6.0)
System.Drawing.Common (>= 6.0)
+
+GROUP Test
+RESTRICTION: || (== net6.0) (== net6.0-windows7.0)
+NUGET
+ remote: https://api.nuget.org/v3/index.json
+ BenchmarkDotNet (0.13.2)
+ BenchmarkDotNet.Annotations (>= 0.13.2)
+ CommandLineParser (>= 2.4.3)
+ Iced (>= 1.17)
+ Microsoft.CodeAnalysis.CSharp (>= 3.0)
+ Microsoft.Diagnostics.Runtime (>= 2.2.332302)
+ Microsoft.Diagnostics.Tracing.TraceEvent (>= 3.0.2)
+ Microsoft.DotNet.PlatformAbstractions (>= 3.1.6)
+ Perfolizer (>= 0.2.1)
+ System.Management (>= 6.0)
+ System.Reflection.Emit (>= 4.7)
+ System.Reflection.Emit.Lightweight (>= 4.7)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
+ BenchmarkDotNet.Annotations (0.13.2)
+ CommandLineParser (2.9.1)
+ Expecto (9.0.4)
+ FSharp.Core (>= 4.6)
+ Mono.Cecil (>= 0.11.3)
+ Expecto.FsCheck (9.0.4)
+ Expecto (>= 9.0.4)
+ FsCheck (>= 2.14.3)
+ FsCheck (2.16.5)
+ FSharp.Core (>= 4.2.3)
+ FsCheck.NUnit (2.16.5)
+ FsCheck (2.16.5)
+ NUnit (>= 3.13.1 < 4.0)
+ FSharp.Core (5.0.2)
+ FsUnit (5.0.5)
+ FSharp.Core (>= 5.0.2)
+ NUnit (>= 3.13.3 < 3.14)
+ Iced (1.17)
+ Microsoft.Bcl.AsyncInterfaces (6.0)
+ Microsoft.CodeAnalysis.Analyzers (3.3.3)
+ Microsoft.CodeAnalysis.Common (4.3.1)
+ Microsoft.CodeAnalysis.Analyzers (>= 3.3.3)
+ System.Collections.Immutable (>= 6.0)
+ System.Memory (>= 4.5.4)
+ System.Reflection.Metadata (>= 5.0)
+ System.Runtime.CompilerServices.Unsafe (>= 6.0)
+ System.Text.Encoding.CodePages (>= 6.0)
+ System.Threading.Tasks.Extensions (>= 4.5.4)
+ Microsoft.CodeAnalysis.CSharp (4.3.1)
+ Microsoft.CodeAnalysis.Common (4.3.1)
+ Microsoft.CodeCoverage (17.3.2)
+ Microsoft.Diagnostics.NETCore.Client (0.2.328102)
+ Microsoft.Bcl.AsyncInterfaces (>= 1.1)
+ Microsoft.Extensions.Logging (>= 2.1.1)
+ Microsoft.Diagnostics.Runtime (2.2.332302)
+ Microsoft.Diagnostics.NETCore.Client (>= 0.2.251802)
+ System.Collections.Immutable (>= 5.0)
+ System.Runtime.CompilerServices.Unsafe (>= 5.0)
+ Microsoft.Diagnostics.Tracing.TraceEvent (3.0.5)
+ System.Runtime.CompilerServices.Unsafe (>= 5.0)
+ Microsoft.DotNet.PlatformAbstractions (3.1.6)
+ Microsoft.Extensions.DependencyInjection (6.0)
+ Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
+ System.Runtime.CompilerServices.Unsafe (>= 6.0)
+ Microsoft.Extensions.DependencyInjection.Abstractions (6.0)
+ Microsoft.Extensions.Logging (6.0)
+ Microsoft.Extensions.DependencyInjection (>= 6.0)
+ Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
+ Microsoft.Extensions.Logging.Abstractions (>= 6.0)
+ Microsoft.Extensions.Options (>= 6.0)
+ System.Diagnostics.DiagnosticSource (>= 6.0)
+ Microsoft.Extensions.Logging.Abstractions (6.0.2)
+ Microsoft.Extensions.Options (6.0)
+ Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0)
+ Microsoft.Extensions.Primitives (>= 6.0)
+ Microsoft.Extensions.Primitives (6.0)
+ System.Runtime.CompilerServices.Unsafe (>= 6.0)
+ Microsoft.NET.Test.Sdk (17.2)
+ Microsoft.CodeCoverage (>= 17.2)
+ Microsoft.TestPlatform.TestHost (>= 17.2)
+ Microsoft.NETCore.Platforms (6.0.5)
+ Microsoft.TestPlatform.ObjectModel (17.3.2)
+ NuGet.Frameworks (>= 5.11)
+ System.Reflection.Metadata (>= 1.6)
+ Microsoft.TestPlatform.TestHost (17.3.2)
+ Microsoft.TestPlatform.ObjectModel (>= 17.3.2)
+ Newtonsoft.Json (>= 9.0.1)
+ Mono.Cecil (0.11.4)
+ NETStandard.Library (2.0.3)
+ Microsoft.NETCore.Platforms (>= 1.1)
+ Newtonsoft.Json (13.0.1)
+ NuGet.Frameworks (6.3)
+ NUnit (3.13.3)
+ NETStandard.Library (>= 2.0)
+ NUnit3TestAdapter (4.2.1)
+ Perfolizer (0.2.1)
+ System.Memory (>= 4.5.3)
+ System.CodeDom (6.0)
+ System.Collections.Immutable (6.0)
+ System.Runtime.CompilerServices.Unsafe (>= 6.0)
+ System.Diagnostics.DiagnosticSource (6.0)
+ System.Runtime.CompilerServices.Unsafe (>= 6.0)
+ System.Management (6.0)
+ System.CodeDom (>= 6.0)
+ System.Memory (4.5.5)
+ System.Reflection.Emit (4.7)
+ System.Reflection.Emit.Lightweight (4.7)
+ System.Reflection.Metadata (6.0.1)
+ System.Collections.Immutable (>= 6.0)
+ System.Runtime.CompilerServices.Unsafe (6.0)
+ System.Text.Encoding.CodePages (6.0)
+ System.Runtime.CompilerServices.Unsafe (>= 6.0)
+ System.Threading.Tasks.Extensions (4.5.4)
+ YoloDev.Expecto.TestSdk (0.12.20)
+ Expecto (>= 9.0 < 10.0)
+ FSharp.Core (>= 4.6)
+ System.Collections.Immutable (>= 1.7.1)
diff --git a/src/OpcViewer/OpcViewer.fsproj b/src/OpcViewer/OpcViewer.fsproj
index f1a7c140..f4fca05e 100644
--- a/src/OpcViewer/OpcViewer.fsproj
+++ b/src/OpcViewer/OpcViewer.fsproj
@@ -2,7 +2,7 @@
Exe
- net5.0
+ net6.0
..\..\bin\Debug\
diff --git a/src/PRo3D.2D3DLinking/PRo3D.Linking.fsproj b/src/PRo3D.2D3DLinking/PRo3D.Linking.fsproj
index 915a82b5..e154ec93 100644
--- a/src/PRo3D.2D3DLinking/PRo3D.Linking.fsproj
+++ b/src/PRo3D.2D3DLinking/PRo3D.Linking.fsproj
@@ -2,7 +2,7 @@
Exe
- net5.0
+ net6.0
_2D3DLinking
PRo3D.Linking
True
diff --git a/src/PRo3D.Base/PRo3D.Base.fsproj b/src/PRo3D.Base/PRo3D.Base.fsproj
index cb61fbb0..16eed30f 100644
--- a/src/PRo3D.Base/PRo3D.Base.fsproj
+++ b/src/PRo3D.Base/PRo3D.Base.fsproj
@@ -2,7 +2,7 @@
Library
- net5.0
+ net6.0
True
F:\pro3d\PRo3D\src\PRo3D.Base
diff --git a/src/PRo3D.Core/PRo3D.Core.fsproj b/src/PRo3D.Core/PRo3D.Core.fsproj
index c5b9f68d..651907cc 100644
--- a/src/PRo3D.Core/PRo3D.Core.fsproj
+++ b/src/PRo3D.Core/PRo3D.Core.fsproj
@@ -2,7 +2,7 @@
Library
- net5.0
+ net6.0
True
diff --git a/src/PRo3D.Core/Surface/Surface.Files.fs b/src/PRo3D.Core/Surface/Surface.Files.fs
index 68ee9dec..410b2923 100644
--- a/src/PRo3D.Core/Surface/Surface.Files.fs
+++ b/src/PRo3D.Core/Surface/Surface.Files.fs
@@ -182,18 +182,23 @@ module Files =
let p = surface.importPath
if Directory.Exists p then Some p else None
+
+ // glub/gah/gugu/ghzu/aaa
+ //ghzu/aaaa
+
+ // aaa/ghzu/gugu/gah/glub
+
+
/// strips away parts of a file path until the remaining depth is reached
- /// [RNO] TODO CAN THROW ERRORS - REWRITE!!
+ let private regex = System.Text.RegularExpressions.Regex("\\\\|/")
let relativePath (path : string) (remaining : int) =
- let parts =
- path.Split('\\')
- //match parts.Length < remaining
- parts
- |> List.ofArray
- |> List.rev
- |> List.take remaining
- |> List.rev
- |> Path.combine
+ let parts = regex.Split(path)
+ if parts.Length > remaining then
+ Array.skip (parts.Length - remaining) parts
+ |> Path.combine
+ |> Some
+ else
+ None
let sceneRelativePath (path : string) =
relativePath path 5
@@ -204,40 +209,60 @@ module Files =
let expandLazyKdTreePaths (scenePath : option) (surfaces : HashMap) (sgSurfaces : HashMap) =
let expand surf tree =
match tree with
- | KdTrees.Level0KdTree.LazyKdTree lk when surf.relativePaths && scenePath.IsSome -> // scene is portable
+ | KdTrees.Level0KdTree.LazyKdTree lk when surf.relativePaths && scenePath.IsSome -> // scene is portable
+
let path = Path.Combine((Path.GetDirectoryName scenePath.Value),"Surfaces")
- let kdTreeSub = lk.kdtreePath |> sceneRelativePath
- let triangleSub = lk.objectSetPath |> sceneRelativePath
-
- KdTrees.LazyKdTree {
- lk with
- kdtreePath = Path.Combine(path, kdTreeSub)
- objectSetPath = Path.Combine(path, triangleSub)
- }
- | KdTrees.Level0KdTree.LazyKdTree lk -> // surfaces have absolute paths
- let kdTreeSub = lk.kdtreePath |> surfaceRelativePath
- let triangleSub = lk.objectSetPath |> surfaceRelativePath
-
- KdTrees.LazyKdTree {
- lk with
- kdtreePath = Path.Combine(surf.importPath, kdTreeSub)
- objectSetPath = Path.Combine(surf.importPath, triangleSub)
- }
- | KdTrees.Level0KdTree.InCoreKdTree ik -> KdTrees.InCoreKdTree ik // kdtrees can be loaded as is
+
+ match sceneRelativePath lk.kdtreePath, sceneRelativePath lk.objectSetPath with
+ | Some kdTreeSub, Some triangleSub ->
+ KdTrees.LazyKdTree {
+ lk with
+ kdtreePath = Path.Combine(path, kdTreeSub)
+ objectSetPath = Path.Combine(path, triangleSub)
+ } |> Some
+ | _ ->
+ Log.warn "[expandLazyKdTreePaths] could not create relative paths for %A" (lk.kdtreePath, lk.objectSetPath)
+ None
+ | KdTrees.Level0KdTree.LazyKdTree lk -> // surfaces have absolute paths
+
+ match surfaceRelativePath lk.kdtreePath, surfaceRelativePath lk.objectSetPath with
+ | Some kdTreeSub, Some triangleSub ->
+ KdTrees.LazyKdTree {
+ lk with
+ kdtreePath = Path.Combine(surf.importPath, kdTreeSub)
+ objectSetPath = Path.Combine(surf.importPath, triangleSub)
+ } |> Some
+ | _ ->
+ Log.warn "[expandLazyKdTreePaths] could not create relative paths for %A" (lk.kdtreePath, lk.objectSetPath)
+ None
+ | KdTrees.Level0KdTree.InCoreKdTree ik ->
+
+ KdTrees.InCoreKdTree ik |> Some // kdtrees can be loaded as is
sgSurfaces
|> HashMap.choose (fun _ s ->
match s.picking with
| Picking.NoPicking -> None
| Picking.KdTree ks ->
- let surf = surfaces |> HashMap.find s.surface
- match surf.surfaceType with
- | SurfaceType.SurfaceOBJ -> Some s
+ match surfaces |> HashMap.tryFind s.surface with
+ | Some surf ->
+ match surf.surfaceType with
+ | SurfaceType.SurfaceOBJ -> Some s
+ | _ ->
+ let kd =
+ ks
+ |> HashMap.choose (fun box k ->
+ // here we skip failed kd-trees if necessary
+ expand surf k
+ )
+
+ { s with picking = Picking.KdTree kd } |> Some
| _ ->
- let kd =
- ks |> HashMap.map (fun _ k -> expand surf k)
- { s with picking = Picking.KdTree kd } |> Some
- | Picking.PickMesh ms -> s |> Some
+ // note: for robustness we skip unknown surfaces
+ Log.warn "[expandLazyKdTreePaths] surface not found. Cannot pick"
+ None
+ | Picking.PickMesh ms ->
+ s |> Some
)
let makeSurfaceRelative guid (surfaceModel : SurfaceModel) (scenePath : option) =
diff --git a/src/PRo3D.Minerva/PRo3D.Minerva.fsproj b/src/PRo3D.Minerva/PRo3D.Minerva.fsproj
index d62d3924..cced201b 100644
--- a/src/PRo3D.Minerva/PRo3D.Minerva.fsproj
+++ b/src/PRo3D.Minerva/PRo3D.Minerva.fsproj
@@ -1,7 +1,7 @@
- net5.0
+ net6.0
Exe
True
diff --git a/src/PRo3D.SimulatedViews/PRo3D.SimulatedViews.fsproj b/src/PRo3D.SimulatedViews/PRo3D.SimulatedViews.fsproj
index e4402214..d941af33 100644
--- a/src/PRo3D.SimulatedViews/PRo3D.SimulatedViews.fsproj
+++ b/src/PRo3D.SimulatedViews/PRo3D.SimulatedViews.fsproj
@@ -2,7 +2,7 @@
Library
- net5.0
+ net6.0
True
diff --git a/src/PRo3D.SimulatedViews/Snapshots/SnapshotAnimation.fs b/src/PRo3D.SimulatedViews/Snapshots/SnapshotAnimation.fs
index 76076e1d..1d0e3fee 100644
--- a/src/PRo3D.SimulatedViews/Snapshots/SnapshotAnimation.fs
+++ b/src/PRo3D.SimulatedViews/Snapshots/SnapshotAnimation.fs
@@ -161,7 +161,7 @@ module SnapshotAnimation =
bm.orderList
|> List.pairwise
|> List.map lerpit
- |> List.map (toSteps fps)
+ |> List.map (toSteps (float fps))
|> List.concat
let firstBm = BookmarkUtils.find bm.orderList.[0] bm
diff --git a/src/PRo3D.Snapshots/PRo3D.Snapshots.fsproj b/src/PRo3D.Snapshots/PRo3D.Snapshots.fsproj
index b55ff8a7..a5752dbe 100644
--- a/src/PRo3D.Snapshots/PRo3D.Snapshots.fsproj
+++ b/src/PRo3D.Snapshots/PRo3D.Snapshots.fsproj
@@ -5,7 +5,7 @@
Exe
- net5.0
+ net6.0
True
True
diff --git a/src/PRo3D.Viewer/PRo3D.Viewer.fsproj b/src/PRo3D.Viewer/PRo3D.Viewer.fsproj
index d82517bb..7fb4b74f 100644
--- a/src/PRo3D.Viewer/PRo3D.Viewer.fsproj
+++ b/src/PRo3D.Viewer/PRo3D.Viewer.fsproj
@@ -5,7 +5,7 @@
Exe
- net5.0
+ net6.0
True
True
diff --git a/src/PRo3D.Viewer/Program.fs b/src/PRo3D.Viewer/Program.fs
index 2c65841a..12bd1594 100644
--- a/src/PRo3D.Viewer/Program.fs
+++ b/src/PRo3D.Viewer/Program.fs
@@ -65,7 +65,7 @@ type Result =
type EmbeddedRessource = EmbeddedRessource
-let viewerVersion = "4.9.3-prerelease2"
+let viewerVersion = "4.9.4-prerelease3"
let catchDomainErrors = false
open System.IO
diff --git a/src/PRo3D.Viewer/Properties/PublishProfiles/FolderProfile.pubxml b/src/PRo3D.Viewer/Properties/PublishProfiles/FolderProfile.pubxml
index 702e9617..72edfcd3 100644
--- a/src/PRo3D.Viewer/Properties/PublishProfiles/FolderProfile.pubxml
+++ b/src/PRo3D.Viewer/Properties/PublishProfiles/FolderProfile.pubxml
@@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
Any CPU
bin\publish\
FileSystem
- netcoreapp3.1
+ net6-ß
win-x64
true
False
diff --git a/src/PRo3D.sln b/src/PRo3D.sln
index ee85c162..0fd5b72f 100644
--- a/src/PRo3D.sln
+++ b/src/PRo3D.sln
@@ -27,6 +27,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\paket.dependencies = ..\paket.dependencies
EndProjectSection
EndProject
+Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Tests", "Tests\Tests.fsproj", "{D71C7F9E-2847-4218-9FE9-31777CD0B470}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -73,6 +75,10 @@ Global
{BD673740-89FF-4A91-AB9D-1774CC2E154F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD673740-89FF-4A91-AB9D-1774CC2E154F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD673740-89FF-4A91-AB9D-1774CC2E154F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D71C7F9E-2847-4218-9FE9-31777CD0B470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D71C7F9E-2847-4218-9FE9-31777CD0B470}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D71C7F9E-2847-4218-9FE9-31777CD0B470}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D71C7F9E-2847-4218-9FE9-31777CD0B470}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/Tests/BaseTests.fs b/src/Tests/BaseTests.fs
new file mode 100644
index 00000000..a145e43e
--- /dev/null
+++ b/src/Tests/BaseTests.fs
@@ -0,0 +1,25 @@
+namespace Tests
+
+open Aardvark.Base
+
+open FsUnit
+open NUnit.Framework
+open Microsoft.FSharp.NativeInterop
+
+module Base =
+
+ open PRo3D.Base
+
+ []
+ let ``[PRo3D.Core.Surface.Files win]``() =
+
+ let r = PRo3D.Core.Surface.Files.relativePath @"C:\user\ZCAM-0555-ZCAM08575-L-RAD-ALL-34-OPC-MULTI-SPHR-20220922\ZCAM-0555-ZCAM08575-L-RAD-ALL-34-OPC-MULTI-SPHR-20220922_000_000\patches\05-Patch-00001~0065\00-Patch-00020~0021-0.aakd" 4
+
+ r.Value |> should equal "ZCAM-0555-ZCAM08575-L-RAD-ALL-34-OPC-MULTI-SPHR-20220922_000_000\patches\05-Patch-00001~0065\00-Patch-00020~0021-0.aakd"
+
+ []
+ let ``[PRo3D.Core.Surface.Files osx]``() =
+
+ let r = PRo3D.Core.Surface.Files.relativePath @"/home/Desktop/ZCAM-0555-ZCAM08575-L-RAD-ALL-34-OPC-MULTI-SPHR-20220922/ZCAM-0555-ZCAM08575-L-RAD-ALL-34-OPC-MULTI-SPHR-20220922_000_000/patches/05-Patch-00001~0065/00-Patch-00020~0021-0.aakd" 4
+
+ r.Value |> should equal "ZCAM-0555-ZCAM08575-L-RAD-ALL-34-OPC-MULTI-SPHR-20220922_000_000\patches\05-Patch-00001~0065\00-Patch-00020~0021-0.aakd"
\ No newline at end of file
diff --git a/src/Tests/Tests.fsproj b/src/Tests/Tests.fsproj
new file mode 100644
index 00000000..83d98dd3
--- /dev/null
+++ b/src/Tests/Tests.fsproj
@@ -0,0 +1,24 @@
+
+
+
+ net6.0
+ true
+
+
+ ..\..\bin\Debug\
+ 0686
+
+
+ ..\..\bin\Release\
+ 0686
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Tests/paket.references b/src/Tests/paket.references
new file mode 100644
index 00000000..3de16c61
--- /dev/null
+++ b/src/Tests/paket.references
@@ -0,0 +1,12 @@
+group Test
+
+FsCheck
+FsCheck.NUnit
+Expecto
+Expecto.FsCheck
+FSharp.Core
+FsUnit
+NUnit
+NUnit3TestAdapter
+Microsoft.NET.Test.Sdk
+YoloDev.Expecto.TestSdk
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
deleted file mode 100644
index fb57ccd1..00000000
--- a/yarn.lock
+++ /dev/null
@@ -1,4 +0,0 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
-# yarn lockfile v1
-
-