Skip to content

Commit

Permalink
Renamed GUIObjectsInPosition to GUIViewObjectsHandler. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent a45151b commit f108463
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/netedit/GNEViewNetHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ GNEViewNetHelper::ObjectsUnderCursor::updateGenericDataElements(ObjectsContainer


void
GNEViewNetHelper::ObjectsUnderCursor::processGUIGlObjects(const GUIObjectsInPosition::GLObjectsSortedContainer& objectsContainer) {
GNEViewNetHelper::ObjectsUnderCursor::processGUIGlObjects(const GUIViewObjectsHandler::GLObjectsSortedContainer& objectsContainer) {
// iterate over filtered edge objects
for (const auto& glObjectLayer : objectsContainer) {
for (const auto &glObject : glObjectLayer.second) {
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/GNEViewNetHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ struct GNEViewNetHelper {
void updateGenericDataElements(ObjectsContainer& container, const GUIGlObject* glObject);

/// @brief process GL objects
void processGUIGlObjects(const GUIObjectsInPosition::GLObjectsSortedContainer& objectsContainer);
void processGUIGlObjects(const GUIViewObjectsHandler::GLObjectsSortedContainer& objectsContainer);

/// @brief default constructor
ObjectsUnderCursor();
Expand Down
2 changes: 1 addition & 1 deletion src/utils/gui/div/GUIGlobalObjectsInPosition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
// global variables definitions
// ===========================================================================

GUIObjectsInPosition gObjectsInPosition;
GUIViewObjectsHandler gObjectsInPosition;

/****************************************************************************/
4 changes: 2 additions & 2 deletions src/utils/gui/div/GUIGlobalObjectsInPosition.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#pragma once
#include <config.h>

#include <utils/gui/settings/GUIObjectsInPosition.h>
#include <utils/gui/settings/GUIViewObjectsHandler.h>


// ===========================================================================
// global variable declarations
// ===========================================================================

extern GUIObjectsInPosition gObjectsInPosition;
extern GUIViewObjectsHandler gObjectsInPosition;
4 changes: 2 additions & 2 deletions src/utils/gui/settings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set(utils_gui_settings_STAT_SRCS
GUISettingsHandler.h
GUIVisualizationSettings.cpp
GUIVisualizationSettings.h
GUIObjectsInPosition.cpp
GUIObjectsInPosition.h
GUIViewObjectsHandler.cpp
GUIViewObjectsHandler.h
)

add_library(utils_gui_settings STATIC ${utils_gui_settings_STAT_SRCS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file GUIObjectsInPosition.cpp
/// @file GUIViewObjectsHandler.cpp
/// @author Pablo Alvarez Lopez
/// @date Jun 22
///
Expand All @@ -22,14 +22,14 @@

#include <utils/shapes/Shape.h>

#include "GUIObjectsInPosition.h"
#include "GUIViewObjectsHandler.h"


GUIObjectsInPosition::GUIObjectsInPosition() {}
GUIViewObjectsHandler::GUIViewObjectsHandler() {}


void
GUIObjectsInPosition::clearElements() {
GUIViewObjectsHandler::clearElements() {
// reset recompute boundaries
recomputeBoundaries = GLO_NETWORK;
// clear objects under cursor
Expand All @@ -46,27 +46,27 @@ GUIObjectsInPosition::clearElements() {


void
GUIObjectsInPosition::setSelectionPosition(const Position &pos) {
GUIViewObjectsHandler::setSelectionPosition(const Position &pos) {
mySelectionPosition = pos;
mySelectionBoundary.reset();
}


void
GUIObjectsInPosition::setSelectionBoundary(const Boundary &boundary) {
GUIViewObjectsHandler::setSelectionBoundary(const Boundary &boundary) {
mySelectionPosition = Position::INVALID;
mySelectionBoundary = boundary;
}


bool
GUIObjectsInPosition::isElementSelected(const GUIGlObject* GLObject) const {
GUIViewObjectsHandler::isElementSelected(const GUIGlObject* GLObject) const {
return mySelectedObjets.find(GLObject) != mySelectedObjets.end();
}


bool
GUIObjectsInPosition::checkCircleElement(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
GUIViewObjectsHandler::checkCircleElement(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
const Position &center, const double radius) {
// declare squared radius
const double squaredRadius = (radius * radius);
Expand Down Expand Up @@ -115,7 +115,7 @@ GUIObjectsInPosition::checkCircleElement(const GUIVisualizationSettings::Detail


bool
GUIObjectsInPosition::checkGeometryPoint(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
GUIViewObjectsHandler::checkGeometryPoint(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
const int index, const Position &center, const double radius) {
// declare squared radius
const double squaredRadius = (radius * radius);
Expand Down Expand Up @@ -164,7 +164,7 @@ GUIObjectsInPosition::checkGeometryPoint(const GUIVisualizationSettings::Detail


bool
GUIObjectsInPosition::checkPositionOverShape(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
GUIViewObjectsHandler::checkPositionOverShape(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
const PositionVector &shape, const double distance) {
if ((mySelectionPosition != Position::INVALID) && (d <= GUIVisualizationSettings::Detail::PreciseSelection)) {
// obtain nearest position over shape
Expand All @@ -182,7 +182,7 @@ GUIObjectsInPosition::checkPositionOverShape(const GUIVisualizationSettings::Det


bool
GUIObjectsInPosition::checkShapeElement(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
GUIViewObjectsHandler::checkShapeElement(const GUIVisualizationSettings::Detail d, const GUIGlObject* GLObject,
const PositionVector &shape) {
// continue depending if we're selecting a position or a boundary
if (mySelectionBoundary.isInitialised()) {
Expand Down Expand Up @@ -215,14 +215,14 @@ GUIObjectsInPosition::checkShapeElement(const GUIVisualizationSettings::Detail d
}


const GUIObjectsInPosition::GLObjectsSortedContainer&
GUIObjectsInPosition::getSelectedObjects() const {
const GUIViewObjectsHandler::GLObjectsSortedContainer&
GUIViewObjectsHandler::getSelectedObjects() const {
return myElementsUnderCursor;
}


const std::vector<int>&
GUIObjectsInPosition::getGeometryPoints(const GUIGlObject* GLObject) const {
GUIViewObjectsHandler::getGeometryPoints(const GUIGlObject* GLObject) const {
// avoid to insert duplicated elements
for (auto &elementLayer : myElementsUnderCursor) {
for (auto &element : elementLayer.second) {
Expand All @@ -236,7 +236,7 @@ GUIObjectsInPosition::getGeometryPoints(const GUIGlObject* GLObject) const {


const Position&
GUIObjectsInPosition::getPositionOverShape(const GUIGlObject* GLObject) const {
GUIViewObjectsHandler::getPositionOverShape(const GUIGlObject* GLObject) const {
// avoid to insert duplicated elements
for (auto &elementLayer : myElementsUnderCursor) {
for (auto &element : elementLayer.second) {
Expand All @@ -250,7 +250,7 @@ GUIObjectsInPosition::getPositionOverShape(const GUIGlObject* GLObject) const {


void
GUIObjectsInPosition::updateFrontElement(const GUIGlObject* GLObject) {
GUIViewObjectsHandler::updateFrontElement(const GUIGlObject* GLObject) {
ObjectContainer frontElement(nullptr);
// extract element
for (auto &elementLayer : myElementsUnderCursor) {
Expand All @@ -275,7 +275,7 @@ GUIObjectsInPosition::updateFrontElement(const GUIGlObject* GLObject) {


bool
GUIObjectsInPosition::addElementUnderCursor(const GUIGlObject* GLObject) {
GUIViewObjectsHandler::addElementUnderCursor(const GUIGlObject* GLObject) {
// avoid to insert duplicated elements
if (isElementSelected(GLObject)) {
return false;
Expand All @@ -296,7 +296,7 @@ GUIObjectsInPosition::addElementUnderCursor(const GUIGlObject* GLObject) {


bool
GUIObjectsInPosition::addGeometryPointUnderCursor(const GUIGlObject* GLObject, const int newIndex) {
GUIViewObjectsHandler::addGeometryPointUnderCursor(const GUIGlObject* GLObject, const int newIndex) {
// avoid to insert duplicated elements
for (auto &elementLayer : myElementsUnderCursor) {
for (auto &element : elementLayer.second) {
Expand Down Expand Up @@ -330,7 +330,7 @@ GUIObjectsInPosition::addGeometryPointUnderCursor(const GUIGlObject* GLObject, c


bool
GUIObjectsInPosition::addPositionOverShape(const GUIGlObject* GLObject, const Position &pos) {
GUIViewObjectsHandler::addPositionOverShape(const GUIGlObject* GLObject, const Position &pos) {
// avoid to insert duplicated elements
for (auto &elementLayer : myElementsUnderCursor) {
for (auto &element : elementLayer.second) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file GUIObjectsInPosition.h
/// @file GUIViewObjectsHandler.h
/// @author Pablo Alvarez Lopez
/// @date Jun 22
///
Expand All @@ -37,7 +37,7 @@ class GNERoute;
// class definitions
// ===========================================================================

class GUIObjectsInPosition {
class GUIViewObjectsHandler {

public:
/// @brief object container
Expand All @@ -61,7 +61,7 @@ class GUIObjectsInPosition {
typedef std::map<double, std::vector<ObjectContainer> > GLObjectsSortedContainer;

/// @brief constructor
GUIObjectsInPosition();
GUIViewObjectsHandler();

/// @brief clear elements
void clearElements();
Expand Down Expand Up @@ -151,8 +151,8 @@ class GUIObjectsInPosition {

private:
/// @brief set copy constructor private
GUIObjectsInPosition(const GUIObjectsInPosition&) = default;
GUIViewObjectsHandler(const GUIViewObjectsHandler&) = default;

/// @brief set assignment operator private
GUIObjectsInPosition& operator=(const GUIObjectsInPosition&) = default;
GUIViewObjectsHandler& operator=(const GUIViewObjectsHandler&) = default;
};

0 comments on commit f108463

Please sign in to comment.