Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AmigoCap/ReViVD
Browse files Browse the repository at this point in the history
  • Loading branch information
yohhaan committed Jul 23, 2019
2 parents 6dc905e + 6d6a02b commit 41d5ee7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 52 deletions.
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![picture](docs/assets/img/teaser_website.png)

## Objective
The main objective is to develop new 3D data visualization and exploration tools in Virtual Reality. We intend, through the ReViVD project, to showcase methods of interacting with data in VR which are simply not possible in other desktop configurations.
ReViVD's main objective is to develop new 3D data visualization and exploration tools in Virtual Reality. We intend to showcase methods of interacting with data in VR which are simply not possible in other desktop configurations.

## Bibliography
References of the project can be found on our [website](https://amigocap.github.io/ReViVD/bibliography/).
Expand Down Expand Up @@ -218,24 +218,3 @@ This json file describes your binary file to let ReViVD know how to read your da
]
}
```


## Roadmap
- [x] Research on the state of the art of VR technologies
- [x] Bibliography
- [x] Headset test and configuration of programming environment
- [x] First demo with basic examples
- [x] Visualization demo
- [x] Creation of our own LineRenderer and RubanMaker
- [x] Aircraft Visualization
- [x] New code architecture
- Optimization of data visualization
- [x] Creation of districts
- [x] Custom shader
- Interaction with data
- [x] Handling controllers
- [x] Filter data
- [x] Moving camera
- [x] Standardized, combinable 3D selectors
- [x] More functionality for selectors: erasers, negative space
- [x] In-program selector creator
59 changes: 29 additions & 30 deletions ReViVD/Assets/ControlPanel/ControlPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ public JsonData LoadJson() {
StreamReader r = new StreamReader(selectFile.field.text);
string json = r.ReadToEnd();
data = JsonConvert.DeserializeObject<JsonData>(json);
if (!CleanupData(data)) {
throw new System.Exception("Data cleanup failed");
if (!CheckJsonData(data)) {
throw new System.Exception("Data checking failed");
}
}
catch (System.Exception e) {
Expand Down Expand Up @@ -272,30 +272,24 @@ public void UnloadJson() {
export.interactable = false;
}

bool CleanupData(JsonData data) { //Fixes potential errors in the .json (ensures end > start, n_ values positive, etc.)
bool CheckJsonData(JsonData data) { //Fixes potential errors in the .json (ensures end > start, n_ values positive, etc.)

if (data.severalFiles_splitInstants) {
string filename = Tools.GetFullPath(data.filename + data.severalFiles_firstFileSuffix);
if (!File.Exists(filename)) {
Debug.LogError("First data file not found at " + filename);
return false;
}

if (data.pathAttributeUsedAs_n_atoms != "")
Debug.LogWarning("Uncommon non-empty n_atom path attribute for a split-file dataset, is this intentional?");
MakeWarningWindow("Uncommon non-empty n_atom path attribute for a split-file dataset, is this intentional?");
}
else {
string filename = Tools.GetFullPath(data.filename);
if (!File.Exists(filename)) {
Debug.LogError("Data file not found at " + filename);
MakeErrorWindow("Data file not found at " + filename);
return false;
}
}


void CheckValue<T>(ref T value, bool condition, T defaultvalue, string log) {
if (condition) {
Debug.LogWarning(log + "Replacing with " + defaultvalue.ToString());
MakeWarningWindow(log + "\nReplacing with " + defaultvalue.ToString());
value = defaultvalue;
}
}
Expand All @@ -305,7 +299,7 @@ void CheckValues_swap<T>(ref T lowValue, ref T highValue, string log) where T :
T temp = lowValue;
lowValue = highValue;
highValue = temp;
Debug.LogWarning("Swapping values");
MakeWarningWindow(log + "\nSwapping the two values.");
}
}

Expand All @@ -316,15 +310,16 @@ void CheckValues_swap<T>(ref T lowValue, ref T highValue, string log) where T :
if (data.lowerTruncature.x > data.upperTruncature.x ||
data.lowerTruncature.y > data.upperTruncature.y ||
data.lowerTruncature.z > data.upperTruncature.z) {
Debug.LogError("lowerTruncature is not strictly inferior to upperTruncature, resetting to default values");
MakeWarningWindow("lowerTruncature is not strictly inferior to upperTruncature, resetting to default values");
data.lowerTruncature = new ControlPanel.JsonData.Vector3D { x = -1000, y = -1000, z = -1000 };
data.upperTruncature = new ControlPanel.JsonData.Vector3D { x = 1000, y = 1000, z = 1000 };
}

if (data.dataset_n_paths <= 0) {
Debug.LogError("Negative number of paths");
MakeErrorWindow("Negative number of paths");
return false;
}
else if (!data.allPaths) {
if (!data.allPaths) {
CheckValue(ref data.chosen_paths_start, data.chosen_paths_start < 0, 0, "Negative value for chosen_paths_start");
CheckValue(ref data.chosen_paths_start, data.chosen_paths_start > data.dataset_n_paths, 0, "Chosen_paths_start value bigger than number of paths");

Expand All @@ -338,9 +333,8 @@ void CheckValues_swap<T>(ref T lowValue, ref T highValue, string log) where T :
if (data.randomPaths) {
CheckValue(ref data.chosen_n_paths, data.chosen_n_paths <= 0, 500, "Negative value for chosen_n_paths");
CheckValue(ref data.chosen_n_paths, data.chosen_n_paths > data.dataset_n_paths, 500, "Chosen_n_paths value bigger than number of paths");
if (data.chosen_n_paths > data.chosen_paths_end - data.chosen_paths_start) {
Debug.LogError("Asking for more random paths than the range allows");
Debug.LogWarning("Falling back to non-random paths in specified range");
if (data.chosen_n_paths >= data.chosen_paths_end - data.chosen_paths_start) {
MakeWarningWindow("Asking for more random paths than the range allows; Falling back to non-random paths in specified range");
data.randomPaths = false;
data.chosen_n_paths = data.chosen_paths_end - data.chosen_paths_start;
data.chosen_paths_step = 1;
Expand All @@ -351,9 +345,10 @@ void CheckValues_swap<T>(ref T lowValue, ref T highValue, string log) where T :
//constant_n_instants

if (data.dataset_n_instants <= 0) {
Debug.LogError("Negative number of instants");
MakeErrorWindow("Negative number of instants");
return false;
}
else if (!data.allInstants) {
if (!data.allInstants) {
CheckValue(ref data.chosen_instants_start, data.chosen_instants_start < 0, 0, "Negative value for chosen_instants_start");
CheckValue(ref data.chosen_instants_start, data.chosen_instants_start > data.dataset_n_instants, 0, "Chosen_instants_start value bigger than number of instants");

Expand Down Expand Up @@ -390,16 +385,16 @@ bool CheckIfPathAttributeExists(string attribute, ControlPanel.JsonData.PathAttr
}

if (data.pathAttributeUsedAs_id != "" && !CheckIfPathAttributeExists(data.pathAttributeUsedAs_id, data.pathAttributes)) {
Debug.LogError("The path attribute to use as id doesn't exist");
MakeWarningWindow("The path attribute to use as id doesn't exist");
}
if (data.pathAttributeUsedAs_n_atoms != "" && !CheckIfPathAttributeExists(data.pathAttributeUsedAs_n_atoms, data.pathAttributes)) {
Debug.LogError("The path attribute to use as n_atoms doesn't exist");
MakeWarningWindow("The path attribute to use as n_atoms doesn't exist");
}

if (data.pathAttributes.Length > 0
+ (data.pathAttributeUsedAs_id == "" ? 0 : 1)
+ (data.pathAttributeUsedAs_n_atoms == "" ? 0 : 1)) {
Debug.LogWarning("Uncommon: some path attributes are unused, is this intentional?");
MakeWarningWindow("Uncommon: some path attributes are unused, is this intentional?");
}

//atomAttributes
Expand All @@ -412,24 +407,24 @@ bool CheckIfAtomAttributeExists(string attribute, ControlPanel.JsonData.AtomAttr
}

if (data.atomAttributeUsedAs_x == "" && data.atomAttributeUsedAs_y == "" && data.atomAttributeUsedAs_z == "") {
Debug.Log("No attributes used for any of the 3 dimensions");
MakeErrorWindow("No attributes used for any of the 3 dimensions");
return false;
}

if (data.atomAttributeUsedAs_x != "" && !CheckIfAtomAttributeExists(data.atomAttributeUsedAs_x, data.atomAttributes)) {
Debug.LogError("The atom attribute to use as x doesn't exist");
MakeWarningWindow("The atom attribute to use as x doesn't exist");
}
if (data.atomAttributeUsedAs_y != "" && !CheckIfAtomAttributeExists(data.atomAttributeUsedAs_y, data.atomAttributes)) {
Debug.LogError("The atom attribute to use as y doesn't exist");
MakeWarningWindow("The atom attribute to use as y doesn't exist");
}
if (data.atomAttributeUsedAs_z != "" && !CheckIfAtomAttributeExists(data.atomAttributeUsedAs_z, data.atomAttributes)) {
Debug.LogError("The atom attribute to use as z doesn't exist");
MakeWarningWindow("The atom attribute to use as z doesn't exist");
}
if (data.atomAttributeUsedAs_t != "" && !CheckIfAtomAttributeExists(data.atomAttributeUsedAs_t, data.atomAttributes)) {
Debug.LogError("The atom attribute to use as t doesn't exist");
MakeWarningWindow("The atom attribute to use as t doesn't exist");
}
if (data.atomAttributeUsedAs_color != "" && !CheckIfAtomAttributeExists(data.atomAttributeUsedAs_color, data.atomAttributes)) {
Debug.LogError("The atom attribute to use as color doesn't exist");
MakeWarningWindow("The atom attribute to use as color doesn't exist");
}

for (int i = 0; i < data.atomAttributes.Length; i++) {
Expand Down Expand Up @@ -565,6 +560,10 @@ public void MakeMessageWindow(string title, string message) {
window.GetComponent<MessageWindow>().title.text = title;
}

public void MakeWarningWindow(string message) {
MakeMessageWindow("Warning", message);
}

public void MakeErrorWindow(string message) {
MakeMessageWindow("An error occured", message);
}
Expand Down

0 comments on commit 41d5ee7

Please sign in to comment.