177 if (editedPolyShape !=
nullptr) {
186 if (tagValue.isNetElement()) {
189 }
else if (tagValue.isAdditional()) {
192 }
else if (tagValue.isShape()) {
195 }
else if (tagValue.isTAZ()) {
200 switch (i->getType()) {
266 for (
const auto &i :
myEdges) {
272 WRITE_DEBUG(
"ObjectsUnderCursor: swapped Lanes to edges")
426 const std::vector<GNEAttributeCarrier*> &
437 std::map<GUIGlObjectType, std::vector<GUIGlObject*> > mySortedGUIGlObjects;
438 for (
const auto &i : GUIGlObjects) {
439 mySortedGUIGlObjects[i->getType()].push_back(i);
442 for (std::map<
GUIGlObjectType, std::vector<GUIGlObject*> >::reverse_iterator i = mySortedGUIGlObjects.rbegin(); i != mySortedGUIGlObjects.rend(); i++) {
443 for (
const auto &j : i->second) {
454 myEventInfo(nullptr) {
489 FXGLVisual* glVis, FXGLCanvas* share, FXToolBar* toolBar) :
490 GUISUMOAbstractView(tmpParent, app, viewParent, net->getVisualisationSpeedUp(), glVis, share),
516 reparent(actualParent);
553 "\tLocate Junction\tLocate a junction within the network.",
555 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
558 "\tLocate Street\tLocate a street within the network.",
560 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
563 "\tLocate TLS\tLocate a tls within the network.",
565 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
568 "\tLocate Additional\tLocate an additional structure within the network.",
570 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
573 "\tLocate PoI\tLocate a PoI within the network.",
575 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
578 "\tLocate Polygon\tLocate a Polygon within the network.",
580 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
584 std::set<std::pair<std::string, GNEAttributeCarrier*> >
588 std::set<std::pair<std::string, GNEAttributeCarrier*> > result;
602 retrievedAC = &
dynamic_cast<GNELane*
>(retrievedAC)->getParentEdge();
607 result.insert(std::make_pair(retrievedAC->
getID(), retrievedAC));
623 new FXMenuSeparator(ret);
659 }
else if (
id != 0) {
669 myApp->getCursorPosition(x, y, b);
688 double minValue = std::numeric_limits<double>::infinity();
689 double maxValue = -std::numeric_limits<double>::infinity();
695 }
else if (active == 11) {
699 const double val = lane->getColorValue(s, active);
700 minValue =
MIN2(minValue, val);
701 maxValue =
MAX2(maxValue, val);
706 minValue =
MIN2(minValue, junction->getPositionInView().z());
707 maxValue =
MAX2(maxValue, junction->getPositionInView().z());
711 if (minValue != std::numeric_limits<double>::infinity()) {
714 double range = maxValue - minValue;
788 if ((
myEditShapePoly ==
nullptr) && (element !=
nullptr) && (shape.size() > 1)) {
832 glMatrixMode(GL_MODELVIEW);
834 glDisable(GL_TEXTURE_2D);
835 glDisable(GL_ALPHA_TEST);
837 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
838 glEnable(GL_DEPTH_TEST);
867 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
868 const float minB[2] = { (float)bound.
xmin(), (float)bound.
ymin() };
869 const float maxB[2] = { (float)bound.
xmax(), (float)bound.
ymax() };
871 glEnable(GL_POLYGON_OFFSET_FILL);
872 glEnable(GL_POLYGON_OFFSET_LINE);
928 std::cout <<
"edge created without an open CommandGroup )-:\n";
1401 if (clearSelection) {
1551 throw ProcessError(
"invalid edit mode called by hotkey");
1686 edge = &(((
GNELane*)pointed)->getParentEdge());
1735 return dynamic_cast<GNEPoly*
>(pointed);
1749 return dynamic_cast<GNEPOI*
>(pointed);
1841 if (edge !=
nullptr) {
1851 if (edge !=
nullptr) {
1855 if (reverseEdge !=
nullptr) {
1866 if (edge !=
nullptr) {
1870 for (
auto it : edges) {
1887 if (edge !=
nullptr) {
1891 for (
auto it : edges) {
1908 if (edge !=
nullptr) {
1919 if (edge !=
nullptr) {
1929 if (edge !=
nullptr) {
1933 for (
auto it : edges) {
1951 if (edge !=
nullptr) {
1955 for (
auto it : edges) {
1972 if (edge !=
nullptr) {
1976 for (
auto it : edges) {
1993 if (edge !=
nullptr) {
1997 for (
auto it : edges) {
2018 if (polygonUnderMouse) {
2033 if (polygonUnderMouse) {
2048 if (polygonUnderMouse) {
2063 if (polygonUnderMouse) {
2078 if (polygonUnderMouse) {
2095 std::vector<GNELane*> lanes;
2096 for (
auto i : GLIDs) {
2099 lanes.push_back(lane);
2102 if (lanes.empty()) {
2106 GNELane* nearestLane = lanes.front();
2109 for (
auto i : lanes) {
2110 double posOverLane = i->getShape().nearest_offset_to_point2D(POI->
getPositionInView());
2111 double lateralOffset = i->getShape().positionAtOffset(posOverLane).distanceTo(POI->
getPositionInView());
2112 if (lateralOffset < minorLateralOffset) {
2113 minorPosOverLane = posOverLane;
2114 minorLateralOffset = lateralOffset;
2119 std::string
id = POI->
getID();
2133 myNet->
addPOI(
id, type, color, pos,
false, nearestLane->
getID(), minorPosOverLane, 0, layer, angle, imgFile, relativePath, POIWidth, POIHeight);
2138 std::string
id = POI->
getID();
2152 myNet->
addPOI(
id, type, color, pos,
false,
"", 0, 0, layer, angle, imgFile, relativePath, POIWidth, POIWeight);
2165 if (lane !=
nullptr) {
2171 for (
auto it : lanes) {
2188 if (lane !=
nullptr) {
2194 for (
auto it : lanes) {
2295 if (lane !=
nullptr) {
2299 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
2301 for (
auto i : lanes) {
2305 if (mapOfEdgesAndLanes.size() != lanes.size()) {
2306 FXMessageBox::information(getApp(), MBOX_OK,
2307 "Multiple lane in the same edge selected",
"%s",
2308 (
"There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " +
toString(vclass) +
".").c_str());
2311 if (mapOfEdgesAndLanes.size() > 0) {
2315 for (
auto i : mapOfEdgesAndLanes) {
2316 if (i.first->hasRestrictedLane(vclass)) {
2321 if (counter == (
int)mapOfEdgesAndLanes.size()) {
2322 FXMessageBox::information(getApp(), MBOX_OK,
2323 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2324 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
2327 WRITE_DEBUG(
"Opening FXMessageBox 'restrict lanes'");
2329 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2330 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2331 (
toString(mapOfEdgesAndLanes.size() - counter) +
" lanes will be restricted for " +
toString(vclass) +
". continue?").c_str());
2335 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'No'");
2336 }
else if (answer == 4) {
2337 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
2342 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
2348 for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
2370 if (lane !=
nullptr) {
2376 std::set<GNEEdge*> setOfEdges;
2378 for (
auto i : edges) {
2379 setOfEdges.insert(i);
2382 for (
auto it : lanes) {
2387 if (setOfEdges.size() > 0) {
2391 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2393 if ((*it)->hasRestrictedLane(vclass)) {
2398 if (counter == (
int)setOfEdges.size()) {
2399 FXMessageBox::information(getApp(), MBOX_OK,
2400 (
"Add vclass for" +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2401 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
2404 WRITE_DEBUG(
"Opening FXMessageBox 'restrict lanes'");
2406 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2407 (
"Add vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2408 (
toString(setOfEdges.size() - counter) +
" restrictions for " +
toString(vclass) +
" will be added. continue?").c_str());
2412 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'No'");
2413 }
else if (answer == 4) {
2414 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
2419 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
2425 for (
auto it : setOfEdges) {
2451 if (lane !=
nullptr) {
2457 std::set<GNEEdge*> setOfEdges;
2459 for (
auto i : edges) {
2460 setOfEdges.insert(i);
2463 for (
auto it : lanes) {
2468 if (setOfEdges.size() > 0) {
2472 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2474 if ((*it)->hasRestrictedLane(vclass)) {
2480 FXMessageBox::information(getApp(), MBOX_OK,
2481 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2482 (
"Selected lanes and edges haven't a restriction for " +
toString(vclass)).c_str());
2485 WRITE_DEBUG(
"Opening FXMessageBox 'restrict lanes'");
2487 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2488 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2489 (
toString(counter) +
" restrictions for " +
toString(vclass) +
" will be removed. continue?").c_str());
2493 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'No'");
2494 }
else if (answer == 4) {
2495 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
2500 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
2506 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2527 FXEvent* evt = (FXEvent*)eventData;
2534 if (evt->click_count == 2) {
2535 handle(
this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
2587 for (
auto it : junctions) {
2607 if (junction !=
nullptr) {
2621 if (junction !=
nullptr) {
2635 if (junction !=
nullptr) {
2640 for (
auto i : selectedJunction) {
2659 if (junction !=
nullptr) {
2664 for (
auto i : selectedJunction) {
3003 if (junctions.size() > 0) {
3004 std::string plural = junctions.size() == 1 ? (
"") : (
"s");
3006 for (
auto i : junctions) {
3017 if (lanes.size() > 0) {
3018 std::string plural = lanes.size() == 1 ? (
"") : (
"s");
3020 for (
auto i : lanes) {
3032 if (edges.size() > 0) {
3033 std::string plural = edges.size() == 1 ? (
"") : (
"s");
3035 for (
auto i : edges) {
3047 if (additionals.size() > 0) {
3048 std::string plural = additionals.size() == 1 ? (
"") : (
"s");
3050 for (
auto i : additionals) {
3066 std::vector<GNECrossing*> crossings;
3067 for (
auto i : junctions) {
3068 for (
auto j : i->getGNECrossings()) {
3069 if (j->isAttributeCarrierSelected()) {
3070 crossings.push_back(j);
3075 if (crossings.size() > 0) {
3076 std::string plural = crossings.size() == 1 ? (
"") : (
"s");
3078 for (
auto i : crossings) {
3092 std::vector<GNEConnection*> connections;
3093 for (
auto i : edges) {
3094 for (
auto j : i->getGNEConnections()) {
3095 if (j->isAttributeCarrierSelected()) {
3096 connections.push_back(j);
3101 if (connections.size() > 0) {
3102 std::string plural = connections.size() == 1 ? (
"") : (
"s");
3104 for (
auto i : connections) {
3117 if (selectedShapes.size() > 0) {
3118 std::string plural = selectedShapes.size() == 1 ? (
"") : (
"s");
3120 for (
auto i : selectedShapes) {
3135 selection.
add(newPos);
3136 selection.
grow(0.1);
3139 for (
auto it_ids : ids) {
3156 WRITE_DEBUG(
"Opening FXMessageBox 'merge junctions'");
3158 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
3159 "Confirm Junction Merger",
"%s",
3160 (
"Do you wish to merge junctions '" + moved->
getMicrosimID() +
3163 "' will be eliminated and its roads added to '" +
3168 WRITE_DEBUG(
"Closed FXMessageBox 'merge junctions' with 'No'");
3169 }
else if (answer == 4) {
3170 WRITE_DEBUG(
"Closed FXMessageBox 'merge junctions' with 'ESC'");
3175 WRITE_DEBUG(
"Closed FXMessageBox 'merge junctions' with 'Yes'");
3207 junctionToMove(nullptr),
3208 edgeToMove(nullptr),
3209 polyToMove(nullptr),
3211 additionalToMove(nullptr),
3212 tazToMove(nullptr) {
3220 movingIndexShape(-1),
3221 movingStartPos(false),
3222 movingEndPos(false),
3223 myViewNet(viewNet) {
3235 offsetMovement =
Position(0, 0, offsetMovement.
y());
3238 offsetMovement.
setz(0);
3240 return offsetMovement;
3252 if (existentIndex != -1) {
3326 if (existentIndex != -1) {
3395 myMovingSelection(false) {
3409 for (
auto i : selectedJunctions) {
3413 i->startGeometryMoving();
3418 for (
auto i : selectedEdges) {
3422 i->startGeometryMoving();
3430 for (
auto i : selectedEdges) {
3434 i->startGeometryMoving();
3438 std::vector<GNEEdge*> noJunctionsSelected;
3439 std::vector<GNEEdge*> originJunctionSelected;
3440 std::vector<GNEEdge*> destinyJunctionSelected;
3442 for (
auto i : selectedEdges) {
3446 if (!originSelected && !destinySelected) {
3447 noJunctionsSelected.push_back(i);
3448 }
else if (originSelected && !destinySelected) {
3449 originJunctionSelected.push_back(i);
3450 }
else if (!originSelected && destinySelected) {
3451 destinyJunctionSelected.push_back(i);
3452 }
else if (!originSelected && !destinySelected) {
3456 i->startGeometryMoving();
3460 for (
auto i : noJunctionsSelected) {
3465 i->startGeometryMoving();
3480 for (
auto i : noJunctionsSelected) {
3481 if (i != clickedEdge) {
3486 if (i->getOppositeEdge() == clickedEdge) {
3492 i->startGeometryMoving();
3507 offsetMovement =
Position(0, 0, offsetMovement.
y());
3510 offsetMovement.
setz(0);
3514 i.first->moveGeometry(i.second, offsetMovement);
3518 i.first->moveEntireShape(i.second, offsetMovement);
3522 i.first->moveVertexShape(i.second->movingIndexShape, i.second->originalPositionInView, offsetMovement);
3533 i.first->endGeometryMoving();
3538 i.first->endGeometryMoving();
3543 i.first->endGeometryMoving();
3551 myMovedJunctionOriginPositions.clear();
3552 myMovedEdgesOriginShape.clear();
3554 for (
const auto &i : myMovedEgdesGeometryPoints) {
3557 myMovedEgdesGeometryPoints.clear();
3571 selectingUsingRectangle(false),
3572 startDrawing(false),
3622 std::vector<GNEEdge*>
3625 std::vector<GNEEdge*> result;
3638 for (
auto i : ACsInBoundary) {
3640 result.push_back(dynamic_cast<GNEEdge*>(i.second));
3660 glTranslated(0, 0,
GLO_MAX - 1);
3663 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
3680 std::vector<GNEAttributeCarrier*> ACToSelect;
3681 std::vector<GNEAttributeCarrier*> ACToUnselect;
3683 ACToSelect.reserve(ACsInBoundary.size());
3684 ACToUnselect.reserve(ACsInBoundary.size());
3689 ACToUnselect.push_back(i);
3693 for (
auto i : ACsInBoundary) {
3696 ACToUnselect.push_back(i.second);
3699 if (std::find(ACToUnselect.begin(), ACToUnselect.end(), i.second) != ACToUnselect.end()) {
3700 ACToSelect.push_back(i.second);
3704 ACToSelect.push_back(i.second);
3710 std::vector<GNEEdge*> edgesToSelect;
3712 for (
auto i : ACToSelect) {
3714 edgesToSelect.push_back(dynamic_cast<GNEEdge*>(i));
3718 for (
auto i : edgesToSelect) {
3720 ACToSelect.push_back(i->getGNEJunctionSource());
3721 for (
auto j : i->getGNEJunctionSource()->getGNEConnections()) {
3722 ACToSelect.push_back(j);
3724 for (
auto j : i->getGNEJunctionSource()->getGNECrossings()) {
3725 ACToSelect.push_back(j);
3728 ACToSelect.push_back(i->getGNEJunctionDestiny());
3729 for (
auto j : i->getGNEJunctionDestiny()->getGNEConnections()) {
3730 ACToSelect.push_back(j);
3732 for (
auto j : i->getGNEJunctionDestiny()->getGNECrossings()) {
3733 ACToSelect.push_back(j);
3738 if ((ACToSelect.size() + ACToUnselect.size()) > 0) {
3741 for (
auto i : ACToUnselect) {
3744 for (
auto i : ACToSelect) {
3745 if (i->getTagProperty().isSelectable()) {
3761 myTestingEnabled(
OptionsCont::getOptions().getBool(
"gui-testing")),
3763 myTestingHeight(0) {
3773 if ((windowSize.size() == 2) && GNEAttributeCarrier::canParse<int>(windowSize[0]) && GNEAttributeCarrier::canParse<int>(windowSize[1])) {
3777 WRITE_ERROR(
"Invalid windows size-format: " +
toString(windowSize) +
"for option 'window-size'");
3801 glTranslated(center.
x(), center.
y(),
GLO_MAX - 1);
3802 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
3805 glVertex2d(0, -size);
3806 glVertex2d(size, -size);
3807 glVertex2d(size, 0);
3824 createEdgeSource(nullptr),
3928 glTranslated(firstLanePoint.
x(), firstLanePoint.
y(),
GLO_JUNCTION + 0.3);
3943 std::vector<double> shapeRotations, shapeLengths;
3956 int segments = (int) shape.size() - 1;
3957 if (segments >= 0) {
3958 shapeRotations.reserve(segments);
3959 shapeLengths.reserve(segments);
3960 for (
int j = 0; j < segments; j++) {
3964 shapeRotations.push_back((
double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double)
M_PI);
3978 glTranslated(lastLanePoint.
x(), lastLanePoint.
y(),
GLO_JUNCTION + 0.3);
3994 bool deleteLastCreatedPoint =
false;
4004 if(temporalShape.size() > 0) {
4015 if (deleteLastCreatedPoint) {
Locate junction - button.
void setViewNet(GNEViewNet *viewNet)
Set the viewNet to be notified of network changes.
DeleteOptions * getDeleteOptions() const
get delete options
void startEditCustomShape(GNENetElement *element, const PositionVector &shape, bool fill)
start edit custom shape
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
long onCmdResetEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
GNEViewParent * myViewParent
view parent
virtual void openAdditionalDialog()
open Additional Dialog
FXMenuCheck * getMenuCheckShowGrid() const
get grid button
void paintGLGrid()
paints a grid
bool addRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, int index, GNEUndoList *undoList)
add restricted lane to edge
long onCmdRemoveRestrictedLaneGreenVerge(FXObject *, FXSelector, void *)
remove restricted lane for all vehicles
GNEPoly * polyToMove
the poly of which geometry is being moved
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
GNETAZFrame * getTAZFrame() const
get frame for GNE_MODE_TAZ
long onCmdResetJunctionShape(FXObject *, FXSelector, void *)
reset junction shape
GNEEdge * edgeToMove
the edge of which geometry is being moved
static const RGBColor BLUE
GNENetElement * getNetElementFront() const
get front net element (or a pointer to nullptr if there isn't)
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
double ymin() const
Returns minimum y-coordinate.
void show()
show prohibition frame
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Position getPositionInView() const
Return current position.
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
void openPolygon(bool allowUndo=true)
open polygon
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
double xmax() const
Returns maximum x-coordinate.
GUICompleteSchemeStorage gSchemeStorage
GNETAZ * getTAZ() const
get current TAZ
const std::vector< T > & getSchemes() const
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
long onCmdAddRestrictedLaneSidewalk(FXObject *, FXSelector, void *)
Add restricted lane for pedestrians.
long onCmdAddRestrictedLaneBikelane(FXObject *, FXSelector, void *)
Add restricted lane for bikes.
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
double scale
information about a lane's width (temporary, used for a single view)
Position getPositionInView() const
Returns position of additional in view.
ConnectionModifications * getConnectionModifications() const
get pointer to ConnectionModifications modul
bool selectEdges() const
whether inspection, selection and inversion should apply to edges or to lanes
GNEPOI * getPOIFront() const
get front POI (or a pointer to nullptr if there isn't)
void abortOperation(bool clearSelection=true)
abort current edition operation
void deleteSelectedJunctions()
delete all currently selected junctions
class used to group all variables related with key pressed after certain events
void abortDrawing()
abort drawing
whether a given shape is user-defined
bool setColorScheme(const std::string &name)
set color scheme
long onCmdSetModeAdditional(FXObject *, FXSelector, void *)
called when user press the button for additional mode
const RGBColor & getSelectedLaneColor() const
get selected lane color
FXMenuCheck * menuCheckShowBubbleOverJunction
show connection as buuble in "Move" mode.
static FXCursor * getCursor(GUICursor which)
returns a cursor previously defined in the enum GUICursor
bool restrictLane(SUMOVehicleClass vclass)
restrict lane
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
const KeyPressed & getKeyPressed() const
get Key Pressed modul
long onCmdDuplicateLane(FXObject *, FXSelector, void *)
duplicate selected lane
begin/end of the description of a junction
long onRightBtnPress(FXObject *, FXSelector, void *)
called when user press mouse's right button
begin/end of the description of a single lane
bool myAmInitialised
Internal information whether doInit() was called.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
static void drawTextBox(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &txtColor=RGBColor::BLACK, const RGBColor &bgColor=RGBColor::WHITE, const RGBColor &borderColor=RGBColor::BLACK, const double angle=0, const double relBorder=0.05, const double relMargin=0.5)
draw Text box with given parameters
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
GNEViewNet * myViewNet
pointer to viewNet
Mode for editing connection prohibits.
SelectingArea(GNEViewNet *viewNet)
default constructor
FXint myWindowCursorPositionY
void markAsCreateEdgeSource()
marks as first junction in createEdge-mode
GNEViewNet()
FOX needs this.
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
void processBoundarySelection(const Boundary &boundary)
Process boundary Selection.
MovedItems myMovedItems
variable use to save pointers to moved elements
The main window of the Netedit.
SetOperation getModificationMode() const
get current modification mode
bool selectEdges() const
check if select edges checkbox is enabled
long onCmdAddSelected(FXObject *, FXSelector, void *)
select AC under cursor
long onCmdToogleMoveElevation(FXObject *, FXSelector, void *)
toogle move elevation
SUMORTree * myGrid
The visualization speed-up.
long onCmdSetModeSelect(FXObject *, FXSelector, void *)
called when user press the button for select mode
GNETAZ * tazToMove
the TAZ element which their Shape is being moved (it's the only additional with a shape instead a pos...
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
void hotkeyFocusFrame()
handle focus frame keypress
static const RGBColor WHITE
AddShapeResult
enum with all possible values after try to create an shape using frame
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
void stopEditCustomShape()
edit edit shape
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
virtual long onMouseMove(FXObject *, FXSelector, void *)
void buildColorRainbow(const GUIVisualizationSettings &s, GUIColorScheme &scheme, int active, GUIGlObjectType objectType)
recalibrate color scheme according to the current value range
Locate addtional structure - button.
void show()
show delete frame
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
connectio between two lanes
Stores the information about how to visualize structures.
mode for connecting lanes
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
long onCmdToogleSelectEdges(FXObject *, FXSelector, void *)
toogle selet edges
const std::vector< GNEAttributeCarrier * > & getClickedAttributeCarriers() const
get vector with clicked ACs
MFXCheckableButton * myEditModeTAZ
chekable button for edit mode TAZ
long onCmdAddRestrictedLaneBuslane(FXObject *, FXSelector, void *)
Add restricted lane for buses.
const double SUMO_const_laneWidth
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
mode for inspecting object attributes
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn't)
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
interpolate z values linear between junctions
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
GUIMainWindow * myApp
The application.
MoveSingleElementValues myMoveSingleElementValues
variable used to save variables related with movement of single elements
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
std::vector< GNEShape * > myShapes
vector with the clicked shape elements (Poly and POIs)
Position selectionCorner1
firstcorner of the rectangle-selection
CreateEdgeOptions myCreateEdgeOptions
variable used to save all elements related to creation of Edges
GNEViewNet * myViewNet
pointer to viewNet
void setEditMode(EditMode mode)
set edit mode
static void resetTextures()
Reset textures.
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
MoveMultipleElementValues(GNEViewNet *viewNet)
constructor
void moveShapeStart(const Position &oldPos, const Position &offset)
move position of shape start without commiting change
smooth elevation with regard to adjoining edges
MFXCheckableButton * myEditModeSelect
chekable button for edit mode select
long onCmdOpenPolygon(FXObject *, FXSelector, void *)
open closed polygon
PositionVector getShape() const
Returns additional element's shape.
double x() const
Returns the x-position.
bool processClick(const Position &clickedPosition, GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
bool isShown() const
return true if modul is shown
void reverseEdge(GNEEdge *edge, GNEUndoList *undoList)
reverse edge
mode for editing additional
bool movingStartPos
bool to indicate that startPos are being moved
GNEAdditional * getAdditionalAtPopupPosition()
try to retrieve a additional at popup position
void smooth(GNEUndoList *undoList)
make geometry smooth
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
ObjectsUnderCursor myObjectsUnderCursor
variable use to save all pointers to objects under cursor after a click
static const RGBColor ORANGE
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
void updateObjectUnderCursor(const std::vector< GUIGlObject *> &GUIGlObjects, GNEPoly *editedPolyShape)
update objects under cursor (Called only in onLeftBtnPress(...) function)
long onCmdAddRestrictedLaneGreenVerge(FXObject *, FXSelector, void *)
Add restricted lane for all vehicles.
MFXCheckableButton * myEditModeMove
chekable button for edit mode move
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
bool isTLSSaved()
check if modifications in TLS was saved
transform lane to bikelane
void beginRectangleSelection()
begin rectangle selection
int movingIndexShape
index moved
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
MFXCheckableButton * myEditModeDelete
chekable button for edit mode delete
TAZCurrent * getTAZCurrentModul() const
get Current TAZ modul
A NBNetBuilder extended by visualisation and editing capabilities.
bool myTestingEnabled
flag to enable or disable testing mode
GNEEdge * createEdge(GNEJunction *src, GNEJunction *dest, GNEEdge *tpl, GNEUndoList *undoList, const std::string &suggestedName="", bool wasSplit=false, bool allowDuplicateGeom=false, bool recomputeConnections=true)
creates a new edge (unless an edge with the same geometry already exists)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getShape() const
Returns whether the shape of the polygon.
PositionVector shape
The crossing's shape.
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
GUIGlID getGlIDFront() const
get front GUI GL ID (or a pointer to nullptr if there isn't)
int editMode
the current NETEDIT mode (temporary)
bool stopConsecutiveLaneSelector()
stop selection of consecutive lanes
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
long onCmdStraightenEdgesElevation(FXObject *, FXSelector, void *)
interpolate z values linear between junctions
void setEditModeFromHotkey(FXushort selid)
sets edit mode (from hotkey)
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when user press a key
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a Point of interest
void moveShapeEnd(const Position &oldPos, const Position &offset)
move position of shape end without commiting change
long onCmdRemoveRestrictedLaneBikelane(FXObject *, FXSelector, void *)
remove restricted lane for bikes
long onCmdRestrictLaneGreenVerge(FXObject *, FXSelector, void *)
restrict lane to all vehicles
void processEdgeSelection(const std::vector< GNEEdge *> &edges)
process selection of edges in view net
CreateEdgeOptions(GNEViewNet *viewNet)
default constructor
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
long onCmdEditConnectionShape(FXObject *, FXSelector, void *)
edit connection shape
GNEProhibitionFrame * getProhibitionFrame() const
get frame for GNE_MODE_PROHIBITION
static const RGBColor BLACK
const std::string & getID() const
Returns the id.
double getHeight() const
Returns the image height of the POI.
void update(void *eventData)
update status of KeyPressed
GNEPoly * getPolyFront() const
get front Poly (or a pointer to nullptr if there isn't)
Remove from selected items - Menu Etry.
MFXCheckableButton * myEditModeProhibition
checkable button for edit mode polygon
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
void commitShapeStartChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape start
long onCmdRemoveSelected(FXObject *, FXSelector, void *)
unselect AC under cursor
void startGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
long onCmdResetConnections(FXObject *, FXSelector, void *)
reset junction connections
const std::vector< std::pair< GNELane *, double > > & getSelectedLanes() const
get current selected lanes
void updateControls()
update control contents after undo/redo or recompute
EditMode myPreviousEditMode
the previous edit mode before edit junction's shapes
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers()
get all selected attribute carriers
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Transform POI to POILane, and viceversa.
void processRectangleSelection()
process rectangle Selection
std::vector< GNETAZ * > myTAZs
vector with the clicked TAZ elements (needed because uses a shape instead a position) ...
Position originalPositionInView
original position of geometry position (needed for commmit position changes)
turn junction into geometry node
void deleteSelectedShapes()
delete all currently selected shapes
#define UNUSED_PARAMETER(x)
show junctions as bubbles
GNEAdditional * additionalToMove
the additional element which position is being moved
FXEvent * myEventInfo
information of event
GNEPolygonFrame * getPolygonFrame() const
get frame for GNE_MODE_POLYGON
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint ...
A class that stores a 2D geometrical boundary.
void handleLaneClick(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
either sets the current lane or toggles the connection of the
virtual void selectAttributeCarrier(bool changeFlag=true)=0
bool isChangesPending() const
return true if there is changes to save
void closePolygon(bool allowUndo=true)
close polygon
GUIGlObjectType getGlTypeFront() const
get front GUI GL object type (or a pointer to nullptr if there isn't)
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
#define WRITE_WARNING(msg)
A single child window which contains a view of the simulation area.
bool mergeJunctions(GNEJunction *moved, const Position &oldPos)
try to merge moved junction with another junction in that spot return true if merging did take place ...
GNEViewNet * myViewNet
pointer to viewNet
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_MODE_TLS
static OptionsCont & getOptions()
Retrieves the options.
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
double p2m(double pixel) const
pixels-to-meters conversion method
GNEJunction * createEdgeSource
source junction for new edge 0 if no edge source is selected an existing (or newly created) junction ...
std::map< const GUIGlObject *, int > myAdditionallyDrawn
List of objects for which GUIGlObject::drawGLAdditional is called.
bool changeAllPhases() const
change all phases
bool restrictLane(SUMOVehicleClass vclass, GNELane *lane, GNEUndoList *undoList)
transform lane to restricted lane
long onCmdSetModeCrossing(FXObject *, FXSelector, void *)
called when user press the button for crossing mode
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
const std::vector< GNEAttributeCarrier * > & getInspectedACs() const
get current list of inspected ACs
void hideViewOptionsMenuChecks()
hide all options menu checks
SelectingArea mySelectingArea
variable used to save variables related with selecting areas
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
std::map< GNEJunction *, Position > myMovedJunctionOriginPositions
container used for move junctions
long onCmdSetModeTAZ(FXObject *, FXSelector, void *)
called when user press the button for TAZ mode
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
void hideCreateEdgeOptionMenuChecks()
hide all MenuChecks
void setCreatedJunction(GNEJunction *junction)
set created junction
void buildEditModeControls()
adds controls for setting the edit mode
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
GNEUndoList * getUndoList() const
get the undoList object
int getIndex() const
returns the index of the lane
long onLeftBtnPress(FXObject *, FXSelector, void *)
long onRightBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's right button
long onCmdSimplifyShape(FXObject *, FXSelector, void *)
simply shape of current polygon
bool isPolygonBlocked() const
return true if polygon is blocked
static const RGBColor GREEN
mode for editing connection prohibitions
void computeNodeShape(double mismatchThreshold)
Compute the junction shape for this node.
void moveSelection()
move selection
bool getShapeRelativePath() const
Returns the relativePath of the Shape.
Locate polygons - button.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
std::vector< GNEAttributeCarrier * > myAttributeCarriers
vector with the clicked attribute carriers
bool showLockIcon() const
check if lock icon should be visible
FXMenuCheck * menuCheckExtendSelection
menu check to extend to edge nodes
virtual long onPaint(FXObject *, FXSelector, void *)
GNEAdditionalFrame::SelectorLaneParents * getConsecutiveLaneSelector() const
getConsecutive Lane Selector
int addColor(const T &color, const double threshold, const std::string &name="")
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
bool addAdditional(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
add additional element
std::string name
The name of this setting.
bool hasCommandGroup() const
Check if undoList has command group.
void stopDrawing()
stop drawing and check if shape can be created
void splitJunction(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint ...
void startDrawing()
start drawing
void deleteSelectedConnections()
delete all currently selected connections
bool removeRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
remove restricted lane
mode for inspecting object attributes
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
virtual void setStatusBarText(const std::string &)
void deleteSelectedCrossings()
delete all currently selected crossings
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GNEPoly * addPolygonForEditShapes(GNENetElement *netElement, const PositionVector &shape, bool fill, RGBColor col)
Builds a special polygon used for edit Junctions's shapes.
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button.
DrawingShape * getDrawingShapeModul() const
get drawing mode modul
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEEdge & getParentEdge()
Returns underlying parent edge.
void processClick(void *eventData)
Auxiliar function used by onLeftBtnPress(...)
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
void sortGUIGlObjectsByAltitude(const std::vector< GUIGlObject *> &GUIGlObjects)
invert GUIGlObjects
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
long onCmdRemoveRestrictedLaneSidewalk(FXObject *, FXSelector, void *)
remove restricted lane for pedestrians
bool clickedOverShapeStart(const Position &pos)
void commitShapeEndChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape end
ViewOptions myViewOptions
variable used to save variables related with view options
transform lane to busLane
long onCmdSetModeMove(FXObject *, FXSelector, void *)
called when user press the button for move mode
FXMenuCheck * menuCheckShowConnections
menu check to show connections
bool showConnections() const
check if select show connections checkbox is enabled
A point in 2D or 3D with translation and scaling methods.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
GNEPOI * getPOIAtPopupPosition()
try to retrieve a POILane at popup position
long onCmdReplaceJunction(FXObject *, FXSelector, void *)
replace node by geometry
long onCmdClearConnections(FXObject *, FXSelector, void *)
clear junction connections
long onCmdRestrictLaneBuslane(FXObject *, FXSelector, void *)
restrict lane to buslanes
FXToolBar * myToolbar
a reference to the toolbar in myParent
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)=0
Returns an own popup-menu.
FXComboBox & getColoringSchemesCombo()
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
long onCmdToogleShowConnection(FXObject *, FXSelector, void *)
toogle show connections
KeyPressed myKeyPressed
variable used to save key status after certain events
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
void drawTemporalDrawShape() const
draw temporal polygon shape in Polygon Mode
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
MFXCheckableButton * myEditModeCreateEdge
GNEEdge * getOppositeEdge() const
get opposite edge
FXMenuCheck * menuCheckShowGrid
show grid button
DrawingShape * getDrawingShapeModul() const
get drawing mode editor
bool isMovementBlocked() const
return true if movement is blocked
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
const RGBColor & getShapeColor() const
Returns the color of the Shape.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
virtual bool isAttributeCarrierSelected() const =0
check if attribute carrier is selected
GNEViewNet * myViewNet
pointer to viewNet
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
registers completed movement with the undoList
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
long onCmdSaveChanges(FXObject *, FXSelector, void *)
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
RGBColor selectionColor
NETEDIT special colors.
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
long onCmdCancelModifications(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
bool removeRestrictedLane(SUMOVehicleClass vclass)
remove restricted lane
void setDottedAC(const GNEAttributeCarrier *AC)
set attributeCarrier under cursor
long onCmdSplitEdgeBidi(FXObject *, FXSelector, void *)
split edge at cursor position
bool autoSelectNodes()
whether to autoselect nodes or to lanes
long onCmdSetModeProhibition(FXObject *, FXSelector, void *)
called when user press the button for polygon mode
static const RGBColor MAGENTA
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
bool startDrawing
whether we have started rectangle-selection
double xmin() const
Returns minimum x-coordinate.
MFXCheckableButton * myEditModeTrafficLight
chekable button for edit mode traffic light
bool controlKeyPressed() const
check if CONTROL key was pressed during click
void initGNEConnections()
initialize GNEConnections
virtual bool onRightBtnRelease(void *data)
called when user releases right button
turn junction into multiple junctions
FXMenuCheck * chainCreateEdge
whether the endpoint for a created edge should be set as the new source
mode for selecting objects
MFXCheckableButton * myEditModeAdditional
chekable button for edit mode additional
void updateCursor()
update cursor after every click/key press/release
void startGeometryMoving()
edge: the shape in xml-definition
const PositionVector & getTemporalShape() const
get Temporal shape
std::vector< GNEEdge * > myEdges
vector with the clicked edges
void createCrossingHotkey()
create crossing (used when user press ENTER key in Crossing mode)
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
Boundary & grow(double by)
extends the boundary by the given amount
bool processClick(const Position &clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
GUIColorer junctionColorer
The junction colorer.
bool myMovingSelection
flag to check if a selection is being moved
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
TestingMode(GNEViewNet *viewNet)
default constructor
mode for creating polygons
const std::string getID() const
function to support debugging
void unMarkAsCreateEdgeSource()
removes mark as first junction in createEdge-mode
move elevation instead of x,y
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Position screenPos2NetPos(int x, int y) const
Translate screen position to network position.
void moveRectangleSelection()
move rectangle selection
void focusUpperElement()
focus upper element of frame
bool clickedOverShapeEnd(const Position &pos)
return true if user clicked over ShapeEnd
long onCmdEditEdgeEndpoint(FXObject *, FXSelector, void *)
change geometry endpoint
GNEJunction * createJunction(const Position &pos, GNEUndoList *undoList)
creates a new junction
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
FXMenuCheck * menuCheckWarnAboutMerge
whether we should warn about merging junctions
GNEJunction * getGNEJunctionSource() const
returns the source-junction
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any prohibition modifications.
void p_abort()
reverts and discards ALL active command groups
std::vector< GNELane * > myLanes
vector with the clicked lanes
GUIPerspectiveChanger * myChanger
The perspective changer.
GNECrossing * getCrossingFront() const
get front crossing (or a pointer to nullptr if there isn't)
long onCmdResetLaneCustomShape(FXObject *, FXSelector, void *)
reset custom shapes of selected lanes
void buildCreateEdgeOptionMenuChecks()
build menu checks
bool myUseToolTips
use tool tips
GNEConnection * getConnectionAtPopupPosition()
try to retrieve a connection at popup position
virtual void onLeftBtnPress(void *data)
mouse functions
mode for editing crossing
Position relativeClickedPosition
relative position of Clicked Position regarding to originalGeometryPointPosition (Used when user does...
GUIGLObjectPopupMenu * myPopup
The current popup-menu.
std::vector< GNEJunction * > myJunctions
vector with the clicked junctions
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
void finishMoveSelection()
finish moving selection
MoveSingleElementValues(GNEViewNet *viewNet)
constructor
double getShapeLayer() const
Returns the layer of the Shape.
std::vector< GNEEdge * > processEdgeRectangleSelection()
process rectangle Selection (only limited to Edges)
void destroyPopup()
destoys the popup
double getWidth() const
Returns the image width of the POI.
void doInit()
called after some features are already initialized
begin/end of the description of an edge
FXint myWindowCursorPositionX
Position of the cursor relative to the window.
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn't)
struct used to group all variables related with movement of single elements
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool overlappedInspectionShown() const
check if overlappedInspection modul is shown
void setSelectionScaling(double selectionScale)
set selection scaling
EditMode getCurrentEditMode() const
get the current edit mode
const PositionVector & getShape() const
retrieve the junction shape
MFXCheckableButton * myEditModeInspect
chekable button for edit mode inspect
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
const PositionVector & getGeometry() const
Returns the geometry of the edge.
bool isDrawing() const
return true if currently a shape is drawed
void finishRectangleSelection()
finish rectangle selection
transform lane to sidewalk
void replaceJunctionByGeometry(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by geometry node(s) and merge the edges
A road/street connecting two junctions (netedit-version)
void duplicateLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
duplicates lane
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when user release a key
FXbool makeCurrent()
A reimplementation due to some internal reasons.
std::vector< GNEPOI * > myPOIs
vector with the clicked POIs
long onCmdRemoveRestrictedLaneBuslane(FXObject *, FXSelector, void *)
remove restricted lane for bus
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
reserved GLO type to pack all additionals
Connection getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection This method goes through "myConnections" and returns the specified o...
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
GNEJunction * getJunctionAtPopupPosition()
try to retrieve a junction at popup position
ModificationMode * getModificationModeModul() const
get modification mode modul
change default geometry endpoints
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
long onCmdSmoothEdgesElevation(FXObject *, FXSelector, void *)
smooth elevation with regard to adjoining edges
GNECrossing * retrieveCrossing(const std::string &id, bool failHard=true) const
get Crossing by id
static const RGBColor YELLOW
PositionVector originalShapeBeforeMoving
original shape of element before start moving (used by polygons, edges, etc., needed for commmit posi...
bool checkSavedPosition(const Position &clickedPosition) const
check if given position is near to saved position
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
Mode for editing Polygons.
static const RGBColor RED
named colors
const PositionVector & getShape() const
returns the shape of the lane
reset junction's connections
long onCmdSaveModifications(FXObject *, FXSelector, void *)
Called when the user presses the OK-Button saves any connection modifications.
double selectionScale
the current selection scaling in NETEDIT (temporary)
double m2p(double meter) const
meter-to-pixels conversion method
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
#define GUIDesignButtonToolbarCheckable
little checkable button with icon placed in navigation toolbar
virtual void show()
show Frame
static const RGBColor CYAN
Set a vertex of polygon as first verte.
GUIGlObject * getNetObject() const
Returns the network object.
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
bool addSelectedLane(GNELane *lane, const Position &clickedPosition)
return true if lane can be selected as consecutive lane
void handleProhibitionClick(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
handle prohibitions and set the relative colouring
GUIVisualizationSettings * myVisualizationSettings
visualization settings
Position calculateOffsetMovement() const
calculate offset movement
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
MoveMultipleElementValues myMoveMultipleElementValues
variable used to save variables related with movement of multiple elements
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
void calculateEdgeValues()
calculate Edge movement values (Position, Index, etc.)
PositionVector customShape
optional customShape for this crossing
Position myPopupPosition
The current popup-menu position.
bool selectingUsingRectangle
whether we have started rectangle-selection
GNEViewNet * myViewNet
pointer to viewNet
An Element which don't belongs to GNENet but has influency in the simulation.
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
GNEConnectorFrame * getConnectorFrame() const
get frame for GNE_MODE_CONNECT
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
bool editingElevation() const
return true if elevation is being edited
MFXCheckableButton * myEditModeConnection
chekable button for edit mode connection
bool showConnections()
show connections over junctions
GNEViewNet * myViewNet
pointer to viewNet
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
virtual void commitGeometryMoving(GNEUndoList *undoList)=0
commit geometry changes in the attributes of an element after use of moveGeometry(...)
const std::string & getTagStr() const
get tag assigned to this object in string format
long onCmdOK(FXObject *, FXSelector, void *)
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
simplify polygon geometry
GNEPOI * poiToMove
the poi which position is being moved
long onCmdSetModeTLS(FXObject *, FXSelector, void *)
called when user press the button for traffic lights mode
void drawTestingElements(GUIMainWindow *mainWindow)
draw testing element
FXMenuCheck * menuCheckChangeAllPhases
menu check to set change all phases
void drawRectangleSelection(const RGBColor &color) const
draw rectangle selection
int doPaintGL(int mode, const Boundary &bound)
do paintGL
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
A storage for options typed value containers)
TemplateEditor * getTemplateEditor() const
get template editor
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
open additional dialog
GNENetElement * getShapeEditedElement() const
retrieve the junction of which the shape is being edited
GNEJunction * junctionToMove
the Junction to be moved.
TAZSaveChanges * getTAZSaveChangesModul() const
get TAZ Save Changes modul
open additional dialog (used in netedit)
std::vector< GNEPoly * > myPolys
vector with the clicked Polys
reset default geometry endpoints
GNECrossingFrame * getCrossingFrame() const
get frame for GNE_MODE_CROSSING
void computeEverything(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string shapePath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
void deleteSelectedAdditionals()
delete all currently selected additionals
void clearJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
clear junction's connections
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
crossing between edges for pedestrians
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
std::map< GNEEdge *, PositionVector > myMovedEdgesOriginShape
container used for move entire edges
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
void initTestingMode()
init testing mode
GNECrossing * getCrossingAtPopupPosition()
try to retrieve a crossing at popup position
bool showGrid
Information whether a grid shall be shown.
long onCmdSmoothEdges(FXObject *, FXSelector, void *)
smooth geometry
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier (or a pointer to nullptr if there isn't)
void drawDecals()
Draws the stored decals.
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
void show()
show inspector frame
GNENet * getNet() const
get the net object
std::vector< GNENetElement * > myNetElements
vector with the clicked net elements
Position selectionCorner2
second corner of the rectangle-selection
std::vector< GNEAdditional * > myAdditionals
vector with the clicked additional elements
std::vector< GUIGlObject * > myGUIGlObjects
vector with the clicked GUIGlObjects
const Position & getPosition() const
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(...)
void updateModeSpecificControls()
updates mode specific controls
GUIGlID getGlID() const
Returns the numerical id of the object.
FXMenuCheck * menuCheckMoveElevation
apply movement to elevation
MFXCheckableButton * myEditModeCrossing
chekable button for edit mode crossing
long onCmdEditCrossingShape(FXObject *, FXSelector, void *)
edit crossing shape
void removeAttributeCarrier(GNEAttributeCarrier *ac, bool ignoreOptions=false)
remove attribute carrier (element)
FXMenuCheck * menuCheckHideConnections
menu check to hide connections in connect mode
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
void setStatusBarText(const std::string &text)
set staturBar text
bool isSelectingLanes() const
return true if modul is selecting lane
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
void beginMoveSelection(GNEAttributeCarrier *originAC)
begin move selection
void calculateTAZValues()
calculate TAZ movement values (Position, Index, etc.)
void swapLane2Edge()
swap lane to edge
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void buildViewOptionsMenuChecks()
build menu checks
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
void hideAllFrames()
hide all frames
long onCmdSetModeConnect(FXObject *, FXSelector, void *)
called when user press the button for connect mode
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Mode for editing additionals.
void startConsecutiveLaneSelector(GNELane *lane, const Position &clickedPosition)
start selection of consecutive lanes
void processShapeSelection(const PositionVector &shape)
process shape selection
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
int myTestingWidth
Width of viewNet in testing mode.
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
virtual void unselectAttributeCarrier(bool changeFlag=true)=0
unselect attribute carrier using GUIGlobalSelection
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
virtual void moveGeometry(const Position &offset)=0
change the position of the element geometry without saving in undoList
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
const GNEAttributeCarrier * myDottedAC
current AttributeCarrier that is drawn using with a dotted contour note: it's constant because is edi...
FXMenuCheck * autoCreateOppositeEdge
create auto create opposite edge
long onCmdSetModePolygon(FXObject *, FXSelector, void *)
called when user press the button for polygon mode
Mode for editing crossing.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
GNEShape * getShapeFront() const
get front shape element (or a pointer to nullptr if there isn't)
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn't)
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
long onCmdSetModeInspect(FXObject *, FXSelector, void *)
called when user press the button for inspect mode
mode for connecting lanes
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
mode for creating new edges
bool getDeleteLastCreatedPoint()
get flag delete last created point
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
bool isShapeBlocked() const
return true if Shape TAZ is blocked
Position myClickedPosition
original clicked position when moveSelection is called (used for calculate offset during moveSelectio...
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
NBEdge * getNBEdge()
returns the internal NBEdge
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn't)
long onCmdSetFirstGeometryPoint(FXObject *, FXSelector, void *)
set as first geometry point the closes geometry point
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor()
returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects) ...
std::vector< GNECrossing * > myCrossings
vector with the clicked crossings
Add to selected items - menu entry.
mode for selecting objects
const PositionVector & getShape() const
get Position vector calculated in updateGeometry(bool updateGrid)
GUIGlID getObjectUnderCursor()
returns the id of the front object under the cursor using GL_SELECT
GNELane * getLaneAtPopupPosition()
try to retrieve a lane at popup position
long onCmdToogleShowBubbles(FXObject *, FXSelector, void *)
toogle show bubbles
void mergeJunctions(GNEJunction *moved, GNEJunction *target, GNEUndoList *undoList)
merge the given junctions edges between the given junctions will be deleted
void endGeometryMoving()
begin movement (used when user click over additional to start a movement, to avoid problems with prob...
int myTestingHeight
Height of viewNet in testing mode.
void drawLaneCandidates() const
draw functions
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
double ymax() const
Returns maximum y-coordinate.
long onCmdTransformPOI(FXObject *, FXSelector, void *)
Transform POI to POILane, and viceversa.
void hotkeyDel()
handle del keypress
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
GNEPoly * myEditShapePoly
bool isMovingSelection() const
check if currently there is element being moved
std::vector< GNEConnection * > myConnections
vector with the clicked connections
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void closePolygon()
ensures that the last position equals the first
NBNode * getNBNode() const
Return net build node.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
C++ TraCI client API implementation.
TestingMode myTestingMode
variable used to save variables related with testing mode
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
std::map< GNEEdge *, MoveSingleElementValues * > myMovedEgdesGeometryPoints
container used for move GeometryPoints of edges
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
void hotkeyEnter()
handle enter keypress
void startGeometryMoving()
long onCmdRestrictLaneBikelane(FXObject *, FXSelector, void *)
restrict lane to bikes
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
void deleteSelectedLanes()
delete all currently selected lanes
long onCmdEditJunctionShape(FXObject *, FXSelector, void *)
edit junction shape
void calculatePolyValues()
calculate Poly movement values (Position, Index, etc.)
void changeFirstGeometryPoint(int oldIndex, bool allowUndo=true)
change first geometry point
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
long onLeftBtnRelease(FXObject *, FXSelector, void *)
called when user releases mouse's left button
Position getSplitPos(const Position &clickPos)
void abortConsecutiveLaneSelector()
abort selection of consecutive lanes
vehicles ignoring classes
void splitEdgesBidi(GNEEdge *edge, GNEEdge *oppositeEdge, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
void requireRecompute()
inform the net about the need for recomputation
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
long onCmdShowGrid(FXObject *, FXSelector, void *)
toogle show grid
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
long onCmdSetModeCreateEdge(FXObject *, FXSelector, void *)
transform lane to greenVerge
long onCmdSetModeDelete(FXObject *, FXSelector, void *)
called when user press the button for delete mode
void deleteSelectedEdges()
delete all currently selected edges
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
clear junction's connections
GNEUndoList * myUndoList
a reference to the undolist maintained in the application
EditMode myEditMode
the current edit mode
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
bool addRestrictedLane(SUMOVehicleClass vclass)
add restricted lane
MFXCheckableButton * myEditModePolygon
chekable button for edit mode polygon
FXMenuCheck * menuCheckSelectEdges
menu check to select only edges
reserved GLO type to pack all netElements
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
FXPopup * getLocatorPopup()
void endGeometryMoving(bool extendToNeighbors=true)
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
const Position & getPopupPosition() const
get position of current popup
ViewOptions(GNEViewNet *viewNet)
default constructor
GNEFrame * myCurrentFrame
the current frame
void addCrossing(const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
add Crossing element
void setz(double z)
set position z
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
long onCmdRestrictLaneSidewalk(FXObject *, FXSelector, void *)
restrict lane to pedestrians
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
virtual Position getPositionInView() const =0
Returns position of additional in view.