2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 28d70365 authored by Maxim Dudin's avatar Maxim Dudin
Browse files

#306 added a gui interface to choose if and how the contacts to be shown

parent 542a6f08
Pipeline #255010 failed with stages
in 3 minutes and 26 seconds
......@@ -17,7 +17,7 @@
"processors" : [ 4 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestriansNearbyIdOutputFile",
"filename" : "contacts.traj",
"filename" : "contacts.txt",
"processors" : [ 5 ]
} ],
"processors" : [ {
......@@ -44,9 +44,7 @@
"maxDistanceForANearbyPedestrian" : 1.5,
"sampleEveryNthStep" : 1,
"allowedAbsenceTimestepsIfContactReturns" : 0,
"minTimespanOfContactTimesteps" : 1,
"printContactTrajectories" : false,
"printForPostVis" : true
"minTimespanOfContactTimesteps" : 1
}
} ],
"isTimestamped" : true,
......
......@@ -31,6 +31,7 @@ public class DefaultSimulationConfig extends DefaultConfig {
private boolean showMeasurementArea = true;
private boolean showStairs = true;
private boolean showPedestrians = true;
private int showContacts = 0;
Please register or sign in to reply
private boolean showWalkdirection = false;
private boolean showTargetPotentialField = false;
private boolean showTargetPotentielFieldMesh = false;
......@@ -71,6 +72,7 @@ public class DefaultSimulationConfig extends DefaultConfig {
this.showWalkdirection = config.showWalkdirection;
this.showGrid = config.showGrid;
this.showPedestrians = config.showPedestrians;
this.showContacts = config.showContacts;
this.showLogo = config.showLogo;
this.showStairs = config.showStairs;
this.showGroups = config.showGroups;
......@@ -101,6 +103,14 @@ public class DefaultSimulationConfig extends DefaultConfig {
return showPedestrians;
}
public int getShowContacts() {
return showContacts;
}
public boolean isShowContacts() {
return showContacts == 0;
}
public boolean isShowWalkdirection() {
return showWalkdirection;
}
......@@ -119,6 +129,11 @@ public class DefaultSimulationConfig extends DefaultConfig {
setChanged();
}
public void setShowContacts(int showContacts) {
this.showContacts = showContacts;
setChanged();
}
public boolean isShowTargets() {
return showTargets;
}
......
......@@ -56,10 +56,10 @@ public class PostvisualizationRenderer extends SimulationRenderer {
private void renderPedestrians(final Graphics2D g, final Color color) {
if (!model.isEmpty()) {
renderTrajectories(g);
if (SHOW_CONTACTS && model.getContactData() != null) {
  • I think we will mostly use the CONTACT_LINES option (direct connection between two agents). Keep the trajectory option? I am not sure. Let's discuss that.

Please register or sign in to reply
if (CONTACT_LINES_INTEAD_OF_TRAJECTORIES) {
if (model.config.getShowContacts() != 0 && model.getContactData() != null) {
if (model.config.getShowContacts() == 1) {
renderConnectingLinesByContact(g);
} else {
} else if (model.config.getShowContacts() == 2) {
renderContactTrajectories(g);
}
}
......
......@@ -182,6 +182,17 @@ public class PostvisualizationWindow extends JPanel implements Observer, DropTar
}, "ProjectView.btnShowPedestrian.tooltip");
addActionToToolbar(toolbar,
new ActionVisualization("show_contacts", resources.getIcon("contacts.png", iconWidth, iconHeight),
model) {
@Override
public void actionPerformed(ActionEvent e) {
model.config.setShowContacts((model.config.getShowContacts() +1)%3);
model.notifyObservers();
}
}, "ProjectView.btnShowContacts.tooltip");
addActionToToolbar(toolbar,
new ActionVisualization("show_trajectory",
resources.getIcon("trajectories.png", iconWidth, iconHeight), model) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment