Skip to content

Commit

Permalink
Renamed MoveSingleElementValues and MoveMultipleElementValues. Refs #12
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Jan 5, 2024
1 parent 6824808 commit 76bd5ab
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 57 deletions.
54 changes: 27 additions & 27 deletions src/netedit/GNEViewNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMai
myDemandViewOptions(this),
myDataViewOptions(this),
myIntervalBar(this),
myMoveSingleElementValues(this),
myMoveMultipleElementValues(this),
myMoveSingleElement(this),
myMoveMultipleElements(this),
myVehicleOptions(this),
myVehicleTypeOptions(this),
mySaveElements(this),
Expand Down Expand Up @@ -524,9 +524,9 @@ GNEViewNet::updateObjectsInPosition(const Position &pos) {
}


const GNEViewNetHelper::MoveMultipleElementValues&
const GNEViewNetHelper::MoveMultipleElementModul&
GNEViewNet::getMoveMultipleElementValues() const {
return myMoveMultipleElementValues;
return myMoveMultipleElements;
}


Expand Down Expand Up @@ -1228,8 +1228,8 @@ GNEViewNet::GNEViewNet() :
myDemandViewOptions(this),
myDataViewOptions(this),
myIntervalBar(this),
myMoveSingleElementValues(this),
myMoveMultipleElementValues(this),
myMoveSingleElement(this),
myMoveMultipleElements(this),
myVehicleOptions(this),
myVehicleTypeOptions(this),
mySaveElements(this),
Expand Down Expand Up @@ -1958,7 +1958,7 @@ GNEViewNet::drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier* AC, do

bool
GNEViewNet::isMovingElement() const {
return myMoveSingleElementValues.isMovingElements() || myMoveMultipleElementValues.isMovingElements();
return myMoveSingleElement.isMovingElements() || myMoveMultipleElements.isMovingElements();
}


Expand Down Expand Up @@ -5526,7 +5526,7 @@ GNEViewNet::drawTestsCircle() const {
void
GNEViewNet::processLeftButtonPressNetwork(void* eventData) {
// reset moving selected edge
myMoveMultipleElementValues.resetMovingSelectedEdge();
myMoveMultipleElements.resetMovingSelectedEdge();
// decide what to do based on mode
switch (myEditModes.networkEditMode) {
case NetworkEditMode::NETWORK_INSPECT: {
Expand Down Expand Up @@ -5648,7 +5648,7 @@ GNEViewNet::processLeftButtonPressNetwork(void* eventData) {
if (myViewObjectsSelector.getNetworkElementFront() == myEditNetworkElementShapes.getEditedNetworkElement()) {
myViewObjectsSelector.getNetworkElementFront()->removeGeometryPoint(getPositionInformation(), myUndoList);
}
} else if (!myMoveSingleElementValues.beginMoveNetworkElementShape()) {
} else if (!myMoveSingleElement.beginMoveNetworkElementShape()) {
// process click if there isn't movable elements (to move camera using drag an drop)
processClick(eventData);
}
Expand All @@ -5660,10 +5660,10 @@ GNEViewNet::processLeftButtonPressNetwork(void* eventData) {
// check if we're moving a set of selected items
if (AC->isAttributeCarrierSelected()) {
// move selected ACs
myMoveMultipleElementValues.beginMoveSelection();
myMoveMultipleElements.beginMoveSelection();
// update view
updateViewNet();
} else if (!myMoveSingleElementValues.beginMoveSingleElementNetworkMode()) {
} else if (!myMoveSingleElement.beginMoveSingleElementNetworkMode()) {
// process click if there isn't movable elements (to move camera using drag an drop)
processClick(eventData);
}
Expand Down Expand Up @@ -5799,8 +5799,8 @@ GNEViewNet::processLeftButtonPressNetwork(void* eventData) {
void
GNEViewNet::processLeftButtonReleaseNetwork() {
// check moved items
if (myMoveMultipleElementValues.isMovingSelection()) {
myMoveMultipleElementValues.finishMoveSelection();
if (myMoveMultipleElements.isMovingSelection()) {
myMoveMultipleElements.finishMoveSelection();
} else if (mySelectingArea.selectingUsingRectangle) {
// check if we're creating a rectangle selection or we want only to select a lane
if (mySelectingArea.startDrawing) {
Expand All @@ -5826,7 +5826,7 @@ GNEViewNet::processLeftButtonReleaseNetwork() {
mySelectingArea.finishRectangleSelection();
} else {
// finish moving of single elements
myMoveSingleElementValues.finishMoveSingleElement();
myMoveSingleElement.finishMoveSingleElement();
}
}

Expand All @@ -5840,15 +5840,15 @@ GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) {
myViewParent->getTAZFrame()->getDrawingShapeModule()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed());
}
// check what type of additional is moved
if (myMoveMultipleElementValues.isMovingSelection()) {
if (myMoveMultipleElements.isMovingSelection()) {
// move entire selection
myMoveMultipleElementValues.moveSelection(mouseLeftButtonPressed);
myMoveMultipleElements.moveSelection(mouseLeftButtonPressed);
} else if (mySelectingArea.selectingUsingRectangle) {
// update selection corner of selecting area
mySelectingArea.moveRectangleSelection();
} else {
// move single elements
myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
}
}

Expand Down Expand Up @@ -5910,10 +5910,10 @@ GNEViewNet::processLeftButtonPressDemand(void* eventData) {
// check if we're moving a set of selected items
if (AC->isAttributeCarrierSelected()) {
// move selected ACs
myMoveMultipleElementValues.beginMoveSelection();
myMoveMultipleElements.beginMoveSelection();
// update view
updateViewNet();
} else if (!myMoveSingleElementValues.beginMoveSingleElementDemandMode()) {
} else if (!myMoveSingleElement.beginMoveSingleElementDemandMode()) {
// process click if there isn't movable elements (to move camera using drag an drop)
processClick(eventData);
}
Expand Down Expand Up @@ -5993,8 +5993,8 @@ GNEViewNet::processLeftButtonPressDemand(void* eventData) {
void
GNEViewNet::processLeftButtonReleaseDemand() {
// check moved items
if (myMoveMultipleElementValues.isMovingSelection()) {
myMoveMultipleElementValues.finishMoveSelection();
if (myMoveMultipleElements.isMovingSelection()) {
myMoveMultipleElements.finishMoveSelection();
} else if (mySelectingArea.selectingUsingRectangle) {
// check if we're creating a rectangle selection or we want only to select a lane
if (mySelectingArea.startDrawing) {
Expand All @@ -6004,7 +6004,7 @@ GNEViewNet::processLeftButtonReleaseDemand() {
mySelectingArea.finishRectangleSelection();
} else {
// finish moving of single elements
myMoveSingleElementValues.finishMoveSingleElement();
myMoveSingleElement.finishMoveSingleElement();
}
}

Expand All @@ -6016,7 +6016,7 @@ GNEViewNet::processMoveMouseDemand(const bool mouseLeftButtonPressed) {
mySelectingArea.moveRectangleSelection();
} else {
// move single elements
myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
}
}

Expand Down Expand Up @@ -6127,8 +6127,8 @@ GNEViewNet::processLeftButtonPressData(void* eventData) {
void
GNEViewNet::processLeftButtonReleaseData() {
// check moved items
if (myMoveMultipleElementValues.isMovingSelection()) {
myMoveMultipleElementValues.finishMoveSelection();
if (myMoveMultipleElements.isMovingSelection()) {
myMoveMultipleElements.finishMoveSelection();
} else if (mySelectingArea.selectingUsingRectangle) {
// check if we're creating a rectangle selection or we want only to select a lane
if (mySelectingArea.startDrawing) {
Expand All @@ -6138,7 +6138,7 @@ GNEViewNet::processLeftButtonReleaseData() {
mySelectingArea.finishRectangleSelection();
} else {
// finish moving of single elements
myMoveSingleElementValues.finishMoveSingleElement();
myMoveSingleElement.finishMoveSingleElement();
}
}

Expand All @@ -6150,7 +6150,7 @@ GNEViewNet::processMoveMouseData(const bool mouseLeftButtonPressed) {
mySelectingArea.moveRectangleSelection();
} else {
// move single elements
myMoveSingleElementValues.moveSingleElement(mouseLeftButtonPressed);
myMoveSingleElement.moveSingleElement(mouseLeftButtonPressed);
}
}

Expand Down
15 changes: 10 additions & 5 deletions src/netedit/GNEViewNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class GNEViewNet : public GUISUMOAbstractView {
const GNEViewNetHelper::ViewObjectsSelector& getViewObjectsSelector() const;

/// @brief get move multiple element values
const GNEViewNetHelper::MoveMultipleElementValues& getMoveMultipleElementValues() const;
const GNEViewNetHelper::MoveMultipleElementModul& getMoveMultipleElementValues() const;

/// @brief get objects in the given boundary
void updateObjectsInBoundary(const Boundary &boundary);
Expand Down Expand Up @@ -644,6 +644,7 @@ class GNEViewNet : public GUISUMOAbstractView {

/// @brief variable used to save checkable buttons for Supermode Data
GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons;

/// @}

/// @name structs related with view options
Expand All @@ -657,18 +658,21 @@ class GNEViewNet : public GUISUMOAbstractView {

/// @brief variable used to save variables related with view options in supermode Data
GNEViewNetHelper::DataViewOptions myDataViewOptions;

/// @}

/// @brief variable used to save IntervalBar
GNEViewNetHelper::IntervalBar myIntervalBar;

/// @name structs related with move elements
/// @{
/// @brief variable used to save variables related with movement of single elements
GNEViewNetHelper::MoveSingleElementValues myMoveSingleElementValues;

/// @brief variable used to save variables related with movement of multiple elements
GNEViewNetHelper::MoveMultipleElementValues myMoveMultipleElementValues;
/// @brief modul used for moving single element
GNEViewNetHelper::MoveSingleElementModul myMoveSingleElement;

/// @brief modul used for moving multiple elements
GNEViewNetHelper::MoveMultipleElementModul myMoveMultipleElements;

// @}

/// @name structs related with Demand options
Expand All @@ -679,6 +683,7 @@ class GNEViewNet : public GUISUMOAbstractView {

/// @brief variable used to save variables related with vehicle type options
GNEViewNetHelper::VehicleTypeOptions myVehicleTypeOptions;

// @}

/// @brief variable used for grouping all variables related with salve elements
Expand Down

0 comments on commit 76bd5ab

Please sign in to comment.