152 FXGLVisual* glVis, FXGLCanvas* share, FXToolBar* toolBar) :
153 GUISUMOAbstractView(tmpParent, app, viewParent, net->getVisualisationSpeedUp(), glVis, share),
154 myViewParent(viewParent),
158 myShowConnections(false),
160 myCreateEdgeSource(0),
161 myMovingSelection(false),
163 myEditModeCreateEdge(0),
166 myEditModeInspect(0),
168 myEditModeConnection(0),
169 myEditModeTrafficLight(0),
170 myEditModeAdditional(0),
171 myEditModeCrossing(0),
172 myEditModePolygon(0),
173 myEditModeProhibition(0),
175 myUndoList(undoList),
178 reparent(actualParent);
180 buildEditModeControls();
182 myNet->setViewNet(
this);
191 if (windowSize.size() == 2 && GNEAttributeCarrier::canParse<int>(windowSize[0]) && GNEAttributeCarrier::canParse<int>(windowSize[1])) {
192 myTestingMode.testingWidth = GNEAttributeCarrier::parse<int>(windowSize[0]);
193 myTestingMode.testingHeight = GNEAttributeCarrier::parse<int>(windowSize[1]);
195 WRITE_ERROR(
"Invalid windows size-format: " +
toString(windowSize) +
"for option 'window-size'");
222 "\tLocate Junction\tLocate a junction within the network.",
224 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
227 "\tLocate Street\tLocate a street within the network.",
229 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
232 "\tLocate TLS\tLocate a tls within the network.",
234 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
237 "\tLocate Additional\tLocate an additional structure within the network.",
239 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
242 "\tLocate PoI\tLocate a PoI within the network.",
244 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
247 "\tLocate Polygon\tLocate a Polygon within the network.",
249 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
272 double minValue = std::numeric_limits<double>::infinity();
273 double maxValue = -std::numeric_limits<double>::infinity();
279 }
else if (active == 11) {
283 const double val = lane->getColorValue(active);
284 minValue =
MIN2(minValue, val);
285 maxValue =
MAX2(maxValue, val);
290 minValue =
MIN2(minValue, junction->getPositionInView().z());
291 maxValue =
MAX2(maxValue, junction->getPositionInView().z());
295 if (minValue != std::numeric_limits<double>::infinity()) {
298 double range = maxValue - minValue;
362 if ((
myEditShapePoly ==
nullptr) && (element !=
nullptr) && (shape.size() > 1)) {
398 for (
auto i : selectedJunctions) {
404 for (
auto i : selectedEdges) {
413 for (
auto i : selectedEdges) {
418 std::vector<GNEEdge*> noJunctionsSelected;
419 std::vector<GNEEdge*> originJunctionSelected;
420 std::vector<GNEEdge*> destinyJunctionSelected;
422 for (
auto i : selectedEdges) {
426 if (!originSelected && !destinySelected) {
427 noJunctionsSelected.push_back(i);
428 }
else if (originSelected && !destinySelected) {
429 originJunctionSelected.push_back(i);
430 }
else if (!originSelected && destinySelected) {
431 destinyJunctionSelected.push_back(i);
432 }
else if (!originSelected && !destinySelected) {
437 for (
auto i : noJunctionsSelected) {
447 for (
auto i : noJunctionsSelected) {
448 if (i != clickedEdge) {
449 int index = i->getVertexIndex(originPositionOnClicked);
465 i.first->moveGeometry(i.second, offset);
470 i.first->moveEntireShape(i.second, offset);
475 i.first->moveVertexShape(i.second.index, i.second.originalPosition, offset);
485 i.first->commitGeometryMoving(i.second,
myUndoList);
487 myOriginPositionOfMovedJunctions.clear();
491 i.first->commitShapeChange(i.second,
myUndoList);
493 myOriginShapesMovedEntireShapes.clear();
497 i.first->commitShapeChange(i.second.originalShape,
myUndoList);
499 myOriginShapesMovedPartialShapes.clear();
512 glMatrixMode(GL_MODELVIEW);
514 glDisable(GL_TEXTURE_2D);
515 glDisable(GL_ALPHA_TEST);
517 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
518 glEnable(GL_DEPTH_TEST);
523 glTranslated(0, 0,
GLO_MAX - 1);
526 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
560 const double size =
p2m(32);
563 glTranslated(center.
x(), center.
y(),
GLO_MAX - 1);
564 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
567 glVertex2d(0, -size);
568 glVertex2d(size, -size);
589 if (temporalDrawingShape.size() > 0) {
599 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
600 const float minB[2] = { (float)bound.
xmin(), (float)bound.
ymin() };
601 const float maxB[2] = { (float)bound.
xmax(), (float)bound.
ymax() };
603 glEnable(GL_POLYGON_OFFSET_FILL);
604 glEnable(GL_POLYGON_OFFSET_LINE);
620 FXEvent* evt = (FXEvent*) eventData;
657 std::cout <<
"edge created without an open CommandGroup )-:\n";
948 bool shiftKeyPressed = ((FXEvent*)eventData)->state & SHIFTMASK;
992 offsetMovement =
Position(0, 0, dist / 10);
997 offsetMovement =
Position(0, 0, (offsetMovement.
y() + offsetMovement.
x()) / 10);
1066 if (clearSelection) {
1184 throw ProcessError(
"invalid edit mode called by hotkey");
1313 edge = &(((
GNELane*)pointed)->getParentEdge());
1343 std::set<GNEEdge*> result;
1346 for (
auto it : ids) {
1352 result.insert((
GNEEdge*)pointed);
1355 result.insert(&(((
GNELane*)pointed)->getParentEdge()));
1388 return dynamic_cast<GNEPoly*
>(pointed);
1402 return dynamic_cast<GNEPOI*
>(pointed);
1497 if (edges.size() != 0) {
1551 for (
auto it : edges) {
1572 for (
auto it : edges) {
1593 for (
auto it : edges) {
1614 for (
auto it : edges) {
1635 if (polygonUnderMouse) {
1650 if (polygonUnderMouse) {
1665 if (polygonUnderMouse) {
1680 if (polygonUnderMouse) {
1695 if (polygonUnderMouse) {
1712 std::vector<GNELane*> lanes;
1713 for (
auto i : GLIDs) {
1716 lanes.push_back(lane);
1719 if (lanes.empty()) {
1723 GNELane* nearestLane = lanes.front();
1726 for (
auto i : lanes) {
1727 double posOverLane = i->getShape().nearest_offset_to_point2D(POI->
getPositionInView());
1728 double lateralOffset = i->getShape().positionAtOffset(posOverLane).distanceTo(POI->
getPositionInView());
1729 if (lateralOffset < minorLateralOffset) {
1730 minorPosOverLane = posOverLane;
1731 minorLateralOffset = lateralOffset;
1736 std::string
id = POI->
getID();
1750 myNet->
addPOI(
id, type, color, pos,
false, nearestLane->
getID(), minorPosOverLane, 0, layer, angle, imgFile, relativePath, POIWidth, POIHeight);
1755 std::string
id = POI->
getID();
1769 myNet->
addPOI(
id, type, color, pos,
false,
"", 0, 0, layer, angle, imgFile, relativePath, POIWidth, POIWeight);
1788 for (
auto it : lanes) {
1875 std::map<GNEEdge*, GNELane*> mapOfEdgesAndLanes;
1877 for (
auto i : lanes) {
1881 if (mapOfEdgesAndLanes.size() != lanes.size()) {
1882 FXMessageBox::information(getApp(), MBOX_OK,
1883 "Multiple lane in the same edge selected",
"%s",
1884 (
"There are selected lanes that belong to the same edge.\n Only one lane per edge will be restricted for " +
toString(vclass) +
".").c_str());
1887 if (mapOfEdgesAndLanes.size() > 0) {
1891 for (
auto i : mapOfEdgesAndLanes) {
1892 if (i.first->hasRestrictedLane(vclass)) {
1897 if (counter == (
int)mapOfEdgesAndLanes.size()) {
1898 FXMessageBox::information(getApp(), MBOX_OK,
1899 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1900 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1903 WRITE_DEBUG(
"Opening FXMessageBox 'restrict lanes'");
1905 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1906 (
"Set vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1907 (
toString(mapOfEdgesAndLanes.size() - counter) +
" lanes will be restricted for " +
toString(vclass) +
". continue?").c_str());
1911 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'No'");
1912 }
else if (answer == 4) {
1913 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
1918 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
1924 for (std::map<GNEEdge*, GNELane*>::iterator i = mapOfEdgesAndLanes.begin(); i != mapOfEdgesAndLanes.end(); i++) {
1952 std::set<GNEEdge*> setOfEdges;
1954 for (
auto i : edges) {
1955 setOfEdges.insert(i);
1958 for (
auto it : lanes) {
1963 if (setOfEdges.size() > 0) {
1967 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
1969 if ((*it)->hasRestrictedLane(vclass)) {
1974 if (counter == (
int)setOfEdges.size()) {
1975 FXMessageBox::information(getApp(), MBOX_OK,
1976 (
"Add vclass for" +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1977 (
"All lanes own already another lane in the same edge with a restriction for " +
toString(vclass)).c_str());
1980 WRITE_DEBUG(
"Opening FXMessageBox 'restrict lanes'");
1982 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
1983 (
"Add vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
1984 (
toString(setOfEdges.size() - counter) +
" restrictions for " +
toString(vclass) +
" will be added. continue?").c_str());
1988 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'No'");
1989 }
else if (answer == 4) {
1990 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
1995 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
2001 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2029 std::set<GNEEdge*> setOfEdges;
2031 for (
auto i : edges) {
2032 setOfEdges.insert(i);
2035 for (
auto it : lanes) {
2040 if (setOfEdges.size() > 0) {
2044 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2046 if ((*it)->hasRestrictedLane(vclass)) {
2052 FXMessageBox::information(getApp(), MBOX_OK,
2053 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2054 (
"Selected lanes and edges haven't a restriction for " +
toString(vclass)).c_str());
2057 WRITE_DEBUG(
"Opening FXMessageBox 'restrict lanes'");
2059 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
2060 (
"Remove vclass for " +
toString(vclass) +
" to selected lanes").c_str(),
"%s",
2061 (
toString(counter) +
" restrictions for " +
toString(vclass) +
" will be removed. continue?").c_str());
2065 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'No'");
2066 }
else if (answer == 4) {
2067 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'ESC'");
2072 WRITE_DEBUG(
"Closed FXMessageBox 'restrict lanes' with 'Yes'");
2078 for (std::set<GNEEdge*>::iterator it = setOfEdges.begin(); it != setOfEdges.end(); it++) {
2105 if (e->click_count == 2) {
2106 handle(
this, FXSEL(SEL_DOUBLECLICKED, 0), eventData);
2139 if (junction != 0) {
2153 if (junction != 0) {
2167 if (junction != 0) {
2172 for (
auto i : selectedJunction) {
2191 if (junction != 0) {
2196 for (
auto i : selectedJunction) {
2380 "Hide connections\t\tHide connections",
this, 0);
2537 if (junctions.size() > 0) {
2538 std::string plural = junctions.size() == 1 ? (
"") : (
"s");
2540 for (
auto i : junctions) {
2551 if (lanes.size() > 0) {
2552 std::string plural = lanes.size() == 1 ? (
"") : (
"s");
2554 for (
auto i : lanes) {
2566 if (edges.size() > 0) {
2567 std::string plural = edges.size() == 1 ? (
"") : (
"s");
2569 for (
auto i : edges) {
2581 if (additionals.size() > 0) {
2582 std::string plural = additionals.size() == 1 ? (
"") : (
"s");
2584 for (
auto i : additionals) {
2600 std::vector<GNECrossing*> crossings;
2601 for (
auto i : junctions) {
2602 for (
auto j : i->getGNECrossings()) {
2603 if (j->isAttributeCarrierSelected()) {
2604 crossings.push_back(j);
2609 if (crossings.size() > 0) {
2610 std::string plural = crossings.size() == 1 ? (
"") : (
"s");
2612 for (
auto i : crossings) {
2626 std::vector<GNEConnection*> connections;
2627 for (
auto i : edges) {
2628 for (
auto j : i->getGNEConnections()) {
2629 if (j->isAttributeCarrierSelected()) {
2630 connections.push_back(j);
2635 if (connections.size() > 0) {
2636 std::string plural = connections.size() == 1 ? (
"") : (
"s");
2638 for (
auto i : connections) {
2651 if (selectedShapes.size() > 0) {
2652 std::string plural = selectedShapes.size() == 1 ? (
"") : (
"s");
2654 for (
auto i : selectedShapes) {
2669 selection.
add(newPos);
2670 selection.
grow(0.1);
2673 for (
auto it_ids : ids) {
2690 WRITE_DEBUG(
"Opening FXMessageBox 'merge junctions'");
2692 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
2693 "Confirm Junction Merger",
"%s",
2694 (
"Do you wish to merge junctions '" + moved->
getMicrosimID() +
2697 "' will be eliminated and its roads added to '" +
2702 WRITE_DEBUG(
"Closed FXMessageBox 'merge junctions' with 'No'");
2703 }
else if (answer == 4) {
2704 WRITE_DEBUG(
"Closed FXMessageBox 'merge junctions' with 'ESC'");
2709 WRITE_DEBUG(
"Closed FXMessageBox 'merge junctions' with 'Yes'");
2737 eventInfo =
nullptr;
2739 attributeCarrier =
nullptr;
2740 netElement =
nullptr;
2741 additional =
nullptr;
2747 connection =
nullptr;
2762 if (glObject ==
nullptr) {
2770 if (attributeCarrier ==
nullptr) {
2774 if (editedPolyShape !=
nullptr) {
2775 if (attributeCarrier == editedPolyShape) {
2777 poly =
dynamic_cast<GNEPoly*
>(attributeCarrier);
2783 if (tagValue.isNetElement()) {
2785 netElement =
dynamic_cast<GNENetElement*
>(attributeCarrier);
2786 }
else if (tagValue.isAdditional()) {
2788 additional =
dynamic_cast<GNEAdditional*
>(attributeCarrier);
2789 }
else if (tagValue.isShape()) {
2791 shape =
dynamic_cast<GNEShape*
>(attributeCarrier);
2797 switch (glObject->
getType()) {
2799 junction =
dynamic_cast<GNEJunction*
>(attributeCarrier);
2802 edge =
dynamic_cast<GNEEdge*
>(attributeCarrier);
2805 lane =
dynamic_cast<GNELane*
>(attributeCarrier);
2808 poi =
dynamic_cast<GNEPOI*
>(attributeCarrier);
2811 poly =
dynamic_cast<GNEPoly*
>(attributeCarrier);
2814 crossing =
dynamic_cast<GNECrossing*
>(attributeCarrier);
2817 connection =
dynamic_cast<GNEConnection*
>(attributeCarrier);
2829 edge = &lane->getParentEdge();
2831 attributeCarrier = edge;
2840 return (eventInfo->state & SHIFTMASK) != 0;
2850 return (eventInfo->state & CONTROLMASK) != 0;
2859 selectingUsingRectangle =
false;
2861 if (shiftKeyPressed) {
2864 b.
add(selectionCorner1);
2865 b.
add(selectionCorner2);
2868 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACInRectangles;
2869 for (
auto i : ids) {
2875 retrievedAC = &
dynamic_cast<GNELane*
>(retrievedAC)->getParentEdge();
2880 ACInRectangles.insert(std::make_pair(retrievedAC->
getID(), retrievedAC));
2885 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToSelect;
2886 std::set<std::pair<std::string, GNEAttributeCarrier*> > ACToUnselect;
2891 ACToUnselect.insert(std::make_pair(i->getID(), i));
2895 for (
auto i : ACInRectangles) {
2898 ACToUnselect.insert(i);
2901 if (ACToUnselect.find(i) != ACToUnselect.end()) {
2902 ACToSelect.insert(i);
2906 ACToSelect.insert(i);
2912 std::vector<GNEEdge*> edgesToSelect;
2914 for (
auto i : ACToSelect) {
2916 edgesToSelect.push_back(dynamic_cast<GNEEdge*>(i.second));
2920 for (
auto i : edgesToSelect) {
2922 ACToSelect.insert(std::make_pair(i->getGNEJunctionSource()->getID(), i->getGNEJunctionSource()));
2923 for (
auto j : i->getGNEJunctionSource()->getGNEConnections()) {
2924 ACToSelect.insert(std::make_pair(j->getID(), j));
2926 for (
auto j : i->getGNEJunctionSource()->getGNECrossings()) {
2927 ACToSelect.insert(std::make_pair(j->getID(), j));
2930 ACToSelect.insert(std::make_pair(i->getGNEJunctionDestiny()->getID(), i->getGNEJunctionDestiny()));
2931 for (
auto j : i->getGNEJunctionDestiny()->getGNEConnections()) {
2932 ACToSelect.insert(std::make_pair(j->getID(), j));
2934 for (
auto j : i->getGNEJunctionDestiny()->getGNECrossings()) {
2935 ACToSelect.insert(std::make_pair(j->getID(), j));
2940 if ((ACToSelect.size() + ACToUnselect.size()) > 0) {
2943 for (
auto i : ACToUnselect) {
2946 for (
auto i : ACToSelect) {
2953 viewNet->makeNonCurrent();
2960 return (
"Selection width:" +
toString(fabs(selectionCorner1.x() - selectionCorner2.x()))
2961 +
" height:" +
toString(fabs(selectionCorner1.y() - selectionCorner2.y()))
2962 +
" diagonal:" +
toString(selectionCorner1.distanceTo2D(selectionCorner2)));
Locate junction - button.
DeleteOptions * getDeleteOptions() const
get delete options
void startEditCustomShape(GNENetElement *element, const PositionVector &shape, bool fill)
start edit custom shape
long onCmdAddRestrictedLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for pedestrians.
GNEJunction * splitEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList, GNEJunction *newJunction=0)
split edge at position by inserting a new junction
AddShapeResult processClick(const Position &clickedPosition, GNELane *lane)
process click over Viewnet
void buildColorRainbow(GUIColorScheme &scheme, int active, GUIGlObjectType objectType)
recalibrate color scheme according to the current value range
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
testingMode myTestingMode
variable used to save variables related with testing mode
GNEPoly * polyToMove
the poly of which geometry is being moved
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
void processSelection(GNEViewNet *viewNet, bool shiftKeyPressed)
Process Selection.
long onCmdRestrictLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to bikes
GNEEdge * edgeToMove
the edge of which geometry is being moved
static const RGBColor BLUE
FXDEFMAP(GNEViewNet) GNEViewNetMap[]
double ymin() const
Returns minimum y-coordinate.
std::vector< GUIGlID > getObjectsAtPosition(Position pos, double radius)
returns the ids of the object at position within the given (rectangular) radius using GL_SELECT ...
void show()
show prohibition frame
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
const GNEAttributeCarrier * getACUnderCursor() const
get AttributeCarrier under cursor
Position getPositionInView() const
Return current position.
bool selectEdges()
whether inspection, selection and inversion should apply to edges or to lanes
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
void openPolygon(bool allowUndo=true)
open polygon
double xmax() const
Returns maximum x-coordinate.
GUICompleteSchemeStorage gSchemeStorage
const std::vector< T > & getSchemes() const
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
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.
GNEAdditional * additional
additional element
void abortOperation(bool clearSelection=true)
abort current edition operation
void deleteSelectedJunctions()
delete all currently selected junctions
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
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
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
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
bool myShowConnections
whether show connections has been activated once
void stopDrawing()
stop drawing and create polygon or
begin/end of the description of a single lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
StringBijection< EditMode > myEditModeNames
since we cannot switch on strings we map the mode names to an enum
long onMouseMove(FXObject *, FXSelector, void *)
called when user moves mouse
Mode for editing connection prohibits.
FXint myWindowCursorPositionY
void markAsCreateEdgeSource()
marks as first junction in createEdge-mode
std::vector< GUIGlID > getObjectsInBoundary(Boundary bound)
returns the ids of all objects in the given boundary
MovedItems myMovedItems
variable use to save pointers to moved elements
The main window of the Netedit.
void beginMoveSelection(GNEAttributeCarrier *originAC, const Position &originPosition)
begin move selection
SetOperation getModificationMode() const
get current modification mode
bool mySelectEdges
flag to check if select edges is enabled
SUMORTree * myGrid
The visualization speed-up.
long onCmdSetModeSelect(FXObject *, FXSelector, void *)
called when user press the button for select mode
GUIGlObjectType glType
GUI GL object type.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
std::map< GNEEdge *, MovingEdges > myOriginShapesMovedPartialShapes
void hotkeyFocusFrame()
handle focus frame keypress
const GNEAttributeCarrier * myACUnderCursor
current AttributeCarrier under Mouse position
static const RGBColor WHITE
AddShapeResult
enum with all possible values after try to create an shape using frame
FXMenuCheck * myMenuCheckShowGrid
show grid button
void stopEditCustomShape()
edit edit shape
AddAdditionalResult addAdditional(GNENetElement *netElement, GNEAdditional *additional)
add additional element
Position movingReference
variable for calculating moving offset (Used when user doesn't click exactly over the center of shape...
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
virtual long onMouseMove(FXObject *, FXSelector, void *)
FXMenuCheck * myChainCreateEdge
whether the endpoint for a created edge should be set as the new source
Locate addtional structure - button.
GNEAttributeCarrier * retrieveAttributeCarrier(const GUIGlID id, bool failHard=true)
get a single attribute carrier based on a GLID
void show()
show delete frame
connectio between two lanes
std::set< GNEEdge * > getEdgesAtPopupPosition()
try to retrieve multiple edges at popup position
mode for connecting lanes
long onCmdSplitEdge(FXObject *, FXSelector, void *)
split edge at cursor position
bool controlKeyPressed() const
check if CONTROL key was pressed during click
long onCmdToogleSelectEdges(FXObject *, FXSelector, void *)
toogle selet edges
const double SUMO_const_laneWidth
mode for inspecting object attributes
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
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.
Position selectionCorner1
firstcorner of the rectangle-selection
void setEditMode(EditMode mode)
set edit mode
static void resetTextures()
Reset textures.
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
GNEConnection * connection
connection
double x() const
Returns the x-position.
int getVertexIndex(const Position &pos, bool createIfNoExist=true)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
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
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
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
int movingIndexShape
current index of shape that are being moved
void resetJunctionConnections(GNEJunction *junction, GNEUndoList *undoList)
reset junction's connections
MFXCheckableButton * myEditModeDelete
chekable button for edit mode delete
A NBNetBuilder extended by visualisation and editing capabilities.
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 movingOriginalShape
Shape of elements before moving (needed for commmit shape changes)
PositionVector shape
The crossing's shape.
void editJunction(GNEJunction *junction)
edits the traffic light for the given junction
int editMode
the current NETEDIT mode (temporary)
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 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.
MFXCheckableButton * myEditModeProhibition
checkable button for edit mode polygon
GUIDialog_ViewSettings * myVisualizationChanger
Visualization changer.
void moveSelection(const Position &offset)
move selection
void commitShapeStartChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape start
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
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
Transform POI to POILane, and viceversa.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
std::map< GNEJunction *, Position > myOriginPositionOfMovedJunctions
Selected Junctions that are being moved.
void updateObjectUnderCursor(GUIGlID glIDObject, GNEPoly *editedPolyShape, FXEvent *ev)
update objects under cursor (Called only in onLeftBtnPress(...) function)
FXMenuCheck * myMenuCheckChangeAllPhases
menu check to set change all phases
turn junction into geometry node
void deleteSelectedShapes()
delete all currently selected shapes
show junctions as bubbles
GNEAdditional * additionalToMove
the stoppingPlace element which shape is being moved
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.
virtual void selectAttributeCarrier(bool changeFlag=true)=0
void closePolygon(bool allowUndo=true)
close polygon
#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 ...
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.
int testingWidth
Width of viewNet in testing mode.
double p2m(double pixel) const
pixels-to-meters conversion method
bool isDrawing() const
return true if currently a shape is drawed
bool testingEnabled
flag to enable or disable testing mode
FXMenuCheck * myMenuCheckHideConnections
menu check to hide connections in connect mode
virtual void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)=0
commit geometry changes in the attributes of an element after use of moveGeometry(...)
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
bool IsObjectTypeLocked(GUIGlObjectType type) const
check if an object is locked
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
int getVertexIndex(const Position &pos, bool createIfNoExist=true)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
SelectingArea mySelectingArea
variable used to save variables related with selecting areas
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
void handleLaneClick(GNELane *lane, bool mayDefinitelyPass, bool allowConflict, bool toggle)
either sets the current lane or toggles the connection of the current lane to this lane (if they shar...
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void insert(const std::string str, const T key, bool checkDuplicates=true)
void buildEditModeControls()
adds controls for setting the edit mode
FXMenuCheck * myMenuCheckMoveElevation
apply movement to elevation
GUIGlID getObjectAtPosition(Position pos)
returns the id of the object at position using GL_SELECT
GNEUndoList * getUndoList() const
get the undoList object
void removeLastPoint()
remove last added point
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
static const RGBColor GREEN
mode for editing connection prohibitions
void computeNodeShape(double mismatchThreshold)
Compute the junction shape for this node.
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(...)
bool showLockIcon() const
check if lock icon should be visible
virtual long onPaint(FXObject *, FXSelector, void *)
int addColor(const T &color, const double threshold, const std::string &name="")
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items
long onCmdRemoveRestrictedLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for bus
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string name
The name of this setting.
double gridXSize
Information about the grid spacings.
bool hasCommandGroup() const
Check if undoList has command group.
void splitJunction(GNEJunction *junction, GNEUndoList *undoList)
replace the selected junction by a list of junctions for each unique edge endpoint ...
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.
FXMenuCheck * myMenuCheckShowConnections
menu check to show connections
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
virtual void setStatusBarText(const std::string &)
void deleteSelectedCrossings()
delete all currently selected crossings
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.
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
GNEEdge & getParentEdge()
Returns underlying parent edge.
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual ~GNEViewNet()
destructor
GNEEdge * getEdgeAtPopupPosition()
try to retrieve an edge at popup position
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
int testingHeight
Height of viewNet in testing mode.
bool clickedOverShapeStart(const Position &pos)
void commitShapeEndChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape end
transform lane to busLane
void handleConnectionClick(GNEConnection *conn, bool mayDefinitelyPass, bool allowConflict, bool toggle)
handle prohibitions and set teh relative colouring
long onCmdSetModeMove(FXObject *, FXSelector, void *)
called when user press the button for move mode
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.
A point in 2D or 3D with translation and scaling methods.
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
FXMenuCheck * myMenuCheckSelectEdges
menu check to select only edges
FXToolBar * myToolbar
a reference to the toolbar in myParent
FXComboBox & getColoringSchemesCombo()
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
long onCmdToogleShowConnection(FXObject *, FXSelector, void *)
toogle show connections
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
MFXCheckableButton * myEditModeCreateEdge
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
virtual void moveGeometry(const Position &oldPos, const Position &offset)=0
change the position of the element geometry without saving in undoList
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
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
bool showJunctionAsBubbles() const
return true if junction must be showed as bubbles
bool removeRestrictedLane(SUMOVehicleClass vclass)
remove restricted lane
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) ...
double xmin() const
Returns minimum x-coordinate.
MFXCheckableButton * myEditModeTrafficLight
chekable button for edit mode traffic light
void initGNEConnections()
initialize GNEConnections
turn junction into multiple junctions
long onCmdRemoveRestrictedLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for bikes
GNECrossing * crossing
crossing
mode for selecting objects
bool addCrossing(GNENetElement *netElement)
add Crossing element
MFXCheckableButton * myEditModeAdditional
chekable button for edit mode additional
GNEAttributeCarrier * attributeCarrier
attribute carrier
void startGeometryMoving()
edge: the shape in xml-definition
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_MODE_SELECT
Boundary & grow(double by)
extends the boundary by the given amount
GUIColorer junctionColorer
The junction colorer.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
mode for creating polygons
const std::string getID() const
function to support debugging
void updateLockGLObjectTypes()
update selected items
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
void startDrawing()
start drawing
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.
std::map< GNEEdge *, PositionVector > myOriginShapesMovedEntireShapes
Selected Edges that are being moved < Edge, PositionVector >
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
void splitEdgesBidi(const std::set< GNEEdge *> &edges, const Position &pos, GNEUndoList *undoList)
split all edges at position by inserting one new junction
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
GUIPerspectiveChanger * myChanger
The perspective changer.
long onCmdRestrictLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to buslanes
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
double getShapeLayer() const
Returns the layer of the Shape.
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.
FXMenuCheck * myAutoCreateOppositeEdge
long onCmdSplitJunction(FXObject *, FXSelector, void *)
split junction into multiple junctions
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
FXMenuCheck * myMenuCheckExtendToEdgeNodes
menu check to extend to edge nodes
long onCmdClosePolygon(FXObject *, FXSelector, void *)
close opened polygon
const PositionVector & getGeometry() const
Returns the geometry of the edge.
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
std::string reportDimensions()
inform about selection size
FXbool makeCurrent()
A reimplementation due to some internal reasons.
long onCmdOK(FXObject *, FXSelector, void *)
reserved GLO type to pack all additionals
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
long onCmdCreateCrossing(FXObject *, FXSelector, void *)
AddAdditionalResult
enum with all possible values after try to create an additional using frame
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
DrawingMode * getDrawingMode() const
get drawing mode editor
static const RGBColor YELLOW
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
GNENetElement * netElement
net element
reset junction's connections
FXMenuCheck * myMenuCheckWarnAboutMerge
whether we should warn about merging junctions
double selectionScale
the current selection scaling in NETEDIT (temporary)
void setACUnderCursor(const GNEAttributeCarrier *AC)
set attributeCarrier under cursor
double m2p(double meter) const
meter-to-pixels conversion method
#define GUIDesignButtonToolbarCheckable
little checkable button with icon placed in navigation toolbar
virtual void show()
show Frame
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)
draw Text box with given parameters
static const RGBColor CYAN
Set a vertex of polygon as first verte.
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
GUIVisualizationSettings * myVisualizationSettings
visualization settings
void simplifyShape(bool allowUndo=true)
replace the current shape with a rectangle
long onCmdDeleteGeometryPoint(FXObject *, FXSelector, void *)
delete the closes geometry point
void show()
show additional frame and update use selected edges/lanes
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
PositionVector customShape
optional customShape for this crossing
long onCmdAddRestrictedLaneBikelane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for bikes.
FXMenuCheck * myMenuCheckShowBubbleOverJunction
show connection as buuble in "Move" mode.
bool selectingUsingRectangle
whether we have started rectangle-selection
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
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
void show()
show shape frame and update use selected edges/lanes
MFXCheckableButton * myEditModeConnection
chekable button for edit mode connection
bool showConnections()
show connections over junctions
GNEJunction * junction
junction
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
long onCmdOK(FXObject *, FXSelector, void *)
long onCmdReverseEdge(FXObject *, FXSelector, void *)
reverse edge
simplify polygon geometry
GNEPOI * poiToMove
the poi which is being moved
Position movingOriginalPosition
original Position of element before moving (needed for commmit position changes)
long onCmdSetModeTLS(FXObject *, FXSelector, void *)
called when user press the button for traffic lights mode
long onCmdCancel(FXObject *, FXSelector, void *)
Called when the user presses the Cancel-button discards any connection modifications.
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
GNEJunction * myCreateEdgeSource
source junction for new edge 0 if no edge source is selected an existing (or newly created) junction ...
void abortDrawing()
abort drawing
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.
long onCmdAddRestrictedLaneBuslane(FXObject *, FXSelector typeOfTransformation, void *)
Add restricted lane for buses.
long onCmdRemoveRestrictedLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
remove restricted lane for pedestrians
open additional dialog (used in netedit)
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
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
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
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
Position selectionCorner2
second corner of the rectangle-selection
long onCmdRestrictLaneSidewalk(FXObject *, FXSelector typeOfTransformation, void *)
restrict lane to pedestrians
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.
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)
GNEEdge * addReversedEdge(GNEEdge *edge, GNEUndoList *undoList)
add reversed edge
void setStatusBarText(const std::string &text)
set staturBar text
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
void swapLane2Edge()
swap lane to edge
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void hideAllFrames()
hide all frames
long onCmdSetModeConnect(FXObject *, FXSelector, void *)
called when user press the button for connect mode
Mode for editing additionals.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
virtual void unselectAttributeCarrier(bool changeFlag=true)=0
unselect attribute carrier using GUIGlobalSelection
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
long onCmdSetModePolygon(FXObject *, FXSelector, void *)
called when user press the button for polygon mode
static const RGBColor selectionColor
Mode for editing crossing.
void unblockObject(GUIGlID id)
Marks an object as unblocked.
long onCmdStraightenEdges(FXObject *, FXSelector, void *)
makes selected edges straight
long onCmdSetModeInspect(FXObject *, FXSelector, void *)
called when user press the button for inspect mode
static const TagValues & getTagProperties(SumoXMLTag tag)
get Tag Properties
void finishMoveSelection()
finish moving selection
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
mode for connecting lanes
bool myMovingSelection
whether a selection is being moved
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
mode for creating new edges
void removePolygonForEditShapes(GNEPoly *polygon)
remove Polygon for edit shapes
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
NBEdge * getNBEdge()
returns the internal NBEdge
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.
mode for selecting objects
const PositionVector & getShape() const
get Position vector calculated in updateGeometry(bool updateGrid)
GUIGlID getObjectUnderCursor()
returns the id of the 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...
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
double ymax() const
Returns maximum y-coordinate.
long onCmdTransformPOI(FXObject *, FXSelector, void *)
Transform POI to POILane, and viceversa.
void hotkeyDel()
handle del keypress
bool isShapeBlocked() const
return true if shape is blocked
long onCmdAddReversedEdge(FXObject *, FXSelector, void *)
add reversed edge
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
GNEPoly * myEditShapePoly
const PositionVector & getTemporalShape() const
get Temporal shape
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.
bool addSRestrictedLane(SUMOVehicleClass vclass, GNEEdge &edge, GNEUndoList *undoList)
add restricted lane to edge
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.
GNENet * myNet
Pointer to current net. (We are not responsible for deletion)
void hotkeyEnter()
handle enter keypress
void startGeometryMoving()
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 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 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
void processClick(FXEvent *e, void *data)
Auxiliar function used by onLeftBtnPress(...)
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
long onCmdSetModeCreateEdge(FXObject *, FXSelector, void *)
long onCmdSetModeDelete(FXObject *, FXSelector, void *)
called when user press the button for delete mode
void deleteSelectedEdges()
delete all currently selected edges
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
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
GNEFrame * myCurrentFrame
the current frame
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
GNEPoly * getPolygonAtPopupPosition()
try to retrieve a polygon at popup position
SumoXMLTag getTag() const
get XML Tag assigned to this object
virtual Position getPositionInView() const =0
Returns position of additional in view.