Skip to content

Commit

Permalink
Removed references to myNetworkElementShapeEdited. Refs #6945
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Jul 13, 2020
1 parent 645302d commit c10cdc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 46 deletions.
42 changes: 5 additions & 37 deletions src/netedit/elements/additional/GNEPoly.cpp
Expand Up @@ -40,7 +40,6 @@ GNEPoly::GNEPoly(GNENet* net, const std::string& id, const std::string& type, co
GNEShape(net, SUMO_TAG_POLY, movementBlocked,
{}, {}, {}, {}, {}, {}, {}, {}, // Parents
{}, {}, {}, {}, {}, {}, {}, {}), // Childrens
myNetworkElementShapeEdited(nullptr),
myBlockShape(shapeBlocked),
mySimplifiedShape(false) {
// check if imgFile is valid
Expand Down Expand Up @@ -238,11 +237,7 @@ GNEPoly::getGlID() const {

std::string
GNEPoly::getParentName() const {
if (myNetworkElementShapeEdited != nullptr) {
return myNetworkElementShapeEdited->getID();
} else {
return myNet->getMicrosimID();
}
return myNet->getMicrosimID();
}


Expand All @@ -260,13 +255,10 @@ GNEPoly::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) {
if (mySimplifiedShape || myShape.size() <= 2) {
simplifyShape->disable();
}
// create open or close polygon's shape only if myNetworkElementShapeEdited is nullptr
if (myNetworkElementShapeEdited == nullptr) {
if (myShape.isClosed()) {
new FXMenuCommand(ret, "Open shape\t\tOpen polygon's shape", nullptr, &parent, MID_GNE_POLYGON_OPEN);
} else {
new FXMenuCommand(ret, "Close shape\t\tClose polygon's shape", nullptr, &parent, MID_GNE_POLYGON_CLOSE);
}
if (myShape.isClosed()) {
new FXMenuCommand(ret, "Open shape\t\tOpen polygon's shape", nullptr, &parent, MID_GNE_POLYGON_OPEN);
} else {
new FXMenuCommand(ret, "Close shape\t\tClose polygon's shape", nullptr, &parent, MID_GNE_POLYGON_CLOSE);
}
// create a extra FXMenuCommand if mouse is over a vertex
int index = getVertexIndex(myNet->getViewNet()->getPositionInformation(), false);
Expand Down Expand Up @@ -452,22 +444,6 @@ GNEPoly::isPolygonClosed() const {
}


void
GNEPoly::setShapeEditedElement(GNENetworkElement* element) {
if (element) {
myNetworkElementShapeEdited = element;
} else {
throw InvalidArgument("Junction cannot be nullptr");
}
}


GNENetworkElement*
GNEPoly::getShapeEditedElement() const {
return myNetworkElementShapeEdited;
}


void
GNEPoly::openPolygon(bool allowUndo) {
// only open if shape is closed
Expand Down Expand Up @@ -770,10 +746,6 @@ GNEPoly::setAttribute(SumoXMLAttr key, const std::string& value) {
}
// disable simplified shape flag
mySimplifiedShape = false;
// update geometry of shape edited element
if (myNetworkElementShapeEdited) {
myNetworkElementShapeEdited->updateGeometry();
}
// update geometry
updateGeometry();
break;
Expand All @@ -788,10 +760,6 @@ GNEPoly::setAttribute(SumoXMLAttr key, const std::string& value) {
}
// disable simplified shape flag
mySimplifiedShape = false;
// update geometry of shape edited element
if (myNetworkElementShapeEdited) {
myNetworkElementShapeEdited->updateGeometry();
}
// update geometry
updateGeometry();
break;
Expand Down
9 changes: 0 additions & 9 deletions src/netedit/elements/additional/GNEPoly.h
Expand Up @@ -206,12 +206,6 @@ class GNEPoly : public GUIPolygon, public GNEShape, protected GNEMoveShape {
/// @brief check if polygon is closed
bool isPolygonClosed() const;

/// @brief retrieve the networkElement of which the shape is being edited
void setShapeEditedElement(GNENetworkElement* element);

/// @brief retrieve the junction of which the shape is being edited
GNENetworkElement* getShapeEditedElement() const;

/// @brief open polygon
void openPolygon(bool allowUndo = true);

Expand All @@ -225,9 +219,6 @@ class GNEPoly : public GUIPolygon, public GNEShape, protected GNEMoveShape {
void simplifyShape(bool allowUndo = true);

protected:
/// @brief junction of which the shape is being edited (optional)
GNENetworkElement* myNetworkElementShapeEdited;

/// @brief Latitude of Polygon
PositionVector myGeoShape;

Expand Down

0 comments on commit c10cdc4

Please sign in to comment.