Skip to content

Commit

Permalink
Added flag myShapeEdited. Refs #6945
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Jul 13, 2020
1 parent c10cdc4 commit 42197ed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/netedit/elements/network/GNENetworkElement.cpp
Expand Up @@ -51,7 +51,8 @@ GNENetworkElement::GNENetworkElement(GNENet* net, const std::string& id, GUIGlOb
GNEAttributeCarrier(tag, net),
GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, additionalParents, shapeParents, TAZElementParents, demandElementParents, genericDataParents),
GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, additionalChildren, shapeChildren, TAZElementChildren, demandElementChildren, genericDataChildren),
myMovingGeometryBoundary() {
myMovingGeometryBoundary(),
myShapeEdited(false) {
}


Expand All @@ -70,6 +71,18 @@ GNENetworkElement::getGUIGlObject() {
}


void
GNENetworkElement::setShapeEdited(const bool value) {
myShapeEdited = value;
}


bool
GNENetworkElement::isShapeEdited() const {
return myShapeEdited;
}


GUIParameterTableWindow*
GNENetworkElement::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) {
// Create table
Expand Down
9 changes: 9 additions & 0 deletions src/netedit/elements/network/GNENetworkElement.h
Expand Up @@ -90,6 +90,12 @@ class GNENetworkElement : public GUIGlObject, public GNEAttributeCarrier, public
/// @brief get GUIGlObject associated with this AttributeCarrier
GUIGlObject* getGUIGlObject();

/// @brief set shape edited
void setShapeEdited(const bool value);

/// @brief check if shape is being edited
bool isShapeEdited() const;

/// @name Functions related with geometry of element
/// @{
/// @brief update pre-computed geometry information
Expand Down Expand Up @@ -185,6 +191,9 @@ class GNENetworkElement : public GUIGlObject, public GNEAttributeCarrier, public
/// @brief position used during moving
Position myMovingPosition;

/// @brief flag to check if element shape is being edited
bool myShapeEdited;

private:
/// @brief set attribute after validation
virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0;
Expand Down

0 comments on commit 42197ed

Please sign in to comment.