Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Connection Lines #55

Open
wants to merge 94 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
55af0b0
DrawLine UI implemented
JulianStaab Jan 2, 2020
9cc5784
Added comments to LineDrawLogic
JulianStaab Jan 2, 2020
e9138af
DrawMode Logic implemented
JulianStaab Jan 3, 2020
a9799d4
Update Position implemented
JulianStaab Jan 3, 2020
6c8aea4
Delete All Lines implemented
JulianStaab Jan 3, 2020
db622ff
Most Unit Tests completed
JulianStaab Jan 8, 2020
b306a3c
All Unit Tests complete
JulianStaab Jan 8, 2020
d92a423
Small Error Fix
JulianStaab Jan 10, 2020
6f6a5f2
add delete specific lines and save/load
Mareska Jan 10, 2020
6e17ede
Merge branch 'verbindungslinien_bewegungslogik' of https://github.com…
JulianStaab Jan 10, 2020
f375fbe
Correction & Fixes
JulianStaab Jan 10, 2020
831bd36
Enhanced the testscene
JulianStaab Jan 11, 2020
2e76b83
Multiple Issues Higlighted Fixed
JulianStaab Jan 14, 2020
1c5d16a
DrawMode Activated by Multiple Buttons Fixed
JulianStaab Jan 14, 2020
264ccdf
Connection Lines Menu
JulianStaab Jan 14, 2020
7386abf
Sharing to be tested
JulianStaab Jan 19, 2020
57981f5
Color and Width Customization
JulianStaab Jan 19, 2020
d2297d3
LineDelete Bug Fixed
JulianStaab Jan 26, 2020
d72a51a
Added ConnectionLines_README.md
EmilieHK Jan 26, 2020
ebfacda
Creating ConnectionLine Window
EmilieHK Mar 18, 2020
524d03f
Integrated Drawing Logic
EmilieHK Mar 18, 2020
de6815b
Error correction
EmilieHK Mar 18, 2020
04be623
Window Colliders Added
EmilieHK Mar 20, 2020
3d23b02
Added Bounding Boxes
Mar 20, 2020
e5cbeae
ConnectionLine Menu opens
Mar 20, 2020
9a7d335
ConnectionLines react when chlicked
EmilieHK Mar 20, 2020
7411596
Reference change
EmilieHK Mar 25, 2020
5e7ba35
Removed Bounding Box
Mar 25, 2020
baf22fe
Adjusted Selector Scripts
EmilieHK Mar 25, 2020
c2205b9
Referencing ConnectionLinesMenu Script
EmilieHK Mar 25, 2020
f0b4bad
ConnectionLinesMenu tested
Mar 25, 2020
41150f0
Begun implementing "DraggableMenu"
EmilieHK Mar 25, 2020
17bc315
Added Top Bars
EmilieHK Mar 25, 2020
83b1293
Added Highlights to TopBar
EmilieHK Mar 25, 2020
b176bbd
Adjusted TopBar Highlights
EmilieHK Mar 27, 2020
d09ae85
Added Bounding Box
EmilieHK Mar 27, 2020
d177bc0
Added Adjust Buttons
EmilieHK Mar 27, 2020
18b8adb
Adjust Button Layout changed
EmilieHK Apr 1, 2020
322a636
Added ConnectionLinesSerializer and set up serialization for LineRend…
JulianStaab Apr 1, 2020
9bbd092
Adjust Button changed to used Button style
EmilieHK Apr 3, 2020
3687e28
Added AdjustBar prefab
EmilieHK Apr 3, 2020
331d43e
Adjusted Box Colliders of each Window
EmilieHK Apr 3, 2020
246663d
Adjust Button changes Caption
EmilieHK Apr 3, 2020
76a567a
Save/Load implemented and tested
JulianStaab Apr 5, 2020
2aafe48
Getters and Setters instead of public variables reworked
JulianStaab Apr 7, 2020
dbf8787
Fixed variable declaration
EmilieHK Apr 11, 2020
1c8260b
Added Color Chooser to CL Menu
EmilieHK Apr 13, 2020
dca8396
Adjusted Position of Color Chooser
Apr 13, 2020
3fa85dd
Added the ColorChosen Event
EmilieHK Apr 13, 2020
c58672c
Adjusted Visibility of ColorChooser
EmilieHK Apr 13, 2020
63e90aa
Completed ColorChosen Event
EmilieHK Apr 13, 2020
b57a005
CleanUp and integrating LineWidth
EmilieHK Apr 13, 2020
83b313d
Completed Changes in the CL menu Script
EmilieHK Apr 13, 2020
c11e3e6
Color and Width Selection Tested
Apr 13, 2020
d3afa04
CleanUp of the CLMenu Script and minor changes to the CLMenu prefab
EmilieHK Apr 13, 2020
3bd43cd
Update LineDrawLogicTester.cs
EmilieHK Apr 13, 2020
a561b34
Minor Size Adjustment of CLMenu
Apr 13, 2020
843016a
Voice Command of Adjust Button changed
Apr 16, 2020
f0697e3
Added Color and Width of Connection Lines to Save/Load System
JulianStaab Apr 16, 2020
92b0bab
Merge branch 'connectionlines_WindowAdjustment' of https://github.com…
JulianStaab Apr 16, 2020
7c82373
Added a Test Window
EmilieHK Apr 16, 2020
305f6ce
Deleted TestMenu
EmilieHK Apr 16, 2020
6d499c1
Reduced number of GetComponent-Calls in CLMenu
EmilieHK Apr 16, 2020
348d177
Added Another TestWindow
EmilieHK Apr 17, 2020
f890ec3
Changed Orientation of AppBar to fix Bug
JulianStaab Apr 17, 2020
e90c0ac
Merge branch 'connectionlines_WindowAdjustment' of https://github.com…
JulianStaab Apr 17, 2020
42f2536
Fixed Bug #39 by changing the AppBar orientation to faceNormal
JulianStaab Apr 20, 2020
68b2567
BoundingBox separated to child
JulianStaab Apr 21, 2020
dee4e40
Added functioning Bounding Box to all Windows
EmilieHK Apr 21, 2020
fccd59e
Adjusted Size of Bounding Box
Apr 21, 2020
8b9abc9
Changed CL Window Structure
EmilieHK Apr 21, 2020
6948a4c
Tested Window Adjustment
Apr 21, 2020
475ab0f
Deleted seperate ReadMe
EmilieHK Apr 21, 2020
b9a0945
Minor Position Change of Line Draw Button
EmilieHK Apr 21, 2020
934d9b5
Testing Bounding Box Visibility Settings
EmilieHK Apr 27, 2020
cba8c4a
Testing the Visibility of the Bounding Box
EmilieHK Apr 27, 2020
e5b9e24
Testing Bounding Box further
EmilieHK Apr 27, 2020
ad02df0
Further testing
EmilieHK Apr 27, 2020
8af3ccf
Activating Bounding Box test
EmilieHK Apr 27, 2020
c74d9df
Reversed Changes
EmilieHK Apr 27, 2020
486ff95
Finalized Bounding Box
EmilieHK Apr 27, 2020
5f32882
Adjusted Size and Dimension of BoundingBox
EmilieHK May 6, 2020
344fa0b
Minor Size Adjustment in the Save Window
EmilieHK May 6, 2020
8988e29
Removed async from Deserialize method in ConnectionLineSerializer
JulianStaab May 14, 2020
aa487e1
Replaced https with http in build.xml in the backend
JulianStaab May 15, 2020
c8de8e4
Updated Test Scene and Colliders
JulianStaab May 15, 2020
2a6ff59
Changed folder name of ConnectionLine Test folder
JulianStaab May 15, 2020
d6095e6
Bug fixed: DrawLine Button raised
JulianStaab Jun 24, 2020
62c1647
Bug fixed: Lines with same end points
JulianStaab Jun 24, 2020
f5f589c
Bug fixed: Disable mode if window closed
JulianStaab Jun 24, 2020
da460a0
Changed Selection to IssueSelector.Selected + Bug fixed: Line could b…
JulianStaab Jun 24, 2020
191cbaf
Fixed the previous bug also for visualizations
JulianStaab Jun 24, 2020
bc5a0cb
Updated the connectionlines branch to MRTK v2.4.0 and fixed many issu…
JulianStaab Dec 14, 2020
eb889c2
Smaller error fixes
Dec 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Integrated Drawing Logic
The Menu functionality has been moved to the new window and the old menu has been deleted. This is not tested yet, color option is removed for now.
  • Loading branch information
EmilieHK committed Mar 18, 2020
commit 524d03ff06a0d7d94474fe4efebe8b417457fed7
1,642 changes: 189 additions & 1,453 deletions Frontend/VIAProMa/Assets/Prefabs/UI/Main Menu.prefab

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ GameObject:
m_Component:
- component: {fileID: 2805648536711648858}
- component: {fileID: 1813544345711381865}
- component: {fileID: 6302961834770258920}
- component: {fileID: 3521828503366769760}
m_Layer: 0
m_Name: ConnectionLinesMenu
m_TagString: Untagged
Expand Down Expand Up @@ -338,7 +338,7 @@ MonoBehaviour:
saveNameInputField: {fileID: 0}
doneButton: {fileID: 3221800555424403491}
confirmMessage: {fileID: 0}
--- !u!114 &6302961834770258920
--- !u!114 &3521828503366769760
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
Expand All @@ -347,7 +347,7 @@ MonoBehaviour:
m_GameObject: {fileID: 2805648536711648859}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07e992baed9f34635b8de3dcfc33d848, type: 3}
m_Script: {fileID: 11500000, guid: 26c0dc655d30a42268678a822bf61f48, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2805648536714552289
Expand Down
232 changes: 232 additions & 0 deletions Frontend/VIAProMa/Assets/Scripts/UI/ConnectionLinesMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
using i5.ViaProMa.UI;
using Microsoft.MixedReality.Toolkit.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ConnectionLinesWindow : MonoBehaviour, IWindow
{
/// <summary>
/// Referencing the caption of the line draw button
/// </summary>
public GameObject caption;

/// <summary>
/// Referencing the caption of the delete button
/// </summary>
public GameObject deleteCaption;

/// <summary>
/// Referencing the LineDraw Button
/// </summary>
public GameObject lineDrawButton;

/// <summary>
/// Referencing the DeleteAllLines Button
/// </summary>
public GameObject deleteAllLinesButton;

///<summary>
///Referencing the DeleteSpecifixLines Button
/// </summary>
public GameObject deleteSpecificLinesButton;

/// <summary>
/// The LineRenderer Prefab to be instantiated
/// </summary>
public GameObject lineRendererPrefab;

/// <summary>
/// True, if the LineDraw Mode is active
/// </summary>
[HideInInspector] public bool isLineModeActivated;

/// <summary>
/// True, if the LineDelete Mode is active
/// </summary>
[HideInInspector] public bool isDeleteLineModeActivated;

/// <summary>
/// True, if the one start object has been selected
/// </summary>
[HideInInspector] public bool oneSelected;

/// <summary>
/// The start object of the line
/// </summary>
[HideInInspector] public GameObject start;

/// <summary>
/// The destination object of the line
/// </summary>
[HideInInspector] public GameObject destination;


public bool WindowEnabled { get; set; }

public bool WindowOpen
{
get => gameObject.activeSelf;
}

public event EventHandler WindowClosed;


public void Close()
{
gameObject.SetActive(false);
WindowClosed?.Invoke(this, EventArgs.Empty);
}

public void Open()
{
gameObject.SetActive(true);
}

public void Open(Vector3 position, Vector3 eulerAngles)
{
Open();
transform.localPosition = position;
transform.localEulerAngles = eulerAngles;
}

/// <summary>
/// Start with the buttons invisible and the LineDraw Mode is deactivated.
/// </summary>
void Start()
{
isLineModeActivated = false;
isDeleteLineModeActivated = false;
}

/// <summary>
/// Is called when the LineDraw Button is clicked. Enables/Disables the LineDrawingMode and switches the displayed text accordingly.
/// When the Draw Line button is clicked, an empty gameobject containing the LineRenderer component is instantiated and start and
/// destination position of the line set.
/// </summary>
public void SwitchLineDrawMode()
{

if (isDeleteLineModeActivated)
{
return;
}
if (isLineModeActivated)
{
caption.GetComponent<TextMeshPro>().SetText("Enter Line Draw");
deleteSpecificLinesButton.GetComponent<Interactable>().Enabled = true;
if (start == null || destination == null)
{
isLineModeActivated = !isLineModeActivated;
return;
}
if (start.GetComponent<IssueSelector>() != null)
{
start.GetComponent<IssueSelector>().backgroundRenderer.material.color = start.GetComponent<IssueSelector>().originalRendererColor;
}
if (destination.GetComponent<IssueSelector>() != null)
{
destination.GetComponent<IssueSelector>().backgroundRenderer.material.color = destination.GetComponent<IssueSelector>().originalRendererColor;
}
if (start.GetComponent<VisualizationSelector>() != null)
{
start.transform.Find("HighlightingCube").gameObject.SetActive(false);
}
if (destination.GetComponent<VisualizationSelector>() != null)
{
destination.transform.Find("HighlightingCube").gameObject.SetActive(false);
}
if (start != null && destination != null)
{
GameObject lineRenderer = Instantiate(lineRendererPrefab, new Vector3(0, 0, 0), Quaternion.identity);
lineRenderer.GetComponent<LineRenderer>().SetPosition(0, start.transform.position);
lineRenderer.GetComponent<LineRenderer>().SetPosition(1, destination.transform.position);
lineRenderer.GetComponent<UpdatePosition>().startObject = start;
lineRenderer.GetComponent<UpdatePosition>().destinationObject = destination;
}
start = null;
destination = null;
}
else
{
caption.GetComponent<TextMeshPro>().SetText("Draw Line");
deleteSpecificLinesButton.GetComponent<Interactable>().Enabled = false;
}
isLineModeActivated = !isLineModeActivated;
Debug.Log("Mode switched!");
}

/// <summary>
/// Deletes all drawn lines in the scene. Is called when the "Delete All Lines" button is clicked.
/// </summary>
public void DeleteAllLines()
{
GameObject[] lines = GameObject.FindGameObjectsWithTag("Line");
foreach
(GameObject line in lines)
{
GameObject.Destroy(line);
Debug.Log("At least one line deleted");
}
Debug.Log("All Lines deleted");
}

public void DeleteSpecificLine()
{
if (isLineModeActivated)
{
return;
}
if (isDeleteLineModeActivated)
{
deleteCaption.GetComponent<TextMeshPro>().SetText("Enter Single Delete");
lineDrawButton.GetComponent<Interactable>().Enabled = true;
if (start == null || destination == null)
{
isDeleteLineModeActivated = !isDeleteLineModeActivated;
return;
}
if (start.GetComponent<IssueSelector>() != null)
{
start.GetComponent<IssueSelector>().backgroundRenderer.material.color = start.GetComponent<IssueSelector>().originalRendererColor;
}
if (destination.GetComponent<IssueSelector>() != null)
{
destination.GetComponent<IssueSelector>().backgroundRenderer.material.color = destination.GetComponent<IssueSelector>().originalRendererColor;
}
if (start.GetComponent<VisualizationSelector>() != null)
{
start.transform.Find("HighlightingCube").gameObject.SetActive(false);
}
if (destination.GetComponent<VisualizationSelector>() != null)
{
destination.transform.Find("HighlightingCube").gameObject.SetActive(false);
}
if (start != null && destination != null)
{
GameObject[] lines = GameObject.FindGameObjectsWithTag("Line");
foreach
(GameObject line in lines)
{
if ((line.GetComponent<LineRenderer>().GetPosition(0) == start.transform.position
&& line.GetComponent<LineRenderer>().GetPosition(1) == destination.transform.position) ||
(line.GetComponent<LineRenderer>().GetPosition(0) == start.transform.position
&& line.GetComponent<LineRenderer>().GetPosition(1) == destination.transform.position))
{
Destroy(line);
}
}
}
}
else
{
deleteCaption.GetComponent<TextMeshPro>().SetText("Delete Line");
lineDrawButton.GetComponent<Interactable>().Enabled = false;
}
isDeleteLineModeActivated = !isDeleteLineModeActivated;



}
}

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

37 changes: 0 additions & 37 deletions Frontend/VIAProMa/Assets/Scripts/UI/ConnectionLinesWindow.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Frontend/VIAProMa/Assets/Scripts/UI/ConnectionLinesWindow.cs.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,5 @@ private void SetVisualizationShelfInstance(int photonId)
PhotonView view = PhotonView.Find(photonId);
visualizationShelfInstance = view.gameObject;
Debug.Log("RPC: setting visualization shelf instance to " + issueShelfInstance.name + " (id " + photonId + ")");
}

public void ShowConnectionLinesMenu()
{
WindowManager.Instance.ConnectionLinesMenu.Open(connectionLinesButton.transform.position, connectionLinesButton.transform.eulerAngles);
}
}

This file was deleted.