Skip to content

Commit

Permalink
Feature/t3d pipeline package (#65)
Browse files Browse the repository at this point in the history
* Added folder structure and script to request CityJSON from a BAG ID

* Added events as described in the package guidelines, still kept option for direct interaction. Added sample scene

* Started adding CityJSON parser

* Finished basic parser and exporter. still need to add semantics in geometry

* Added Parsing semantics and exporting them again

* Added semantic null propagation

* Removed comments, checked if custom types are processed correctly

* Added comments for null propagation of Semantics Values

* Started adding CityJSON visualizer

* Added default material, fixed mesh direction, removed vertexOffset

* added serialized option to use json center as relative RD center

* removed prints

* Added vertex transform processing

* Removed Write Text File script

* cleanup

* Removed duplicate vertices from the export

* Fixed vertex indexing, added geographical extents to metadata node

* Started adding annotation functionality

* Annotations can be typed and are added to the CityJSON Export

* added option for local/global id

* Added annotation markers and tooltips

* Added upload scripts and assets

* Cleanup

* Fixed hierarchy to allow for uploading exports. Authentication token not included

* Started adding comments

* Added missing comments, minor fixes

* Fixed sample scenes

* Separated Poly2Mesh into a separate dependency in ThirdPartyTools. T3DPipeline and SelectionTools now depend on this. Used version from SelectionTools because this version had some additions.

* - A CityJSON with an empty vertex list will now no longer throw an error. it will give a warning that any visualisation will create empty meshes.
- Removed deleted script from Scene
- added todo for MultiPoint and MultiLineString mesh creation

* moved T3D samples into samples~

* added samples path to package.json

* Fixed missing reference

Co-authored-by: Sam Baas <[email protected]>
  • Loading branch information
TomSimons and sambaas authored Nov 2, 2022
1 parent fd307a4 commit 37ad87a
Show file tree
Hide file tree
Showing 205 changed files with 12,825 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ X Economic Services Departments
/// </summary>
namespace Netherlands3D.Core
{
/// <summary>
/// Supported coordinate systems
/// </summary>
public enum CoordinateSystem
{
Unity,
WGS84,
RD
}

/// <summary>
/// Vector2 width Double values to represent RD-coordinates (X,Y)
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Netherlands3D.Events;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

namespace Netherlands3D.Core
{
public class Vector3EventListener : MonoBehaviour
{
[SerializeField]
private Vector3Event onEvent;

[SerializeField]
private Vector3ValueUnityEvent trigger;

void Awake()
{
if (onEvent)
{
onEvent.started.AddListener(Invoke);
}
}

public void Invoke(Vector3 value)
{
trigger.Invoke(value);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"references": [
"GUID:9ca88277166fea644a31588b4f943acc",
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:6055be8ebefd69e48b49212b09b47b2f"
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:ac7554b4e1ace4702b59a76ef8c76499"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
8 changes: 8 additions & 0 deletions Packages/Netherlands3D/T3DPipeline.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packages/Netherlands3D/T3DPipeline/Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packages/Netherlands3D/T3DPipeline/Runtime/Events.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 82f328a3b0832b641bb6be0a57ec68a9, type: 3}
m_Name: CityJSONParsed
m_EditorClassIdentifier:
eventName:
description:
started:
m_PersistentCalls:
m_Calls: []
received:
m_PersistentCalls:
m_Calls: []
cancelled:
m_PersistentCalls:
m_Calls: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 82f328a3b0832b641bb6be0a57ec68a9, type: 3}
m_Name: CityJSONVisualized
m_EditorClassIdentifier:
eventName:
description:
started:
m_PersistentCalls:
m_Calls: []
received:
m_PersistentCalls:
m_Calls: []
cancelled:
m_PersistentCalls:
m_Calls: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a6319a1c876ebd247a42bdca122ae5c3, type: 3}
m_Name: JSONBagReceived
m_EditorClassIdentifier:
eventName:
description:
started:
m_PersistentCalls:
m_Calls: []
received:
m_PersistentCalls:
m_Calls: []
cancelled:
m_PersistentCalls:
m_Calls: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packages/Netherlands3D/T3DPipeline/Runtime/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using SimpleJSON;

namespace Netherlands3D.T3DPipeline
{
/// <summary>
/// Class to hold an annotation that can be added to a building.
/// </summary>
public class Annotation
{
public int Id; // An annotation has to have an id that is unique per CityObject. It may be unique globally for all CityObjects but this is not required.
public string Text { get; set; } // The text of the annotation
public Vector3Double Position { get; private set; } //the position of the Annotation on the building

public Annotation(int id, string text, Vector3Double position)
{
Id = id;
Text = text;
Position = position;
}

public JSONNode GetJSONNode()
{
var annotation = new JSONObject();
var point = new JSONArray();
point.Add("x", Position.x);
point.Add("y", Position.y);
point.Add("z", Position.z);
annotation.Add("position", point);
annotation.Add("text", Text);
return annotation;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 37ad87a

Please sign in to comment.