Skip to content

Commit

Permalink
Added functions checkDrawMoveContour(). Refs #14109
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent 19b1790 commit 5a04f65
Show file tree
Hide file tree
Showing 36 changed files with 207 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/netedit/elements/GNEAttributeCarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class GNEAttributeCarrier : public GNEReferenceCounter {
/// @brief check if draw select contour (blue)
virtual bool checkDrawSelectContour() const = 0;

/// @brief check if draw move contour (red)
virtual bool checkDrawMoveContour() const = 0;

/// @}

/// @brief reset attribute carrier to their default values
Expand Down
13 changes: 13 additions & 0 deletions src/netedit/elements/additional/GNEAdditional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,19 @@ GNEAdditional::checkDrawSelectContour() const {
}


bool
GNEAdditional::checkDrawMoveContour() const {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if we're in move mode
if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
return myNet->getViewNet()->checkOverLockedElement(this, mySelected);
} else {
return false;
}
}


GUIGLObjectPopupMenu*
GNEAdditional::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) {
GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/additional/GNEAdditional.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ class GNEAdditional : public GNEPathManager::PathElement, public GNEHierarchical
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name inherited from GUIGlObject
Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/data/GNEDataInterval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ GNEDataInterval::checkDrawSelectContour() const {
}


bool
GNEDataInterval::checkDrawMoveContour() const {
return false;
}


bool
GNEDataInterval::isDataIntervalValid() const {
return true;
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/data/GNEDataInterval.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class GNEDataInterval : public GNEHierarchicalElement, public Parameterised {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name members and functions relative to write data elements into XML
Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/data/GNEDataSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ GNEDataSet::checkDrawSelectContour() const {
}


bool
GNEDataSet::checkDrawMoveContour() const {
return false;
}


void
GNEDataSet::addDataIntervalChild(GNEDataInterval* dataInterval) {
// check that dataInterval wasn't previously inserted
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/data/GNEDataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ class GNEDataSet : public GNEAttributeCarrier, public Parameterised {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name data interval children
Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/data/GNEGenericData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ GNEGenericData::checkDrawSelectContour() const {
}


bool
GNEGenericData::checkDrawMoveContour() const {
return false;
}


bool
GNEGenericData::isGenericDataValid() const {
return true;
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/data/GNEGenericData.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class GNEGenericData : public GNEPathManager::PathElement, public Parameterised,
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name members and functions relative to write data sets into XML
Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/data/GNEMeanData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ GNEMeanData::checkDrawSelectContour() const {
}


bool
GNEMeanData::checkDrawMoveContour() const {
return false;
}


std::string
GNEMeanData::getAttribute(SumoXMLAttr key) const {
switch (key) {
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/data/GNEMeanData.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class GNEMeanData : public GNEHierarchicalElement {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name inherited from GNEAttributeCarrier
Expand Down
12 changes: 12 additions & 0 deletions src/netedit/elements/demand/GNEDemandElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,19 @@ GNEDemandElement::checkDrawSelectContour() const {
} else {
return false;
}
}


bool
GNEDemandElement::checkDrawMoveContour() const {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if we're in select mode
if (editModes.isCurrentSupermodeDemand() && (editModes.demandEditMode == DemandEditMode::DEMAND_MOVE)) {
return myNet->getViewNet()->checkOverLockedElement(this, mySelected);
} else {
return false;
}
}


Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNEDemandElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ class GNEDemandElement : public GNEPathManager::PathElement, public GNEHierarchi
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name inherited from GUIGlObject
Expand Down
13 changes: 13 additions & 0 deletions src/netedit/elements/network/GNEConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,19 @@ GNEConnection::checkDrawSelectContour() const {
}


bool
GNEConnection::checkDrawMoveContour() const {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if we're in move mode
if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
return myNet->getViewNet()->checkOverLockedElement(this, mySelected);
} else {
return false;
}
}


GNEMoveOperation*
GNEConnection::getMoveOperation() {
// edit depending if shape is being edited
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNEConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class GNEConnection : public GNENetworkElement {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name Functions related with move elements
Expand Down
13 changes: 13 additions & 0 deletions src/netedit/elements/network/GNECrossing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ GNECrossing::checkDrawSelectContour() const {
}


bool
GNECrossing::checkDrawMoveContour() const {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if we're in move mode
if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
return myNet->getViewNet()->checkOverLockedElement(this, mySelected);
} else {
return false;
}
}


GNEMoveOperation*
GNECrossing::getMoveOperation() {
// edit depending if shape is being edited
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNECrossing.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class GNECrossing : public GNENetworkElement {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name Functions related with move elements
Expand Down
13 changes: 13 additions & 0 deletions src/netedit/elements/network/GNEEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,19 @@ GNEEdge::checkDrawSelectContour() const {
}


bool
GNEEdge::checkDrawMoveContour() const {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if we're in move mode
if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
return myNet->getViewNet()->checkOverLockedElement(this, mySelected);
} else {
return false;
}
}


GNEMoveOperation*
GNEEdge::getMoveOperation() {
// get geometry point radius
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNEEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class GNEEdge : public GNENetworkElement, public GNECandidateElement {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name Functions related with move elements
Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/network/GNEEdgeTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ GNEEdgeTemplate::checkDrawSelectContour() const {
}


bool
GNEEdgeTemplate::checkDrawMoveContour() const {
return false;
}


std::string
GNEEdgeTemplate::getAttribute(SumoXMLAttr key) const {
return myEdge->getAttribute(key);
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNEEdgeTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class GNEEdgeTemplate : public GNEAttributeCarrier {

/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/network/GNEEdgeType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ GNEEdgeType::checkDrawSelectContour() const {
}


bool
GNEEdgeType::checkDrawMoveContour() const {
return false;
}


GNEMoveOperation*
GNEEdgeType::getMoveOperation() {
return nullptr;
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNEEdgeType.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ class GNEEdgeType : public GNENetworkElement, public Parameterised, public NBTyp
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name Functions related with move elements
Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/network/GNEInternalLane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ GNEInternalLane::checkDrawSelectContour() const {
}


bool
GNEInternalLane::checkDrawMoveContour() const {
return false;
}


GNEMoveOperation*
GNEInternalLane::getMoveOperation() {
// internal lanes cannot be moved
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNEInternalLane.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ class GNEInternalLane : public GNENetworkElement, public FXDelegator {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name Functions related with move elements
Expand Down
13 changes: 13 additions & 0 deletions src/netedit/elements/network/GNEJunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ GNEJunction::checkDrawSelectContour() const {
}


bool
GNEJunction::checkDrawMoveContour() const {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if we're in move mode
if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
return myNet->getViewNet()->checkOverLockedElement(this, mySelected);
} else {
return false;
}
}


GNEMoveOperation*
GNEJunction::getMoveOperation() {
// edit depending if shape is being edited
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNEJunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class GNEJunction : public GNENetworkElement, public GNECandidateElement {
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name Functions related with move elements
Expand Down
13 changes: 13 additions & 0 deletions src/netedit/elements/network/GNELane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,19 @@ GNELane::checkDrawSelectContour() const {
}


bool
GNELane::checkDrawMoveContour() const {
// get edit modes
const auto& editModes = myNet->getViewNet()->getEditModes();
// check if we're in move mode
if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
return myNet->getViewNet()->checkOverLockedElement(this, mySelected);
} else {
return false;
}
}


GNEMoveOperation*
GNELane::getMoveOperation() {
// edit depending if shape is being edited
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/network/GNELane.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class GNELane : public GNENetworkElement, public GNECandidateElement, public FXD
/// @brief check if draw select contour (blue)
bool checkDrawSelectContour() const;

/// @brief check if draw move contour (red)
bool checkDrawMoveContour() const;

/// @}

/// @name Functions related with move elements
Expand Down
6 changes: 6 additions & 0 deletions src/netedit/elements/network/GNELaneTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ GNELaneTemplate::checkDrawSelectContour() const {
}


bool
GNELaneTemplate::checkDrawMoveContour() const {
return false;
}


std::string
GNELaneTemplate::getAttribute(SumoXMLAttr key) const {
return myLane->getAttribute(key);
Expand Down

0 comments on commit 5a04f65

Please sign in to comment.