Skip to content

Commit

Permalink
added visualization option for hiding junction shapes refs #36
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@15749 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
namdre committed Feb 26, 2014
1 parent 87b2cdf commit c366794
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sumo/src/guisim/GUIJunctionWrapper.cpp
Expand Up @@ -117,7 +117,7 @@ GUIJunctionWrapper::drawGL(const GUIVisualizationSettings& s) const {
if (s.scale * myMaxSize < 1.) {
return;
}
if (!myIsInner) {
if (!myIsInner && s.drawJunctionShape) {
glPushName(getGlID());
glPushMatrix();
const SUMOReal colorValue = static_cast<SUMOReal>(s.junctionColorer.getActive() == 1 && gSelected.isSelected(getType(), getGlID()));
Expand Down
1 change: 1 addition & 0 deletions sumo/src/utils/gui/settings/GUISettingsHandler.cpp
Expand Up @@ -200,6 +200,7 @@ GUISettingsHandler::myStartElement(int element,
mySettings.junctionName = parseTextSettings("junctionName", attrs, mySettings.junctionName);
mySettings.internalJunctionName = parseTextSettings("internalJunctionName", attrs, mySettings.internalJunctionName);
mySettings.showLane2Lane = TplConvert::_2bool(attrs.getStringSecure("showLane2Lane", toString(mySettings.showLane2Lane)).c_str());
mySettings.drawJunctionShape = TplConvert::_2bool(attrs.getStringSecure("drawShape", toString(mySettings.drawJunctionShape)).c_str());
myCurrentColorer = element;
break;
case SUMO_TAG_VIEWSETTINGS_ADDITIONALS:
Expand Down
9 changes: 7 additions & 2 deletions sumo/src/utils/gui/settings/GUIVisualizationSettings.cpp
Expand Up @@ -66,7 +66,7 @@ GUIVisualizationSettings::GUIVisualizationSettings()
drawLinkTLIndex(false), drawLinkJunctionIndex(false),
junctionName(false, 50, RGBColor(0, 255, 128, 255)),
internalJunctionName(false, 50, RGBColor(0, 204, 128, 255)),
showLane2Lane(false), addMode(0), minAddSize(1), addExaggeration(1),
showLane2Lane(false), drawJunctionShape(true), addMode(0), minAddSize(1), addExaggeration(1),
addName(false, 50, RGBColor(255, 0, 128, 255)),
minPOISize(0), poiExaggeration(1), poiName(false, 50, RGBColor(255, 0, 128, 255)),
minPolySize(0), polyExaggeration(1), polyName(false, 50, RGBColor(255, 0, 128, 255)),
Expand Down Expand Up @@ -338,7 +338,8 @@ GUIVisualizationSettings::save(OutputDevice& dev) const {
<< "\" drawLinkJunctionIndex=\"" << drawLinkJunctionIndex << "\"\n"
<< " " << junctionName.print("junctionName") << "\n"
<< " " << internalJunctionName.print("internalJunctionName") << "\n"
<< " showLane2Lane=\"" << showLane2Lane << "\">\n";
<< " showLane2Lane=\"" << showLane2Lane << "\""
<< " drawShape=\"" << drawJunctionShape << "\">\n";
junctionColorer.save(dev);
dev << " </junctions>\n";

Expand Down Expand Up @@ -476,6 +477,10 @@ GUIVisualizationSettings::operator==(const GUIVisualizationSettings& v2) {
return false;
}

if (drawJunctionShape != v2.drawJunctionShape) {
return false;
}

if (addMode != v2.addMode) {
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions sumo/src/utils/gui/settings/GUIVisualizationSettings.h
Expand Up @@ -183,11 +183,11 @@ class GUIVisualizationSettings {
bool drawLinkJunctionIndex;
// Setting bundles for optional drawing junction names
GUIVisualizationTextSettings junctionName, internalJunctionName;
//@}


/// @brief Information whether lane-to-lane arrows shall be drawn
bool showLane2Lane;
/// @brief whether the shape of the junction should be drawn
bool drawJunctionShape;
//@}


/// @name Additional structures visualization settings
Expand Down
4 changes: 4 additions & 0 deletions sumo/src/utils/gui/windows/GUIDialog_ViewSettings.cpp
Expand Up @@ -414,6 +414,8 @@ GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent,
new FXLabel(m42, " ", 0, LAYOUT_CENTER_Y);
myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName);
myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction name", mySettings->internalJunctionName);
myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE);
myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
} {
new FXTabItem(tabbook, "Detectors/Trigger", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4);
FXVerticalFrame* frame5 =
Expand Down Expand Up @@ -656,6 +658,7 @@ GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* data) {
myPolyNamePanel->update(mySettings->polyName);

myShowLane2Lane->setCheck(mySettings->showLane2Lane);
myDrawJunctionShape->setCheck(mySettings->drawJunctionShape);
myAntialiase->setCheck(mySettings->antialiase);
myDither->setCheck(mySettings->dither);
myShowSizeLegend->setCheck(mySettings->showSizeLegend);
Expand Down Expand Up @@ -789,6 +792,7 @@ GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*v
tmpSettings.polyName = myPolyNamePanel->getSettings();

tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE);
tmpSettings.antialiase = (myAntialiase->getCheck() != FALSE);
tmpSettings.dither = (myDither->getCheck() != FALSE);
tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE);
Expand Down
1 change: 1 addition & 0 deletions sumo/src/utils/gui/windows/GUIDialog_ViewSettings.h
Expand Up @@ -269,6 +269,7 @@ class GUIDialog_ViewSettings : public FXDialogBox {
FXRealSpinDial* myPolyMinSizeDialer, *myPolyUpscaleDialer;

FXCheckButton* myShowLane2Lane;
FXCheckButton* myDrawJunctionShape;
FXCheckButton* myAntialiase;
FXCheckButton* myDither;
FXCheckButton* myShowSizeLegend;
Expand Down

0 comments on commit c366794

Please sign in to comment.